diff --git a/.github/ISSUE_TEMPLATE/new-issue-template.md b/.github/ISSUE_TEMPLATE/new-issue-template.md index cf6c5bc7a..096eb28cb 100644 --- a/.github/ISSUE_TEMPLATE/new-issue-template.md +++ b/.github/ISSUE_TEMPLATE/new-issue-template.md @@ -11,7 +11,7 @@ assignees: '' It is important to realise that **this is NOT A SUPPORT FORUM**, this is for reproducible BUGS with raylib ONLY. -There are lots of generous and helpful people ready to help you out on [raylib Discord forum](https://discord.gg/VkzNHUE) or [raylib reddit](https://www.reddit.com/r/raylib/). +There are lots of generous and helpful people ready to help you out on [raylib Discord forum](https://discord.gg/raylib) or [raylib reddit](https://www.reddit.com/r/raylib/). Remember that asking for support questions here actively takes developer time away from improving raylib. @@ -25,7 +25,7 @@ Please, before submitting a new issue verify and check: ### Issue description -*Briefly describe the issue you are experiencing (or the feature you want to see added to raylib). Tell us what you were trying to do and what happened instead. Remember, this is not the best place to ask questions. For questions, go to [raylib Discord server](https://discord.gg/VkzNHUE).* +*Briefly describe the issue you are experiencing (or the feature you want to see added to raylib). Tell us what you were trying to do and what happened instead. Remember, this is not the best place to ask questions. For questions, go to [raylib Discord server](https://discord.gg/raylib).* ### Environment diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index b26db09d1..2a12f8ff2 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -50,6 +50,8 @@ jobs: - name: Generate Artifacts run: | cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include + cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md + cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE cd build tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }} diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 000000000..803b472a0 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,93 @@ +name: CMakeBuilds + +on: + push: + pull_request: + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build_windows: + name: Windows Build + # The CMake configure and build commands are platform agnostic and should work equally + # well on Windows or Mac. You can convert this to a matrix build if you need + # cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Create Build Environment + # Some projects don't allow in-source building, so create a separate build directory + # We'll use this as our working directory for all subsequent commands + run: cmake -E make_directory ${{github.workspace}}/build + + - name: Configure CMake + # Use a bash shell so we can use the same syntax for environment variable + # access regardless of the host operating system + shell: powershell + working-directory: ${{github.workspace}}/build + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. + # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 + run: cmake $env:GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$env:BUILD_TYPE -DPLATFORM=Desktop + + - name: Build + working-directory: ${{github.workspace}}/build + shell: powershell + # Execute the build. You can specify a specific target with "--target " + run: cmake --build . --config $env:BUILD_TYPE + + - name: Test + working-directory: ${{github.workspace}}/build + shell: powershell + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C $env:BUILD_TYPE + + build_linux: + name: Linux Build + # The CMake configure and build commands are platform agnostic and should work equally + # well on Windows or Mac. You can convert this to a matrix build if you need + # cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Create Build Environment + # Some projects don't allow in-source building, so create a separate build directory + # We'll use this as our working directory for all subsequent commands + run: cmake -E make_directory ${{github.workspace}}/build + + - name: Setup Environment + run: | + sudo apt-get update -qq + sudo apt-get install gcc-multilib + 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 + - name: Configure CMake + # Use a bash shell so we can use the same syntax for environment variable + # access regardless of the host operating system + shell: bash + working-directory: ${{github.workspace}}/build + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. + # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPLATFORM=Desktop + + - name: Build + working-directory: ${{github.workspace}}/build + shell: bash + # Execute the build. You can specify a specific target with "--target " + run: cmake --build . --config $BUILD_TYPE + + - name: Test + working-directory: ${{github.workspace}}/build + shell: bash + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C $BUILD_TYPE diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b393406f1..ea12e021f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -71,6 +71,8 @@ jobs: - name: Generate Artifacts run: | cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include + cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md + cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE cd build tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }} diff --git a/.github/workflows/linux_examples.yml b/.github/workflows/linux_examples.yml new file mode 100644 index 000000000..c268f4796 --- /dev/null +++ b/.github/workflows/linux_examples.yml @@ -0,0 +1,32 @@ +name: Linux Examples + +on: + push: + pull_request: + branches: [ master ] + paths: + - 'examples/**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Environment + 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 + + - name: Build Library + run: | + cd src + make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC + cd .. + + - name: Build Examples + run: | + cd examples + make PLATFORM=PLATFORM_DESKTOP -B + cd .. diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d9076979c..503694d57 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -56,6 +56,8 @@ jobs: - name: Generate Artifacts run: | cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include + cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md + cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE cd build tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }} diff --git a/.github/workflows/webassembly.yml b/.github/workflows/webassembly.yml index 100b235ec..ce558647d 100644 --- a/.github/workflows/webassembly.yml +++ b/.github/workflows/webassembly.yml @@ -49,6 +49,8 @@ jobs: - name: Generate Artifacts run: | copy /Y .\src\raylib.h .\build\${{ env.RELEASE_NAME }}\include\raylib.h + copy /Y .\README.md .\build\${{ env.RELEASE_NAME }}\README.md + copy /Y .\LICENSE .\build\${{ env.RELEASE_NAME }}\LICENSE cd build 7z a ./${{ env.RELEASE_NAME }}.zip ./${{ env.RELEASE_NAME }} dir diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c43bf2009..3c9ce45f2 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -29,11 +29,11 @@ jobs: - compiler: msvc16 bits: 32 ARCH: "x86" - VSBINPATH: "Win32" + VSARCHPATH: "Win32" - compiler: msvc16 bits: 64 ARCH: "x64" - VSBINPATH: "x64" + VSARCHPATH: "x64" env: RELEASE_NAME: raylib-dev_win${{ matrix.bits }}_${{ matrix.compiler }} @@ -80,12 +80,12 @@ jobs: - name: Build Library (MSVC16) run: | - cd projects/VS2017 + cd projects/VS2019 msbuild.exe raylib.sln /target:raylib /property:Configuration=Release /property:Platform=${{ matrix.ARCH }} - copy /Y .\bin\${{ matrix.VSBINPATH }}\Release\raylib.lib .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylib.lib + copy /Y .\build\raylib\bin\${{ matrix.VSARCHPATH }}\Release\raylib.lib .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylib.lib msbuild.exe raylib.sln /target:raylib /property:Configuration=Release.DLL /property:Platform=${{ matrix.ARCH }} - copy /Y .\bin\${{ matrix.VSBINPATH }}\Release.DLL\raylib.dll .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylib.dll - copy /Y .\bin\${{ matrix.VSBINPATH }}\Release.DLL\raylib.lib .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylibdll.lib + copy /Y .\build\raylib\bin\${{ matrix.VSARCHPATH }}\Release.DLL\raylib.dll .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylib.dll + copy /Y .\build\raylib\bin\${{ matrix.VSARCHPATH }}\Release.DLL\raylib.lib .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylibdll.lib cd ../.. shell: cmd if: matrix.compiler == 'msvc16' @@ -93,6 +93,8 @@ jobs: - name: Generate Artifacts run: | copy /Y .\src\raylib.h .\build\${{ env.RELEASE_NAME }}\include\raylib.h + copy /Y .\README.md .\build\${{ env.RELEASE_NAME }}\README.md + copy /Y .\LICENSE .\build\${{ env.RELEASE_NAME }}\LICENSE cd build 7z a ./${{ env.RELEASE_NAME }}.zip ./${{ env.RELEASE_NAME }} dir diff --git a/.github/workflows/windows_examples.yml b/.github/workflows/windows_examples.yml new file mode 100644 index 000000000..05bc49940 --- /dev/null +++ b/.github/workflows/windows_examples.yml @@ -0,0 +1,26 @@ +name: Windows Examples + +on: + push: + pull_request: + branches: [ master ] + paths: + - 'examples/**' + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v1 + + - name: Build Library (MSVC16) + run: | + cd projects/VS2019 + msbuild.exe raylib.sln /property:Configuration=Release /property:Platform=x86 + cd ../.. + shell: cmd + diff --git a/.gitignore b/.gitignore index d51b5bcd3..49e296e73 100644 --- a/.gitignore +++ b/.gitignore @@ -55,8 +55,6 @@ packages/ # Ignore all examples files examples/* -# Unignore all examples dirs -!examples/*/ # Unignore all examples files with extension !examples/*.c !examples/*.png diff --git a/BINDINGS.md b/BINDINGS.md index 29f5baa07..5dad05daf 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -6,41 +6,41 @@ Here it is a list with the ones I'm aware of: | name | raylib version | language | repo | |:------------------:|:-------------: | :--------:|----------------------------------------------------------------------| -| raylib | **3.1-dev** | [C](https://en.wikipedia.org/wiki/C_(programming_language)) | https://github.com/raysan5/raylib | -| raylib-cpp | 3.5 | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | https://github.com/robloach/raylib-cpp | -| Raylib-cs | 3.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/ChrisDill/Raylib-cs | +| raylib | **3.7** | [C](https://en.wikipedia.org/wiki/C_(programming_language)) | https://github.com/raysan5/raylib | +| raylib-cpp | 3.7 | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | https://github.com/robloach/raylib-cpp | +| Raylib-cs | 3.7 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/ChrisDill/Raylib-cs | | raylib-cppsharp | 2.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/phxvyper/raylib-cppsharp | -| raylib-boo | 3.5 | [Boo](http://boo-language.github.io/) | https://github.com/Rabios/raylib-boo | +| raylib-boo | 3.7 | [Boo](http://boo-language.github.io/) | https://github.com/Rabios/raylib-boo | | RaylibFS | 2.5 | [F#](https://fsharp.org/) | https://github.com/dallinbeutler/RaylibFS | | raylib_d | 2.5 | [D](https://dlang.org/) | https://github.com/Sepheus/raylib_d | | raylib-d | 3.0 | [D](https://dlang.org/) | https://github.com/onroundit/raylib-d | | bindbc-raylib | 3.0 | [D](https://dlang.org/) | https://github.com/o3o/bindbc-raylib | -| dray | 3.0 | [D](https://dlang.org/) | https://github.com/xdrie/dray | -| raylib-go | 3.0 | [Go](https://golang.org/) | https://github.com/gen2brain/raylib-go | +| dray | 3.5 | [D](https://dlang.org/) | https://github.com/xdrie/dray | +| raylib-go | 3.8-dev | [Go](https://golang.org/) | https://github.com/gen2brain/raylib-go | | raylib-goplus | 2.6-dev | [Go](https://golang.org/) | https://github.com/Lachee/raylib-goplus | | ray-go | 2.6-dev | [Go](https://golang.org/) | https://github.com/hecate-tech/ray-go | | go-raylib | 3.5 | [Go](https://golang.org/) | https://github.com/chunqian/go-raylib | -| raylib-rs | 3.0 | [Rust](https://www.rust-lang.org/) | https://github.com/deltaphc/raylib-rs | +| raylib-rs | 3.5 | [Rust](https://www.rust-lang.org/) | https://github.com/deltaphc/raylib-rs | | raylib-lua | 1.7 | [Lua](http://www.lua.org/) | https://github.com/raysan5/raylib-lua | | raylib-lua-ffi | 2.0 | [Lua](http://www.lua.org/) | https://github.com/raysan5/raylib/issues/693 | | raylib-lua-sol | 2.5 | [Lua](http://www.lua.org/) | https://github.com/RobLoach/raylib-lua-sol | -| raylib-lua | 3.5 | [Lua](http://www.lua.org/) | https://github.com/TSnake41/raylib-lua | +| raylib-lua | 3.7 | [Lua](http://www.lua.org/) | https://github.com/TSnake41/raylib-lua | | raylib-luamore | 3.0 | [Lua](http://www.lua.org/) | https://github.com/HDPLocust/raylib-luamore | -| raylua | 3.5 | [Lua](http://www.lua.org/) | https://github.com/Rabios/raylua | +| raylua | 3.7 | [Lua](http://www.lua.org/) | https://github.com/Rabios/raylua | | LuaJIT-Raylib | 2.6 | [Lua](http://www.lua.org/) | https://github.com/Bambofy/LuaJIT-Raylib | | raylib-nelua | 3.0 | [Nelua](https://nelua.io/) | https://github.com/Andre-LA/raylib-nelua | | raylib-Nim | 1.7 | [Nim](https://nim-lang.org/) | https://gitlab.com/define-private-public/raylib-Nim | | raylib-nim | 2.0 | [Nim](https://nim-lang.org/) | https://github.com/Skrylar/raylib-nim | | raylib-Forever | 3.1-dev | [Nim](https://nim-lang.org/) | https://github.com/Guevara-chan/Raylib-Forever | | nim-raylib | 3.1-dev | [Nim](https://nim-lang.org/) | https://github.com/tomc1998/nim-raylib | -| NimraylibNow! | 3.5-dev | [Nim](https://nim-lang.org/) | https://github.com/greenfork/nimraylib_now | +| NimraylibNow! | 3.7 | [Nim](https://nim-lang.org/) | https://github.com/greenfork/nimraylib_now | | raylib-haskell | 2.0 | [Haskell](https://www.haskell.org/) | https://github.com/DevJac/raylib-haskell | | raylib-cr | 2.5-dev | [Crystal](https://crystal-lang.org/) | https://github.com/AregevDev/raylib-cr | | cray | 1.8 | [Crystal](https://crystal-lang.org/) | https://gitlab.com/Zatherz/cray | | raylib.cr | 2.0 | [Crystal](https://crystal-lang.org/) | https://github.com/sam0x17/raylib.cr | | raylib-pascal | 2.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/drezgames/raylib-pascal | | raylib-pas | 3.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/tazdij/raylib-pas | -| Ray4Laz | 3.5 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/GuvaCode/Ray4Laz | +| Ray4Laz | 3.7 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/GuvaCode/Ray4Laz | | Graphics-Raylib | 1.4 | [Perl](https://www.perl.org/) | https://github.com/athreef/Graphics-Raylib | | raylib-ruby-ffi | 2.0 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/D3nX/raylib-ruby-ffi | | raylib-ruby | 2.6 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/a0/raylib-ruby | @@ -51,15 +51,16 @@ Here it is a list with the ones I'm aware of: | jaylib | 3.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | https://github.com/electronstudio/jaylib/ | | raylib-java | 2.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | https://github.com/XoanaIO/raylib-java | | clj-raylib | 3.0 | [Clojure](https://clojure.org/) | https://github.com/lsevero/clj-raylib | -| node-raylib | 3.0 | [Node.js](https://nodejs.org/en/) | https://github.com/RobLoach/node-raylib | +| node-raylib | 3.5 | [Node.js](https://nodejs.org/en/) | https://github.com/RobLoach/node-raylib | | QuickJS-raylib | 3.0 | [QuickJS](https://bellard.org/quickjs/) | https://github.com/sntg-p/QuickJS-raylib | -| raylib-js | 2.6 | [JavaScript](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/RobLoach/raylib-js | +| raylib-duktape | 2.6 | [JavaScript (Duktape)](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/RobLoach/raylib-duktape | +| raylib-v7 | 3.5 | [JavaScript (v7)](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/Rabios/raylib-v7 | | raylib-chaiscript | 2.6 | [ChaiScript](http://chaiscript.com/) | https://github.com/RobLoach/raylib-chaiscript | | raylib-squirrel | 2.5 | [Squirrel](http://www.squirrel-lang.org/) | https://github.com/RobLoach/raylib-squirrel | | racket-raylib-2d | 2.5 | [Racket](https://racket-lang.org/) | https://github.com/arvyy/racket-raylib-2d | -| raylib-php | 3.0 | [PHP](https://en.wikipedia.org/wiki/PHP) | https://github.com/joseph-montanez/raylib-php | +| raylib-php | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | https://github.com/joseph-montanez/raylib-php | | raylib-php-ffi | 2.4-dev | [PHP](https://en.wikipedia.org/wiki/PHP) | https://github.com/oraoto/raylib-php-ffi | -| raylib-phpcpp | 3.0 | [PHP](https://en.wikipedia.org/wiki/PHP) | https://github.com/oraoto/raylib-phpcpp | +| raylib-phpcpp | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | https://github.com/oraoto/raylib-phpcpp | | raylib-factor | 3.5 | [Factor](https://factorcode.org/) | https://github.com/ArnautDaniel/raylib-factor | | gforth-raylib | 3.5 | [Gforth](https://gforth.org/) | https://github.com/ArnautDaniel/gforth-raylib | | raylib-haxe | 2.4 | [Haxe](https://haxe.org/) | https://github.com/ibilon/raylib-haxe | @@ -69,18 +70,18 @@ Here it is a list with the ones I'm aware of: | raylib-chibi | 2.5 | [Chibi-Scheme](https://github.com/ashinn/chibi-scheme) | https://github.com/VincentToups/raylib-chibi | | raylib-gambit-scheme | 3.1-dev | [Gambit Scheme](https://github.com/gambit/gambit) | https://github.com/georgjz/raylib-gambit-scheme | | Euraylib | 3.0 | [Euphoria](https://openeuphoria.org/) | https://github.com/gAndy50/Euraylib | -| raylib-wren | 3.0 | [Wren](http://wren.io/) | https://github.com/TSnake41/raylib-wren | +| raylib-wren | 3.7 | [Wren](http://wren.io/) | https://github.com/TSnake41/raylib-wren | | raylib-odin | 3.0 | [Odin](https://odin-lang.org/) | https://github.com/kevinw/raylib-odin | +| raylib_odin_bindings | 3.8+ | [Odin](https://odin-lang.org/) | https://github.com/Deathbat2190/raylib_odin_bindings | | raylib-zig | 3.0 | [Zig](https://ziglang.org/) | https://github.com/Not-Nik/raylib-zig | | raylib-jai | 3.1-dev | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | https://github.com/kevinw/raylib-jai | | ray.zig | 2.5 | [Zig](https://ziglang.org/) | https://github.com/BitPuffin/zig-raylib-experiments | | raylib-Ada | 3.0 | [Ada](https://www.adacore.com/about-ada) | https://github.com/mimo/raylib-Ada | | jaylib | 3.0 | [Janet](https://janet-lang.org/) | https://github.com/janet-lang/jaylib | | raykit | ? | [Kit](https://www.kitlang.org/) | https://github.com/Gamerfiend/raykit | -| vraylib | 2.5 | [V](https://vlang.io/) | https://github.com/MajorHard/vraylib | -| hb-raylib | 3.0 | [Harbour](https://harbour.github.io/) | https://github.com/rjopek/hb-raylib | +| vraylib | 3.5 | [V](https://vlang.io/) | https://github.com/waotzi/vraylib | | ray.mod | 3.0 | [BlitzMax](https://blitzmax.org/) | https://github.com/bmx-ng/ray.mod | -| ray-ocaml | 3.0 | [OCaml](https://ocaml.org/) | https://github.com/tjammer/raylib-ocaml | +| ray-ocaml | 3.5 | [OCaml](https://ocaml.org/) | https://github.com/tjammer/raylib-ocaml | | raylib-mosaic | 3.0 | [Mosaic](https://github.com/sal55/langs/tree/master/Mosaic) | https://github.com/pluckyporcupine/raylib-mosaic | | raylib-xdpw | 2.6 | [XD Pascal](https://github.com/vtereshkov/xdpw) | https://github.com/vtereshkov/raylib-xdpw | | raylib-carp | 3.0 | [Carp](https://github.com/carp-lang/Carp) | https://github.com/pluckyporcupine/raylib-carp | @@ -89,7 +90,10 @@ Here it is a list with the ones I'm aware of: | raylib-smallBasic | 3.1-dev | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib | | raylib-ats2 | 3.0 | [ATS2](http://www.ats-lang.org/) | https://github.com/mephistopheles-8/raylib-ats2 | | raylib-beef | 3.0 | [Beef](https://www.beeflang.org/) | https://github.com/M0n7y5/raylib-beef | +| raylib-swift | 3.5 | [Swift](https://swift.org/) | https://github.com/conifer-dev/raylib-swift | | raylib-never | 3.0 | [Never](https://github.com/never-lang/never) | https://github.com/never-lang/raylib-never | +| hb-raylib | 3.5 | [Harbour](https://harbour.github.io) | https://github.com/MarcosLeonardoMendezGerencir/hb-raylib | +| Relib | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | https://github.com/RedCubeDev-ByteSpace/Relib | | raylib.cbl | 2.0 | [COBOL](https://en.wikipedia.org/wiki/COBOL) | *[code examples](https://github.com/Martinfx/Cobol/tree/master/OpenCobol/Games/raylib)* | diff --git a/CHANGELOG b/CHANGELOG index ea02b3e17..c37aa3162 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,100 @@ changelog --------- -Current Release: raylib 3.5.0 (25 December 2020) +Current Release: raylib 3.7.0 (26 April 2021) + +------------------------------------------------------------------------- +Release: raylib 3.7 (26 April 2021) +------------------------------------------------------------------------- +KEY CHANGES: + - [rlgl] REDESIGNED: Greater abstraction level, some functionality moved to core module + - [rlgl] REVIEWED: Instancing and stereo rendering + - [core] REDESIGNED: VR simulator, fbo/shader exposed to user + - [utils] ADDED: File access callbacks system + - [models] ADDED: glTF animations support (#1551) by @object71 + - [audio] ADDED: Music streaming support from memory (#1606) by @nezvers + - [*] RENAMED: enum types and enum values for consistency + +Detailed changes: +[core] ADDED: LoadVrStereoConfig() +[core] ADDED: UnloadVrStereoConfig() +[core] ADDED: BeginVrStereoMode() +[core] ADDED: EndVrStereoMode() +[core] ADDED: GetCurrentMonitor() (#1485) by @object71 +[core] ADDED: SetGamepadMappings() (#1506) +[core] RENAMED: struct Camera: camera.type to camera.projection +[core] RENAMED: LoadShaderCode() to LoadShaderFromMemory() (#1690) +[core] RENAMED: SetMatrixProjection() to rlSetMatrixProjection() +[core] RENAMED: SetMatrixModelview() to rlSetMatrixModelview() +[core] RENAMED: GetMatrixModelview() to rlGetMatrixModelview() +[core] RENAMED: GetMatrixProjection() to rlGetMatrixProjection() +[core] RENAMED: GetShaderDefault() to rlGetShaderDefault() +[core] RENAMED: GetTextureDefault() to rlGetTextureDefault() +[core] REMOVED: GetShapesTexture() +[core] REMOVED: GetShapesTextureRec() +[core] REMOVED: GetMouseCursor() +[core] REMOVED: SetTraceLogExit() +[core] REVIEWED: GetFileName() and GetDirectoryPath() (#1534) by @gilzoide +[core] REVIEWED: Wait() to support FreeBSD (#1618) +[core] REVIEWED: HighDPI support on macOS retina (#1510) +[core] REDESIGNED: GetFileExtension(), includes the .dot +[core] REDESIGNED: IsFileExtension(), includes the .dot +[core] REDESIGNED: Compresion API to use sdefl/sinfl libs +[rlgl] ADDED: SUPPORT_GL_DETAILS_INFO config flag +[rlgl] REMOVED: GenTexture*() functions (#721) +[rlgl] REVIEWED: rlLoadShaderDefault() +[rlgl] REDESIGNED: rlLoadExtensions(), more details exposed +[raymath] REVIEWED: QuaternionFromEuler() (#1651) +[raymath] REVIEWED: MatrixRotateZYX() (#1642) +[shapes] ADDED: DrawLineBezierQuad() (#1468) by @epsilon-phase +[shapes] ADDED: CheckCollisionLines() +[shapes] ADDED: CheckCollisionPointLine() by @mkupiec1 +[shapes] REVIEWED: CheckCollisionPointTriangle() by @mkupiec1 +[shapes] REDESIGNED: SetShapesTexture() +[shapes] REDESIGNED: DrawCircleSector(), to use float params +[shapes] REDESIGNED: DrawCircleSectorLines(), to use float params +[shapes] REDESIGNED: DrawRing(), to use float params +[shapes] REDESIGNED: DrawRingLines(), to use float params +[textures] ADDED: DrawTexturePoly() and example (#1677) by @chriscamacho +[textures] ADDED: UnloadImageColors() for allocs consistency +[textures] RENAMED: GetImageData() to LoadImageColors() +[textures] REVIEWED: ImageClearBackground() and ImageDrawRectangleRec() (#1487) by @JeffM2501 +[textures] REVIEWED: DrawTexturePro() and DrawRectanglePro() transformations (#1632) by @ChrisDill +[text] REDESIGNED: DrawFPS() +[models] ADDED: UploadMesh() (#1529) +[models] ADDED: UpdateMeshBuffer() +[models] ADDED: DrawMesh() +[models] ADDED: DrawMeshInstanced() +[models] ADDED: UnloadModelAnimations() (#1648) by @object71 +[models] REMOVED: DrawGizmo() +[models] REMOVED: LoadMeshes() +[models] REMOVED: MeshNormalsSmooth() +[models] REVIEWED: DrawLine3D() (#1643) +[audio] REVIEWED: Multichannel sound system (#1548) +[audio] REVIEWED: jar_xm library (#1701) by @jmorel33 +[utils] ADDED: SetLoadFileDataCallback() +[utils] ADDED: SetSaveFileDataCallback() +[utils] ADDED: SetLoadFileTextCallback() +[utils] ADDED: SetSaveFileTextCallback() +[examples] ADDED: text_draw_3d (#1689) by @Demizdor +[examples] ADDED: textures_poly (#1677) by @chriscamacho +[examples] ADDED: models_gltf_model (#1551) by @object71 +[examples] RENAMED: shaders_rlgl_mesh_instanced to shaders_mesh_intancing +[examples] REDESIGNED: shaders_rlgl_mesh_instanced by @moliad +[examples] REDESIGNED: core_vr_simulator +[examples] REDESIGNED: models_yaw_pitch_roll +[build] ADDED: Config flag: SUPPORT_STANDARD_FILEIO +[build] ADDED: Config flag: SUPPORT_WINMM_HIGHRES_TIMER (#1641) +[build] ADDED: Config flag: SUPPORT_GL_DETAILS_INFO +[build] ADDED: Examples projects to VS2019 solution +[build] REVIEWED: Makefile to support PLATFORM_RPI (#1580) +[build] REVIEWED: Multiple typecast warnings by @JeffM2501 +[build] REDESIGNED: VS2019 project build paths +[build] REDESIGNED: CMake build system by @object71 +[*] RENAMED: Several functions parameters for consistency +[*] UPDATED: Multiple bindings to latest version +[*] UPDATED: All external libraries to latest versions +[*] Multiple code improvements and fixes by multiple contributors! ------------------------------------------------------------------------- Release: raylib 3.5 - 7th Anniversary Edition (25 December 2020) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c5d2113c..5fe826dff 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,9 +2,11 @@ cmake_minimum_required(VERSION 3.0) project(raylib) # Directory for easier includes +# Anywhere you see include(...) you can check /cmake for that file set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -# RAYLIB_IS_MAIN determines whether the project is being used from root, or as a dependency. +# RAYLIB_IS_MAIN determines whether the project is being used from root +# or if it is added as a dependency (through add_subdirectory for example). if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") set(RAYLIB_IS_MAIN TRUE) else() @@ -17,7 +19,7 @@ include(CompilerFlags) # Registers build options that are exposed to cmake include(CMakeOptions.txt) -# Checks a few environment and compiler configurations +# Enforces a few environment and compiler configurations include(BuildOptions) # Main sources directory (the second parameter sets the output directory name to raylib) diff --git a/CMakeOptions.txt b/CMakeOptions.txt index f39d17a1e..c024965e9 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -8,16 +8,16 @@ enum_option(OPENGL_VERSION "OFF;3.3;2.1;1.1;ES 2.0" "Force a specific OpenGL Ver # Configuration options option(BUILD_EXAMPLES "Build the examples." ${RAYLIB_IS_MAIN}) +option(CUSTOMIZE_BUILD "Show options for customizing your Raylib library build." OFF) option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF) option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF) option(ENABLE_MSAN "Enable MemorySanitizer (MSan) for debugging (not recommended to run with ASAN)" OFF) # Shared library is always PIC. Static library should be PIC too if linked into a shared library option(WITH_PIC "Compile static library as position-independent code" OFF) -option(SHARED "Build raylib as a dynamic library" OFF) -option(STATIC "Build raylib as a static library" ON) +option(BUILD_SHARED_LIBS "Build raylib as a shared library" OFF) option(MACOS_FATLIB "Build fat library for both i386 and x86_64 on macOS" OFF) -option(USE_AUDIO "Build raylib with audio module" ON) +cmake_dependent_option(USE_AUDIO "Build raylib with audio module" ON CUSTOMIZE_BUILD ON) enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system GLFW instead of embedded one") if(UNIX AND NOT APPLE) @@ -28,61 +28,59 @@ option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option") # core.c -option(SUPPORT_CAMERA_SYSTEM "Provide camera module (camera.h) with multiple predefined cameras: free, 1st/3rd person, orbital" ON) -option(SUPPORT_GESTURES_SYSTEM "Gestures module is included (gestures.h) to support gestures detection: tap, hold, swipe, drag" ON) -option(SUPPORT_MOUSE_GESTURES "Mouse gestures are directly mapped like touches and processed by gestures system" ON) -option(SUPPORT_SSH_KEYBOARD_RPI "Reconfigure standard input to receive key inputs, works with SSH connection" OFF) -option(SUPPORT_DEFAULT_FONT "Default font is loaded on window initialization to be available for the user to render simple text. If enabled, uses external module functions to load default raylib font (module: text)" ON) -option(SUPPORT_SCREEN_CAPTURE "Allow automatic screen capture of current screen pressing F12, defined in KeyCallback()" ON) -option(SUPPORT_GIF_RECORDING "Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()" ON) -option(SUPPORT_BUSY_WAIT_LOOP "Use busy wait loop for timing sync instead of a high-resolution timer" OFF) -option(SUPPORT_EVENTS_WAITING "Wait for events passively (sleeping while no events) instead of polling them actively every frame" OFF) -option(SUPPORT_HIGH_DPI "Support high DPI displays" OFF) -option(SUPPORT_DATA_STORAGE "Support for persistent data storage" ON) - -# rlgl.h -option(SUPPORT_VR_SIMULATOR "Support VR simulation functionality (stereo rendering)" ON) +cmake_dependent_option(SUPPORT_CAMERA_SYSTEM "Provide camera module (camera.h) with multiple predefined cameras: free, 1st/3rd person, orbital" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_GESTURES_SYSTEM "Gestures module is included (gestures.h) to support gestures detection: tap, hold, swipe, drag" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_MOUSE_GESTURES "Mouse gestures are directly mapped like touches and processed by gestures system" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_SSH_KEYBOARD_RPI "Reconfigure standard input to receive key inputs, works with SSH connection" OFF CUSTOMIZE_BUILD OFF) +cmake_dependent_option(SUPPORT_DEFAULT_FONT "Default font is loaded on window initialization to be available for the user to render simple text. If enabled, uses external module functions to load default raylib font (module: text)" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_SCREEN_CAPTURE "Allow automatic screen capture of current screen pressing F12, defined in KeyCallback()" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_GIF_RECORDING "Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_BUSY_WAIT_LOOP "Use busy wait loop for timing sync instead of a high-resolution timer" OFF CUSTOMIZE_BUILD OFF) +cmake_dependent_option(SUPPORT_EVENTS_WAITING "Wait for events passively (sleeping while no events) instead of polling them actively every frame" OFF CUSTOMIZE_BUILD OFF) +cmake_dependent_option(SUPPORT_WINMM_HIGHRES_TIMER "Setting a higher resolution can improve the accuracy of time-out intervals in wait functions" OFF CUSTOMIZE_BUILD OFF) +cmake_dependent_option(SUPPORT_DATA_STORAGE "Support for persistent data storage" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_COMPRESSION_API "Support for compression API" ON CUSTOMIZE_BUILD ON) # shapes.c -option(SUPPORT_FONT_TEXTURE "Draw rectangle shapes using font texture white character instead of default white texture. Allows drawing rectangles and text with a single draw call, very useful for GUI systems!" ON) -option(SUPPORT_QUADS_DRAW_MODE "Use QUADS instead of TRIANGLES for drawing when possible. Some lines-based shapes could still use lines" ON) +cmake_dependent_option(SUPPORT_QUADS_DRAW_MODE "Use QUADS instead of TRIANGLES for drawing when possible. Some lines-based shapes could still use lines" ON CUSTOMIZE_BUILD ON) # textures.c -option(SUPPORT_IMAGE_EXPORT "Support image exporting to file" ON) -option(SUPPORT_IMAGE_GENERATION "Support procedural image generation functionality (gradient, spot, perlin-noise, cellular)" ON) -option(SUPPORT_IMAGE_MANIPULATION "Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop... If not defined only three image editing functions supported: ImageFormat(), ImageAlphaMask(), ImageToPOT()" ON) -option(SUPPORT_FILEFORMAT_PNG "Support loading PNG as textures" ON) -option(SUPPORT_FILEFORMAT_DDS "Support loading DDS as textures" ON) -option(SUPPORT_FILEFORMAT_HDR "Support loading HDR as textures" ON) -option(SUPPORT_FILEFORMAT_KTX "Support loading KTX as textures" ON) -option(SUPPORT_FILEFORMAT_ASTC "Support loading ASTC as textures" ON) -option(SUPPORT_FILEFORMAT_BMP "Support loading BMP as textures" ${OFF}) -option(SUPPORT_FILEFORMAT_TGA "Support loading TGA as textures" ${OFF}) -option(SUPPORT_FILEFORMAT_JPG "Support loading JPG as textures" ${OFF}) -option(SUPPORT_FILEFORMAT_GIF "Support loading GIF as textures" ${OFF}) -option(SUPPORT_FILEFORMAT_PSD "Support loading PSD as textures" ${OFF}) -option(SUPPORT_FILEFORMAT_PKM "Support loading PKM as textures" ${OFF}) -option(SUPPORT_FILEFORMAT_PVR "Support loading PVR as textures" ${OFF}) +cmake_dependent_option(SUPPORT_IMAGE_EXPORT "Support image exporting to file" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_IMAGE_GENERATION "Support procedural image generation functionality (gradient, spot, perlin-noise, cellular)" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_IMAGE_MANIPULATION "Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop... If not defined only three image editing functions supported: ImageFormat(), ImageAlphaMask(), ImageToPOT()" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_PNG "Support loading PNG as textures" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_DDS "Support loading DDS as textures" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_HDR "Support loading HDR as textures" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_KTX "Support loading KTX as textures" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_ASTC "Support loading ASTC as textures" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_BMP "Support loading BMP as textures" ${OFF} CUSTOMIZE_BUILD OFF) +cmake_dependent_option(SUPPORT_FILEFORMAT_TGA "Support loading TGA as textures" ${OFF} CUSTOMIZE_BUILD OFF) +cmake_dependent_option(SUPPORT_FILEFORMAT_JPG "Support loading JPG as textures" ${OFF} CUSTOMIZE_BUILD OFF) +cmake_dependent_option(SUPPORT_FILEFORMAT_GIF "Support loading GIF as textures" ${OFF} CUSTOMIZE_BUILD OFF) +cmake_dependent_option(SUPPORT_FILEFORMAT_PSD "Support loading PSD as textures" ${OFF} CUSTOMIZE_BUILD OFF) +cmake_dependent_option(SUPPORT_FILEFORMAT_PKM "Support loading PKM as textures" ${OFF} CUSTOMIZE_BUILD OFF) +cmake_dependent_option(SUPPORT_FILEFORMAT_PVR "Support loading PVR as textures" ${OFF} CUSTOMIZE_BUILD OFF) # text.c -option(SUPPORT_FILEFORMAT_FNT "Support loading fonts in FNT format" ON) -option(SUPPORT_FILEFORMAT_TTF "Support loading font in TTF/OTF format" ON) -option(SUPPORT_TEXT_MANIPULATION "Support text manipulation functions" ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_FNT "Support loading fonts in FNT format" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_TTF "Support loading font in TTF/OTF format" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_TEXT_MANIPULATION "Support text manipulation functions" ON CUSTOMIZE_BUILD ON) # models.c -option(SUPPORT_MESH_GENERATION "Support procedural mesh generation functions, uses external par_shapes.h library. NOTE: Some generated meshes DO NOT include generated texture coordinates" ON) -option(SUPPORT_FILEFORMAT_OBJ "Support loading OBJ file format" ON) -option(SUPPORT_FILEFORMAT_MTL "Support loading MTL file format" ON) -option(SUPPORT_FILEFORMAT_IQM "Support loading IQM file format" ON) -option(SUPPORT_FILEFORMAT_GLTF "Support loading GLTF file format" ON) +cmake_dependent_option(SUPPORT_MESH_GENERATION "Support procedural mesh generation functions, uses external par_shapes.h library. NOTE: Some generated meshes DO NOT include generated texture coordinates" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_OBJ "Support loading OBJ file format" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_MTL "Support loading MTL file format" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_IQM "Support loading IQM file format" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_GLTF "Support loading GLTF file format" ON CUSTOMIZE_BUILD ON) # raudio.c -option(SUPPORT_FILEFORMAT_WAV "Support loading WAV for sound" ON) -option(SUPPORT_FILEFORMAT_OGG "Support loading OGG for sound" ON) -option(SUPPORT_FILEFORMAT_XM "Support loading XM for sound" ON) -option(SUPPORT_FILEFORMAT_MOD "Support loading MOD for sound" ON) -option(SUPPORT_FILEFORMAT_MP3 "Support loading MP3 for sound" ON) -option(SUPPORT_FILEFORMAT_FLAC "Support loading FLAC for sound" ${OFF}) +cmake_dependent_option(SUPPORT_FILEFORMAT_WAV "Support loading WAV for sound" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_OGG "Support loading OGG for sound" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_XM "Support loading XM for sound" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_MOD "Support loading MOD for sound" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_MP3 "Support loading MP3 for sound" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_FILEFORMAT_FLAC "Support loading FLAC for sound" ${OFF} CUSTOMIZE_BUILD OFF) # utils.c -option(SUPPORT_TRACELOG "Show TraceLog() output messages. NOTE: By default LOG_DEBUG traces not shown" ON) +cmake_dependent_option(SUPPORT_STANDARD_FILEIO "Support standard file io library (stdio.h)" ON CUSTOMIZE_BUILD ON) +cmake_dependent_option(SUPPORT_TRACELOG "Show TraceLog() output messages. NOTE: By default LOG_DEBUG traces not shown" ON CUSTOMIZE_BUILD ON) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3d932bc37..644a89bf4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,22 +4,22 @@ Hello contributors! Welcome to raylib! Do you enjoy raylib and want to contribute? Nice! You can help with the following points: -- C programming - Can you write/review/test/improve the code? -- Documentation/Tutorials/Example - Can you write some tutorial/example? -- Porting to other platforms - Can you port and compile raylib on other systems? -- Web Development - Can you help [with the website](https://github.com/raysan5/raylib.com)? -- Testing - Can you find some bugs in raylib? +- `C programming` - Can you write/review/test/improve the code? +- `Documentation/Tutorials/Example` - Can you write some tutorial/example? +- `Porting to other platforms` - Can you port/adapt/compile raylib on other systems? +- `Web Development` - Can you help [with the website](https://github.com/raysan5/raylib.com)? +- `Testing` - Can you find some bugs in raylib? This document contains a set of guidelines to contribute to the project. These are mostly guidelines, not rules. Use your best judgement, and feel free to propose changes to this document in a pull request. ### raylib philosophy - - raylib is a tool to enjoy videogames programming, every single function in raylib should be a tutorial on itself. - - raylib is **SIMPLE** and **EASY-TO-USE**, I tried to keep it compact with a small set of functions, if a function is too complex or is not clearly useful, better not including it. + - raylib is a tool to **ENJOY** videogames programming, every function in raylib is designed as a mini-tutorial on itself. + - raylib is **SIMPLE** and **EASY-TO-USE**, I tried to keep it compact with a small set of functions, if a function is too complex, better not including it. - raylib is open source and free; educators and institutions can use this tool to **TEACH** videogames programming completely for free. - raylib is collaborative; contribution of tutorials / code examples / bug fixes / code comments are highly appreciated. - - raylib's license (and its external libs respective licenses) allow using it on commercial projects. + - raylib's license (and its external libs respective licenses) allow using raylib on commercial projects. ### Some interesting reads to start with @@ -40,9 +40,9 @@ to make it easier for students/users to read, write and understand code. Source code is extensively commented for that purpose, raylib primary learning method is: - > learn by reading code and examples + > `Learn by reading code and examples` -For detailed information on building raylib and examples, please see [raylib Wiki](https://github.com/raysan5/raylib/wiki). +For detailed information on building raylib and examples, please check [raylib Wiki](https://github.com/raysan5/raylib/wiki). ### Opening new Issues @@ -68,69 +68,9 @@ To open new issue for raylib (bug, enhancement, discussion...), just try to foll If you have any doubt, don't hesitate to [contact me](mailto:ray@raylib.com)!. You can write me a direct mail but you can also contact me on the following networks: - - [raylib reddit](https://www.reddit.com/r/raylib/) - A good place for discussions or to ask for help. - - [raylib Discord](https://discord.gg/VkzNHUE) - A direct communication channel for project discussions. + - [raylib Discord](https://discord.gg/raylib) - A direct communication channel for project discussions. - [raylib twitter](https://twitter.com/raysan5) - My personal twitter account, I usually post about raylib, you can send me PMs. + - [raylib reddit](https://www.reddit.com/r/raylib/) - A good place for discussions or to ask for help. - [raylib web](http://www.raylib.com/) - On top-right corner there is a bunch of networks where you can find me. Thank you very much for your time! :) - ----- - -Here is a list of raylib contributors, these people have invested part of their time -contributing (in some way or another) to make the raylib project better. Huge thanks to all of them! - - - [Zopokx](https://github.com/Zopokx) for testing the web. - - [Elendow](http://www.elendow.com) for testing and helping on web development. - - Victor Dual for implementing and testing 3D shapes functions. - - Marc Palau for implementing and testing 3D shapes functions and contribute on camera and gestures modules. - - Kevin Gato for improving texture internal formats support and helping on raygui development. - - Daniel Nicolas for improving texture internal formats support and helping on raygui development. - - Marc Agüera for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com)) - - Daniel Moreno for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com)) - - Daniel Gomez for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com)) - - [Sergio Martinez](https://github.com/anidealgift) for helping on raygui development and tools development (raygui_styler). - - [Victor Fisac](https://github.com/victorfisac) for developing physics raylib module (physac) and implementing PBR materials and lighting systems... among multiple other improvements and multiple tools and games. - - Albert Martos for helping on raygui and porting examples and game-templates to Android and HTML5. - - Ian Eito for helping on raygui and porting examples and game-templates to Android and HTML5. - - [procedural](https://github.com/procedural) for testing raylib on Linux, correcting some bugs and adding several mouse functions. - - [Chris Hemingway](https://github.com/cHemingway) for improving raylib on OSX build system. - - [Emanuele Petriglia](https://github.com/LelixSuper) for working on multiple GNU/Linux improvements and developing [TicTacToe](https://github.com/LelixSuper/TicTacToe) raylib game. - - [Joshua Reisenauer](https://github.com/kd7tck) for adding audio modules support (XM, MOD) and reviewing audio system. - - [Marcelo Paez](https://github.com/paezao) for helping on OSX High DPI display issue. - - [Ghassan Al-Mashareqa](https://github.com/ghassanpl) for an amazing contribution to raylib Lua module. - - [Teodor Stoenescu](https://github.com/teodor-stoenescu) for improvements on OBJ object loading. - - [RDR8](https://github.com/RDR8) for helping with Linux build improvements. - - [Saggi Mizrahi](https://github.com/ficoos) for multiple fixes on Linux and audio system. - - [Daniel Lemos](https://github.com/xspager) for fixing issues on Linux games building. - - [Joel Davis](https://github.com/joeld42) for adding raycast picking utilities and a [great example](https://github.com/raysan5/raylib/blob/master/examples/models/models_mesh_picking.c) - - [Richard Goodwin](https://github.com/AudioMorphology) for adding RPI touchscreen support. - - [Milan Nikolic](https://github.com/gen2brain) for adding Android build support with custom standalone toolchain. - - [Michael Vetter](https://github.com/jubalh) for improvements on build system and his work on Suse Linux package... and multiple fixes! - - [Wilhem Barbier](https://github.com/nounoursheureux) for adding Image generation functions, shaders work and some fixes. - - [Benjamin Summerton](https://github.com/define-private-public) for improving OSX building and his amazing work on CMake build sytem. - - [MartinFX](https://github.com/Martinfx) for adding compilation support for FreeBSD OS and derivatives. - - [Ahmad Fatoum](https://github.com/a3f) for implementing CI support for raylib (Travis and AppVeyor) and great improvements on build system. - - [SamNChiet](https://github.com/SamNChiet) for a greatly improved UWP input implementation. - - [David Reid](https://github.com/mackron) for a complete review of audio module to support his amazing miniaudio library. - - [Kai](https://github.com/questor) for multiple code reviews and improvements. - - [Max Danielsson](https://github.com/autious) for adding support for orthographic 3d camera projection - - [Lumaio](https://github.com/TheLumaio) for his great work on GBuffers and GetCollisionRayModel(). - - [Jonas Daeyaert](https://github.com/culacant) for an amazing work on IQM animated models support. - - [Seth Archambault](https://github.com/SethArchambault) for the work on Android Gamepad support (SNES model). - - [D3nX](https://github.com/D3nX) for adding Code::Blocks project template. - - [Jak Barnes](https://github.com/Syphonx) for a great work on `rnet`, new raylib network module - - [Vlad Adrian](https://github.com/Demizdor) for an amazing work on Unicode support, new shapes functions and raygui. - - [Reece Mackie](https://github.com/Rover656) for a great work on improving UWP support - - [flashback-fx](flashback-fx) for improving easings library and example - - [Jorge A. Gomes](https://github.com/overdev) for adding nine-patch textures support and example - - [Berni8k](https://github.com/Berni8k) for improving Raspberry Pi input system, using evdev - - [Wilhem Barbier](https://github.com/wbrbr) for implementing glTF loading support and solving several issues - - [Marco Lizza](https://github.com/MarcoLizza) for improving logging system and multiple issues - - [Anata](https://github.com/anatagawa) for creating amazing examples and contributing with them - - [Narice](https://github.com/narice) made easings.h includable as standalone header - - [Eric J.](https://github.com/ProfJski) for shaders_eratosthenes example contribution - - [PompPenguin](https://github.com/PompPenguin) for reviewing 3rd person camera - - [Mohamed Shazan](https://github.com/msmshazan) for adding support for ANGLE graphics backend - -Please, if I forget someone in this list, excuse me and send me a PR! diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 000000000..5673507db --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,63 @@ +### WARNING: This file is unmaintained! This list of contributors is uncomplete! + +### Check CHANGELOG for some of the contributors details or just the official contributors list of the repo + +--- + +Here is a list of raylib contributors, these people have invested part of their time +contributing (in some way or another) to make the raylib project better. Huge thanks to all of them! + + - [Zopokx](https://github.com/Zopokx) for testing the web. + - [Elendow](http://www.elendow.com) for testing and helping on web development. + - Victor Dual for implementing and testing 3D shapes functions. + - Marc Palau for implementing and testing 3D shapes functions and contribute on camera and gestures modules. + - Kevin Gato for improving texture internal formats support and helping on raygui development. + - Daniel Nicolas for improving texture internal formats support and helping on raygui development. + - Marc Agüera for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com)) + - Daniel Moreno for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com)) + - Daniel Gomez for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com)) + - [Sergio Martinez](https://github.com/anidealgift) for helping on raygui development and tools development (raygui_styler). + - [Victor Fisac](https://github.com/victorfisac) for developing physics raylib module (physac) and implementing PBR materials and lighting systems... among multiple other improvements and multiple tools and games. + - Albert Martos for helping on raygui and porting examples and game-templates to Android and HTML5. + - Ian Eito for helping on raygui and porting examples and game-templates to Android and HTML5. + - [procedural](https://github.com/procedural) for testing raylib on Linux, correcting some bugs and adding several mouse functions. + - [Chris Hemingway](https://github.com/cHemingway) for improving raylib on OSX build system. + - [Emanuele Petriglia](https://github.com/LelixSuper) for working on multiple GNU/Linux improvements and developing [TicTacToe](https://github.com/LelixSuper/TicTacToe) raylib game. + - [Joshua Reisenauer](https://github.com/kd7tck) for adding audio modules support (XM, MOD) and reviewing audio system. + - [Marcelo Paez](https://github.com/paezao) for helping on OSX High DPI display issue. + - [Ghassan Al-Mashareqa](https://github.com/ghassanpl) for an amazing contribution to raylib Lua module. + - [Teodor Stoenescu](https://github.com/teodor-stoenescu) for improvements on OBJ object loading. + - [RDR8](https://github.com/RDR8) for helping with Linux build improvements. + - [Saggi Mizrahi](https://github.com/ficoos) for multiple fixes on Linux and audio system. + - [Daniel Lemos](https://github.com/xspager) for fixing issues on Linux games building. + - [Joel Davis](https://github.com/joeld42) for adding raycast picking utilities and a [great example](https://github.com/raysan5/raylib/blob/master/examples/models/models_mesh_picking.c) + - [Richard Goodwin](https://github.com/AudioMorphology) for adding RPI touchscreen support. + - [Milan Nikolic](https://github.com/gen2brain) for adding Android build support with custom standalone toolchain. + - [Michael Vetter](https://github.com/jubalh) for improvements on build system and his work on Suse Linux package... and multiple fixes! + - [Wilhem Barbier](https://github.com/nounoursheureux) for adding Image generation functions, shaders work and some fixes. + - [Benjamin Summerton](https://github.com/define-private-public) for improving OSX building and his amazing work on CMake build sytem. + - [MartinFX](https://github.com/Martinfx) for adding compilation support for FreeBSD OS and derivatives. + - [Ahmad Fatoum](https://github.com/a3f) for implementing CI support for raylib (Travis and AppVeyor) and great improvements on build system. + - [SamNChiet](https://github.com/SamNChiet) for a greatly improved UWP input implementation. + - [David Reid](https://github.com/mackron) for a complete review of audio module to support his amazing miniaudio library. + - [Kai](https://github.com/questor) for multiple code reviews and improvements. + - [Max Danielsson](https://github.com/autious) for adding support for orthographic 3d camera projection + - [Lumaio](https://github.com/TheLumaio) for his great work on GBuffers and GetCollisionRayModel(). + - [Jonas Daeyaert](https://github.com/culacant) for an amazing work on IQM animated models support. + - [Seth Archambault](https://github.com/SethArchambault) for the work on Android Gamepad support (SNES model). + - [D3nX](https://github.com/D3nX) for adding Code::Blocks project template. + - [Jak Barnes](https://github.com/Syphonx) for a great work on `rnet`, new raylib network module + - [Vlad Adrian](https://github.com/Demizdor) for an amazing work on Unicode support, new shapes functions and raygui. + - [Reece Mackie](https://github.com/Rover656) for a great work on improving UWP support + - [flashback-fx](flashback-fx) for improving easings library and example + - [Jorge A. Gomes](https://github.com/overdev) for adding nine-patch textures support and example + - [Berni8k](https://github.com/Berni8k) for improving Raspberry Pi input system, using evdev + - [Wilhem Barbier](https://github.com/wbrbr) for implementing glTF loading support and solving several issues + - [Marco Lizza](https://github.com/MarcoLizza) for improving logging system and multiple issues + - [Anata](https://github.com/anatagawa) for creating amazing examples and contributing with them + - [Narice](https://github.com/narice) made easings.h includable as standalone header + - [Eric J.](https://github.com/ProfJski) for shaders_eratosthenes example contribution + - [PompPenguin](https://github.com/PompPenguin) for reviewing 3rd person camera + - [Mohamed Shazan](https://github.com/msmshazan) for adding support for ANGLE graphics backend + +Please, if I forget someone in this list, excuse me and send me a PR! diff --git a/HISTORY.md b/HISTORY.md index 6291d5f29..073d183c6 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -249,7 +249,7 @@ After **10 months of intense development**, new raylib version is ready. Despite - New **GitHub Actions CI** system has been implemented for Windows, Linux and macOS code and examples compilation on every new commit or PR to make sure library keeps stable and usable with no breaking bugs. -Note that only key changes are listed here but there is way more! About **30 new functions**, multiple functions reviewed, bindings to [+40 programming languages](https://github.com/raysan5/raylib/blob/master/BINDINGS.md) and great samples/demos/tutorials [created by the community](https://discord.gg/VkzNHUE), including raylib integration with [Spine](https://github.com/WEREMSOFT/spine-raylib-runtimes), [Unity](https://unitycoder.com/blog/2019/12/09/using-raylib-dll-in-unity/), [Tiled](https://github.com/OnACoffeeBreak/raylib_tiled_import_with_tmx), [Nuklear](http://bedroomcoders.co.uk/implementing-a-3d-gui-with-raylib/), [enet](https://github.com/nxrighthere/NetDynamics) and [more](https://github.com/raysan5/raylib/issues/1079)! +Note that only key changes are listed here but there is way more! About **30 new functions**, multiple functions reviewed, bindings to [+40 programming languages](https://github.com/raysan5/raylib/blob/master/BINDINGS.md) and great samples/demos/tutorials [created by the community](https://discord.gg/raylib), including raylib integration with [Spine](https://github.com/WEREMSOFT/spine-raylib-runtimes), [Unity](https://unitycoder.com/blog/2019/12/09/using-raylib-dll-in-unity/), [Tiled](https://github.com/OnACoffeeBreak/raylib_tiled_import_with_tmx), [Nuklear](http://bedroomcoders.co.uk/implementing-a-3d-gui-with-raylib/), [enet](https://github.com/nxrighthere/NetDynamics) and [more](https://github.com/raysan5/raylib/issues/1079)! It has been **10 months of improvements** to create the best raylib ever. @@ -291,3 +291,34 @@ Here the list with some highlights for `raylib 3.5`. A part of those changes, many new functions have been added, some redundant functions removed and many functions have been reviewed for consistency with the full API (function name, parameters name and order, code formatting...). Again, this release represents is a **great improvement for raylib and marks the way forward** for the library. Make sure to check [CHANGELOG](CHANGELOG) for details! Hope you enjoy it! Happy holidays! :) + +notes on raylib 3.7 +------------------- + +April 2021, it's been about 4 months since last raylib release and here it is already a new one, this time with a bunch of internal redesigns and improvements. Surprisingly, on April the 8th I was awarded for a second time with the [Google Open Source Peer Bonus Award](https://opensource.googleblog.com/2021/04/announcing-first-group-of-google-open-source-peer-bonus-winners.html) for my contribution to open source world with raylib and it seems the library is getting some traction, what a better moment for a new release? Let's see what can be found in this new version: + +Let's start with some numbers: + + - **+100** closed issues (for a TOTAL of **+900**!) + - **+400** commits since previous RELEASE + - **+50** functions ADDED (**+30** of them to rlgl API) + - **+30** functions REVIEWED/REDESIGNED + - **+40** new contributors (for a TOTAL of **+210**!) + +Highlights for `raylib 3.7`: + + - **REDESIGNED: `rlgl` module for greater abstraction level**. This suppose an **important change in raylib architecture**, now `rlgl` functionality is self-contained in the module and used by higher-level layers (specially by `core` module), those upper layers are the ones that expose functionality to the main API when required, for example the `Shaders`, `Mesh` and `Materials` functionality. Multiple `rlgl` functions have been renamed for consistency, in this case, following the `rl*()` prefix convention. Functions have also been reorganized internally by categories and `GenTexture*()` functions have been removed from the library and moved to [`models_material_pbr`](https://github.com/raysan5/raylib/blob/master/examples/models/models_material_pbr.c) example. + + - **REDESIGNED: VR simulator and stereo rendering mechanism**. A **brand new API** has been added, more comprehensive and better integrated with raylib, the **new stereo rendering** can be combined with `RenderTexture` and `Shader` API allowing the user to **manage fbo and distortion shader directly**. Also, the new rendering mechanism supports **instancing on stereo rendering**! Check the updated [`core_vr_simulator`](https://github.com/raysan5/raylib/blob/master/examples/core/core_vr_simulator.c) example for reference! + + - **ADDED: New file access callbacks system**. Several new callback functions have been added to the API to allow custom file loaders. A [nice example](https://github.com/RobLoach/raylib-physfs) it's the **raylib integration with a virtual file system** [PhysFS](https://icculus.org/physfs/). + + - **ADDED: glTF animations support**. glTF is the preferred models file format to be used with raylib and along the addition of a models animation API on latest raylib versions, now animations support for glTF format has come to raylib, thanks for this great contribution to [Hristo Stamenov](@object71) + + - **ADDED: Music streaming support from memory**. raylib has been adding the `Load*FromMemory()` option to all its supported file formats but **music streaming** was not supported yet... until now. Thanks to this great contribution by [Agnis "NeZvērs" Aldiņš](@nezvers), now raylib supports music streamming from memory data for all supported file formats: WAV, OGG, MP3, FLAC, XM and MOD. + + - **RENAMED: enums values for consistency**. Most raylib enums names and values names have been renamed for consistency, now all value names start with the type of data they represent. It increases clarity and readability when using those values and also **improves overall library consistency**. + +Beside those key changes, many functions have been reviewed with improvements and bug fixes, many of them contributed by the community! Thanks! And again, this release sets a **new milestone for raylib library**. Make sure to check [CHANGELOG](CHANGELOG) for detailed list of changes! Hope you enjoy this new raylib installment! + +Happy **gamedev/tools/graphics** programming! :) diff --git a/README.md b/README.md index 28d3bb815..e07b2b16c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - + **raylib is a simple and easy-to-use library to enjoy videogames programming.** @@ -8,14 +8,16 @@ raylib is highly inspired by Borland BGI graphics lib and by XNA framework and i Ready to learn? Jump to [code examples!](http://www.raylib.com/examples.html) +--- +
[![GitHub contributors](https://img.shields.io/github/contributors/raysan5/raylib)](https://github.com/raysan5/raylib/graphs/contributors) [![GitHub All Releases](https://img.shields.io/github/downloads/raysan5/raylib/total)](https://github.com/raysan5/raylib/releases) -[![GitHub commits since tagged version](https://img.shields.io/github/commits-since/raysan5/raylib/3.5.0)](https://github.com/raysan5/raylib/commits/master) +[![GitHub commits since tagged version](https://img.shields.io/github/commits-since/raysan5/raylib/3.7.0)](https://github.com/raysan5/raylib/commits/master) [![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE) -[![Chat on Discord](https://img.shields.io/discord/426912293134270465.svg?logo=discord)](https://discord.gg/VkzNHUE) +[![Chat on Discord](https://img.shields.io/discord/426912293134270465.svg?logo=discord)](https://discord.gg/raylib) [![GitHub stars](https://img.shields.io/github/stars/raysan5/raylib?style=social)](https://github.com/raysan5/raylib/stargazers) [![Twitter Follow](https://img.shields.io/twitter/follow/raysan5?style=social)](https://twitter.com/raysan5) [![Subreddit subscribers](https://img.shields.io/reddit/subreddit-subscribers/raylib?style=social)](https://www.reddit.com/r/raylib/) @@ -26,39 +28,55 @@ Ready to learn? Jump to [code examples!](http://www.raylib.com/examples.html) [![Android](https://github.com/raysan5/raylib/workflows/Android/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AAndroid) [![WebAssembly](https://github.com/raysan5/raylib/workflows/WebAssembly/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AWebAssembly) +[![CMakeBuilds](https://github.com/raysan5/raylib/workflows/CMakeBuilds/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3ACMakeBuilds) +[![Windows Examples](https://github.com/raysan5/raylib/actions/workflows/windows_examples.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/windows_examples.yml) +[![Linux Examples](https://github.com/raysan5/raylib/actions/workflows/linux_examples.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/linux_examples.yml) + features -------- - - **NO external dependencies**, all required libraries are bundled into raylib + - **NO external dependencies**, all required libraries are [bundled into raylib](https://github.com/raysan5/raylib/tree/master/src/external) - Multiple platforms supported: **Windows, Linux, MacOS, RPI, Android, HTML5... and more!** - Written in plain C code (C99) in PascalCase/camelCase notation - Hardware accelerated with OpenGL (**1.1, 2.1, 3.3 or ES 2.0**) - **Unique OpenGL abstraction layer** (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) - Multiple **Fonts** formats supported (TTF, XNA fonts, AngelCode fonts) - - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC) + - Multiple texture formats supported, including **compressed formats** (DXT, ETC, ASTC) - **Full 3D support**, including 3D Shapes, Models, Billboards, Heightmaps and more! - Flexible Materials system, supporting classic maps and **PBR maps** - - **Animated 3D models** supported (skeletal bones animation) + - **Animated 3D models** supported (skeletal bones animation) (IQM, glTF) - Shaders support, including model and **postprocessing** shaders. - **Powerful math module** for Vector, Matrix and Quaternion operations: [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h) - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD) - **VR stereo rendering** support with configurable HMD device parameters - Huge examples collection with [+120 code examples](https://github.com/raysan5/raylib/tree/master/examples)! - Bindings to [+50 programming languages](https://github.com/raysan5/raylib/blob/master/BINDINGS.md)! - - Free and open source. + - **Free and open source**. -raylib uses on its [core](https://github.com/raysan5/raylib/blob/master/src/core.c) module the outstanding [GLFW3](http://www.glfw.org/) library, embedded in the form of [rglfw](https://github.com/raysan5/raylib/blob/master/src/rglfw.c) module, to avoid external dependencies. +raylib uses internally some libraries for window/graphics/inputs management and also to support different fileformats loading, all those libraries are embedded with raylib and are available in [src/external](https://github.com/raysan5/raylib/tree/master/src/external) directory. Check [raylib dependencies](https://github.com/raysan5/raylib/wiki/raylib-dependencies) on [raylib Wiki](https://github.com/raysan5/raylib/wiki) for a detailed list. -raylib uses on its [raudio](https://github.com/raysan5/raylib/blob/master/src/raudio.c) module, the amazing [miniaudio](https://github.com/dr-soft/miniaudio) library to support multiple platforms and multiple audio backends. +basic example +-------------- +This is a basic raylib example, it creates a window and it draws the text `"Congrats! You created your first window!"` in the middle of the screen. Check this example [running live on web here](https://www.raylib.com/examples/web/core/loader.html?name=core_basic_window). +```c +#include "raylib.h" -raylib uses internally several single-file header-only libraries to support different fileformats loading and saving, all those libraries are embedded with raylib and available in [src/external](https://github.com/raysan5/raylib/tree/master/src/external) directory. Check [raylib Wiki](https://github.com/raysan5/raylib/wiki/raylib-dependencies) for a detailed list. +int main(void) +{ + InitWindow(800, 450, "raylib [core] example - basic window"); -*On Android platform, `native_app_glue` module (provided by Android NDK) and native Android libraries are used to manage window/context, inputs and activity life cycle.* + while (!WindowShouldClose()) + { + BeginDrawing(); + ClearBackground(RAYWHITE); + DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); + EndDrawing(); + } -*On Raspberry Pi 0,1,2,3 platform (native mode), `Videocore API` and `EGL` libraries are used for window/context management. Inputs are processed using `evdev` Linux libraries* + CloseWindow(); -*On Raspberry Pi 4 platform (native mode), `DRM subsystem` and `GBM API` libraries are used for window/context management. Inputs are processed using `evdev` Linux libraries* - -*On Web platform, raylib uses `emscripten` provided libraries for several input events management, specially noticeable the touch events support.* + return 0; +} +``` build and installation ---------------------- @@ -87,7 +105,7 @@ You can download and install raylib using the [conan](https://conan.io) dependen *The raylib recipe in conan is kept up to date by conan team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/conan-io/conan-center-index) on the conan-center-index repository.* -#### Building raylib on multiple platforms +#### Installing and building raylib on multiple platforms [raylib Wiki](https://github.com/raysan5/raylib/wiki#development-platforms) contains detailed instructions on building and usage on multiple platforms. @@ -98,12 +116,11 @@ You can download and install raylib using the [conan](https://conan.io) dependen - [Working on Raspberry Pi](https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi) - [Working for Android](https://github.com/raysan5/raylib/wiki/Working-for-Android) - [Working for Web (HTML5)](https://github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5)) - - [Working for UWP (Universal Window Platform)](https://github.com/raysan5/raylib/wiki/Working-for-UWP) - [Working anywhere with CMake](https://github.com/raysan5/raylib/wiki/Working-with-CMake) *Note that Wiki is open for edit, if you find some issue while building raylib for your target platform, feel free to edit the Wiki or open and issue related to it.* -#### Using raylib with multiple IDEs +#### Setup raylib with multiple IDEs raylib has been developed on Windows platform using [Notepad++](https://notepad-plus-plus.org/) and [MinGW GCC](http://mingw-w64.org/doku.php) compiler but it can be used with other IDEs on multiple platforms. @@ -111,18 +128,32 @@ raylib has been developed on Windows platform using [Notepad++](https://notepad- *Note that there are lots of IDEs supported, some of the provided templates could require some review, please, if you find some issue with some template or you think they could be improved, feel free to send a PR or open a related issue.* -contact -------- +learning and docs +------------------ - * Webpage: [http://www.raylib.com](http://www.raylib.com) - * Discord: [https://discord.gg/raylib](https://discord.gg/VkzNHUE) - * Twitter: [http://www.twitter.com/raysan5](http://www.twitter.com/raysan5) - * Twitch: [http://www.twitch.tv/raysan5](http://www.twitch.tv/raysan5) - * Reddit: [https://www.reddit.com/r/raylib](https://www.reddit.com/r/raylib) - * Patreon: [https://www.patreon.com/raylib](https://www.patreon.com/raylib) - * YouTube: [https://www.youtube.com/channel/raylib](https://www.youtube.com/channel/UC8WIBkhYb5sBNqXO1mZ7WSQ) +raylib is designed to be learned using [the examples](https://github.com/raysan5/raylib/tree/master/examples) as the main reference. There is no standard API documentation but there is a [**cheatsheet**](https://www.raylib.com/cheatsheet/cheatsheet.html) containing all the functions available on the library and a short description of each one of them, input parameters and result value names should be intuitive enough to understand how each function works. -If you are using raylib and enjoying it, please, join our [Discord server](https://discord.gg/VkzNHUE) and let us know! :) +Some additional documentation about raylib design can be found in raylib GitHub Wiki. Here the more relevant links: + + - [raylib cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html) + - [raylib architecture](https://github.com/raysan5/raylib/wiki/raylib-architecture) + - [raylib library design](https://github.com/raysan5/raylib/wiki) + - [raylib examples collection](https://github.com/raysan5/raylib/tree/master/examples) + - [raylib games collection](https://github.com/raysan5/raylib-games) + + +contact and networks +--------------------- + +raylib is present in several networks and raylib community is growing everyday. If you are using raylib and enjoying it, feel free to join us in any of these networks. The most active network is our [Discord server](https://discord.gg/raylib)! :) + + - Webpage: [http://www.raylib.com](http://www.raylib.com) + - Discord: [https://discord.gg/raylib](https://discord.gg/raylib) + - Twitter: [http://www.twitter.com/raysan5](http://www.twitter.com/raysan5) + - Twitch: [http://www.twitch.tv/raysan5](http://www.twitch.tv/raysan5) + - Reddit: [https://www.reddit.com/r/raylib](https://www.reddit.com/r/raylib) + - Patreon: [https://www.patreon.com/raylib](https://www.patreon.com/raylib) + - YouTube: [https://www.youtube.com/channel/raylib](https://www.youtube.com/c/raylib) license ------- diff --git a/ROADMAP.md b/ROADMAP.md index e11e898b3..94c96846b 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,21 +1,25 @@ roadmap ------- -Here it is a wish-list with features and ideas to improve the library. Note that features listed here are quite high-level and could be long term additions for the library. Current version of raylib is complete and functional but there is a lot of room for improvement. +Here it is a wish-list with features and ideas to improve the library. Note that features listed here are usually long term additions for the library. Current version of raylib is complete and functional but there is a lot of room for improvement. -[raylib source code](https://github.com/raysan5/raylib/tree/master/src) has some *TODO* marks around code with pending things to review and improve. Check also [GitHub Issues](https://github.com/raysan5/raylib/issues) for further details! +Also note that [raylib source code](https://github.com/raysan5/raylib/tree/master/src) has multiple *TODO* comments around code with pending things to review or improve. Check also [GitHub Issues](https://github.com/raysan5/raylib/issues) for further details! -**raylib 3.x** - - [ ] Network module (UDP): `rnet` ([info](https://github.com/raysan5/raylib/issues/753)) - - [ ] Custom raylib resource packer: `rres` ([info](https://github.com/raysan5/rres)) - - [ ] Basic CPU/GPU stats system (memory, draws, time...) +There is also a [Discussions Wishlist](https://github.com/raysan5/raylib/discussions/1502) open to everyone, feel free to check and comment. + +**raylib 4.0** + - [ ] Network module (UDP): `rnet` ([#753](https://github.com/raysan5/raylib/issues/753)) + - [ ] Custom raylib resource packer: `rres` ([link](https://github.com/raysan5/rres)) + - [ ] Basic CPU/GPU stats system (memory, draws, time...) ([#1295](https://github.com/raysan5/raylib/issues/1295)) + - [ ] Software rendering backend (avoiding OpenGL) ([#1370](https://github.com/raysan5/raylib/issues/1370)) + - [ ] Redesigned camera module (more flexible) ([#1143](https://github.com/raysan5/raylib/issues/1143)) - [x] Continuous Deployment using GitHub Actions **raylib 3.0** - [x] Custom memory allocators support - [x] Global variables moved to global context - [x] Optimize data structures for pass-by-value - - [x] Trace log messages redesign ([info](https://github.com/raysan5/raylib/issues/1065)) + - [x] Trace log messages redesign ([#1065](https://github.com/raysan5/raylib/issues/1065)) - [x] Continuous Integration using GitHub Actions **raylib 2.5** diff --git a/SPONSORS.md b/SPONSORS.md index 19e8abb43..c4822d0e0 100644 --- a/SPONSORS.md +++ b/SPONSORS.md @@ -1,47 +1,57 @@ -The following people has contributed with a generous donation to the raylib project. +## raylib GitHub Sponsors -## 🥇 Gold Contributors +### Current raylib GitHub Sponsors -... +The following people is currently [**sponsoring raylib**](https://github.com/sponsors/raysan5) with a generous donation to allow improving and growing the project! -## 🥈 Silver Contributors +Note that Sponsors donations vary between sponsors, I just decided not to make any distinction while listing them. - - Jonathan Johnson ([@ecton](https://github.com/ecton)) - Eric J. ([@ProfJski](https://github.com/ProfJski)) - - Rudy Faile ([@rfaile313](https://github.com/rfaile313)) - https://rudyfaile.com/ - devdad ([@devdad](https://github.com/devdad)) - - frithrah ([@frithrah](https://github.com/frithrah)) - Zach Geis ([@zacgeis](https://github.com/zacgeis)) - -## 🥉 Bronze Contributors - - minirop ([@minirop](https://github.com/minirop)) - Daniel Gómez ([@Koocachookies](https://github.com/Koocachookies)) - Sergio ([@anidealgift](https://github.com/anidealgift)) - - JFons ([@JFonS](https://github.com/JFonS)) - Marc Agüera ([@maguera93](https://github.com/maguera93)) - Pau Fernández ([@pauek](https://github.com/pauek)) - - Jens Pitkänen ([@neonmoe](https://github.com/neonmoe)) - Snowminx ([@Gamerfiend](https://github.com/Gamerfiend)) - NimbusFox ([@NimbusFox](https://github.com/NimbusFox)) - Robin Mattheussen ([@romatthe](https://github.com/romatthe)) - - Rahul Nair ([@rahulunair](https://github.com/rahulunair)) - Grant Haywood ([@cinterloper](https://github.com/cinterloper)) - Terry Nguyen ([@terrehbyte](https://github.com/terrehbyte)) - - albatros-hmd ([@albatros-hmd](https://github.com/albatros-hmd)) - - Benjamin Stigsen ([@BenStigsen](https://github.com/BenStigsen)) - - Louis Johnson ([@louisgjohnson](https://github.com/louisgjohnson)) - - Dani Martin ([@danimartin82](https://github.com/danimartin82)) - Tommi Sinivuo ([@TommiSinivuo](https://github.com/TommiSinivuo)) - - Joakim Wennergren ([@joakimwennergren](https://github.com/joakimwennergren)) - Richard Urbanec ([@Poryg1](https://github.com/Poryg1)) - pmgl ([@pmgl](https://github.com/pmgl)) - cob ([@majorcob](https://github.com/majorcob)) - Samuel Batista ([@gamedevsam](https://github.com/gamedevsam)) + - Merlyn Morgan-Graham ([@kavika13](https://github.com/kavika13)) + - Toby4213 ([@Toby4213](https://github.com/Toby4213)) + - linus ([@hochbaum](https://github.com/hochbaum)) + + +### Past raylib GitHub Sponsors + +The following people has **sponsored raylib** in the past, allowing the project to reach current amazing state. + + - Jonathan Johnson ([@ecton](https://github.com/ecton)) + - Rudy Faile ([@rfaile313](https://github.com/rfaile313)) - https://rudyfaile.com/ + - frithrah ([@frithrah](https://github.com/frithrah)) + - Jens Pitkänen ([@neonmoe](https://github.com/neonmoe)) + - Rahul Nair ([@rahulunair](https://github.com/rahulunair)) + - albatros-hmd ([@albatros-hmd](https://github.com/albatros-hmd)) + - Benjamin Stigsen ([@BenStigsen](https://github.com/BenStigsen)) + - Louis Johnson ([@louisgjohnson](https://github.com/louisgjohnson)) + - Dani Martin ([@danimartin82](https://github.com/danimartin82)) + - Joakim Wennergren ([@joakimwennergren](https://github.com/joakimwennergren)) - Alexandre Chêne ([@kooparse](https://github.com/kooparse)) - daddio69 ([@daddio69](https://github.com/daddio69)) - James Ghawaly ([@jghawaly](https://github.com/jghawaly)) - jack ([@Jack-Ji](https://github.com/Jack-Ji)) - - Merlyn Morgan-Graham ([@kavika13](https://github.com/kavika13)) - - + - Guido Offermans ([@jghawaly](https://github.com/GuidoOffermans)) + +### Notes for Current/Past raylib Sponsor + + - **If you are not on the list, feel free to send a PR to add you if desired.** + - **If you want your personal webpage listed along your GitHub account, feel free to send a PR to add it.** + - **If you prefer not to listed in this list, feel free to send a PR to remove it.** + diff --git a/cmake/BuildOptions.cmake b/cmake/BuildOptions.cmake index 00586c23c..0fce64292 100644 --- a/cmake/BuildOptions.cmake +++ b/cmake/BuildOptions.cmake @@ -1,24 +1,3 @@ -if(NOT (STATIC OR SHARED)) - message(FATAL_ERROR "Nothing to do if both -DSHARED=OFF and -DSTATIC=OFF...") -endif() - -if (DEFINED BUILD_SHARED_LIBS) - set(SHARED ${BUILD_SHARED_LIBS}) - if (${BUILD_SHARED_LIBS}) - set(STATIC OFF) - else() - set(STATIC ON) - endif() -endif() -if(DEFINED SHARED_RAYLIB) - set(SHARED ${SHARED_RAYLIB}) - message(DEPRECATION "-DSHARED_RAYLIB is deprecated. Please use -DSHARED instead.") -endif() -if(DEFINED STATIC_RAYLIB) - set(STATIC ${STATIC_RAYLIB}) - message(DEPRECATION "-DSTATIC_RAYLIB is deprecated. Please use -DSTATIC instead.") -endif() - if(${PLATFORM} MATCHES "Desktop" AND APPLE) if(MACOS_FATLIB) if (CMAKE_OSX_ARCHITECTURES) diff --git a/cmake/CompileDefinitions.cmake b/cmake/CompileDefinitions.cmake new file mode 100644 index 000000000..36062b309 --- /dev/null +++ b/cmake/CompileDefinitions.cmake @@ -0,0 +1,110 @@ +# Adding compile definitions +target_compile_definitions("raylib" PUBLIC "${PLATFORM_CPP}") +target_compile_definitions("raylib" PUBLIC "${GRAPHICS}") + +function(define_if target variable) + if (${${variable}}) + target_compile_definitions(${target} PUBLIC "${variable}") + endif () +endfunction() + +if (${CUSTOMIZE_BUILD}) + target_compile_definitions("raylib" PUBLIC EXTERNAL_CONFIG_FLAGS) + define_if("raylib" SUPPORT_CAMERA_SYSTEM) + define_if("raylib" SUPPORT_GESTURES_SYSTEM) + define_if("raylib" SUPPORT_MOUSE_GESTURES) + define_if("raylib" SUPPORT_SSH_KEYBOARD_RPI) + define_if("raylib" SUPPORT_BUSY_WAIT_LOOP) + define_if("raylib" SUPPORT_EVENTS_WAITING) + define_if("raylib" SUPPORT_SCREEN_CAPTURE) + define_if("raylib" SUPPORT_GIF_RECORDING) + define_if("raylib" SUPPORT_HIGH_DPI) + define_if("raylib" SUPPORT_COMPRESSION_API) + define_if("raylib" SUPPORT_DATA_STORAGE) + define_if("raylib" SUPPORT_VR_SIMULATOR) + define_if("raylib" SUPPORT_FONT_TEXTURE) + define_if("raylib" SUPPORT_QUADS_DRAW_MODE) + define_if("raylib" SUPPORT_FILEFORMAT_PNG) + define_if("raylib" SUPPORT_FILEFORMAT_DDS) + define_if("raylib" SUPPORT_FILEFORMAT_HDR) + define_if("raylib" SUPPORT_FILEFORMAT_KTX) + define_if("raylib" SUPPORT_FILEFORMAT_ASTC) + define_if("raylib" SUPPORT_FILEFORMAT_BMP) + define_if("raylib" SUPPORT_FILEFORMAT_TGA) + define_if("raylib" SUPPORT_FILEFORMAT_JPG) + define_if("raylib" SUPPORT_FILEFORMAT_GIF) + define_if("raylib" SUPPORT_FILEFORMAT_PSD) + define_if("raylib" SUPPORT_FILEFORMAT_PKM) + define_if("raylib" SUPPORT_FILEFORMAT_PVR) + define_if("raylib" ORT_IMAGE_EXPORT) + define_if("raylib" SUPPORT_IMAGE_MANIPULATION) + define_if("raylib" SUPPORT_IMAGE_GENERATION) + define_if("raylib" SUPPORT_DEFAULT_FONT) + define_if("raylib" SUPPORT_FILEFORMAT_FNT) + define_if("raylib" SUPPORT_FILEFORMAT_TTF) + define_if("raylib" SUPPORT_TEXT_MANIPULATION) + define_if("raylib" SUPPORT_FILEFORMAT_OBJ) + define_if("raylib" SUPPORT_FILEFORMAT_MTL) + define_if("raylib" SUPPORT_FILEFORMAT_IQM) + define_if("raylib" SUPPORT_FILEFORMAT_GLTF) + define_if("raylib" SUPPORT_MESH_GENERATION) + define_if("raylib" SUPPORT_FILEFORMAT_WAV) + define_if("raylib" SUPPORT_FILEFORMAT_OGG) + define_if("raylib" SUPPORT_FILEFORMAT_XM) + define_if("raylib" SUPPORT_FILEFORMAT_MOD) + define_if("raylib" SUPPORT_FILEFORMAT_FLAC) + define_if("raylib" SUPPORT_FILEFORMAT_MP3) + define_if("raylib" SUPPORT_STANDARD_FILEIO) + define_if("raylib" SUPPORT_TRACELOG) + define_if("raylib" SUPPORT_COMPRESSION_API) + + + if (UNIX AND NOT APPLE) + target_compile_definitions("raylib" PUBLIC "MAX_FILEPATH_LENGTH=4096") + else () + target_compile_definitions("raylib" PUBLIC "MAX_FILEPATH_LENGTH=512") + endif () + + target_compile_definitions("raylib" PUBLIC "MAX_GAMEPADS=4") + target_compile_definitions("raylib" PUBLIC "MAX_GAMEPAD_AXIS=8") + target_compile_definitions("raylib" PUBLIC "MAX_GAMEPAD_BUTTONS=32") + target_compile_definitions("raylib" PUBLIC "MAX_TOUCH_POINTS=10") + target_compile_definitions("raylib" PUBLIC "MAX_KEY_PRESSED_QUEUE=16") + + target_compile_definitions("raylib" PUBLIC "STORAGE_DATA_FILE=\"storage.data\"") + target_compile_definitions("raylib" PUBLIC "MAX_KEY_PRESSED_QUEUE=16") + target_compile_definitions("raylib" PUBLIC "MAX_DECOMPRESSION_SIZE=64") + + if (${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_33" OR ${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_11") + target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_BUFFER_ELEMENTS=8192") + elseif (${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_ES2") + target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_BUFFER_ELEMENTS=2048") + endif () + + target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_DRAWCALLS=256") + target_compile_definitions("raylib" PUBLIC "MAX_MATRIX_STACK_SIZE=32") + target_compile_definitions("raylib" PUBLIC "MAX_SHADER_LOCATIONS=32") + target_compile_definitions("raylib" PUBLIC "MAX_MATERIAL_MAPS=12") + target_compile_definitions("raylib" PUBLIC "RL_CULL_DISTANCE_NEAR=0.01") + target_compile_definitions("raylib" PUBLIC "RL_CULL_DISTANCE_FAR=1000.0") + + target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_POSITION=\"vertexPosition\"") + target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD=\"vertexTexCoord\"") + target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_NORMAL=\"vertexNormal\"") + target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_COLOR=\"vertexColor\"") + target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_TANGENT=\"vertexTangent\"") + target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2=\"vertexTexCoord2\"") + + target_compile_definitions("raylib" PUBLIC "MAX_TEXT_BUFFER_LENGTH=1024") + target_compile_definitions("raylib" PUBLIC "MAX_TEXT_UNICODE_CHARS=512") + target_compile_definitions("raylib" PUBLIC "MAX_TEXTSPLIT_COUNT=128") + + target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_FORMAT=ma_format_f32") + target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_CHANNELS=2") + target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_SAMPLE_RATE=44100") + target_compile_definitions("raylib" PUBLIC "DEFAULT_AUDIO_BUFFER_SIZE=4096") + + target_compile_definitions("raylib" PUBLIC "MAX_TRACELOG_MSG_LENGTH=128") + target_compile_definitions("raylib" PUBLIC "MAX_UWP_MESSAGES=512") +endif () + diff --git a/cmake/CompilerFlags.cmake b/cmake/CompilerFlags.cmake index 41fee6922..970462c8b 100644 --- a/cmake/CompilerFlags.cmake +++ b/cmake/CompilerFlags.cmake @@ -1,28 +1,52 @@ include(AddIfFlagCompiles) +# Makes +/- operations on void pointers be considered an error +# https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html add_if_flag_compiles(-Werror=pointer-arith CMAKE_C_FLAGS) + +# Generates error whenever a function is used before being declared +# https://gcc.gnu.org/onlinedocs/gcc-4.0.1/gcc/Warning-Options.html add_if_flag_compiles(-Werror=implicit-function-declaration CMAKE_C_FLAGS) -# src/external/jar_xm.h does shady stuff + +# Allows some casting of pointers without generating a warning add_if_flag_compiles(-fno-strict-aliasing CMAKE_C_FLAGS) -if (ENABLE_ASAN) - add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS) - add_if_flag_compiles(-fsanitize=address CMAKE_C_FLAGS CMAKE_LINKER_FLAGS) -endif() -if (ENABLE_UBSAN) - add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS) - add_if_flag_compiles(-fsanitize=undefined CMAKE_C_FLAGS CMAKE_LINKER_FLAGS) -endif() -if (ENABLE_MSAN) - add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS) - add_if_flag_compiles(-fsanitize=memory CMAKE_C_FLAGS CMAKE_LINKER_FLAGS) -endif() - if (ENABLE_MSAN AND ENABLE_ASAN) + # MSAN and ASAN both work on memory - ASAN does more things MESSAGE(WARNING "Compiling with both AddressSanitizer and MemorySanitizer is not recommended") endif() -add_definitions("-DRAYLIB_CMAKE=1") +if (ENABLE_ASAN) + + # If enabled it would generate errors/warnings for all kinds of memory errors + # (like returning a stack variable by reference) + # https://clang.llvm.org/docs/AddressSanitizer.html + + add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS) + add_if_flag_compiles(-fsanitize=address CMAKE_C_FLAGS CMAKE_LINKER_FLAGS) + +endif() + +if (ENABLE_UBSAN) + + # If enabled this will generate errors for undefined behavior points + # (like adding +1 to the maximum int value) + # https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html + + add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS) + add_if_flag_compiles(-fsanitize=undefined CMAKE_C_FLAGS CMAKE_LINKER_FLAGS) + +endif() + +if (ENABLE_MSAN) + + # If enabled this will generate warnings for places where uninitialized memory is used + # https://clang.llvm.org/docs/MemorySanitizer.html + + add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS) + add_if_flag_compiles(-fsanitize=memory CMAKE_C_FLAGS CMAKE_LINKER_FLAGS) + +endif() if(CMAKE_VERSION VERSION_LESS "3.1") if(CMAKE_C_COMPILER_ID STREQUAL "GNU") @@ -31,3 +55,25 @@ if(CMAKE_VERSION VERSION_LESS "3.1") else() set (CMAKE_C_STANDARD 99) endif() + +if(${PLATFORM} MATCHES "Android") + + # If enabled will remove dead code during the linking process + # https://gcc.gnu.org/onlinedocs/gnat_ugn/Compilation-options.html + add_if_flag_compiles(-ffunction-sections CMAKE_C_FLAGS) + + # If enabled will generate some exception data (usually disabled for C programs) + # https://gcc.gnu.org/onlinedocs/gcc-4.2.4/gcc/Code-Gen-Options.html + add_if_flag_compiles(-funwind-tables CMAKE_C_FLAGS) + + # If enabled adds stack protection guards around functions that allocate memory + # https://www.keil.com/support/man/docs/armclang_ref/armclang_ref_cjh1548250046139.htm + add_if_flag_compiles(-fstack-protector-strong CMAKE_C_FLAGS) + + # Marks that the library will not be compiled with an executable stack + add_if_flag_compiles(-Wa,--noexecstack CMAKE_C_FLAGS) + + # Do not expand symbolic links or resolve paths like "/./" or "/../", etc. + # https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html + add_if_flag_compiles(-no-canonical-prefixes CMAKE_C_FLAGS) +endif() diff --git a/cmake/GlfwImport.cmake b/cmake/GlfwImport.cmake index 12dbfeb9f..1b94cdf80 100644 --- a/cmake/GlfwImport.cmake +++ b/cmake/GlfwImport.cmake @@ -1,8 +1,8 @@ if(USE_EXTERNAL_GLFW STREQUAL "ON") - find_package(glfw3 3.2.1 REQUIRED) + find_package(glfw3 3.3.3 REQUIRED) elseif(USE_EXTERNAL_GLFW STREQUAL "IF_POSSIBLE") - find_package(glfw3 3.2.1 QUIET) + find_package(glfw3 3.3.3 QUIET) endif() if (glfw3_FOUND) set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw) @@ -16,14 +16,19 @@ if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MAT set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) - set(BUILD_SHARED_LIBS OFF CACHE BOOL " " FORCE) set(GLFW_USE_WAYLAND ${USE_WAYLAND} CACHE BOOL "" FORCE) + set(WAS_SHARED ${BUILD_SHARED_LIBS}) + set(BUILD_SHARED_LIBS OFF CACHE BOOL " " FORCE) + add_subdirectory(external/glfw) + + set(BUILD_SHARED_LIBS ${WAS_SHARED} CACHE BOOL " " FORCE) + unset(WAS_SHARED) - list(APPEND raylib_sources $) + list(APPEND raylib_sources $) include_directories(BEFORE SYSTEM external/glfw/include) else() MESSAGE(STATUS "Using external GLFW") set(GLFW_PKG_DEPS glfw3) -endif() \ No newline at end of file +endif() diff --git a/cmake/InstallConfigurations.cmake b/cmake/InstallConfigurations.cmake index a26fedf55..6a89ad55c 100644 --- a/cmake/InstallConfigurations.cmake +++ b/cmake/InstallConfigurations.cmake @@ -7,12 +7,12 @@ install( ) # PKG_CONFIG_LIBS_PRIVATE is used in raylib.pc.in -if (STATIC) +if (NOT BUILD_SHARED_LIBS) include(LibraryPathToLinkerFlags) library_path_to_linker_flags(__PKG_CONFIG_LIBS_PRIVATE "${LIBS_PRIVATE}") set(PKG_CONFIG_LIBS_PRIVATE ${__PKG_CONFIG_LIBS_PRIVATE} ${GLFW_PKG_LIBS}) string(REPLACE ";" " " PKG_CONFIG_LIBS_PRIVATE "${PKG_CONFIG_LIBS_PRIVATE}") -elseif (SHARED) +elseif (BUILD_SHARED_LIBS) set(PKG_CONFIG_LIBS_EXTRA "") endif () diff --git a/cmake/LibraryConfigurations.cmake b/cmake/LibraryConfigurations.cmake index 8cca24649..2d4767a94 100644 --- a/cmake/LibraryConfigurations.cmake +++ b/cmake/LibraryConfigurations.cmake @@ -1,12 +1,7 @@ - -### Config options ### -# Translate the config options to what raylib wants -configure_file(config.h.in ${CMAKE_BINARY_DIR}/cmake/config.h) - -if(${PLATFORM} MATCHES "Desktop") +if (${PLATFORM} MATCHES "Desktop") set(PLATFORM_CPP "PLATFORM_DESKTOP") - if(APPLE) + if (APPLE) # Need to force OpenGL 3.3 on OS X # See: https://github.com/raysan5/raylib/issues/341 set(GRAPHICS "GRAPHICS_API_OPENGL_33") @@ -16,40 +11,35 @@ if(${PLATFORM} MATCHES "Desktop") if (NOT CMAKE_SYSTEM STRLESS "Darwin-18.0.0") add_definitions(-DGL_SILENCE_DEPRECATION) MESSAGE(AUTHOR_WARNING "OpenGL is deprecated starting with macOS 10.14 (Mojave)!") - endif() - elseif(WIN32) + endif () + elseif (WIN32) add_definitions(-D_CRT_SECURE_NO_WARNINGS) set(LIBS_PRIVATE ${LIBS_PRIVATE} winmm) - else() + else () find_library(pthread NAMES pthread) find_package(OpenGL QUIET) if ("${OPENGL_LIBRARIES}" STREQUAL "") set(OPENGL_LIBRARIES "GL") - endif() + endif () if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD") find_library(OSS_LIBRARY ossaudio) - endif() + endif () set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY}) - endif() + endif () -elseif(${PLATFORM} MATCHES "Web") +elseif (${PLATFORM} MATCHES "Web") set(PLATFORM_CPP "PLATFORM_WEB") set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") - set(CMAKE_C_FLAGS "-s USE_GLFW=3 -s ASSERTIONS=1 --profiling") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 --profiling") set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") -elseif(${PLATFORM} MATCHES "Android") +elseif (${PLATFORM} MATCHES "Android") set(PLATFORM_CPP "PLATFORM_ANDROID") set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") - include(AddIfFlagCompiles) - add_if_flag_compiles(-ffunction-sections CMAKE_C_FLAGS) - add_if_flag_compiles(-funwind-tables CMAKE_C_FLAGS) - add_if_flag_compiles(-fstack-protector-strong CMAKE_C_FLAGS) set(CMAKE_POSITION_INDEPENDENT_CODE ON) - add_if_flag_compiles(-Wa,--noexecstack CMAKE_C_FLAGS) - add_if_flag_compiles(-no-canonical-prefixes CMAKE_C_FLAGS) + add_definitions(-DANDROID -D__ANDROID_API__=21) include_directories(external/android/native_app_glue) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -uANativeActivity_onCreate") @@ -57,7 +47,7 @@ elseif(${PLATFORM} MATCHES "Android") find_library(OPENGL_LIBRARY OpenGL) set(LIBS_PRIVATE m log android EGL GLESv2 OpenSLES atomic c) -elseif(${PLATFORM} MATCHES "Raspberry Pi") +elseif (${PLATFORM} MATCHES "Raspberry Pi") set(PLATFORM_CPP "PLATFORM_RPI") set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") @@ -70,7 +60,7 @@ elseif(${PLATFORM} MATCHES "Raspberry Pi") link_directories(/opt/vc/lib) set(LIBS_PRIVATE ${GLESV2} ${EGL} ${BCMHOST} pthread rt m dl) -elseif(${PLATFORM} MATCHES "DRM") +elseif (${PLATFORM} MATCHES "DRM") set(PLATFORM_CPP "PLATFORM_DRM") set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") @@ -83,10 +73,12 @@ elseif(${PLATFORM} MATCHES "DRM") find_library(DRM drm) find_library(GBM gbm) - include_directories(/usr/include/libdrm) + if (NOT CMAKE_CROSSCOMPILING) + include_directories(/usr/include/libdrm) + endif () set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} pthread m dl) -endif() +endif () if (${OPENGL_VERSION}) set(${SUGGESTED_GRAPHICS} "${GRAPHICS}") @@ -98,12 +90,18 @@ if (${OPENGL_VERSION}) set(GRAPHICS "GRAPHICS_API_OPENGL_11") elseif (${OPENGL_VERSION} MATCHES "ES 2.0") set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") - endif() + endif () if ("${SUGGESTED_GRAPHICS}" AND NOT "${SUGGESTED_GRAPHICS}" STREQUAL "${GRAPHICS}") message(WARNING "You are overriding the suggested GRAPHICS=${SUGGESTED_GRAPHICS} with ${GRAPHICS}! This may fail") - endif() -endif() + endif () +endif () -if(NOT GRAPHICS) +if (NOT GRAPHICS) set(GRAPHICS "GRAPHICS_API_OPENGL_33") -endif() \ No newline at end of file +endif () + +set(LIBS_PRIVATE ${LIBS_PRIVATE} ${OPENAL_LIBRARY}) + +if (${PLATFORM} MATCHES "Desktop") + set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw) +endif () diff --git a/cmake/test-pkgconfig.sh b/cmake/test-pkgconfig.sh deleted file mode 100755 index ccbdfb652..000000000 --- a/cmake/test-pkgconfig.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# Test if including/linking/running an installed raylib works - -set -x -export LD_RUN_PATH=/usr/local/lib - -CFLAGS="-Wall -Wextra -Werror $CFLAGS" -if [ "$ARCH" = "i386" ]; then -CFLAGS="-m32 $CLFAGS" -fi - -cat << EOF | ${CC:-cc} -otest -xc - $(pkg-config --libs --cflags $@ raylib.pc) $CFLAGS && exec ./test -#include -#include - -int main(void) -{ - int num = GetRandomValue(42, 1337); - return 42 <= num && num <= 1337 ? EXIT_SUCCESS : EXIT_FAILURE; -} -EOF diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index e3ef3a0fc..ad391edd4 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,122 +1,138 @@ # Setup the project and settings project(examples) -# Get the sources together -set(example_dirs audio core models others shaders shapes text textures) +# Directories that contain examples +set(example_dirs + audio + core + models + others + shaders + shapes + text + textures + ) + +# Next few lines will check for existence of symbols or header files +# They are needed for the physac example and threads examples set(CMAKE_REQUIRED_DEFINITIONS -D_POSIX_C_SOURCE=199309L) - include(CheckSymbolExists) - check_symbol_exists(CLOCK_MONOTONIC time.h HAVE_CLOCK_MONOTONIC) - check_symbol_exists(QueryPerformanceCounter windows.h HAVE_QPC) +include(CheckSymbolExists) +check_symbol_exists(CLOCK_MONOTONIC time.h HAVE_CLOCK_MONOTONIC) +check_symbol_exists(QueryPerformanceCounter windows.h HAVE_QPC) set(CMAKE_REQUIRED_DEFINITIONS) -if(HAVE_QPC OR HAVE_CLOCK_MONOTONIC) - set(example_dirs ${example_dirs} physac) -endif() -set(example_sources) -set(example_resources) -foreach(example_dir ${example_dirs}) - # Get the .c files - file(GLOB sources ${example_dir}/*.c) - list(APPEND example_sources ${sources}) - - # Any any resources - file(GLOB resources ${example_dir}/resources/*) - list(APPEND example_resources ${resources}) -endforeach() - -if (APPLE AND NOT CMAKE_SYSTEM STRLESS "Darwin-18.0.0") - add_definitions(-DGL_SILENCE_DEPRECATION) - MESSAGE(AUTHOR_WARNING "OpenGL is deprecated starting with macOS 10.14 (Mojave)!") -endif() +if (HAVE_QPC OR HAVE_CLOCK_MONOTONIC) + set(example_dirs ${example_dirs} physac) +endif () include(CheckIncludeFile) CHECK_INCLUDE_FILE("stdatomic.h" HAVE_STDATOMIC_H) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) find_package(Threads) if (CMAKE_USE_PTHREADS_INIT AND HAVE_STDATOMIC_H) - add_if_flag_compiles("-std=c11" CMAKE_C_FLAGS) - if(THREADS_HAVE_PTHREAD_ARG) - add_if_flag_compiles("-pthread" CMAKE_C_FLAGS) - endif() - if(CMAKE_THREAD_LIBS_INIT) - link_libraries("${CMAKE_THREAD_LIBS_INIT}") - endif() -else() - # Items requiring pthreads - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_loading_thread.c) -endif() + add_if_flag_compiles("-std=c11" CMAKE_C_FLAGS) + if (THREADS_HAVE_PTHREAD_ARG) + add_if_flag_compiles("-pthread" CMAKE_C_FLAGS) + endif () + if (CMAKE_THREAD_LIBS_INIT) + link_libraries("${CMAKE_THREAD_LIBS_INIT}") + endif () +endif () +if (APPLE AND NOT CMAKE_SYSTEM STRLESS "Darwin-18.0.0") + add_definitions(-DGL_SILENCE_DEPRECATION) + MESSAGE(AUTHOR_WARNING "OpenGL is deprecated starting with macOS 10.14 (Mojave)!") +endif () -if(${PLATFORM} MATCHES "Android") - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/standard_lighting.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_picking.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_vr_simulator.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_camera_free.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_camera_first_person.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_world_screen.c) +# Collect all source files and resource files +# into a CMake variable +set(example_sources) +set(example_resources) +foreach (example_dir ${example_dirs}) + # Get the .c files + file(GLOB sources ${example_dir}/*.c) + list(APPEND example_sources ${sources}) + + # Any any resources + file(GLOB resources ${example_dir}/resources/*) + list(APPEND example_resources ${resources}) +endforeach () - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_mesh_picking.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_material_pbr.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_cubicmap.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_skybox.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_mesh_picking.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_mesh_generation.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_heightmap.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_billboard.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_rlgl_solar_system.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_rlgl_full_solar_system.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_solar_system.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_obj_viewer.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_animation.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_first_person_maze.c) +if(NOT CMAKE_USE_PTHREADS_INIT OR NOT HAVE_STDATOMIC_H) + # Items requiring pthreads + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_loading_thread.c) +endif () - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_custom_uniform.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_model_shader.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_postprocessing.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_raymarching.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_palette_switch.c) - list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_basic_lighting.c) +if (${PLATFORM} MATCHES "Android") + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/standard_lighting.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_picking.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_vr_simulator.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_camera_free.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_3d_camera_first_person.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/core/core_world_screen.c) + + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_mesh_picking.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_material_pbr.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_cubicmap.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_skybox.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_mesh_picking.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_mesh_generation.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_heightmap.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_billboard.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_rlgl_solar_system.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_rlgl_full_solar_system.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_solar_system.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_obj_viewer.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_animation.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_first_person_maze.c) + + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_custom_uniform.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_model_shader.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_postprocessing.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_raymarching.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_palette_switch.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_basic_lighting.c) -elseif(${PLATFORM} MATCHES "Web") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY") - # Since WASM is used, ALLOW_MEMORY_GROWTH has no extra overheads - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ALLOW_MEMORY_GROWTH=1 --no-heap-copy") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html") - set(CMAKE_EXECUTABLE_SUFFIX ".html") - - # Remove the -rdynamic flag because otherwise emscripten - # does not generate HTML+JS+WASM files, only a non-working - # and fat HTML - string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}") -endif() +elseif (${PLATFORM} MATCHES "Web") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY") + # Since WASM is used, ALLOW_MEMORY_GROWTH has no extra overheads + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ALLOW_MEMORY_GROWTH=1 --no-heap-copy") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html") + set(CMAKE_EXECUTABLE_SUFFIX ".html") + + # Remove the -rdynamic flag because otherwise emscripten + # does not generate HTML+JS+WASM files, only a non-working + # and fat HTML + string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}") +endif () include_directories(BEFORE SYSTEM others/external/include) if (NOT TARGET raylib) - find_package(raylib 2.0 REQUIRED) -endif() + find_package(raylib 2.0 REQUIRED) +endif () # Do each example -foreach(example_source ${example_sources}) - # Create the basename for the example - get_filename_component(example_name ${example_source} NAME) - string(REPLACE ".c" "" example_name ${example_name}) - - # Setup the example - add_executable(${example_name} ${example_source}) - - target_link_libraries(${example_name} raylib) - - string(REGEX MATCH ".*/.*/" resources_dir ${example_source}) - string(APPEND resources_dir "resources") - - if(${PLATFORM} MATCHES "Web" AND EXISTS ${resources_dir}) - # The local resources path needs to be mapped to /resources virtual path - string(APPEND resources_dir "@resources") - set_target_properties(${example_name} PROPERTIES LINK_FLAGS "--preload-file ${resources_dir}") - endif() -endforeach() +foreach (example_source ${example_sources}) + # Create the basename for the example + get_filename_component(example_name ${example_source} NAME) + string(REPLACE ".c" "" example_name ${example_name}) + + # Setup the example + add_executable(${example_name} ${example_source}) + + target_link_libraries(${example_name} raylib) + + string(REGEX MATCH ".*/.*/" resources_dir ${example_source}) + string(APPEND resources_dir "resources") + + if (${PLATFORM} MATCHES "Web" AND EXISTS ${resources_dir}) + # The local resources path needs to be mapped to /resources virtual path + string(APPEND resources_dir "@resources") + set_target_properties(${example_name} PROPERTIES LINK_FLAGS "--preload-file ${resources_dir}") + endif () +endforeach () # Copy all of the resource files to the destination file(COPY ${example_resources} DESTINATION "resources/") diff --git a/examples/Makefile b/examples/Makefile index 661ebcdcf..01c30c14c 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -25,7 +25,7 @@ # Define required raylib variables PROJECT_NAME ?= raylib_examples -RAYLIB_VERSION ?= 3.5.0 +RAYLIB_VERSION ?= 3.7.0 RAYLIB_PATH ?= .. # Define default options @@ -177,15 +177,12 @@ ifeq ($(PLATFORM),PLATFORM_WEB) CC = emcc endif -# Define default make program: Mingw32-make -MAKE = mingw32-make +# Define default make program +MAKE = make ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),LINUX) - MAKE = make - endif - ifeq ($(PLATFORM_OS),OSX) - MAKE = make + ifeq ($(PLATFORM_OS),WINDOWS) + MAKE = mingw32-make endif endif @@ -260,8 +257,8 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define include paths for required headers -# NOTE: Several external required libraries (stb and others) -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external +# NOTE: Some external/extras libraries could be required (stb, physac, easings...) +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external -I$(RAYLIB_PATH)/src/extras # Define additional directories containing required header files ifeq ($(PLATFORM),PLATFORM_RPI) @@ -280,7 +277,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) INCLUDE_PATHS += -I/usr/local/include endif ifeq ($(PLATFORM_OS),LINUX) - INCLUDE_PATHS = -I$(RAYLIB_H_INSTALL_PATH) -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external + INCLUDE_PATHS += -I$(RAYLIB_H_INSTALL_PATH) endif endif @@ -311,10 +308,6 @@ ifeq ($(PLATFORM),PLATFORM_RPI) LDFLAGS += -L/opt/vc/lib endif -ifeq ($(PLATFORM),PLATFORM_DRM) - LDFLAGS += -lGLESv2 -lEGL -ldrm -lgbm -endif - # Define any libraries required on linking # if you want to link libraries (libname.so or libname.a), use the -lname ifeq ($(PLATFORM),PLATFORM_DESKTOP) @@ -402,7 +395,8 @@ CORE = \ core/core_vr_simulator \ core/core_loading_thread \ core/core_quat_conversion \ - core/core_window_flags + core/core_window_flags \ + core/core_split_screen SHAPES = \ shapes/shapes_basic_shapes \ @@ -440,7 +434,8 @@ TEXTURES = \ textures/textures_sprite_explosion \ textures/textures_bunnymark \ textures/textures_blend_modes \ - textures/textures_draw_tiled + textures/textures_draw_tiled \ + textures/textures_poly TEXT = \ text/text_raylib_fonts \ @@ -452,7 +447,8 @@ TEXT = \ text/text_input_box \ text/text_writing_anim \ text/text_rectangle_bounds \ - text/text_unicode + text/text_unicode \ + text/text_draw_3d MODELS = \ models/models_animation \ @@ -488,7 +484,7 @@ SHADERS = \ shaders/shaders_simple_mask \ shaders/shaders_spotlight \ shaders/shaders_hot_reloading \ - shaders/shaders_rlgl_mesh_instanced \ + shaders/shaders_mesh_instancing \ shaders/shaders_multi_sample2d AUDIO = \ diff --git a/examples/Makefile.Android b/examples/Makefile.Android index afa3024ac..b5480473e 100644 --- a/examples/Makefile.Android +++ b/examples/Makefile.Android @@ -42,56 +42,64 @@ else endif ifeq ($(ANDROID_ARCH),ARM) - ANDROID_ARCH_NAME = armeabi-v7a + ANDROID_ARCH_NAME = armeabi-v7a endif ifeq ($(ANDROID_ARCH),ARM64) - ANDROID_ARCH_NAME = arm64-v8a + ANDROID_ARCH_NAME = arm64-v8a endif ifeq ($(ANDROID_ARCH),x86) - ANDROID_ARCH_NAME = i686 + ANDROID_ARCH_NAME = i686 endif ifeq ($(ANDROID_ARCH),x86_64) - ANDROID_ARCH_NAME = x86_64 + ANDROID_ARCH_NAME = x86_64 endif # Required path variables # NOTE: JAVA_HOME must be set to JDK (using OpenJDK 13) JAVA_HOME ?= C:/open-jdk -ANDROID_HOME = C:/android-sdk -ANDROID_TOOLCHAIN = C:/android-ndk/toolchains/llvm/prebuilt/windows-x86_64 -ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/29.0.3 +ANDROID_HOME ?= C:/android-sdk +ANDROID_BUILD_TOOLS ?= $(ANDROID_HOME)/build-tools/29.0.3 ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools # Android project configuration variables PROJECT_NAME ?= raylib_game PROJECT_LIBRARY_NAME ?= main -PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME) +PROJECT_BUILD_ID ?= android +PROJECT_BUILD_PATH ?= $(PROJECT_BUILD_ID).$(PROJECT_NAME) PROJECT_RESOURCES_PATH ?= resources PROJECT_SOURCE_FILES ?= raylib_game.c +NATIVE_APP_GLUE_PATH = $(ANDROID_NDK)/sources/android/native_app_glue # Some source files are placed in directories, when compiling to some # output directory other than source, that directory must pre-exist. # Here we get a list of required folders that need to be created on # code output folder $(PROJECT_BUILD_PATH)\obj to avoid GCC errors. -PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES))) +PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES))) # Android app configuration variables -APP_LABEL_NAME ?= rGame -APP_COMPANY_NAME ?= raylib -APP_PRODUCT_NAME ?= rgame -APP_VERSION_CODE ?= 1 -APP_VERSION_NAME ?= 1.0 -APP_ICON_LDPI ?= $(RAYLIB_PATH)\logo\raylib_36x36.png -APP_ICON_MDPI ?= $(RAYLIB_PATH)\logo\raylib_48x48.png -APP_ICON_HDPI ?= $(RAYLIB_PATH)\logo\raylib_72x72.png +APP_LABEL_NAME ?= rGame +APP_COMPANY_NAME ?= raylib +APP_PRODUCT_NAME ?= rgame +APP_VERSION_CODE ?= 1 +APP_VERSION_NAME ?= 1.0 +APP_ICON_LDPI ?= $(RAYLIB_PATH)/logo/raylib_36x36.png +APP_ICON_MDPI ?= $(RAYLIB_PATH)/logo/raylib_48x48.png +APP_ICON_HDPI ?= $(RAYLIB_PATH)/logo/raylib_72x72.png APP_SCREEN_ORIENTATION ?= landscape -APP_KEYSTORE_PASS ?= raylib +APP_KEYSTORE_PASS ?= raylib # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) -RAYLIB_LIBTYPE ?= STATIC +RAYLIB_LIBTYPE ?= STATIC # Library path for libraylib.a/libraylib.so -RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src +RAYLIB_LIB_PATH = $(RAYLIB_PATH)/src + +# Define copy command depending on OS +ifeq ($(OS),Windows_NT) + COPY_COMMAND ?= copy /Y +else + COPY_COMMAND ?= cp -f +endif # Shared libs must be added to APK if required # NOTE: Generated NativeLoader.java automatically load those libraries @@ -108,6 +116,14 @@ ifeq ($(ANDROID_ARCH),ARM64) CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android$(ANDROID_API_VERSION)-clang AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar endif +ifeq ($(ANDROID_ARCH),x86) + CC = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android$(ANDROID_API_VERSION)-clang + AR = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android-ar +endif +ifeq ($(ANDROID_ARCH),x86_64) + CC = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android$(ANDROID_API_VERSION)-clang + AR = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android-ar +endif # Compiler flags for arquitecture ifeq ($(ANDROID_ARCH),ARM) @@ -124,7 +140,7 @@ CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION) # Paths containing required header files -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(NATIVE_APP_GLUE_PATH) # Linker options LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a @@ -154,13 +170,15 @@ all: create_temp_project_dirs \ compile_project_class \ compile_project_class_dex \ create_project_apk_package \ - sign_project_apk_package \ - zipalign_project_apk_package + zipalign_project_apk_package \ + sign_project_apk_package # Create required temp directories for APK building create_temp_project_dirs: +ifeq ($(OS),Windows_NT) if not exist $(PROJECT_BUILD_PATH) mkdir $(PROJECT_BUILD_PATH) if not exist $(PROJECT_BUILD_PATH)\obj mkdir $(PROJECT_BUILD_PATH)\obj + if not exist $(PROJECT_BUILD_PATH)\obj mkdir $(PROJECT_BUILD_PATH)\obj\src if not exist $(PROJECT_BUILD_PATH)\src mkdir $(PROJECT_BUILD_PATH)\src if not exist $(PROJECT_BUILD_PATH)\src\com mkdir $(PROJECT_BUILD_PATH)\src\com if not exist $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME) mkdir $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME) @@ -176,36 +194,62 @@ create_temp_project_dirs: if not exist $(PROJECT_BUILD_PATH)\assets mkdir $(PROJECT_BUILD_PATH)\assets if not exist $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) mkdir $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) if not exist $(PROJECT_BUILD_PATH)\obj\screens mkdir $(PROJECT_BUILD_PATH)\obj\screens +else + mkdir -p $(PROJECT_BUILD_PATH) + mkdir -p $(PROJECT_BUILD_PATH)/obj + mkdir -p $(PROJECT_BUILD_PATH)/obj/src + mkdir -p $(PROJECT_BUILD_PATH)/src + mkdir -p $(PROJECT_BUILD_PATH)/src/com + mkdir -p $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME) + mkdir -p $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME) + mkdir -p $(PROJECT_BUILD_PATH)/lib + mkdir -p $(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME) + mkdir -p $(PROJECT_BUILD_PATH)/bin + mkdir -p $(PROJECT_BUILD_PATH)/res + mkdir -p $(PROJECT_BUILD_PATH)/res/drawable-ldpi + mkdir -p $(PROJECT_BUILD_PATH)/res/drawable-mdpi + mkdir -p $(PROJECT_BUILD_PATH)/res/drawable-hdpi + mkdir -p $(PROJECT_BUILD_PATH)/res/values + mkdir -p $(PROJECT_BUILD_PATH)/assets + mkdir -p $(PROJECT_BUILD_PATH)/assets/$(PROJECT_RESOURCES_PATH) + mkdir -p $(PROJECT_BUILD_PATH)/obj/screens +endif $(foreach dir, $(PROJECT_SOURCE_DIRS), $(call create_dir, $(dir))) define create_dir - if not exist $(PROJECT_BUILD_PATH)\obj\$(1) mkdir $(PROJECT_BUILD_PATH)\obj\$(1) + mkdir -p $(PROJECT_BUILD_PATH)/obj/$(1) endef # Copy required shared libs for integration into APK # NOTE: If using shared libs they are loaded by generated NativeLoader.java copy_project_required_libs: ifeq ($(RAYLIB_LIBTYPE),SHARED) - copy /Y $(RAYLIB_LIB_PATH)\libraylib.so $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.so + $(COPY_COMMAND) $(RAYLIB_LIB_PATH)/libraylib.so $(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME)/libraylib.so endif ifeq ($(RAYLIB_LIBTYPE),STATIC) - copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.a + $(COPY_COMMAND) $(RAYLIB_LIB_PATH)/libraylib.a $(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME)/libraylib.a endif # Copy project required resources: strings.xml, icon.png, assets # NOTE: Required strings.xml is generated and game resources are copied to assets folder -# TODO: Review xcopy usage, it can not be found in some systems! copy_project_resources: - copy $(APP_ICON_LDPI) $(PROJECT_BUILD_PATH)\res\drawable-ldpi\icon.png /Y - copy $(APP_ICON_MDPI) $(PROJECT_BUILD_PATH)\res\drawable-mdpi\icon.png /Y - copy $(APP_ICON_HDPI) $(PROJECT_BUILD_PATH)\res\drawable-hdpi\icon.png /Y + $(COPY_COMMAND) $(APP_ICON_LDPI) $(PROJECT_BUILD_PATH)/res/drawable-ldpi/icon.png + $(COPY_COMMAND) $(APP_ICON_MDPI) $(PROJECT_BUILD_PATH)/res/drawable-mdpi/icon.png + $(COPY_COMMAND) $(APP_ICON_HDPI) $(PROJECT_BUILD_PATH)/res/drawable-hdpi/icon.png +ifeq ($(OS),Windows_NT) @echo ^ > $(PROJECT_BUILD_PATH)/res/values/strings.xml @echo ^^$(APP_LABEL_NAME)^^ >> $(PROJECT_BUILD_PATH)/res/values/strings.xml if exist $(PROJECT_RESOURCES_PATH) C:\Windows\System32\xcopy $(PROJECT_RESOURCES_PATH) $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) /Y /E /F +else + @echo "" > $(PROJECT_BUILD_PATH)/res/values/strings.xml + @echo "$(APP_LABEL_NAME)" >> $(PROJECT_BUILD_PATH)/res/values/strings.xml + @[ -d "$(PROJECT_RESOURCES_PATH)" ] || cp -rf $(PROJECT_RESOURCES_PATH) $(PROJECT_BUILD_PATH)/assets/$(PROJECT_RESOURCES_PATH) +endif # Generate NativeLoader.java to load required shared libraries # NOTE: Probably not the bet way to generate this file... but it works. generate_loader_script: +ifeq ($(OS),Windows_NT) @echo package com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME); > $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java @echo. >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java @echo public class NativeLoader extends android.app.NativeActivity { >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java @@ -216,10 +260,23 @@ endif @echo System.loadLibrary("$(PROJECT_LIBRARY_NAME)"); >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java @echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java @echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java - +else + @echo "package com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME);" > $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java + @echo "" >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java + @echo "public class NativeLoader extends android.app.NativeActivity {" >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java + @echo " static {" >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java +ifeq ($(RAYLIB_LIBTYPE),SHARED) + @echo " System.loadLibrary(\"raylib\");" >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java +endif + @echo " System.loadLibrary(\"$(PROJECT_LIBRARY_NAME)\");" >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java + @echo " }" >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java + @echo "}" >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java +endif + # Generate AndroidManifest.xml with all the required options # NOTE: Probably not the bet way to generate this file... but it works. generate_android_manifest: +ifeq ($(OS),Windows_NT) @echo ^ > $(PROJECT_BUILD_PATH)/AndroidManifest.xml @echo ^> $(PROJECT_BUILD_PATH)/AndroidManifest.xml @echo package="com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME)" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml @@ -240,11 +297,37 @@ generate_android_manifest: @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml +else + @echo "" > $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo "> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " package=\"com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME)\" " >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " android:versionCode=\"$(APP_VERSION_CODE)\" android:versionName=\"$(APP_VERSION_NAME)\" >" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " " >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " " >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " " >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " > $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\"" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " android:configChanges=\"orientation|keyboardHidden|screenSize\"" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " android:screenOrientation=\"$(APP_SCREEN_ORIENTATION)\" android:launchMode=\"singleTask\"" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " android:clearTaskOnLaunch=\"true\">" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " " >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " " >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " " >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " " >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " " >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " " >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo " " >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo "" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml +endif # Generate storekey for APK signing: $(PROJECT_NAME).keystore # NOTE: Configure here your Distinguished Names (-dname) if required! generate_apk_keystore: +ifeq ($(OS),Windows_NT) if not exist $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore $(JAVA_HOME)/bin/keytool -genkeypair -validity 10000 -dname "CN=$(APP_COMPANY_NAME),O=Android,C=ES" -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -alias $(PROJECT_NAME)Key -keyalg RSA +else + @[ -f "$(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore" ] || $(JAVA_HOME)/bin/keytool -genkeypair -validity 10000 -dname "CN=$(APP_COMPANY_NAME),O=Android,C=ES" -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -alias $(PROJECT_NAME)Key -keyalg RSA +endif # Config project package and resource using AndroidManifest.xml and res/values/strings.xml # NOTE: Generates resources file: src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java @@ -253,7 +336,7 @@ config_project_package: # Compile native_app_glue code as static library: obj/libnative_app_glue.a compile_native_app_glue: - $(CC) -c $(RAYLIB_PATH)/src/external/android/native_app_glue/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS) + $(CC) -c $(NATIVE_APP_GLUE_PATH)/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS) $(AR) rcs $(PROJECT_BUILD_PATH)/obj/libnative_app_glue.a $(PROJECT_BUILD_PATH)/obj/native_app_glue.o # Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so @@ -267,7 +350,7 @@ $(PROJECT_BUILD_PATH)/obj/%.o:%.c # Compile project .java code into .class (Java bytecode) compile_project_class: - $(JAVA_HOME)/bin/javac -verbose -source 1.7 -target 1.7 -d $(PROJECT_BUILD_PATH)/obj -bootclasspath $(JAVA_HOME)/jre/lib/rt.jar -classpath $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar;$(PROJECT_BUILD_PATH)/obj -sourcepath $(PROJECT_BUILD_PATH)/src $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java + $(JAVA_HOME)/bin/javac -verbose -source 1.7 -target 1.7 -d $(PROJECT_BUILD_PATH)/obj -bootclasspath $(JAVA_HOME)/jre/lib/rt.jar -classpath $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar -d $(PROJECT_BUILD_PATH)/obj $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java # Compile .class files into Dalvik executable bytecode (.dex) # NOTE: Since Android 5.0, Dalvik interpreter (JIT) has been replaced by ART (AOT) @@ -313,6 +396,10 @@ deploy: # Clean everything clean: +ifeq ($(OS),Windows_NT) del $(PROJECT_BUILD_PATH)\* /f /s /q rmdir $(PROJECT_BUILD_PATH) /s /q +else + rm -r $(PROJECT_BUILD_PATH) +endif @echo Cleaning done diff --git a/examples/README.md b/examples/README.md index 61795a9c5..6a366972f 100644 --- a/examples/README.md +++ b/examples/README.md @@ -20,16 +20,16 @@ Examples using raylib core platform functionality like window creation, inputs, | 12 | [core_3d_camera_first_person](core/core_3d_camera_first_person.c) | core_3d_camera_first_person | ray | | | 13 | [core_3d_picking](core/core_3d_picking.c) | core_3d_picking | ray | | | 14 | [core_world_screen](core/core_world_screen.c) | core_world_screen | ray | | -| 15 | [core_custom_logging](core/core_custom_logging.c) | core_custom_logging | [Pablo Marcos](https://github.com/pamarcos) | | +| 15 | [core_custom_logging](core/core_custom_logging.c) | core_custom_logging | [Pablo Marcos](https://github.com/pamarcos) | | | 16 | [core_window_letterbox](core/core_window_letterbox.c) | core_window_letterbox | [Anata](https://github.com/anatagawa) | | | 17 | [core_drop_files](core/core_drop_files.c) | core_drop_files | ray | | | 18 | [core_random_values](core/core_random_values.c) | core_random_values | ray | | -| 19 | [core_scissor_test](core/core_scissor_test.c) | core_scissor_test | [Chris Dill](https://github.com/MysteriousSpace) | ⭐️ | +| 19 | [core_scissor_test](core/core_scissor_test.c) | core_scissor_test | [Chris Dill](https://github.com/MysteriousSpace) | | | 20 | [core_storage_values](core/core_storage_values.c) | core_storage_values | ray | | -| 21 | [core_vr_simulator](core/core_vr_simulator.c) | core_vr_simulator | ray | | -| 22 | [core_loading_thread](core/core_loading_thread.c) | core_loading_thread | ray | ⭐️ | -| 23 | [core/core_quat_conversion](core/core_quat_conversion.c) | core_quat_conversion | [Chris Camacho](https://github.com/codifies) | ⭐️ | -| 24 | [core/core_window_flags](core/core_window_flags.c) | core_window_flags | ray | ⭐️ | | ⭐️ | +| 21 | [core_vr_simulator](core/core_vr_simulator.c) | core_vr_simulator | ray | ⭐️ | +| 22 | [core_loading_thread](core/core_loading_thread.c) | core_loading_thread | ray | | +| 23 | [core/core_quat_conversion](core/core_quat_conversion.c) | core_quat_conversion | [Chris Camacho](https://github.com/codifies) | | +| 24 | [core/core_window_flags](core/core_window_flags.c) | core_window_flags | ray | | ### category: shapes @@ -38,18 +38,18 @@ Examples using raylib shapes drawing functionality, provided by raylib [shapes]( | ## | example | image | developer | new | |----|----------|--------|:----------:|:---:| | 25 | [shapes_basic_shapes](shapes/shapes_basic_shapes.c) | shapes_basic_shapes | ray | | -| 26 | [shapes_bouncing_ball](shapes/shapes_bouncing_ball.c) | shapes_bouncing_ball | ray | ⭐️ | +| 26 | [shapes_bouncing_ball](shapes/shapes_bouncing_ball.c) | shapes_bouncing_ball | ray | | | 27 | [shapes_colors_palette](shapes/shapes_colors_palette.c) | shapes_colors_palette | ray | | | 28 | [shapes_logo_raylib](shapes/shapes_logo_raylib.c) | shapes_logo_raylib | ray | | | 29 | [shapes_logo_raylib_anim](shapes/shapes_logo_raylib_anim.c) | shapes_logo_raylib_anim | ray | | | 30 | [shapes_rectangle_scaling](shapes/shapes_rectangle_scaling.c) | shapes_rectangle_scaling | [Vlad Adrian](https://github.com/demizdor) | | | 31 | [shapes_lines_bezier](shapes/shapes_lines_bezier.c) | shapes_lines_bezier | ray | | -| 32 | [shapes_collision_area](shapes/shapes_collision_area.c) | shapes_collision_area | ray | ⭐️ | -| 33 | [shapes_following_eyes](shapes/shapes_following_eyes.c) | shapes_following_eyes | ray | ⭐️ | -| 34 | [shapes_easings_ball_anim](shapes/shapes_easings_ball_anim.c) | shapes_easings_ball_anim | ray | ⭐️ | -| 35 | [shapes_easings_box_anim](shapes/shapes_easings_box_anim.c) | shapes_easings_box_anim | ray | ⭐️ | -| 36 | [shapes_easings_rectangle_array](shapes/shapes_easings_rectangle_array.c) | shapes_easings_rectangle_array | ray | ⭐️ | -| 37 | [shapes_draw_ring](shapes/shapes_draw_ring.c) | shapes_draw_ring | [Vlad Adrian](https://github.com/demizdor) | ⭐️ | +| 32 | [shapes_collision_area](shapes/shapes_collision_area.c) | shapes_collision_area | ray | | +| 33 | [shapes_following_eyes](shapes/shapes_following_eyes.c) | shapes_following_eyes | ray | | +| 34 | [shapes_easings_ball_anim](shapes/shapes_easings_ball_anim.c) | shapes_easings_ball_anim | ray | | +| 35 | [shapes_easings_box_anim](shapes/shapes_easings_box_anim.c) | shapes_easings_box_anim | ray | | +| 36 | [shapes_easings_rectangle_array](shapes/shapes_easings_rectangle_array.c) | shapes_easings_rectangle_array | ray | | +| 37 | [shapes_draw_ring](shapes/shapes_draw_ring.c) | shapes_draw_ring | [Vlad Adrian](https://github.com/demizdor) | | | 38 | [shapes_draw_circle_sector](shapes/shapes_draw_circle_sector.c) | shapes_draw_circle_sector | [Vlad Adrian](https://github.com/demizdor) | | | 39 | [shapes_draw_rectangle_rounded](shapes/shapes_draw_rectangle_rounded.c) | shapes_draw_rectangle_rounded | [Vlad Adrian](https://github.com/demizdor) | | @@ -66,18 +66,19 @@ Examples using raylib textures functionality, including image/textures loading/g | 44 | [textures_image_generation](textures/textures_image_generation.c) | textures_image_generation | ray | | | 45 | [textures_image_loading](textures/textures_image_loading.c) | textures_image_loading | ray | | | 46 | [textures_image_processing](textures/textures_image_processing.c) | textures_image_processing | ray | | -| 47 | [textures_image_text](textures/textures_image_text.c) | textures_image_text | ray | | -| 48 | [textures_to_image](textures/textures_to_image.c) | textures_to_image | ray | ⭐️ | +| 47 | [textures_image_text](textures/textures_image_text.c) | textures_image_text | ray | | +| 48 | [textures_to_image](textures/textures_to_image.c) | textures_to_image | ray | | | 49 | [textures_raw_data](textures/textures_raw_data.c) | textures_raw_data | ray | | | 50 | [textures_particles_blending](textures/textures_particles_blending.c) | textures_particles_blending | ray | | | 51 | [textures_npatch_drawing](textures/textures_npatch_drawing.c) | textures_npatch_drawing | [Jorge A. Gomes](https://github.com/overdev) | | -| 52 | [textures_background_scrolling](textures/textures_background_scrolling.c) | textures_background_scrolling | ray | ⭐️ | -| 53 | [textures_sprite_button](textures/textures_sprite_button.c) | textures_sprite_button | ray | ⭐️ | -| 54 | [textures_sprite_explosion](textures/textures_sprite_explosion.c) | textures_sprite_explosion | ray | ⭐️ | -| 55 | [textures_bunnymark](textures/textures_bunnymark.c) | textures_bunnymark | ray | | -| 56 | [textures_mouse_painting](textures/textures_mouse_painting.c) | textures_mouse_painting | [Chris Dill](https://github.com/MysteriousSpace) | | -| 57 | [textures_blend_modes](textures/textures_blend_modes.c) | textures_blend_modes | [Karlo Licudine](https://github.com/accidentalrebel) | ⭐️ | -| 58 | [textures/textures_draw_tiled](textures/textures_draw_tiled.c) | textures_draw_tiled | [Vlad Adrian](https://github.com/demizdor) | ⭐️ | +| 52 | [textures_background_scrolling](textures/textures_background_scrolling.c) | textures_background_scrolling | ray | | +| 53 | [textures_sprite_button](textures/textures_sprite_button.c) | textures_sprite_button | ray | | +| 54 | [textures_sprite_explosion](textures/textures_sprite_explosion.c) | textures_sprite_explosion | ray | | +| 55 | [textures_bunnymark](textures/textures_bunnymark.c) | textures_bunnymark | ray | | +| 56 | [textures_mouse_painting](textures/textures_mouse_painting.c) | textures_mouse_painting | [Chris Dill](https://github.com/MysteriousSpace) | | +| 57 | [textures_blend_modes](textures/textures_blend_modes.c) | textures_blend_modes | [Karlo Licudine](https://github.com/accidentalrebel) | | +| 58 | [textures_draw_tiled](textures/textures_draw_tiled.c) | textures_draw_tiled | [Vlad Adrian](https://github.com/demizdor) | | +| -- | [textures_poly](textures/textures_poly.c) | textures_poly | [Chris Camacho](https://github.com/codifies) | ⭐️ | ### category: text @@ -89,12 +90,13 @@ Examples using raylib text functionality, including sprite fonts loading/generat | 60 | [text_font_spritefont](text/text_font_spritefont.c) | text_font_spritefont | ray | | | 61 | [text_font_filters](text/text_font_filters.c) | text_font_filters | ray | | | 62 | [text_font_loading](text/text_font_loading.c) | text_font_loading | ray | | -| 63 | [text_font_sdf](text/text_font_sdf.c) | text_font_sdf | ray | | +| 63 | [text_font_sdf](text/text_font_sdf.c) | text_font_sdf | ray | | | 64 | [text_format_text](text/text_format_text.c) | text_format_text | ray | | | 65 | [text_input_box](text/text_input_box.c) | text_input_box | ray | | | 66 | [text_writing_anim](text/text_writing_anim.c) | text_writing_anim | ray | | | 67 | [text_rectangle_bounds](text/text_rectangle_bounds.c) | text_rectangle_bounds | [Vlad Adrian](https://github.com/demizdor) | | | 68 | [text_unicode](text/text_unicode.c) | text_unicode | [Vlad Adrian](https://github.com/demizdor) | | +| -- | [text_draw_3d](text/text_draw_3d.c) | text_draw_3d | [Vlad Adrian](https://github.com/demizdor) | ⭐️ | ### category: models @@ -102,22 +104,23 @@ Examples using raylib models functionality, including models loading/generation | ## | example | image | developer | new | |----|----------|--------|:----------:|:---:| -| 69 | [models_animation](models/models_animation.c) | models_animation | [culacant](https://github.com/culacant) | | +| 69 | [models_animation](models/models_animation.c) | models_animation | [culacant](https://github.com/culacant) | | | 70 | [models_billboard](models/models_billboard.c) | models_billboard | ray | | | 71 | [models_box_collisions](models/models_box_collisions.c) | models_box_collisions | ray | | | 72 | [models_cubicmap](models/models_cubicmap.c) | models_cubicmap | ray | | -| 73 | [models_first_person_maze](models/models_first_person_maze.c) | models_first_person_maze | ray | | +| 73 | [models_first_person_maze](models/models_first_person_maze.c) | models_first_person_maze | ray | | | 74 | [models_geometric_shapes](models/models_geometric_shapes.c) | models_geometric_shapes | ray | | | 75 | [models_material_pbr](models/models_material_pbr.c) | models_material_pbr | ray | | | 76 | [models_mesh_generation](models/models_mesh_generation.c) | models_mesh_generation | ray | | | 77 | [models_mesh_picking](models/models_mesh_picking.c) | models_mesh_picking | [Joel Davis](https://github.com/joeld42) | | | 78 | [models_loading](models/models_loading.c) | models_loading | ray | | | 79 | [models_orthographic_projection](models/models_orthographic_projection.c) | models_orthographic_projection | [Max Danielsson](https://github.com/autious) | | -| 80 | [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | models_rlgl_solar_system | ray | | +| 80 | [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | models_rlgl_solar_system | ray | | | 81 | [models_skybox](models/models_skybox.c) | models_skybox | ray | | -| 82 | [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | models_yaw_pitch_roll | [Berni](https://github.com/Berni8k) | | +| 82 | [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | models_yaw_pitch_roll | [Berni](https://github.com/Berni8k) | ⭐️ | | 83 | [models_heightmap](models/models_heightmap.c) | models_heightmap | ray | | -| 84 | [models_waving_cubes](models/models_waving_cubes.c) | models_waving_cubes | [codecat](https://github.com/codecat) | ⭐️ | +| 84 | [models_waving_cubes](models/models_waving_cubes.c) | models_waving_cubes | [codecat](https://github.com/codecat) | | +| -- | [models_gltf_model](models/models_gltf_model.c) | models_gltf_model | [object71](https://github.com/object71) | ⭐️ | ### category: shaders @@ -126,22 +129,22 @@ Examples using raylib shaders functionality, including shaders loading, paramete | ## | example | image | developer | new | |----|----------|--------|:----------:|:---:| | 85 | [shaders_basic_lighting](shaders/shaders_basic_lighting.c) | shaders_basic_lighting | [Chris Camacho](https://github.com/codifies) | | -| 86 | [shaders_model_shader](shaders/shaders_model_shader.c) | shaders_model_shader | ray | | -| 87 | [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | shaders_shapes_textures | ray | | -| 88 | [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | shaders_custom_uniform | ray | | -| 89 | [shaders_postprocessing](shaders/shaders_postprocessing.c) | shaders_postprocessing | ray | | -| 90 | [shaders_palette_switch](shaders/shaders_palette_switch.c) | shaders_palette_switch | [Marco Lizza](https://github.com/MarcoLizza) | | +| 86 | [shaders_model_shader](shaders/shaders_model_shader.c) | shaders_model_shader | ray | | +| 87 | [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | shaders_shapes_textures | ray | | +| 88 | [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | shaders_custom_uniform | ray | | +| 89 | [shaders_postprocessing](shaders/shaders_postprocessing.c) | shaders_postprocessing | ray | | +| 90 | [shaders_palette_switch](shaders/shaders_palette_switch.c) | shaders_palette_switch | [Marco Lizza](https://github.com/MarcoLizza) | | | 91 | [shaders_raymarching](shaders/shaders_raymarching.c) | shaders_raymarching | Shader by Iñigo Quilez | | -| 92 | [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | shaders_texture_drawing | Michał Ciesielski | | +| 92 | [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | shaders_texture_drawing | Michał Ciesielski | | | 93 | [shaders_texture_waves](shaders/shaders_texture_waves.c) | shaders_texture_waves | [Anata](https://github.com/anatagawa) | | | 94 | [shaders_julia_set](shaders/shaders_julia_set.c) | shaders_julia_set | [eggmund](https://github.com/eggmund) | | -| 95 | [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | shaders_eratosthenes | [ProfJski](https://github.com/ProfJski) | | +| 95 | [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | shaders_eratosthenes | [ProfJski](https://github.com/ProfJski) | | | 96 | [shaders_fog](shaders/shaders_fog.c) | shaders_fog | [Chris Camacho](https://github.com/codifies) | | -| 97 | [shaders_simple_mask](shaders/shaders_simple_mask.c) | shaders_simple_mask | [Chris Camacho](https://github.com/codifies) | | -| 98 | [shaders_spotlight](shaders/shaders_spotlight.c) | shaders_spotlight | [Chris Camacho](https://github.com/codifies) | ⭐️ | -| 99 | [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | shaders_hot_reloading | ray | ⭐️ | -| 100 | [shaders_rlgl_mesh_instanced](shaders/shaders_rlgl_mesh_instanced.c) | shaders_rlgl_mesh_instanced | [Chris Camacho](https://github.com/codifies) | ⭐️ | -| 101 | [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | shaders_multi_sample2d | ray | ⭐️ | +| 97 | [shaders_simple_mask](shaders/shaders_simple_mask.c) | shaders_simple_mask | [Chris Camacho](https://github.com/codifies) | | +| 98 | [shaders_spotlight](shaders/shaders_spotlight.c) | shaders_spotlight | [Chris Camacho](https://github.com/codifies) | | +| 99 | [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | shaders_hot_reloading | ray | | +| 100 | [shaders_mesh_instancing](shaders/shaders_mesh_instancing.c) | shaders_mesh_instancing | [seanpringle](https://github.com/seanpringle), [moliad](https://github.com/moliad) | ⭐️ | +| 101 | [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | shaders_multi_sample2d | ray | | ### category: audio @@ -192,7 +195,7 @@ Examples showing raylib misc functionality that does not fit in other categories | 119 | [raudio_standalone](others/raudio_standalone.c) | | ray | | | 120 | [rlgl_standalone](others/rlgl_standalone.c) | | ray | | | 121 | [easings_testbed](others/easings_testbed.c) | | [Juan Miguel López](https://github.com/flashback-fx) | | -| 122 | [embedded_files_loading](others/embedded_files_loading.c)) | | [Kristian Holmgren](https://github.com/defutura) | | +| 122 | [embedded_files_loading](others/embedded_files_loading.c) | | [Kristian Holmgren](https://github.com/defutura) | | As always contributions are welcome, feel free to send new examples! Here it is an [examples template](examples_template.c) to start with! diff --git a/examples/audio/audio_module_playing.c b/examples/audio/audio_module_playing.c index 9a85cbc0e..33a43a8c1 100644 --- a/examples/audio/audio_module_playing.c +++ b/examples/audio/audio_module_playing.c @@ -43,9 +43,9 @@ int main(void) for (int i = MAX_CIRCLES - 1; i >= 0; i--) { circles[i].alpha = 0.0f; - circles[i].radius = GetRandomValue(10, 40); - circles[i].position.x = GetRandomValue(circles[i].radius, screenWidth - circles[i].radius); - circles[i].position.y = GetRandomValue(circles[i].radius, screenHeight - circles[i].radius); + circles[i].radius = (float)GetRandomValue(10, 40); + circles[i].position.x = (float)GetRandomValue((int)circles[i].radius, (int)(screenWidth - circles[i].radius)); + circles[i].position.y = (float)GetRandomValue((int)circles[i].radius, (int)(screenHeight - circles[i].radius)); circles[i].speed = (float)GetRandomValue(1, 100)/2000.0f; circles[i].color = colors[GetRandomValue(0, 13)]; } @@ -87,7 +87,7 @@ int main(void) if (IsKeyDown(KEY_DOWN)) pitch -= 0.01f; else if (IsKeyDown(KEY_UP)) pitch += 0.01f; - + SetMusicPitch(music, pitch); // Get timePlayed scaled to bar dimensions @@ -104,9 +104,9 @@ int main(void) if (circles[i].alpha <= 0.0f) { circles[i].alpha = 0.0f; - circles[i].radius = GetRandomValue(10, 40); - circles[i].position.x = GetRandomValue(circles[i].radius, screenWidth - circles[i].radius); - circles[i].position.y = GetRandomValue(circles[i].radius, screenHeight - circles[i].radius); + circles[i].radius = (float)GetRandomValue(10, 40); + circles[i].position.x = (float)GetRandomValue((int)circles[i].radius, (int)(screenWidth - circles[i].radius)); + circles[i].position.y = (float)GetRandomValue((int)circles[i].radius, (int)(screenHeight - circles[i].radius)); circles[i].color = colors[GetRandomValue(0, 13)]; circles[i].speed = (float)GetRandomValue(1, 100)/2000.0f; } diff --git a/examples/audio/audio_multichannel_sound.c b/examples/audio/audio_multichannel_sound.c index b9a76f9d7..438cff96c 100644 --- a/examples/audio/audio_multichannel_sound.c +++ b/examples/audio/audio_multichannel_sound.c @@ -26,8 +26,8 @@ int main(void) Sound fxWav = LoadSound("resources/sound.wav"); // Load WAV audio file Sound fxOgg = LoadSound("resources/target.ogg"); // Load OGG audio file - - SetSoundVolume(fxWav, 0.2); + + SetSoundVolume(fxWav, 0.2f); SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -46,7 +46,7 @@ int main(void) BeginDrawing(); ClearBackground(RAYWHITE); - + DrawText("MULTICHANNEL SOUND PLAYING", 20, 20, 20, GRAY); DrawText("Press SPACE to play new ogg instance!", 200, 120, 20, LIGHTGRAY); DrawText("Press ENTER to play new wav instance!", 200, 180, 20, LIGHTGRAY); diff --git a/examples/audio/audio_raw_stream.c b/examples/audio/audio_raw_stream.c index 1130eae04..636eb0052 100644 --- a/examples/audio/audio_raw_stream.c +++ b/examples/audio/audio_raw_stream.c @@ -32,7 +32,7 @@ int main(void) InitAudioDevice(); // Initialize audio device // Init raw audio stream (sample rate: 22050, sample size: 16bit-short, channels: 1-mono) - AudioStream stream = InitAudioStream(22050, 16, 1); + AudioStream stream = LoadAudioStream(22050, 16, 1); // Buffer for the single cycle waveform we are synthesizing short *data = (short *)malloc(sizeof(short)*MAX_SAMPLES); @@ -71,7 +71,7 @@ int main(void) // Sample mouse input. mousePosition = GetMousePosition(); - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) { float fp = (float)(mousePosition.y); frequency = 40.0f + (float)(fp); @@ -140,8 +140,8 @@ int main(void) // Draw the current buffer state proportionate to the screen for (int i = 0; i < screenWidth; i++) { - position.x = i; - position.y = 250 + 50*data[i*MAX_SAMPLES/screenWidth]/32000; + position.x = (float)i; + position.y = 250 + 50*data[i*MAX_SAMPLES/screenWidth]/32000.0f; DrawPixelV(position, RED); } @@ -155,7 +155,7 @@ int main(void) free(data); // Unload sine wave data free(writeBuf); // Unload write buffer - CloseAudioStream(stream); // Close raw audio stream and delete buffers from RAM + UnloadAudioStream(stream); // Close raw audio stream and delete buffers from RAM CloseAudioDevice(); // Close audio device (music streaming is automatically stopped) CloseWindow(); // Close window and OpenGL context diff --git a/examples/core/core_2d_camera.c b/examples/core/core_2d_camera.c index d6c85079e..7336bbbd7 100644 --- a/examples/core/core_2d_camera.c +++ b/examples/core/core_2d_camera.c @@ -30,19 +30,19 @@ int main(void) for (int i = 0; i < MAX_BUILDINGS; i++) { - buildings[i].width = GetRandomValue(50, 200); - buildings[i].height = GetRandomValue(100, 800); - buildings[i].y = screenHeight - 130 - buildings[i].height; - buildings[i].x = -6000 + spacing; + buildings[i].width = (float)GetRandomValue(50, 200); + buildings[i].height = (float)GetRandomValue(100, 800); + buildings[i].y = screenHeight - 130.0f - buildings[i].height; + buildings[i].x = -6000.0f + spacing; - spacing += buildings[i].width; + spacing += (int)buildings[i].width; buildColors[i] = (Color){ GetRandomValue(200, 240), GetRandomValue(200, 240), GetRandomValue(200, 250), 255 }; } Camera2D camera = { 0 }; - camera.target = (Vector2){ player.x + 20, player.y + 20 }; - camera.offset = (Vector2){ screenWidth/2, screenHeight/2 }; + camera.target = (Vector2){ player.x + 20.0f, player.y + 20.0f }; + camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f }; camera.rotation = 0.0f; camera.zoom = 1.0f; @@ -54,7 +54,7 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - + // Player movement if (IsKeyDown(KEY_RIGHT)) player.x += 2; else if (IsKeyDown(KEY_LEFT)) player.x -= 2; @@ -98,8 +98,8 @@ int main(void) DrawRectangleRec(player, RED); - DrawLine(camera.target.x, -screenHeight*10, camera.target.x, screenHeight*10, GREEN); - DrawLine(-screenWidth*10, camera.target.y, screenWidth*10, camera.target.y, GREEN); + DrawLine((int)camera.target.x, -screenHeight*10, (int)camera.target.x, screenHeight*10, GREEN); + DrawLine(-screenWidth*10, (int)camera.target.y, screenWidth*10, (int)camera.target.y, GREEN); EndMode2D(); diff --git a/examples/core/core_2d_camera_platformer.c b/examples/core/core_2d_camera_platformer.c index 645c317f1..9ab204924 100644 --- a/examples/core/core_2d_camera_platformer.c +++ b/examples/core/core_2d_camera_platformer.c @@ -46,7 +46,7 @@ int main(void) //-------------------------------------------------------------------------------------- const int screenWidth = 800; const int screenHeight = 450; - + InitWindow(screenWidth, screenHeight, "raylib [core] example - 2d camera"); Player player = { 0 }; @@ -60,12 +60,12 @@ int main(void) {{ 250, 300, 100, 10 }, 1, GRAY }, {{ 650, 300, 100, 10 }, 1, GRAY } }; - + int envItemsLength = sizeof(envItems)/sizeof(envItems[0]); Camera2D camera = { 0 }; camera.target = player.position; - camera.offset = (Vector2){ screenWidth/2, screenHeight/2 }; + camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f }; camera.rotation = 0.0f; camera.zoom = 1.0f; @@ -77,10 +77,10 @@ int main(void) UpdateCameraEvenOutOnLanding, UpdateCameraPlayerBoundsPush }; - + int cameraOption = 0; int cameraUpdatersLength = sizeof(cameraUpdaters)/sizeof(cameraUpdaters[0]); - + char *cameraDescriptions[] = { "Follow player center", "Follow player center, but clamp to map edges", @@ -88,25 +88,25 @@ int main(void) "Follow player center horizontally; updateplayer center vertically after landing", "Player push camera on getting too close to screen edge" }; - + SetTargetFPS(60); //-------------------------------------------------------------------------------------- // Main game loop - while (!WindowShouldClose()) + while (!WindowShouldClose()) { // Update //---------------------------------------------------------------------------------- float deltaTime = GetFrameTime(); - + UpdatePlayer(&player, envItems, envItemsLength, deltaTime); camera.zoom += ((float)GetMouseWheelMove()*0.05f); - + if (camera.zoom > 3.0f) camera.zoom = 3.0f; else if (camera.zoom < 0.25f) camera.zoom = 0.25f; - - if (IsKeyPressed(KEY_R)) + + if (IsKeyPressed(KEY_R)) { camera.zoom = 1.0f; player.position = (Vector2){ 400, 280 }; @@ -125,12 +125,12 @@ int main(void) ClearBackground(LIGHTGRAY); BeginMode2D(camera); - + for (int i = 0; i < envItemsLength; i++) DrawRectangleRec(envItems[i].rect, envItems[i].color); Rectangle playerRect = { player.position.x - 20, player.position.y - 40, 40, 40 }; DrawRectangleRec(playerRect, RED); - + EndMode2D(); DrawText("Controls:", 20, 20, 10, BLACK); @@ -140,7 +140,7 @@ int main(void) DrawText("- C to change camera mode", 40, 100, 10, DARKGRAY); DrawText("Current camera mode:", 20, 120, 10, BLACK); DrawText(cameraDescriptions[cameraOption], 40, 140, 10, DARKGRAY); - + EndDrawing(); //---------------------------------------------------------------------------------- } @@ -157,50 +157,50 @@ void UpdatePlayer(Player *player, EnvItem *envItems, int envItemsLength, float d { if (IsKeyDown(KEY_LEFT)) player->position.x -= PLAYER_HOR_SPD*delta; if (IsKeyDown(KEY_RIGHT)) player->position.x += PLAYER_HOR_SPD*delta; - if (IsKeyDown(KEY_SPACE) && player->canJump) + if (IsKeyDown(KEY_SPACE) && player->canJump) { player->speed = -PLAYER_JUMP_SPD; player->canJump = false; } int hitObstacle = 0; - for (int i = 0; i < envItemsLength; i++) + for (int i = 0; i < envItemsLength; i++) { EnvItem *ei = envItems + i; Vector2 *p = &(player->position); if (ei->blocking && - ei->rect.x <= p->x && + ei->rect.x <= p->x && ei->rect.x + ei->rect.width >= p->x && ei->rect.y >= p->y && - ei->rect.y < p->y + player->speed*delta) + ei->rect.y < p->y + player->speed*delta) { hitObstacle = 1; player->speed = 0.0f; p->y = ei->rect.y; } } - - if (!hitObstacle) + + if (!hitObstacle) { player->position.y += player->speed*delta; player->speed += G*delta; player->canJump = false; - } + } else player->canJump = true; } void UpdateCameraCenter(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height) { - camera->offset = (Vector2){ width/2, height/2 }; + camera->offset = (Vector2){ width/2.0f, height/2.0f }; camera->target = player->position; } void UpdateCameraCenterInsideMap(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height) { camera->target = player->position; - camera->offset = (Vector2){ width/2, height/2 }; + camera->offset = (Vector2){ width/2.0f, height/2.0f }; float minX = 1000, minY = 1000, maxX = -1000, maxY = -1000; - + for (int i = 0; i < envItemsLength; i++) { EnvItem *ei = envItems + i; @@ -209,10 +209,10 @@ void UpdateCameraCenterInsideMap(Camera2D *camera, Player *player, EnvItem *envI minY = fminf(ei->rect.y, minY); maxY = fmaxf(ei->rect.y + ei->rect.height, maxY); } - + Vector2 max = GetWorldToScreen2D((Vector2){ maxX, maxY }, *camera); Vector2 min = GetWorldToScreen2D((Vector2){ minX, minY }, *camera); - + if (max.x < width) camera->offset.x = width - (max.x - width/2); if (max.y < height) camera->offset.y = height - (max.y - height/2); if (min.x > 0) camera->offset.x = width/2 - min.x; @@ -224,11 +224,11 @@ void UpdateCameraCenterSmoothFollow(Camera2D *camera, Player *player, EnvItem *e static float minSpeed = 30; static float minEffectLength = 10; static float fractionSpeed = 0.8f; - - camera->offset = (Vector2){ width/2, height/2 }; + + camera->offset = (Vector2){ width/2.0f, height/2.0f }; Vector2 diff = Vector2Subtract(player->position, camera->target); float length = Vector2Length(diff); - + if (length > minEffectLength) { float speed = fmaxf(fractionSpeed*length, minSpeed); @@ -241,34 +241,34 @@ void UpdateCameraEvenOutOnLanding(Camera2D *camera, Player *player, EnvItem *env static float evenOutSpeed = 700; static int eveningOut = false; static float evenOutTarget; - - camera->offset = (Vector2){ width/2, height/2 }; + + camera->offset = (Vector2){ width/2.0f, height/2.0f }; camera->target.x = player->position.x; - + if (eveningOut) { - if (evenOutTarget > camera->target.y) + if (evenOutTarget > camera->target.y) { camera->target.y += evenOutSpeed*delta; - - if (camera->target.y > evenOutTarget) - { - camera->target.y = evenOutTarget; - eveningOut = 0; - } - } - else - { - camera->target.y -= evenOutSpeed*delta; - - if (camera->target.y < evenOutTarget) + + if (camera->target.y > evenOutTarget) { camera->target.y = evenOutTarget; eveningOut = 0; } } - } - else + else + { + camera->target.y -= evenOutSpeed*delta; + + if (camera->target.y < evenOutTarget) + { + camera->target.y = evenOutTarget; + eveningOut = 0; + } + } + } + else { if (player->canJump && (player->speed == 0) && (player->position.y != camera->target.y)) { @@ -278,7 +278,7 @@ void UpdateCameraEvenOutOnLanding(Camera2D *camera, Player *player, EnvItem *env } } -void UpdateCameraPlayerBoundsPush(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height) +void UpdateCameraPlayerBoundsPush(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height) { static Vector2 bbox = { 0.2f, 0.2f }; diff --git a/examples/core/core_2d_camera_smooth_pixelperfect.c b/examples/core/core_2d_camera_smooth_pixelperfect.c new file mode 100644 index 000000000..ae40cdfc1 --- /dev/null +++ b/examples/core/core_2d_camera_smooth_pixelperfect.c @@ -0,0 +1,130 @@ +/******************************************************************************************* +* +* raylib [core] example - smooth pixel-perfect camera +* +* This example has been created using raylib 3.7 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) +* +* Example contributed by Giancamillo Alessandroni ([discord]NotManyIdeas#9972 - [github]NotManyIdeasDev) and +* reviewed by Ramon Santamaria (@raysan5) +* +* Copyright (c) 2021 Giancamillo Alessandroni (NotManyIdeas#9972) and Ramon Santamaria (@raysan5) +* +********************************************************************************************/ + +#include "raylib.h" +#include + +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + const int virualScreenWidth = 160; + const int virtualScreenHeight = 90; + + const float virtualRatio = (float)screenWidth/(float)virualScreenWidth; + + InitWindow(screenWidth, screenHeight, "raylib [core] example - smooth pixel-perfect camera"); + + Camera2D worldSpaceCamera = { 0 }; // Game world camera + worldSpaceCamera.zoom = 1.0f; + + Camera2D screenSpaceCamera = { 0 }; //Smoothing camera + screenSpaceCamera.zoom = 1.0f; + + RenderTexture2D renderTexture = LoadRenderTexture(virualScreenWidth, virtualScreenHeight); //This is where we'll draw all our objects. + + Rectangle firstRectangle = { 70.0f, 35.0f, 20.0f, 20.0f }; + Rectangle secondRectangle = { 90.0f, 55.0f, 30.0f, 10.0f }; + Rectangle thirdRectangle = { 80.0f, 65.0f, 15.0f, 25.0f }; + + //The renderTexture's height is flipped (in the source Rectangle), due to OpenGL reasons. + Rectangle renderTextureSource = { 0.0f, 0.0f, (float)renderTexture.texture.width, (float)-renderTexture.texture.height }; + Rectangle renderTextureDest = { -virtualRatio, -virtualRatio, screenWidth + (virtualRatio*2), screenHeight + (virtualRatio*2) }; + + Vector2 origin = { 0.0f, 0.0f }; + + float rotation = 0.0f; + float degreesPerSecond = 60.0f; + + float cameraX = 0.0f; + float cameraY = 0.0f; + + SetTargetFPS(60); + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key + { + // Update + //---------------------------------------------------------------------------------- + rotation += degreesPerSecond*GetFrameTime(); // Rotate the rectangles. + + // Make the camera move to demonstrate the effect. + cameraX = (sinf(GetTime())*50.0f) - 10.0f; + cameraY = cosf(GetTime())*30.0f; + + // Set the camera's target to the values computed above. + screenSpaceCamera.target = (Vector2){ cameraX, cameraY }; + + //Round worldSpace coordinates, keep decimals into screenSpace coordinates. + worldSpaceCamera.target.x = (int)screenSpaceCamera.target.x; + screenSpaceCamera.target.x -= worldSpaceCamera.target.x; + screenSpaceCamera.target.x *= virtualRatio; + + worldSpaceCamera.target.y = (int)screenSpaceCamera.target.y; + screenSpaceCamera.target.y -= worldSpaceCamera.target.y; + screenSpaceCamera.target.y *= virtualRatio; + + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + ClearBackground(RED); // This is for debug purposes. If you see red, then you've probably done something wrong. + + BeginTextureMode(renderTexture); + BeginMode2D(worldSpaceCamera); + ClearBackground(RAYWHITE); // This is the color you should see as background color. + + // Draw the rectangles + DrawRectanglePro(firstRectangle, origin, rotation, BLACK); + DrawRectanglePro(secondRectangle, origin, -rotation, RED); + DrawRectanglePro(thirdRectangle, origin, rotation + 45.0f, BLUE); + + EndMode2D(); + EndTextureMode(); + + BeginMode2D(screenSpaceCamera); + + // Draw the render texture with an offset of 1 worldSpace unit/pixel, so that the content behind the renderTexture is not shown. + DrawTexturePro( + renderTexture.texture, + renderTextureSource, + renderTextureDest, + origin, + 0.0f, + WHITE + ); + + EndMode2D(); + + //Debug info + DrawText("Screen resolution: 800x450", 5, 0, 20, DARKBLUE); + DrawText("World resolution: 160x90", 5, 20, 20, DARKGREEN); + DrawFPS(screenWidth - 75, 0); + EndDrawing(); + //---------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + UnloadRenderTexture(renderTexture); // RenderTexture unloading + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} \ No newline at end of file diff --git a/examples/core/core_2d_camera_smooth_pixelperfect.png b/examples/core/core_2d_camera_smooth_pixelperfect.png new file mode 100644 index 000000000..aeac79446 Binary files /dev/null and b/examples/core/core_2d_camera_smooth_pixelperfect.png differ diff --git a/examples/core/core_3d_camera_first_person.c b/examples/core/core_3d_camera_first_person.c index 9225991a0..59fc8307c 100644 --- a/examples/core/core_3d_camera_first_person.c +++ b/examples/core/core_3d_camera_first_person.c @@ -28,7 +28,7 @@ int main(void) camera.target = (Vector3){ 0.0f, 1.8f, 0.0f }; camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; camera.fovy = 60.0f; - camera.type = CAMERA_PERSPECTIVE; + camera.projection = CAMERA_PERSPECTIVE; // Generates some random columns float heights[MAX_COLUMNS] = { 0 }; @@ -38,7 +38,7 @@ int main(void) for (int i = 0; i < MAX_COLUMNS; i++) { heights[i] = (float)GetRandomValue(1, 12); - positions[i] = (Vector3){ GetRandomValue(-15, 15), heights[i]/2, GetRandomValue(-15, 15) }; + positions[i] = (Vector3){ (float)GetRandomValue(-15, 15), heights[i]/2.0f, (float)GetRandomValue(-15, 15) }; colors[i] = (Color){ GetRandomValue(20, 255), GetRandomValue(10, 55), 30, 255 }; } diff --git a/examples/core/core_3d_camera_free.c b/examples/core/core_3d_camera_free.c index 5053fd63a..f469d121d 100644 --- a/examples/core/core_3d_camera_free.c +++ b/examples/core/core_3d_camera_free.c @@ -26,7 +26,7 @@ int main(void) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) camera.fovy = 45.0f; // Camera field-of-view Y - camera.type = CAMERA_PERSPECTIVE; // Camera mode type + camera.projection = CAMERA_PERSPECTIVE; // Camera mode type Vector3 cubePosition = { 0.0f, 0.0f, 0.0f }; diff --git a/examples/core/core_3d_camera_mode.c b/examples/core/core_3d_camera_mode.c index eae6c888c..654fc2dba 100644 --- a/examples/core/core_3d_camera_mode.c +++ b/examples/core/core_3d_camera_mode.c @@ -26,7 +26,7 @@ int main(void) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) camera.fovy = 45.0f; // Camera field-of-view Y - camera.type = CAMERA_PERSPECTIVE; // Camera mode type + camera.projection = CAMERA_PERSPECTIVE; // Camera mode type Vector3 cubePosition = { 0.0f, 0.0f, 0.0f }; diff --git a/examples/core/core_3d_picking.c b/examples/core/core_3d_picking.c index baf35036e..1c42de79f 100644 --- a/examples/core/core_3d_picking.c +++ b/examples/core/core_3d_picking.c @@ -26,14 +26,14 @@ int main(void) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) camera.fovy = 45.0f; // Camera field-of-view Y - camera.type = CAMERA_PERSPECTIVE; // Camera mode type + camera.projection = CAMERA_PERSPECTIVE; // Camera mode type Vector3 cubePosition = { 0.0f, 1.0f, 0.0f }; Vector3 cubeSize = { 2.0f, 2.0f, 2.0f }; Ray ray = { 0 }; // Picking line ray - bool collision = false; + RayCollision collision = { 0 }; SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode @@ -47,18 +47,18 @@ int main(void) //---------------------------------------------------------------------------------- UpdateCamera(&camera); // Update camera - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) { - if (!collision) + if (!collision.hit) { ray = GetMouseRay(GetMousePosition(), camera); // Check collision between ray and box - collision = CheckCollisionRayBox(ray, + collision = GetRayCollisionBox(ray, (BoundingBox){(Vector3){ cubePosition.x - cubeSize.x/2, cubePosition.y - cubeSize.y/2, cubePosition.z - cubeSize.z/2 }, (Vector3){ cubePosition.x + cubeSize.x/2, cubePosition.y + cubeSize.y/2, cubePosition.z + cubeSize.z/2 }}); } - else collision = false; + else collision.hit = false; } //---------------------------------------------------------------------------------- @@ -70,7 +70,7 @@ int main(void) BeginMode3D(camera); - if (collision) + if (collision.hit) { DrawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, RED); DrawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, MAROON); @@ -90,7 +90,7 @@ int main(void) DrawText("Try selecting the box with mouse!", 240, 10, 20, DARKGRAY); - if(collision) DrawText("BOX SELECTED", (screenWidth - MeasureText("BOX SELECTED", 30)) / 2, screenHeight * 0.1f, 30, GREEN); + if (collision.hit) DrawText("BOX SELECTED", (screenWidth - MeasureText("BOX SELECTED", 30)) / 2, (int)(screenHeight * 0.1f), 30, GREEN); DrawFPS(10, 10); diff --git a/examples/core/core_basic_window.cpp b/examples/core/core_basic_window.cpp deleted file mode 100644 index 414f91852..000000000 --- a/examples/core/core_basic_window.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************************* -* -* raylib [core] example - Basic window -* -* Welcome to raylib! -* -* To test examples, just press F6 and execute raylib_compile_execute script -* Note that compiled executable is placed in the same folder as .c file -* -* You can find all basic examples on C:\raylib\raylib\examples folder or -* raylib official webpage: www.raylib.com -* -* Enjoy using raylib. :) -* -* This example has been created using raylib 1.0 (www.raylib.com) -* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) -* -* Copyright (c) 2014 Ramon Santamaria (@raysan5) -* -********************************************************************************************/ - -#include "raylib.h" - -int main(int argc, char* argv[]) -{ - // Initialization - //-------------------------------------------------------------------------------------- - int screenWidth = 800; - int screenHeight = 450; - - InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window"); - - SetTargetFPS(60); - //-------------------------------------------------------------------------------------- - - // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key - { - // Update - //---------------------------------------------------------------------------------- - // TODO: Update your variables here - //---------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - BeginDrawing(); - - ClearBackground(RAYWHITE); - - DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); - - EndDrawing(); - //---------------------------------------------------------------------------------- - } - - // De-Initialization - //-------------------------------------------------------------------------------------- - CloseWindow(); // Close window and OpenGL context - //-------------------------------------------------------------------------------------- - - return 0; -} \ No newline at end of file diff --git a/examples/core/core_basic_window_web.c b/examples/core/core_basic_window_web.c index 1ecb22f35..8ce1922ab 100644 --- a/examples/core/core_basic_window_web.c +++ b/examples/core/core_basic_window_web.c @@ -46,7 +46,7 @@ int main() #else SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- - + // Main game loop while (!WindowShouldClose()) // Detect window close button or ESC key { diff --git a/examples/core/core_input_gamepad.c b/examples/core/core_input_gamepad.c index bf9d219c5..3595329b2 100644 --- a/examples/core/core_input_gamepad.c +++ b/examples/core/core_input_gamepad.c @@ -18,6 +18,7 @@ #include "raylib.h" // NOTE: Gamepad name ID depends on drivers and OS +#define XBOX360_LEGACY_NAME_ID "Xbox Controller" #if defined(PLATFORM_RPI) #define XBOX360_NAME_ID "Microsoft X-Box 360 pad" #define PS3_NAME_ID "PLAYSTATION(R)3 Controller" @@ -57,102 +58,102 @@ int main(void) ClearBackground(RAYWHITE); - if (IsGamepadAvailable(GAMEPAD_PLAYER1)) + if (IsGamepadAvailable(0)) { - DrawText(TextFormat("GP1: %s", GetGamepadName(GAMEPAD_PLAYER1)), 10, 10, 10, BLACK); + DrawText(TextFormat("GP1: %s", GetGamepadName(0)), 10, 10, 10, BLACK); - if (IsGamepadName(GAMEPAD_PLAYER1, XBOX360_NAME_ID)) + if (IsGamepadName(0, XBOX360_NAME_ID) || IsGamepadName(0, XBOX360_LEGACY_NAME_ID)) { DrawTexture(texXboxPad, 0, 0, DARKGRAY); // Draw buttons: xbox home - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_MIDDLE)) DrawCircle(394, 89, 19, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE)) DrawCircle(394, 89, 19, RED); // Draw buttons: basic - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_MIDDLE_RIGHT)) DrawCircle(436, 150, 9, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_MIDDLE_LEFT)) DrawCircle(352, 150, 9, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_LEFT)) DrawCircle(501, 151, 15, BLUE); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawCircle(536, 187, 15, LIME); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT)) DrawCircle(572, 151, 15, MAROON); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_UP)) DrawCircle(536, 115, 15, GOLD); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE_RIGHT)) DrawCircle(436, 150, 9, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE_LEFT)) DrawCircle(352, 150, 9, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_LEFT)) DrawCircle(501, 151, 15, BLUE); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawCircle(536, 187, 15, LIME); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT)) DrawCircle(572, 151, 15, MAROON); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_UP)) DrawCircle(536, 115, 15, GOLD); // Draw buttons: d-pad DrawRectangle(317, 202, 19, 71, BLACK); DrawRectangle(293, 228, 69, 19, BLACK); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_UP)) DrawRectangle(317, 202, 19, 26, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_DOWN)) DrawRectangle(317, 202 + 45, 19, 26, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_LEFT)) DrawRectangle(292, 228, 25, 19, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(292 + 44, 228, 26, 19, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_UP)) DrawRectangle(317, 202, 19, 26, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_DOWN)) DrawRectangle(317, 202 + 45, 19, 26, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_LEFT)) DrawRectangle(292, 228, 25, 19, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(292 + 44, 228, 26, 19, RED); // Draw buttons: left-right back - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawCircle(259, 61, 20, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawCircle(536, 61, 20, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawCircle(259, 61, 20, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawCircle(536, 61, 20, RED); // Draw axis: left joystick DrawCircle(259, 152, 39, BLACK); DrawCircle(259, 152, 34, LIGHTGRAY); - DrawCircle(259 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_X)*20), - 152 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_Y)*20), 25, BLACK); + DrawCircle(259 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X)*20), + 152 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y)*20), 25, BLACK); // Draw axis: right joystick DrawCircle(461, 237, 38, BLACK); DrawCircle(461, 237, 33, LIGHTGRAY); - DrawCircle(461 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_X)*20), - 237 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_Y)*20), 25, BLACK); + DrawCircle(461 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_X)*20), + 237 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_Y)*20), 25, BLACK); // Draw axis: left-right triggers DrawRectangle(170, 30, 15, 70, GRAY); DrawRectangle(604, 30, 15, 70, GRAY); - DrawRectangle(170, 30, 15, (((1.0f + GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_TRIGGER))/2.0f)*70), RED); - DrawRectangle(604, 30, 15, (((1.0f + GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_TRIGGER))/2.0f)*70), RED); + DrawRectangle(170, 30, 15, (((1 + (int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER))/2)*70), RED); + DrawRectangle(604, 30, 15, (((1 + (int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER))/2)*70), RED); - //DrawText(TextFormat("Xbox axis LT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK); - //DrawText(TextFormat("Xbox axis RT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK); + //DrawText(TextFormat("Xbox axis LT: %02.02f", GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK); + //DrawText(TextFormat("Xbox axis RT: %02.02f", GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK); } - else if (IsGamepadName(GAMEPAD_PLAYER1, PS3_NAME_ID)) + else if (IsGamepadName(0, PS3_NAME_ID)) { DrawTexture(texPs3Pad, 0, 0, DARKGRAY); // Draw buttons: ps - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_MIDDLE)) DrawCircle(396, 222, 13, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE)) DrawCircle(396, 222, 13, RED); // Draw buttons: basic - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_MIDDLE_LEFT)) DrawRectangle(328, 170, 32, 13, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_MIDDLE_RIGHT)) DrawTriangle((Vector2){ 436, 168 }, (Vector2){ 436, 185 }, (Vector2){ 464, 177 }, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_UP)) DrawCircle(557, 144, 13, LIME); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT)) DrawCircle(586, 173, 13, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawCircle(557, 203, 13, VIOLET); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_LEFT)) DrawCircle(527, 173, 13, PINK); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE_LEFT)) DrawRectangle(328, 170, 32, 13, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_MIDDLE_RIGHT)) DrawTriangle((Vector2){ 436, 168 }, (Vector2){ 436, 185 }, (Vector2){ 464, 177 }, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_UP)) DrawCircle(557, 144, 13, LIME); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT)) DrawCircle(586, 173, 13, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawCircle(557, 203, 13, VIOLET); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_LEFT)) DrawCircle(527, 173, 13, PINK); // Draw buttons: d-pad DrawRectangle(225, 132, 24, 84, BLACK); DrawRectangle(195, 161, 84, 25, BLACK); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_UP)) DrawRectangle(225, 132, 24, 29, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_DOWN)) DrawRectangle(225, 132 + 54, 24, 30, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_LEFT)) DrawRectangle(195, 161, 30, 25, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(195 + 54, 161, 30, 25, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_UP)) DrawRectangle(225, 132, 24, 29, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_DOWN)) DrawRectangle(225, 132 + 54, 24, 30, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_LEFT)) DrawRectangle(195, 161, 30, 25, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(195 + 54, 161, 30, 25, RED); // Draw buttons: left-right back buttons - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawCircle(239, 82, 20, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawCircle(557, 82, 20, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawCircle(239, 82, 20, RED); + if (IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawCircle(557, 82, 20, RED); // Draw axis: left joystick DrawCircle(319, 255, 35, BLACK); DrawCircle(319, 255, 31, LIGHTGRAY); - DrawCircle(319 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_X)*20), - 255 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_Y)*20), 25, BLACK); + DrawCircle(319 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X) * 20), + 255 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y) * 20), 25, BLACK); // Draw axis: right joystick DrawCircle(475, 255, 35, BLACK); DrawCircle(475, 255, 31, LIGHTGRAY); - DrawCircle(475 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_X)*20), - 255 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_Y)*20), 25, BLACK); + DrawCircle(475 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_X)*20), + 255 + ((int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_Y)*20), 25, BLACK); // Draw axis: left-right triggers DrawRectangle(169, 48, 15, 70, GRAY); DrawRectangle(611, 48, 15, 70, GRAY); - DrawRectangle(169, 48, 15, (((1.0f - GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_TRIGGER))/2.0f)*70), RED); - DrawRectangle(611, 48, 15, (((1.0f - GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_TRIGGER))/2.0f)*70), RED); + DrawRectangle(169, 48, 15, (((1 - (int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_TRIGGER)) / 2) * 70), RED); + DrawRectangle(611, 48, 15, (((1 - (int)GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_TRIGGER)) / 2) * 70), RED); } else { @@ -161,11 +162,11 @@ int main(void) // TODO: Draw generic gamepad } - DrawText(TextFormat("DETECTED AXIS [%i]:", GetGamepadAxisCount(GAMEPAD_PLAYER1)), 10, 50, 10, MAROON); + DrawText(TextFormat("DETECTED AXIS [%i]:", GetGamepadAxisCount(0)), 10, 50, 10, MAROON); - for (int i = 0; i < GetGamepadAxisCount(GAMEPAD_PLAYER1); i++) + for (int i = 0; i < GetGamepadAxisCount(0); i++) { - DrawText(TextFormat("AXIS %i: %.02f", i, GetGamepadAxisMovement(GAMEPAD_PLAYER1, i)), 20, 70 + 20*i, 10, DARKGRAY); + DrawText(TextFormat("AXIS %i: %.02f", i, GetGamepadAxisMovement(0, i)), 20, 70 + 20*i, 10, DARKGRAY); } if (GetGamepadButtonPressed() != -1) DrawText(TextFormat("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED); @@ -191,4 +192,4 @@ int main(void) //-------------------------------------------------------------------------------------- return 0; -} \ No newline at end of file +} diff --git a/examples/core/core_input_gestures.c b/examples/core/core_input_gestures.c index affab3ebb..50bbff7ef 100644 --- a/examples/core/core_input_gestures.c +++ b/examples/core/core_input_gestures.c @@ -24,7 +24,7 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [core] example - input gestures"); Vector2 touchPosition = { 0, 0 }; - Rectangle touchArea = { 220, 10, screenWidth - 230, screenHeight - 20 }; + Rectangle touchArea = { 220, 10, screenWidth - 230.0f, screenHeight - 20.0f }; int gesturesCount = 0; char gestureStrings[MAX_GESTURE_STRINGS][32]; diff --git a/examples/core/core_input_mouse.c b/examples/core/core_input_mouse.c index ad205aed8..c3415e8b7 100644 --- a/examples/core/core_input_mouse.c +++ b/examples/core/core_input_mouse.c @@ -33,9 +33,13 @@ int main(void) //---------------------------------------------------------------------------------- ballPosition = GetMousePosition(); - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) ballColor = MAROON; - else if (IsMouseButtonPressed(MOUSE_MIDDLE_BUTTON)) ballColor = LIME; - else if (IsMouseButtonPressed(MOUSE_RIGHT_BUTTON)) ballColor = DARKBLUE; + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) ballColor = MAROON; + else if (IsMouseButtonPressed(MOUSE_BUTTON_MIDDLE)) ballColor = LIME; + else if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT)) ballColor = DARKBLUE; + else if (IsMouseButtonPressed(MOUSE_BUTTON_SIDE)) ballColor = PURPLE; + else if (IsMouseButtonPressed(MOUSE_BUTTON_EXTRA)) ballColor = YELLOW; + else if (IsMouseButtonPressed(MOUSE_BUTTON_FORWARD)) ballColor = ORANGE; + else if (IsMouseButtonPressed(MOUSE_BUTTON_BACK)) ballColor = BEIGE; //---------------------------------------------------------------------------------- // Draw diff --git a/examples/core/core_input_multitouch.c b/examples/core/core_input_multitouch.c index 584e029ab..32408a3b1 100644 --- a/examples/core/core_input_multitouch.c +++ b/examples/core/core_input_multitouch.c @@ -42,13 +42,13 @@ int main(void) ballColor = BEIGE; - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) ballColor = MAROON; - if (IsMouseButtonDown(MOUSE_MIDDLE_BUTTON)) ballColor = LIME; - if (IsMouseButtonDown(MOUSE_RIGHT_BUTTON)) ballColor = DARKBLUE; + if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) ballColor = MAROON; + if (IsMouseButtonDown(MOUSE_BUTTON_MIDDLE)) ballColor = LIME; + if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT)) ballColor = DARKBLUE; - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) touchCounter = 10; - if (IsMouseButtonPressed(MOUSE_MIDDLE_BUTTON)) touchCounter = 10; - if (IsMouseButtonPressed(MOUSE_RIGHT_BUTTON)) touchCounter = 10; + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) touchCounter = 10; + if (IsMouseButtonPressed(MOUSE_BUTTON_MIDDLE)) touchCounter = 10; + if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT)) touchCounter = 10; if (touchCounter > 0) touchCounter--; //---------------------------------------------------------------------------------- @@ -68,12 +68,12 @@ int main(void) { // Draw circle and touch index number DrawCircleV(touchPosition, 34, ORANGE); - DrawText(TextFormat("%d", i), touchPosition.x - 10, touchPosition.y - 70, 40, BLACK); + DrawText(TextFormat("%d", i), (int)touchPosition.x - 10, (int)touchPosition.y - 70, 40, BLACK); } } // Draw the normal mouse location - DrawCircleV(ballPosition, 30 + (touchCounter*3), ballColor); + DrawCircleV(ballPosition, 30 + (touchCounter*3.0f), ballColor); DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, DARKGRAY); DrawText("touch the screen at multiple locations to get multiple balls", 10, 30, 20, DARKGRAY); diff --git a/examples/core/core_quat_conversion.c b/examples/core/core_quat_conversion.c index cd7777e6d..cca6f01ef 100644 --- a/examples/core/core_quat_conversion.c +++ b/examples/core/core_quat_conversion.c @@ -26,17 +26,17 @@ int main(void) const int screenHeight = 450; InitWindow(screenWidth, screenHeight, "raylib [core] example - quat conversions"); - + Camera3D camera = { 0 }; camera.position = (Vector3){ 0.0f, 10.0f, 10.0f }; // Camera position camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) camera.fovy = 45.0f; // Camera field-of-view Y - camera.type = CAMERA_PERSPECTIVE; // Camera mode type + camera.projection = CAMERA_PERSPECTIVE; // Camera mode type - Mesh mesh = GenMeshCylinder(0.2f, 1.0f, 32); + Mesh mesh = GenMeshCylinder(0.2f, 1.0f, 32); Model model = LoadModelFromMesh(mesh); - + // Some required variables Quaternion q1 = { 0 }; Matrix m1 = { 0 }, m2 = { 0 }, m3 = { 0 }, m4 = { 0 }; @@ -44,7 +44,7 @@ int main(void) SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- - + // Main game loop while (!WindowShouldClose()) // Detect window close button or ESC key { @@ -60,28 +60,28 @@ int main(void) if (v1.x > PI*2) v1.x -= PI*2; if (v1.y > PI*2) v1.y -= PI*2; if (v1.z > PI*2) v1.z -= PI*2; - + q1 = QuaternionFromEuler(v1.x, v1.y, v1.z); m1 = MatrixRotateZYX(v1); m2 = QuaternionToMatrix(q1); q1 = QuaternionFromMatrix(m1); m3 = QuaternionToMatrix(q1); - - v2 = QuaternionToEuler(q1); - v2.x *= DEG2RAD; - v2.y *= DEG2RAD; - v2.z *= DEG2RAD; - + + v2 = QuaternionToEuler(q1); + v2.x *= DEG2RAD; + v2.y *= DEG2RAD; + v2.z *= DEG2RAD; + m4 = MatrixRotateZYX(v2); //-------------------------------------------------------------------------------------- - + // Draw //---------------------------------------------------------------------------------- BeginDrawing(); ClearBackground(RAYWHITE); - + BeginMode3D(camera); model.transform = m1; @@ -94,19 +94,19 @@ int main(void) DrawModel(model, (Vector3){ 0, 0, -1 }, 1.0f, RED); DrawGrid(10, 1.0f); - + EndMode3D(); - + if (v2.x < 0) v2.x += PI*2; if (v2.y < 0) v2.y += PI*2; if (v2.z < 0) v2.z += PI*2; - + Color cx,cy,cz; cx = cy = cz = BLACK; if (v1.x == v2.x) cx = GREEN; if (v1.y == v2.y) cy = GREEN; if (v1.z == v2.z) cz = GREEN; - + DrawText(TextFormat("%2.3f", v1.x), 20, 20, 20, cx); DrawText(TextFormat("%2.3f", v1.y), 20, 40, 20, cy); DrawText(TextFormat("%2.3f", v1.z), 20, 60, 20, cz); @@ -122,7 +122,7 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- UnloadModel(model); // Unload model data (mesh and materials) - + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/core/core_scissor_test.c b/examples/core/core_scissor_test.c index 55221330e..56eb84f80 100644 --- a/examples/core/core_scissor_test.c +++ b/examples/core/core_scissor_test.c @@ -46,7 +46,7 @@ int main(void) ClearBackground(RAYWHITE); - if (scissorMode) BeginScissorMode(scissorArea.x, scissorArea.y, scissorArea.width, scissorArea.height); + if (scissorMode) BeginScissorMode((int)scissorArea.x, (int)scissorArea.y, (int)scissorArea.width, (int)scissorArea.height); // Draw full screen rectangle and some text // NOTE: Only part defined by scissor area will be rendered diff --git a/examples/core/core_split_screen.c b/examples/core/core_split_screen.c new file mode 100644 index 000000000..0bfdb84ac --- /dev/null +++ b/examples/core/core_split_screen.c @@ -0,0 +1,155 @@ +/******************************************************************************************* +* +* raylib [core] example - split screen +* +* This example has been created using raylib 3.7 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) +* +* Example contributed by Jeffery Myers (@JeffM2501) and reviewed by Ramon Santamaria (@raysan5) +* +* Copyright (c) 2021 Jeffery Myers (@JeffM2501) +* +********************************************************************************************/ + +#include "raylib.h" + +Texture2D textureGrid = { 0 }; +Camera cameraPlayer1 = { 0 }; +Camera cameraPlayer2 = { 0 }; + +// Scene drawing +void DrawScene(void) +{ + int count = 5; + float spacing = 4; + + // Grid of cube trees on a plane to make a "world" + DrawPlane((Vector3){ 0, 0, 0 }, (Vector2){ 50, 50 }, BEIGE); // Simple world plane + + for (float x = -count*spacing; x <= count*spacing; x += spacing) + { + for (float z = -count*spacing; z <= count*spacing; z += spacing) + { + DrawCubeTexture(textureGrid, (Vector3) { x, 1.5f, z }, 1, 1, 1, GREEN); + DrawCubeTexture(textureGrid, (Vector3) { x, 0.5f, z }, 0.25f, 1, 0.25f, BROWN); + } + } + + // Draw a cube at each player's position + DrawCube(cameraPlayer1.position, 1, 1, 1, RED); + DrawCube(cameraPlayer2.position, 1, 1, 1, BLUE); +} + +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib [core] example - split screen"); + + // Generate a simple texture to use for trees + Image img = GenImageChecked(256, 256, 32, 32, DARKGRAY, WHITE); + textureGrid = LoadTextureFromImage(img); + UnloadImage(img); + SetTextureFilter(textureGrid, TEXTURE_FILTER_ANISOTROPIC_16X); + SetTextureWrap(textureGrid, TEXTURE_WRAP_CLAMP); + + // Setup player 1 camera and screen + cameraPlayer1.fovy = 45.0f; + cameraPlayer1.up.y = 1.0f; + cameraPlayer1.target.y = 1.0f; + cameraPlayer1.position.z = -3.0f; + cameraPlayer1.position.y = 1.0f; + + RenderTexture screenPlayer1 = LoadRenderTexture(screenWidth/2, screenHeight); + + // Setup player two camera and screen + cameraPlayer2.fovy = 45.0f; + cameraPlayer2.up.y = 1.0f; + cameraPlayer2.target.y = 3.0f; + cameraPlayer2.position.x = -3.0f; + cameraPlayer2.position.y = 3.0f; + + RenderTexture screenPlayer2 = LoadRenderTexture(screenWidth / 2, screenHeight); + + // Build a flipped rectangle the size of the split view to use for drawing later + Rectangle splitScreenRect = { 0.0f, 0.0f, (float)screenPlayer1.texture.width, (float)-screenPlayer1.texture.height }; + + SetTargetFPS(60); // Set our game to run at 60 frames-per-second + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key + { + // Update + //---------------------------------------------------------------------------------- + // If anyone moves this frame, how far will they move based on the time since the last frame + // this moves thigns at 10 world units per second, regardless of the actual FPS + float offsetThisFrame = 10.0f*GetFrameTime(); + + // Move player 1 forward and backwards (no turning) + if (IsKeyDown(KEY_W)) + { + cameraPlayer1.position.z += offsetThisFrame; + cameraPlayer1.target.z += offsetThisFrame; + } + else if (IsKeyDown(KEY_S)) + { + cameraPlayer1.position.z -= offsetThisFrame; + cameraPlayer1.target.z -= offsetThisFrame; + } + + // Move player 2 forward and backwards (no turning) + if (IsKeyDown(KEY_UP)) + { + cameraPlayer2.position.x += offsetThisFrame; + cameraPlayer2.target.x += offsetThisFrame; + } + else if (IsKeyDown(KEY_DOWN)) + { + cameraPlayer2.position.x -= offsetThisFrame; + cameraPlayer2.target.x -= offsetThisFrame; + } + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + // Draw player 1's view to the render texture + BeginTextureMode(screenPlayer1); + ClearBackground(SKYBLUE); + BeginMode3D(cameraPlayer1); + DrawScene(); + EndMode3D(); + DrawText("PLAYER1 W/S to move", 0, 0, 20, RED); + EndTextureMode(); + + // Draw player 2's view to the render texture + BeginTextureMode(screenPlayer2); + ClearBackground(SKYBLUE); + BeginMode3D(cameraPlayer2); + DrawScene(); + EndMode3D(); + DrawText("PLAYER2 UP/DOWN to move", 0, 0, 20, BLUE); + EndTextureMode(); + + // Draw both view render textures to the screen side by side + BeginDrawing(); + ClearBackground(BLACK); + DrawTextureRec(screenPlayer1.texture, splitScreenRect, (Vector2) { 0, 0 }, WHITE); + DrawTextureRec(screenPlayer2.texture, splitScreenRect, (Vector2) { screenWidth/2.0f, 0 }, WHITE); + EndDrawing(); + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + UnloadRenderTexture(screenPlayer1); + UnloadRenderTexture(screenPlayer2); + UnloadTexture(textureGrid); + + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} \ No newline at end of file diff --git a/examples/core/core_split_screen.png b/examples/core/core_split_screen.png new file mode 100644 index 000000000..20cd2ead9 Binary files /dev/null and b/examples/core/core_split_screen.png differ diff --git a/examples/core/core_vr_simulator.c b/examples/core/core_vr_simulator.c index 8d24983cc..bba90b823 100644 --- a/examples/core/core_vr_simulator.c +++ b/examples/core/core_vr_simulator.c @@ -2,19 +2,19 @@ * * raylib [core] example - VR Simulator (Oculus Rift CV1 parameters) * -* This example has been created using raylib 1.7 (www.raylib.com) +* This example has been created using raylib 3.7 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2017 Ramon Santamaria (@raysan5) +* Copyright (c) 2017-2021 Ramon Santamaria (@raysan5) * ********************************************************************************************/ #include "raylib.h" #if defined(PLATFORM_DESKTOP) - #define GLSL_VERSION 330 + #define GLSL_VERSION 330 #else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB - #define GLSL_VERSION 100 + #define GLSL_VERSION 100 #endif int main(void) @@ -25,48 +25,68 @@ int main(void) const int screenHeight = 450; // NOTE: screenWidth/screenHeight should match VR device aspect ratio - - SetConfigFlags(FLAG_MSAA_4X_HINT); InitWindow(screenWidth, screenHeight, "raylib [core] example - vr simulator"); - // Init VR simulator (Oculus Rift CV1 parameters) - InitVrSimulator(); + // VR device parameters definition + VrDeviceInfo device = { + // Oculus Rift CV1 parameters for simulator + .hResolution = 2160, // Horizontal resolution in pixels + .vResolution = 1200, // Vertical resolution in pixels + .hScreenSize = 0.133793f, // Horizontal size in meters + .vScreenSize = 0.0669f, // Vertical size in meters + .vScreenCenter = 0.04678f, // Screen center in meters + .eyeToScreenDistance = 0.041f, // Distance between eye and display in meters + .lensSeparationDistance = 0.07f, // Lens separation distance in meters + .interpupillaryDistance = 0.07f, // IPD (distance between pupils) in meters - VrDeviceInfo hmd = { 0 }; // VR device parameters (head-mounted-device) + // NOTE: CV1 uses fresnel-hybrid-asymmetric lenses with specific compute shaders + // Following parameters are just an approximation to CV1 distortion stereo rendering + .lensDistortionValues[0] = 1.0f, // Lens distortion constant parameter 0 + .lensDistortionValues[1] = 0.22f, // Lens distortion constant parameter 1 + .lensDistortionValues[2] = 0.24f, // Lens distortion constant parameter 2 + .lensDistortionValues[3] = 0.0f, // Lens distortion constant parameter 3 + .chromaAbCorrection[0] = 0.996f, // Chromatic aberration correction parameter 0 + .chromaAbCorrection[1] = -0.004f, // Chromatic aberration correction parameter 1 + .chromaAbCorrection[2] = 1.014f, // Chromatic aberration correction parameter 2 + .chromaAbCorrection[3] = 0.0f, // Chromatic aberration correction parameter 3 + }; - // Oculus Rift CV1 parameters for simulator - hmd.hResolution = 2160; // HMD horizontal resolution in pixels - hmd.vResolution = 1200; // HMD vertical resolution in pixels - hmd.hScreenSize = 0.133793f; // HMD horizontal size in meters - hmd.vScreenSize = 0.0669f; // HMD vertical size in meters - hmd.vScreenCenter = 0.04678f; // HMD screen center in meters - hmd.eyeToScreenDistance = 0.041f; // HMD distance between eye and display in meters - hmd.lensSeparationDistance = 0.07f; // HMD lens separation distance in meters - hmd.interpupillaryDistance = 0.07f; // HMD IPD (distance between pupils) in meters - - // NOTE: CV1 uses a Fresnel-hybrid-asymmetric lenses with specific distortion compute shaders. - // Following parameters are an approximation to distortion stereo rendering but results differ from actual device. - hmd.lensDistortionValues[0] = 1.0f; // HMD lens distortion constant parameter 0 - hmd.lensDistortionValues[1] = 0.22f; // HMD lens distortion constant parameter 1 - hmd.lensDistortionValues[2] = 0.24f; // HMD lens distortion constant parameter 2 - hmd.lensDistortionValues[3] = 0.0f; // HMD lens distortion constant parameter 3 - hmd.chromaAbCorrection[0] = 0.996f; // HMD chromatic aberration correction parameter 0 - hmd.chromaAbCorrection[1] = -0.004f; // HMD chromatic aberration correction parameter 1 - hmd.chromaAbCorrection[2] = 1.014f; // HMD chromatic aberration correction parameter 2 - hmd.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3 + // Load VR stereo config for VR device parameteres (Oculus Rift CV1 parameters) + VrStereoConfig config = LoadVrStereoConfig(device); // Distortion shader (uses device lens distortion and chroma) Shader distortion = LoadShader(0, TextFormat("resources/distortion%i.fs", GLSL_VERSION)); - SetVrConfiguration(hmd, distortion); // Set Vr device parameters for stereo rendering + // Update distortion shader with lens and distortion-scale parameters + SetShaderValue(distortion, GetShaderLocation(distortion, "leftLensCenter"), + config.leftLensCenter, SHADER_UNIFORM_VEC2); + SetShaderValue(distortion, GetShaderLocation(distortion, "rightLensCenter"), + config.rightLensCenter, SHADER_UNIFORM_VEC2); + SetShaderValue(distortion, GetShaderLocation(distortion, "leftScreenCenter"), + config.leftScreenCenter, SHADER_UNIFORM_VEC2); + SetShaderValue(distortion, GetShaderLocation(distortion, "rightScreenCenter"), + config.rightScreenCenter, SHADER_UNIFORM_VEC2); + + SetShaderValue(distortion, GetShaderLocation(distortion, "scale"), + config.scale, SHADER_UNIFORM_VEC2); + SetShaderValue(distortion, GetShaderLocation(distortion, "scaleIn"), + config.scaleIn, SHADER_UNIFORM_VEC2); + SetShaderValue(distortion, GetShaderLocation(distortion, "deviceWarpParam"), + device.lensDistortionValues, SHADER_UNIFORM_VEC4); + SetShaderValue(distortion, GetShaderLocation(distortion, "chromaAbParam"), + device.chromaAbCorrection, SHADER_UNIFORM_VEC4); + + // Initialize framebuffer for stereo rendering + // NOTE: Screen size should match HMD aspect ratio + RenderTexture2D target = LoadRenderTexture(GetScreenWidth(), GetScreenHeight()); // Define the camera to look into our 3d world Camera camera = { 0 }; camera.position = (Vector3){ 5.0f, 2.0f, 5.0f }; // Camera position camera.target = (Vector3){ 0.0f, 2.0f, 0.0f }; // Camera looking at point - camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) + camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector camera.fovy = 60.0f; // Camera field-of-view Y - camera.type = CAMERA_PERSPECTIVE; // Camera type + camera.projection = CAMERA_PERSPECTIVE; // Camera type Vector3 cubePosition = { 0.0f, 0.0f, 0.0f }; @@ -81,8 +101,6 @@ int main(void) // Update //---------------------------------------------------------------------------------- UpdateCamera(&camera); // Update camera (simulator mode) - - if (IsKeyPressed(KEY_SPACE)) ToggleVrMode(); // Toggle VR mode //---------------------------------------------------------------------------------- // Draw @@ -91,18 +109,23 @@ int main(void) ClearBackground(RAYWHITE); - BeginVrDrawing(); + BeginTextureMode(target); + ClearBackground(RAYWHITE); + BeginVrStereoMode(config); + BeginMode3D(camera); - BeginMode3D(camera); + DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); + DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); + DrawGrid(40, 1.0f); - DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); - DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); + EndMode3D(); + EndVrStereoMode(); + EndTextureMode(); - DrawGrid(40, 1.0f); - - EndMode3D(); - - EndVrDrawing(); + BeginShaderMode(distortion); + DrawTextureRec(target.texture, (Rectangle){ 0, 0, (float)target.texture.width, + (float)-target.texture.height }, (Vector2){ 0.0f, 0.0f }, WHITE); + EndShaderMode(); DrawFPS(10, 10); @@ -112,11 +135,12 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- - UnloadShader(distortion); // Unload distortion shader + UnloadVrStereoConfig(config); // Unload stereo config - CloseVrSimulator(); // Close VR simulator + UnloadRenderTexture(target); // Unload stereo render fbo + UnloadShader(distortion); // Unload distortion shader - CloseWindow(); // Close window and OpenGL context + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- return 0; diff --git a/examples/core/core_window_flags.c b/examples/core/core_window_flags.c index f3448e9ea..4b20066f0 100644 --- a/examples/core/core_window_flags.c +++ b/examples/core/core_window_flags.c @@ -36,12 +36,12 @@ int main(void) */ // Set configuration flags for window creation - SetConfigFlags(FLAG_VSYNC_HINT | FLAG_MSAA_4X_HINT | FLAG_WINDOW_HIGHDPI); + //SetConfigFlags(FLAG_VSYNC_HINT | FLAG_MSAA_4X_HINT | FLAG_WINDOW_HIGHDPI); InitWindow(screenWidth, screenHeight, "raylib [core] example - window flags"); - Vector2 ballPosition = { GetScreenWidth() / 2, GetScreenHeight() / 2 }; + Vector2 ballPosition = { GetScreenWidth() / 2.0f, GetScreenHeight() / 2.0f }; Vector2 ballSpeed = { 5.0f, 4.0f }; - int ballRadius = 20; + float ballRadius = 20; int framesCounter = 0; @@ -139,13 +139,13 @@ int main(void) else ClearBackground(RAYWHITE); DrawCircleV(ballPosition, ballRadius, MAROON); - DrawRectangleLinesEx((Rectangle) { 0, 0, GetScreenWidth(), GetScreenHeight() }, 4, RAYWHITE); + DrawRectangleLinesEx((Rectangle) { 0, 0, (float)GetScreenWidth(), (float)GetScreenHeight() }, 4, RAYWHITE); DrawCircleV(GetMousePosition(), 10, DARKBLUE); DrawFPS(10, 10); - DrawText(FormatText("Screen Size: [%i, %i]", GetScreenWidth(), GetScreenHeight()), 10, 40, 10, GREEN); + DrawText(TextFormat("Screen Size: [%i, %i]", GetScreenWidth(), GetScreenHeight()), 10, 40, 10, GREEN); // Draw window state info DrawText("Following flags can be set after window creation:", 10, 60, 10, GRAY); diff --git a/examples/core/core_window_letterbox.c b/examples/core/core_window_letterbox.c index 1712b9ba5..2c3af6df6 100644 --- a/examples/core/core_window_letterbox.c +++ b/examples/core/core_window_letterbox.c @@ -64,13 +64,13 @@ int main(void) // Recalculate random colors for the bars for (int i = 0; i < 10; i++) colors[i] = (Color){ GetRandomValue(100, 250), GetRandomValue(50, 150), GetRandomValue(10, 100), 255 }; } - + // Update virtual mouse (clamped mouse value behind game screen) Vector2 mouse = GetMousePosition(); Vector2 virtualMouse = { 0 }; virtualMouse.x = (mouse.x - (GetScreenWidth() - (gameScreenWidth*scale))*0.5f)/scale; virtualMouse.y = (mouse.y - (GetScreenHeight() - (gameScreenHeight*scale))*0.5f)/scale; - virtualMouse = ClampValue(virtualMouse, (Vector2){ 0, 0 }, (Vector2){ gameScreenWidth, gameScreenHeight }); + virtualMouse = ClampValue(virtualMouse, (Vector2){ 0, 0 }, (Vector2){ (float)gameScreenWidth, (float)gameScreenHeight }); // Apply the same transformation as the virtual mouse to the real mouse (i.e. to work with raygui) //SetMouseOffset(-(GetScreenWidth() - (gameScreenWidth*scale))*0.5f, -(GetScreenHeight() - (gameScreenHeight*scale))*0.5f); @@ -90,7 +90,7 @@ int main(void) for (int i = 0; i < 10; i++) DrawRectangle(0, (gameScreenHeight/10)*i, gameScreenWidth, gameScreenHeight/10, colors[i]); DrawText("If executed inside a window,\nyou can resize the window,\nand see the screen scaling!", 10, 25, 20, WHITE); - + DrawText(TextFormat("Default Mouse: [%i , %i]", (int)mouse.x, (int)mouse.y), 350, 25, 20, GREEN); DrawText(TextFormat("Virtual Mouse: [%i , %i]", (int)virtualMouse.x, (int)virtualMouse.y), 350, 55, 20, YELLOW); @@ -98,7 +98,7 @@ int main(void) // Draw RenderTexture2D to window, properly scaled DrawTexturePro(target.texture, (Rectangle){ 0.0f, 0.0f, (float)target.texture.width, (float)-target.texture.height }, - (Rectangle){ (GetScreenWidth() - ((float)gameScreenWidth*scale))*0.5, (GetScreenHeight() - ((float)gameScreenHeight*scale))*0.5, + (Rectangle){ (GetScreenWidth() - ((float)gameScreenWidth*scale))*0.5f, (GetScreenHeight() - ((float)gameScreenHeight*scale))*0.5f, (float)gameScreenWidth*scale, (float)gameScreenHeight*scale }, (Vector2){ 0, 0 }, 0.0f, WHITE); EndDrawing(); diff --git a/examples/core/core_world_screen.c b/examples/core/core_world_screen.c index be1a96b9d..fe13b1b4c 100644 --- a/examples/core/core_world_screen.c +++ b/examples/core/core_world_screen.c @@ -26,7 +26,7 @@ int main(void) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; camera.fovy = 45.0f; - camera.type = CAMERA_PERSPECTIVE; + camera.projection = CAMERA_PERSPECTIVE; Vector3 cubePosition = { 0.0f, 0.0f, 0.0f }; Vector2 cubeScreenPosition = { 0.0f, 0.0f }; @@ -62,7 +62,7 @@ int main(void) EndMode3D(); - DrawText("Enemy: 100 / 100", cubeScreenPosition.x - MeasureText("Enemy: 100/100", 20)/2, cubeScreenPosition.y, 20, BLACK); + DrawText("Enemy: 100 / 100", (int)cubeScreenPosition.x - MeasureText("Enemy: 100/100", 20)/2, (int)cubeScreenPosition.y, 20, BLACK); DrawText("Text is always on top of the cube", (screenWidth - MeasureText("Text is always on top of the cube", 20))/2, 25, 20, GRAY); EndDrawing(); diff --git a/examples/examples_template.c b/examples/examples_template.c index 49cd5e7b1..8dc31706d 100644 --- a/examples/examples_template.c +++ b/examples/examples_template.c @@ -1,39 +1,39 @@ /* WELCOME raylib EXAMPLES CONTRIBUTOR! - - This is a bsasic template to anyone ready to contribute with some code example for the library, + + This is a basic template to anyone ready to contribute with some code example for the library, here there are some guidelines on how to create an example to be included in raylib 1. File naming: _ - Lower case filename, words separated by underscore, no more than 3-4 words in total to describe the example. referes to the primary raylib module the example is more related with (code, shapes, textures, models, shaders, raudio). i.e: core_input_multitouch, shapes_lines_bezier, shaders_palette_switch - + 2. Follow below template structure, example info should list the module, the short description and the author of the example, twitter or github info could be also provided for the author. Short description should also be used on the title of the window. - + 3. Code should be organized by sections:[Initialization]- [Update] - [Draw] - [De-Initialization] Place your code between the dotted lines for every section, please don't mix update logic with drawing and remember to unload all loaded resources. - + 4. Code should follow raylib conventions: https://github.com/raysan5/raylib/wiki/raylib-coding-conventions Try to be very organized, using line-breaks appropiately. - + 5. Add comments to the specific parts of code the example is focus on. Don't abuse with comments, try to be clear and impersonal on the comments. - + 6. Try to keep the example simple, under 300 code lines if possible. Try to avoid external dependencies. Try to avoid defining functions outside the main(). Example should be as self-contained as possible. - + 7. About external resources, they should be placed in a [resources] folder and those resources should be open and free for use and distribution. Avoid propietary content. - + 8. Try to keep the example simple but with a creative touch. Simple but beautiful examples are more appealing to users! - + 9. In case of additional information is required, just come to raylib Discord channel: example-contributions - + 10. Have fun! */ @@ -58,9 +58,9 @@ int main() const int screenHeight = 450; InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window"); - - // TODO: Load resources / Initialize variables at this point - + + // TODO: Load resources / Initialize variables at this point + SetTargetFPS(60); //-------------------------------------------------------------------------------------- @@ -79,7 +79,7 @@ int main() ClearBackground(RAYWHITE); // TODO: Draw everything that requires to be drawn at this point: - + DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); // Example EndDrawing(); @@ -88,11 +88,11 @@ int main() // De-Initialization //-------------------------------------------------------------------------------------- - + // TODO: Unload all loaded resources at this point - + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- return 0; -} \ No newline at end of file +} diff --git a/examples/models/models_animation.c b/examples/models/models_animation.c index a80c8c968..2c3348c0f 100644 --- a/examples/models/models_animation.c +++ b/examples/models/models_animation.c @@ -11,7 +11,7 @@ * ******************************************************************************************** * -* To export a model from blender, make sure it is not posed, the vertices need to be in the +* To export a model from blender, make sure it is not posed, the vertices need to be in the * same position as they would be in edit mode. * and that the scale of your models is set to 0. Scaling can be done from the export menu. * @@ -37,7 +37,7 @@ int main(void) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) camera.fovy = 45.0f; // Camera field-of-view Y - camera.type = CAMERA_PERSPECTIVE; // Camera mode type + camera.projection = CAMERA_PERSPECTIVE; // Camera mode type Model model = LoadModel("resources/guy/guy.iqm"); // Load the animated model mesh and basic data Texture2D texture = LoadTexture("resources/guy/guytex.png"); // Load model texture and set material @@ -100,7 +100,7 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- UnloadTexture(texture); // Unload texture - + // Unload model animations data for (int i = 0; i < animsCount; i++) UnloadModelAnimation(anims[i]); RL_FREE(anims); diff --git a/examples/models/models_billboard.c b/examples/models/models_billboard.c index 597e9a609..0a7e878ba 100644 --- a/examples/models/models_billboard.c +++ b/examples/models/models_billboard.c @@ -26,7 +26,7 @@ int main(void) camera.target = (Vector3){ 0.0f, 2.0f, 0.0f }; camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; camera.fovy = 45.0f; - camera.type = CAMERA_PERSPECTIVE; + camera.projection = CAMERA_PERSPECTIVE; Texture2D bill = LoadTexture("resources/billboard.png"); // Our texture billboard Vector3 billPosition = { 0.0f, 2.0f, 0.0f }; // Position where draw billboard diff --git a/examples/models/models_cubicmap.c b/examples/models/models_cubicmap.c index f50878459..0a566581e 100644 --- a/examples/models/models_cubicmap.c +++ b/examples/models/models_cubicmap.c @@ -31,7 +31,7 @@ int main(void) // NOTE: By default each cube is mapped to one part of texture atlas Texture2D texture = LoadTexture("resources/cubicmap_atlas.png"); // Load map texture - model.materials[0].maps[MAP_DIFFUSE].texture = texture; // Set map diffuse texture + model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set map diffuse texture Vector3 mapPosition = { -16.0f, 0.0f, -8.0f }; // Set model position @@ -62,7 +62,7 @@ int main(void) EndMode3D(); - DrawTextureEx(cubicmap, (Vector2){ screenWidth - cubicmap.width*4 - 20, 20 }, 0.0f, 4.0f, WHITE); + DrawTextureEx(cubicmap, (Vector2){ screenWidth - cubicmap.width*4.0f - 20, 20.0f }, 0.0f, 4.0f, WHITE); DrawRectangleLines(screenWidth - cubicmap.width*4 - 20, 20, cubicmap.width*4, cubicmap.height*4, GREEN); DrawText("cubicmap image used to", 658, 90, 10, GRAY); diff --git a/examples/models/models_first_person_maze.c b/examples/models/models_first_person_maze.c index 07c51b9ad..08a9b5cf3 100644 --- a/examples/models/models_first_person_maze.c +++ b/examples/models/models_first_person_maze.c @@ -32,14 +32,13 @@ int main(void) // NOTE: By default each cube is mapped to one part of texture atlas Texture2D texture = LoadTexture("resources/cubicmap_atlas.png"); // Load map texture - model.materials[0].maps[MAP_DIFFUSE].texture = texture; // Set map diffuse texture + model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set map diffuse texture // Get map image data to be used for collision detection - Color *mapPixels = GetImageData(imMap); + Color *mapPixels = LoadImageColors(imMap); UnloadImage(imMap); // Unload image from RAM Vector3 mapPosition = { -16.0f, 0.0f, -8.0f }; // Set model position - Vector3 playerPosition = camera.position; // Set player position SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set camera mode @@ -93,13 +92,10 @@ int main(void) ClearBackground(RAYWHITE); BeginMode3D(camera); - DrawModel(model, mapPosition, 1.0f, WHITE); // Draw maze map - //DrawCubeV(playerPosition, (Vector3){ 0.2f, 0.4f, 0.2f }, RED); // Draw player - EndMode3D(); - DrawTextureEx(cubicmap, (Vector2){ GetScreenWidth() - cubicmap.width*4 - 20, 20 }, 0.0f, 4.0f, WHITE); + DrawTextureEx(cubicmap, (Vector2){ GetScreenWidth() - cubicmap.width*4.0f - 20, 20.0f }, 0.0f, 4.0f, WHITE); DrawRectangleLines(GetScreenWidth() - cubicmap.width*4 - 20, 20, cubicmap.width*4, cubicmap.height*4, GREEN); // Draw player position radar @@ -113,13 +109,13 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- - free(mapPixels); // Unload color array + UnloadImageColors(mapPixels); // Unload color array - UnloadTexture(cubicmap); // Unload cubicmap texture - UnloadTexture(texture); // Unload map texture - UnloadModel(model); // Unload map model + UnloadTexture(cubicmap); // Unload cubicmap texture + UnloadTexture(texture); // Unload map texture + UnloadModel(model); // Unload map model - CloseWindow(); // Close window and OpenGL context + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- return 0; diff --git a/examples/models/models_geometric_shapes.c b/examples/models/models_geometric_shapes.c index 39477927c..c1feb8027 100644 --- a/examples/models/models_geometric_shapes.c +++ b/examples/models/models_geometric_shapes.c @@ -26,7 +26,7 @@ int main(void) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; camera.fovy = 45.0f; - camera.type = CAMERA_PERSPECTIVE; + camera.projection = CAMERA_PERSPECTIVE; SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- diff --git a/examples/models/models_gltf_animation.c b/examples/models/models_gltf_animation.c new file mode 100644 index 000000000..69df2982b --- /dev/null +++ b/examples/models/models_gltf_animation.c @@ -0,0 +1,122 @@ +/******************************************************************************************* +* +* raylib [models] example - Load 3d gltf model with animations and play them +* +* This example has been created using raylib 3.5 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) +* +* Example contributed by Hristo Stamenov (@object71) and reviewed by Ramon Santamaria (@raysan5) +* +* Copyright (c) 2021 Hristo Stamenov (@object71) and Ramon Santamaria (@raysan5) +* +******************************************************************************************** +* +* To export a model from blender, make sure it is not posed, the vertices need to be in the +* same position as they would be in edit mode. +* and that the scale of your models is set to 0. Scaling can be done from the export menu. +* +********************************************************************************************/ + +#include "raylib.h" + +#include + + +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib [models] example - model animation"); + + // Define the camera to look into our 3d world + Camera camera = { 0 }; + camera.position = (Vector3){ 10.0f, 10.0f, 10.0f }; // Camera position + camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point + camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) + camera.fovy = 45.0f; // Camera field-of-view Y + camera.projection = CAMERA_PERSPECTIVE; // Camera mode type + + Model model = LoadModel("resources/gltf/rigged_figure.glb"); // Load the animated model mesh and + // basic data +// Texture2D texture = LoadTexture("resources/guy/guytex.png"); // Load model texture and set material +// SetMaterialTexture(&model.materials[0], MAP_DIFFUSE, texture); // Set model material map texture + + Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position + + // Load animation data + int animsCount = 0; + ModelAnimation *anims = LoadModelAnimations("resources/gltf/rigged_figure.glb", &animsCount); + int animFrameCounter = 0; + int animationDirection = 1; + + SetCameraMode(camera, CAMERA_FREE); // Set free camera mode + + SetTargetFPS(30); // Set our game to run at 60 frames-per-second + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key + { + // Update + //---------------------------------------------------------------------------------- + UpdateCamera(&camera); + + // Play animation when spacebar is held down + if (IsKeyDown(KEY_SPACE)) + { + animFrameCounter += animationDirection; + + if (animFrameCounter >= anims[0].frameCount || animFrameCounter <= 0) + { + animationDirection *= -1; + animFrameCounter += animationDirection; + } + + UpdateModelAnimation(model, anims[0], animFrameCounter); + } + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + + ClearBackground(RAYWHITE); + + BeginMode3D(camera); + + DrawModelEx(model, position, (Vector3){ 1.0f, 0.0f, 0.0f }, -90.0f, (Vector3){ 1.0f, 1.0f, 1.0f }, WHITE); + + for (int i = 0; i < model.boneCount; i++) + { + DrawSphere(anims[0].framePoses[animFrameCounter][i].translation, 0.01f, RED); + } + + DrawGrid(10, 1.0f); // Draw a grid + + EndMode3D(); + + DrawText("PRESS SPACE to PLAY MODEL ANIMATION", 10, 10, 20, MAROON); + DrawText("(cc4) Rigged Figure by @Cesium", screenWidth - 200, screenHeight - 20, 10, GRAY); + + EndDrawing(); + //---------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- +// UnloadTexture(texture); // Unload texture + + // Unload model animations data + for (int i = 0; i < animsCount; i++) UnloadModelAnimation(anims[i]); + RL_FREE(anims); + + UnloadModel(model); // Unload model + + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} diff --git a/examples/models/models_gltf_model.c b/examples/models/models_gltf_model.c new file mode 100644 index 000000000..3475b3f0c --- /dev/null +++ b/examples/models/models_gltf_model.c @@ -0,0 +1,107 @@ +/******************************************************************************************* +* +* raylib [models] example - Load 3d gltf model +* +* This example has been created using raylib 3.5 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) +* +* Example contributed by Hristo Stamenov (@object71) and reviewed by Ramon Santamaria (@raysan5) +* +* Copyright (c) 2021 Hristo Stamenov (@object71) and Ramon Santamaria (@raysan5) +* +******************************************************************************************** +* +* To export a model from blender, make sure it is not posed, the vertices need to be in the +* same position as they would be in edit mode. +* and that the scale of your models is set to 0. Scaling can be done from the export menu. +* +********************************************************************************************/ + +#include "raylib.h" + +#include + +#define MAX_MODELS 7 + +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib [models] example - model"); + + // Define the camera to look into our 3d world + Camera camera = { 0 }; + camera.position = (Vector3){ 10.0f, 10.0f, 10.0f }; // Camera position + camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point + camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) + camera.fovy = 45.0f; // Camera field-of-view Y + camera.projection = CAMERA_PERSPECTIVE; // Camera mode type + + Model model[MAX_MODELS] = { 0 }; + + model[0] = LoadModel("resources/gltf/raylib_32x32.glb"); + model[1] = LoadModel("resources/gltf/rigged_figure.glb"); + model[2] = LoadModel("resources/gltf/GearboxAssy.glb"); + model[3] = LoadModel("resources/gltf/BoxAnimated.glb"); + model[4] = LoadModel("resources/gltf/AnimatedTriangle.gltf"); + model[5] = LoadModel("resources/gltf/AnimatedMorphCube.glb"); + model[6] = LoadModel("resources/gltf/vertex_colored_object.glb"); + + int currentModel = 0; + + Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position + + SetCameraMode(camera, CAMERA_FREE); // Set free camera mode + + SetTargetFPS(60); // Set our game to run at 60 frames-per-second + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key + { + // Update + //---------------------------------------------------------------------------------- + UpdateCamera(&camera); + + if (IsKeyReleased(KEY_RIGHT)) + { + currentModel++; + if (currentModel == MAX_MODELS) currentModel = 0; + } + + if (IsKeyReleased(KEY_LEFT)) + { + currentModel--; + if (currentModel < 0) currentModel = MAX_MODELS - 1; + } + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + + ClearBackground(SKYBLUE); + + BeginMode3D(camera); + + DrawModelEx(model[currentModel], position, (Vector3){ 0.0f, 1.0f, 0.0f }, 180.0f, (Vector3){ 2.0f, 2.0f, 2.0f }, WHITE); + + DrawGrid(10, 1.0f); // Draw a grid + + EndMode3D(); + + EndDrawing(); + //---------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + for(int i = 0; i < MAX_MODELS; i++) UnloadModel(model[i]); // Unload models + + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} diff --git a/examples/models/models_gltf_model.png b/examples/models/models_gltf_model.png new file mode 100644 index 000000000..654444b84 Binary files /dev/null and b/examples/models/models_gltf_model.png differ diff --git a/examples/models/models_heightmap.c b/examples/models/models_heightmap.c index bf7b0e0af..03479a9bc 100644 --- a/examples/models/models_heightmap.c +++ b/examples/models/models_heightmap.c @@ -29,7 +29,7 @@ int main(void) Mesh mesh = GenMeshHeightmap(image, (Vector3){ 16, 8, 16 }); // Generate heightmap mesh (RAM and VRAM) Model model = LoadModelFromMesh(mesh); // Load model from generated mesh - model.materials[0].maps[MAP_DIFFUSE].texture = texture; // Set map diffuse texture + model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set map diffuse texture Vector3 mapPosition = { -8.0f, 0.0f, -8.0f }; // Define model position UnloadImage(image); // Unload heightmap image from RAM, already uploaded to VRAM diff --git a/examples/models/models_loading.c b/examples/models/models_loading.c index af9c5e390..16f122ee8 100644 --- a/examples/models/models_loading.c +++ b/examples/models/models_loading.c @@ -9,7 +9,7 @@ * - GLTF > Modern text/binary file format, includes lot of information and it could * also reference external files, raylib will try loading mesh and materials data * - IQM > Binary file format including mesh vertex data but also animation data, -* raylib can load .iqm animations. +* raylib can load .iqm animations. * * This example has been created using raylib 2.6 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) @@ -35,15 +35,15 @@ int main(void) camera.target = (Vector3){ 0.0f, 10.0f, 0.0f }; // Camera looking at point camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) camera.fovy = 45.0f; // Camera field-of-view Y - camera.type = CAMERA_PERSPECTIVE; // Camera mode type + camera.projection = CAMERA_PERSPECTIVE; // Camera mode type Model model = LoadModel("resources/models/castle.obj"); // Load model Texture2D texture = LoadTexture("resources/models/castle_diffuse.png"); // Load model texture - model.materials[0].maps[MAP_DIFFUSE].texture = texture; // Set map diffuse texture + model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set map diffuse texture Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position - - BoundingBox bounds = MeshBoundingBox(model.meshes[0]); // Set model bounds + + BoundingBox bounds = GetMeshBoundingBox(model.meshes[0]); // Set model bounds // NOTE: bounds are calculated from the original size of the model, // if model is scaled on drawing, bounds must be also scaled @@ -61,7 +61,7 @@ int main(void) // Update //---------------------------------------------------------------------------------- UpdateCamera(&camera); - + // Load new models/textures on drag&drop if (IsFileDropped()) { @@ -76,10 +76,10 @@ int main(void) { UnloadModel(model); // Unload previous model model = LoadModel(droppedFiles[0]); // Load new model - model.materials[0].maps[MAP_DIFFUSE].texture = texture; // Set current map diffuse texture + model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set current map diffuse texture + + bounds = GetMeshBoundingBox(model.meshes[0]); - bounds = MeshBoundingBox(model.meshes[0]); - // TODO: Move camera position from target enough distance to visualize model properly } else if (IsFileExtension(droppedFiles[0], ".png")) // Texture file formats supported @@ -87,7 +87,7 @@ int main(void) // Unload current model texture and load new one UnloadTexture(texture); texture = LoadTexture(droppedFiles[0]); - model.materials[0].maps[MAP_DIFFUSE].texture = texture; + model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; } } @@ -95,10 +95,10 @@ int main(void) } // Select model on mouse click - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) { // Check collision between ray and box - if (CheckCollisionRayBox(GetMouseRay(GetMousePosition(), camera), bounds)) selected = !selected; + if (GetRayCollisionBox(GetMouseRay(GetMousePosition(), camera), bounds).hit) selected = !selected; else selected = false; } //---------------------------------------------------------------------------------- @@ -118,7 +118,7 @@ int main(void) if (selected) DrawBoundingBox(bounds, GREEN); // Draw selection box EndMode3D(); - + DrawText("Drag & drop model to load mesh/texture.", 10, GetScreenHeight() - 20, 10, DARKGRAY); if (selected) DrawText("MODEL SELECTED", GetScreenWidth() - 110, 10, 10, GREEN); diff --git a/examples/models/models_material_pbr.c b/examples/models/models_material_pbr.c index 0104d3922..dfef69da1 100644 --- a/examples/models/models_material_pbr.c +++ b/examples/models/models_material_pbr.c @@ -14,18 +14,31 @@ #include "raylib.h" #include "raymath.h" +#include "rlgl.h" #include #define RLIGHTS_IMPLEMENTATION #include "rlights.h" +#if defined(PLATFORM_DESKTOP) + #define GLSL_VERSION 330 +#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB + #define GLSL_VERSION 100 +#endif + #define CUBEMAP_SIZE 1024 // Cubemap texture size #define IRRADIANCE_SIZE 32 // Irradiance texture size #define PREFILTERED_SIZE 256 // Prefiltered HDR environment texture size #define BRDF_SIZE 512 // BRDF LUT texture size -#define LIGHT_DISTANCE 1000.0f -#define LIGHT_HEIGHT 1.0f +#define LIGHT_DISTANCE 1000.0f +#define LIGHT_HEIGHT 1.0f + +// PBR texture maps generation +static TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int size, int format); // Generate cubemap (6 faces) from equirectangular (panorama) texture +static TextureCubemap GenTextureIrradiance(Shader shader, TextureCubemap cubemap, int size); // Generate irradiance cubemap using cubemap texture +static TextureCubemap GenTexturePrefilter(Shader shader, TextureCubemap cubemap, int size); // Generate prefilter cubemap using cubemap texture +static Texture2D GenTextureBRDF(Shader shader, int size); // Generate a generic BRDF texture // PBR material loading static Material LoadMaterialPBR(Color albedo, float metalness, float roughness); @@ -46,7 +59,7 @@ int main(void) camera.target = (Vector3){ 0.0f, 0.5f, 0.0f }; // Camera looking at point camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) camera.fovy = 45.0f; // Camera field-of-view Y - camera.type = CAMERA_PERSPECTIVE; // Camera mode type + camera.projection = CAMERA_PERSPECTIVE; // Camera mode type // Load model and PBR material Model model = LoadModel("resources/pbr/trooper.obj"); @@ -78,7 +91,7 @@ int main(void) // Send to material PBR shader camera view position float cameraPos[3] = { camera.position.x, camera.position.y, camera.position.z }; - SetShaderValue(model.materials[0].shader, model.materials[0].shader.locs[LOC_VECTOR_VIEW], cameraPos, UNIFORM_VEC3); + SetShaderValue(model.materials[0].shader, model.materials[0].shader.locs[SHADER_LOC_VECTOR_VIEW], cameraPos, SHADER_UNIFORM_VEC3); //---------------------------------------------------------------------------------- // Draw @@ -120,115 +133,411 @@ static Material LoadMaterialPBR(Color albedo, float metalness, float roughness) Material mat = LoadMaterialDefault(); // Initialize material to default // Load PBR shader (requires several maps) -#if defined(PLATFORM_DESKTOP) - mat.shader = LoadShader("resources/shaders/glsl330/pbr.vs", "resources/shaders/glsl330/pbr.fs"); -#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB - mat.shader = LoadShader("resources/shaders/glsl100/pbr.vs", "resources/shaders/glsl100/pbr.fs"); -#endif + mat.shader = LoadShader(TextFormat("resources/shaders/glsl%i/pbr.vs", GLSL_VERSION), + TextFormat("resources/shaders/glsl%i/pbr.fs", GLSL_VERSION)); // Get required locations points for PBR material // NOTE: Those location names must be available and used in the shader code - mat.shader.locs[LOC_MAP_ALBEDO] = GetShaderLocation(mat.shader, "albedo.sampler"); - mat.shader.locs[LOC_MAP_METALNESS] = GetShaderLocation(mat.shader, "metalness.sampler"); - mat.shader.locs[LOC_MAP_NORMAL] = GetShaderLocation(mat.shader, "normals.sampler"); - mat.shader.locs[LOC_MAP_ROUGHNESS] = GetShaderLocation(mat.shader, "roughness.sampler"); - mat.shader.locs[LOC_MAP_OCCLUSION] = GetShaderLocation(mat.shader, "occlusion.sampler"); - //mat.shader.locs[LOC_MAP_EMISSION] = GetShaderLocation(mat.shader, "emission.sampler"); - //mat.shader.locs[LOC_MAP_HEIGHT] = GetShaderLocation(mat.shader, "height.sampler"); - mat.shader.locs[LOC_MAP_IRRADIANCE] = GetShaderLocation(mat.shader, "irradianceMap"); - mat.shader.locs[LOC_MAP_PREFILTER] = GetShaderLocation(mat.shader, "prefilterMap"); - mat.shader.locs[LOC_MAP_BRDF] = GetShaderLocation(mat.shader, "brdfLUT"); + mat.shader.locs[SHADER_LOC_MAP_ALBEDO] = GetShaderLocation(mat.shader, "albedo.sampler"); + mat.shader.locs[SHADER_LOC_MAP_METALNESS] = GetShaderLocation(mat.shader, "metalness.sampler"); + mat.shader.locs[SHADER_LOC_MAP_NORMAL] = GetShaderLocation(mat.shader, "normals.sampler"); + mat.shader.locs[SHADER_LOC_MAP_ROUGHNESS] = GetShaderLocation(mat.shader, "roughness.sampler"); + mat.shader.locs[SHADER_LOC_MAP_OCCLUSION] = GetShaderLocation(mat.shader, "occlusion.sampler"); + //mat.shader.locs[SHADER_LOC_MAP_EMISSION] = GetShaderLocation(mat.shader, "emission.sampler"); + //mat.shader.locs[SHADER_LOC_MAP_HEIGHT] = GetShaderLocation(mat.shader, "height.sampler"); + mat.shader.locs[SHADER_LOC_MAP_IRRADIANCE] = GetShaderLocation(mat.shader, "irradianceMap"); + mat.shader.locs[SHADER_LOC_MAP_PREFILTER] = GetShaderLocation(mat.shader, "prefilterMap"); + mat.shader.locs[SHADER_LOC_MAP_BRDF] = GetShaderLocation(mat.shader, "brdfLUT"); // Set view matrix location - mat.shader.locs[LOC_MATRIX_MODEL] = GetShaderLocation(mat.shader, "matModel"); - //mat.shader.locs[LOC_MATRIX_VIEW] = GetShaderLocation(mat.shader, "view"); - mat.shader.locs[LOC_VECTOR_VIEW] = GetShaderLocation(mat.shader, "viewPos"); + mat.shader.locs[SHADER_LOC_MATRIX_MODEL] = GetShaderLocation(mat.shader, "matModel"); + //mat.shader.locs[SHADER_LOC_MATRIX_VIEW] = GetShaderLocation(mat.shader, "view"); + mat.shader.locs[SHADER_LOC_VECTOR_VIEW] = GetShaderLocation(mat.shader, "viewPos"); // Set PBR standard maps - mat.maps[MAP_ALBEDO].texture = LoadTexture("resources/pbr/trooper_albedo.png"); - mat.maps[MAP_NORMAL].texture = LoadTexture("resources/pbr/trooper_normals.png"); - mat.maps[MAP_METALNESS].texture = LoadTexture("resources/pbr/trooper_metalness.png"); - mat.maps[MAP_ROUGHNESS].texture = LoadTexture("resources/pbr/trooper_roughness.png"); - mat.maps[MAP_OCCLUSION].texture = LoadTexture("resources/pbr/trooper_ao.png"); - + mat.maps[MATERIAL_MAP_ALBEDO].texture = LoadTexture("resources/pbr/trooper_albedo.png"); + mat.maps[MATERIAL_MAP_NORMAL].texture = LoadTexture("resources/pbr/trooper_normals.png"); + mat.maps[MATERIAL_MAP_METALNESS].texture = LoadTexture("resources/pbr/trooper_metalness.png"); + mat.maps[MATERIAL_MAP_ROUGHNESS].texture = LoadTexture("resources/pbr/trooper_roughness.png"); + mat.maps[MATERIAL_MAP_OCCLUSION].texture = LoadTexture("resources/pbr/trooper_ao.png"); + // Set textures filtering for better quality - SetTextureFilter(mat.maps[MAP_ALBEDO].texture, FILTER_BILINEAR); - SetTextureFilter(mat.maps[MAP_NORMAL].texture, FILTER_BILINEAR); - SetTextureFilter(mat.maps[MAP_METALNESS].texture, FILTER_BILINEAR); - SetTextureFilter(mat.maps[MAP_ROUGHNESS].texture, FILTER_BILINEAR); - SetTextureFilter(mat.maps[MAP_OCCLUSION].texture, FILTER_BILINEAR); - + SetTextureFilter(mat.maps[MATERIAL_MAP_ALBEDO].texture, FILTER_BILINEAR); + SetTextureFilter(mat.maps[MATERIAL_MAP_NORMAL].texture, FILTER_BILINEAR); + SetTextureFilter(mat.maps[MATERIAL_MAP_METALNESS].texture, FILTER_BILINEAR); + SetTextureFilter(mat.maps[MATERIAL_MAP_ROUGHNESS].texture, FILTER_BILINEAR); + SetTextureFilter(mat.maps[MATERIAL_MAP_OCCLUSION].texture, FILTER_BILINEAR); + // Enable sample usage in shader for assigned textures - SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "albedo.useSampler"), (int[1]){ 1 }, UNIFORM_INT); - SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "normals.useSampler"), (int[1]){ 1 }, UNIFORM_INT); - SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "metalness.useSampler"), (int[1]){ 1 }, UNIFORM_INT); - SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "roughness.useSampler"), (int[1]){ 1 }, UNIFORM_INT); - SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "occlusion.useSampler"), (int[1]){ 1 }, UNIFORM_INT); + SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "albedo.useSampler"), (int[1]){ 1 }, SHADER_UNIFORM_INT); + SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "normals.useSampler"), (int[1]){ 1 }, SHADER_UNIFORM_INT); + SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "metalness.useSampler"), (int[1]){ 1 }, SHADER_UNIFORM_INT); + SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "roughness.useSampler"), (int[1]){ 1 }, SHADER_UNIFORM_INT); + SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "occlusion.useSampler"), (int[1]){ 1 }, SHADER_UNIFORM_INT); int renderModeLoc = GetShaderLocation(mat.shader, "renderMode"); - SetShaderValue(mat.shader, renderModeLoc, (int[1]){ 0 }, UNIFORM_INT); + SetShaderValue(mat.shader, renderModeLoc, (int[1]){ 0 }, SHADER_UNIFORM_INT); // Set up material properties color - mat.maps[MAP_ALBEDO].color = albedo; - mat.maps[MAP_NORMAL].color = (Color){ 128, 128, 255, 255 }; - mat.maps[MAP_METALNESS].value = metalness; - mat.maps[MAP_ROUGHNESS].value = roughness; - mat.maps[MAP_OCCLUSION].value = 1.0f; - mat.maps[MAP_EMISSION].value = 0.5f; - mat.maps[MAP_HEIGHT].value = 0.5f; - + mat.maps[MATERIAL_MAP_ALBEDO].color = albedo; + mat.maps[MATERIAL_MAP_NORMAL].color = (Color){ 128, 128, 255, 255 }; + mat.maps[MATERIAL_MAP_METALNESS].value = metalness; + mat.maps[MATERIAL_MAP_ROUGHNESS].value = roughness; + mat.maps[MATERIAL_MAP_OCCLUSION].value = 1.0f; + mat.maps[MATERIAL_MAP_EMISSION].value = 0.5f; + mat.maps[MATERIAL_MAP_HEIGHT].value = 0.5f; + // Generate cubemap from panorama texture //-------------------------------------------------------------------------------------------------------- - Texture2D panorama = LoadTexture("resources/dresden_square.hdr"); + Texture2D panorama = LoadTexture("resources/dresden_square_2k.hdr"); + // Load equirectangular to cubemap shader -#if defined(PLATFORM_DESKTOP) - Shader shdrCubemap = LoadShader("resources/shaders/glsl330/cubemap.vs", "resources/shaders/glsl330/cubemap.fs"); -#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB - Shader shdrCubemap = LoadShader("resources/shaders/glsl100/cubemap.vs", "resources/shaders/glsl100/cubemap.fs"); -#endif - SetShaderValue(shdrCubemap, GetShaderLocation(shdrCubemap, "equirectangularMap"), (int[1]){ 0 }, UNIFORM_INT); - TextureCubemap cubemap = GenTextureCubemap(shdrCubemap, panorama, CUBEMAP_SIZE, UNCOMPRESSED_R32G32B32); + Shader shdrCubemap = LoadShader(TextFormat("resources/shaders/glsl%i/pbr.vs", GLSL_VERSION), + TextFormat("resources/shaders/glsl%i/pbr.fs", GLSL_VERSION)); + + SetShaderValue(shdrCubemap, GetShaderLocation(shdrCubemap, "equirectangularMap"), (int[1]){ 0 }, SHADER_UNIFORM_INT); + TextureCubemap cubemap = GenTextureCubemap(shdrCubemap, panorama, CUBEMAP_SIZE, PIXELFORMAT_UNCOMPRESSED_R32G32B32); UnloadTexture(panorama); UnloadShader(shdrCubemap); //-------------------------------------------------------------------------------------------------------- - + // Generate irradiance map from cubemap texture //-------------------------------------------------------------------------------------------------------- // Load irradiance (GI) calculation shader -#if defined(PLATFORM_DESKTOP) - Shader shdrIrradiance = LoadShader("resources/shaders/glsl330/skybox.vs", "resources/shaders/glsl330/irradiance.fs"); -#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB - Shader shdrIrradiance = LoadShader("resources/shaders/glsl100/skybox.vs", "resources/shaders/glsl100/irradiance.fs"); -#endif - SetShaderValue(shdrIrradiance, GetShaderLocation(shdrIrradiance, "environmentMap"), (int[1]){ 0 }, UNIFORM_INT); - mat.maps[MAP_IRRADIANCE].texture = GenTextureIrradiance(shdrIrradiance, cubemap, IRRADIANCE_SIZE); + Shader shdrIrradiance = LoadShader(TextFormat("resources/shaders/glsl%i/skybox.vs", GLSL_VERSION), + TextFormat("resources/shaders/glsl%i/irradiance.fs", GLSL_VERSION)); + + SetShaderValue(shdrIrradiance, GetShaderLocation(shdrIrradiance, "environmentMap"), (int[1]){ 0 }, SHADER_UNIFORM_INT); + mat.maps[MATERIAL_MAP_IRRADIANCE].texture = GenTextureIrradiance(shdrIrradiance, cubemap, IRRADIANCE_SIZE); UnloadShader(shdrIrradiance); //-------------------------------------------------------------------------------------------------------- - + // Generate prefilter map from cubemap texture //-------------------------------------------------------------------------------------------------------- // Load reflection prefilter calculation shader -#if defined(PLATFORM_DESKTOP) - Shader shdrPrefilter = LoadShader("resources/shaders/glsl330/skybox.vs", "resources/shaders/glsl330/prefilter.fs"); -#else - Shader shdrPrefilter = LoadShader("resources/shaders/glsl100/skybox.vs", "resources/shaders/glsl100/prefilter.fs"); -#endif - SetShaderValue(shdrPrefilter, GetShaderLocation(shdrPrefilter, "environmentMap"), (int[1]){ 0 }, UNIFORM_INT); - mat.maps[MAP_PREFILTER].texture = GenTexturePrefilter(shdrPrefilter, cubemap, PREFILTERED_SIZE); + Shader shdrPrefilter = LoadShader(TextFormat("resources/shaders/glsl%i/skybox.vs", GLSL_VERSION), + TextFormat("resources/shaders/glsl%i/prefilter.fs", GLSL_VERSION)); + + SetShaderValue(shdrPrefilter, GetShaderLocation(shdrPrefilter, "environmentMap"), (int[1]){ 0 }, SHADER_UNIFORM_INT); + mat.maps[MATERIAL_MAP_PREFILTER].texture = GenTexturePrefilter(shdrPrefilter, cubemap, PREFILTERED_SIZE); UnloadTexture(cubemap); UnloadShader(shdrPrefilter); //-------------------------------------------------------------------------------------------------------- - + // Generate BRDF (bidirectional reflectance distribution function) texture (using shader) //-------------------------------------------------------------------------------------------------------- -#if defined(PLATFORM_DESKTOP) - Shader shdrBRDF = LoadShader("resources/shaders/glsl330/brdf.vs", "resources/shaders/glsl330/brdf.fs"); -#else - Shader shdrBRDF = LoadShader("resources/shaders/glsl100/brdf.vs", "resources/shaders/glsl100/brdf.fs"); -#endif - mat.maps[MAP_BRDF].texture = GenTextureBRDF(shdrBRDF, BRDF_SIZE); + Shader shdrBRDF = LoadShader(TextFormat("resources/shaders/glsl%i/brdf.vs", GLSL_VERSION), + TextFormat("resources/shaders/glsl%i/brdf.fs", GLSL_VERSION)); + + mat.maps[MATERIAL_MAP_BRDG].texture = GenTextureBRDF(shdrBRDF, BRDF_SIZE); UnloadShader(shdrBRDF); //-------------------------------------------------------------------------------------------------------- return mat; } + +// Texture maps generation (PBR) +//------------------------------------------------------------------------------------------- +// Generate cubemap texture from HDR texture +static TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int size, int format) +{ + TextureCubemap cubemap = { 0 }; + + rlDisableBackfaceCulling(); // Disable backface culling to render inside the cube + + // STEP 1: Setup framebuffer + //------------------------------------------------------------------------------------------ + unsigned int rbo = rlLoadTextureDepth(size, size, true); + cubemap.id = rlLoadTextureCubemap(NULL, size, format); + + unsigned int fbo = rlLoadFramebuffer(size, size); + rlFramebufferAttach(fbo, rbo, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER, 0); + rlFramebufferAttach(fbo, cubemap.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X, 0); + + // Check if framebuffer is complete with attachments (valid) + if (rlFramebufferComplete(fbo)) TraceLog(LOG_INFO, "FBO: [ID %i] Framebuffer object created successfully", fbo); + //------------------------------------------------------------------------------------------ + + // STEP 2: Draw to framebuffer + //------------------------------------------------------------------------------------------ + // NOTE: Shader is used to convert HDR equirectangular environment map to cubemap equivalent (6 faces) + rlEnableShader(shader.id); + + // Define projection matrix and send it to shader + Matrix matFboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR); + rlSetUniformMatrix(shader.locs[SHADER_LOC_MATRIX_PROJECTION], matFboProjection); + + // Define view matrix for every side of the cubemap + Matrix fboViews[6] = { + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ -1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 1.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 1.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, -1.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 1.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, -1.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }) + }; + + rlViewport(0, 0, size, size); // Set viewport to current fbo dimensions + + // Activate and enable texture for drawing to cubemap faces + rlActiveTextureSlot(0); + rlEnableTexture(panorama.id); + + for (int i = 0; i < 6; i++) + { + // Set the view matrix for the current cube face + rlSetUniformMatrix(shader.locs[SHADER_LOC_MATRIX_VIEW], fboViews[i]); + + // Select the current cubemap face attachment for the fbo + // WARNING: This function by default enables->attach->disables fbo!!! + rlFramebufferAttach(fbo, cubemap.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X + i, 0); + rlEnableFramebuffer(fbo); + + // Load and draw a cube, it uses the current enabled texture + rlClearScreenBuffers(); + rlLoadDrawCube(); + + // ALTERNATIVE: Try to use internal batch system to draw the cube instead of rlLoadDrawCube + // for some reason this method does not work, maybe due to cube triangles definition? normals pointing out? + // TODO: Investigate this issue... + //rlSetTexture(panorama.id); // WARNING: It must be called after enabling current framebuffer if using internal batch system! + //rlClearScreenBuffers(); + //DrawCubeV(Vector3Zero(), Vector3One(), WHITE); + //rlDrawRenderBatchActive(); + } + //------------------------------------------------------------------------------------------ + + // STEP 3: Unload framebuffer and reset state + //------------------------------------------------------------------------------------------ + rlDisableShader(); // Unbind shader + rlDisableTexture(); // Unbind texture + rlDisableFramebuffer(); // Unbind framebuffer + rlUnloadFramebuffer(fbo); // Unload framebuffer (and automatically attached depth texture/renderbuffer) + + // Reset viewport dimensions to default + rlViewport(0, 0, rlGetFramebufferWidth(), rlGetFramebufferHeight()); + rlEnableBackfaceCulling(); + //------------------------------------------------------------------------------------------ + + cubemap.width = size; + cubemap.height = size; + cubemap.mipmaps = 1; + cubemap.format = PIXELFORMAT_UNCOMPRESSED_R32G32B32; + + return cubemap; +} + +// Generate irradiance texture using cubemap data +static TextureCubemap GenTextureIrradiance(Shader shader, TextureCubemap cubemap, int size) +{ + TextureCubemap irradiance = { 0 }; + + rlDisableBackfaceCulling(); // Disable backface culling to render inside the cube + + // STEP 1: Setup framebuffer + //------------------------------------------------------------------------------------------ + unsigned int rbo = rlLoadTextureDepth(size, size, true); + irradiance.id = rlLoadTextureCubemap(NULL, size, PIXELFORMAT_UNCOMPRESSED_R32G32B32); + + unsigned int fbo = rlLoadFramebuffer(size, size); + rlFramebufferAttach(fbo, rbo, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER, 0); + rlFramebufferAttach(fbo, cubemap.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X, 0); + //------------------------------------------------------------------------------------------ + + // STEP 2: Draw to framebuffer + //------------------------------------------------------------------------------------------ + // NOTE: Shader is used to solve diffuse integral by convolution to create an irradiance cubemap + rlEnableShader(shader.id); + + // Define projection matrix and send it to shader + Matrix matFboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR); + rlSetUniformMatrix(shader.locs[SHADER_LOC_MATRIX_PROJECTION], matFboProjection); + + // Define view matrix for every side of the cubemap + Matrix fboViews[6] = { + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ -1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 1.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 1.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, -1.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 1.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, -1.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }) + }; + + rlActiveTextureSlot(0); + rlEnableTextureCubemap(cubemap.id); + + rlViewport(0, 0, size, size); // Set viewport to current fbo dimensions + + for (int i = 0; i < 6; i++) + { + rlSetUniformMatrix(shader.locs[SHADER_LOC_MATRIX_VIEW], fboViews[i]); + rlFramebufferAttach(fbo, irradiance.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X + i, 0); + + rlEnableFramebuffer(fbo); + rlClearScreenBuffers(); + rlLoadDrawCube(); + } + //------------------------------------------------------------------------------------------ + + // STEP 3: Unload framebuffer and reset state + //------------------------------------------------------------------------------------------ + rlDisableShader(); // Unbind shader + rlDisableTexture(); // Unbind texture + rlDisableFramebuffer(); // Unbind framebuffer + rlUnloadFramebuffer(fbo); // Unload framebuffer (and automatically attached depth texture/renderbuffer) + + // Reset viewport dimensions to default + rlViewport(0, 0, rlGetFramebufferWidth(), rlGetFramebufferHeight()); + rlEnableBackfaceCulling(); + //------------------------------------------------------------------------------------------ + + irradiance.width = size; + irradiance.height = size; + irradiance.mipmaps = 1; + irradiance.format = PIXELFORMAT_UNCOMPRESSED_R32G32B32; + + return irradiance; +} + +// Generate prefilter texture using cubemap data +static TextureCubemap GenTexturePrefilter(Shader shader, TextureCubemap cubemap, int size) +{ + TextureCubemap prefilter = { 0 }; + + rlDisableBackfaceCulling(); // Disable backface culling to render inside the cube + + // STEP 1: Setup framebuffer + //------------------------------------------------------------------------------------------ + unsigned int rbo = rlLoadTextureDepth(size, size, true); + prefilter.id = rlLoadTextureCubemap(NULL, size, PIXELFORMAT_UNCOMPRESSED_R32G32B32); + rlTextureParameters(prefilter.id, RL_TEXTURE_MIN_FILTER, RL_TEXTURE_FILTER_MIP_LINEAR); + + unsigned int fbo = rlLoadFramebuffer(size, size); + rlFramebufferAttach(fbo, rbo, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER, 0); + rlFramebufferAttach(fbo, cubemap.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X, 0); + //------------------------------------------------------------------------------------------ + + // Generate mipmaps for the prefiltered HDR texture + //glGenerateMipmap(GL_TEXTURE_CUBE_MAP); // TODO! + + // STEP 2: Draw to framebuffer + //------------------------------------------------------------------------------------------ + // NOTE: Shader is used to prefilter HDR and store data into mipmap levels + + // Define projection matrix and send it to shader + Matrix fboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR); + rlEnableShader(shader.id); + rlSetUniformMatrix(shader.locs[SHADER_LOC_MATRIX_PROJECTION], fboProjection); + + // Define view matrix for every side of the cubemap + Matrix fboViews[6] = { + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ -1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 1.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 1.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, -1.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 1.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, -1.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }) + }; + + rlActiveTextureSlot(0); + rlEnableTextureCubemap(cubemap.id); + + // TODO: Locations should be taken out of this function... too shader dependant... + int roughnessLoc = rlGetLocationUniform(shader.id, "roughness"); + + rlEnableFramebuffer(fbo); + + #define MAX_MIPMAP_LEVELS 5 // Max number of prefilter texture mipmaps + + for (int mip = 0; mip < MAX_MIPMAP_LEVELS; mip++) + { + // Resize framebuffer according to mip-level size. + unsigned int mipWidth = size*(int)powf(0.5f, (float)mip); + unsigned int mipHeight = size*(int)powf(0.5f, (float)mip); + + rlViewport(0, 0, mipWidth, mipHeight); + + //glBindRenderbuffer(GL_RENDERBUFFER, rbo); + //glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, mipWidth, mipHeight); + + float roughness = (float)mip/(float)(MAX_MIPMAP_LEVELS - 1); + rlSetUniform(roughnessLoc, &roughness, SHADER_UNIFORM_FLOAT, 1); + + for (int i = 0; i < 6; i++) + { + rlSetUniformMatrix(shader.locs[SHADER_LOC_MATRIX_VIEW], fboViews[i]); + rlFramebufferAttach(fbo, prefilter.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X + i, mip); + + rlClearScreenBuffers(); + rlLoadDrawCube(); + } + } + //------------------------------------------------------------------------------------------ + + // STEP 3: Unload framebuffer and reset state + //------------------------------------------------------------------------------------------ + rlDisableShader(); // Unbind shader + rlDisableTexture(); // Unbind texture + rlDisableFramebuffer(); // Unbind framebuffer + rlUnloadFramebuffer(fbo); // Unload framebuffer (and automatically attached depth texture/renderbuffer) + + // Reset viewport dimensions to default + rlViewport(0, 0, rlGetFramebufferWidth(), rlGetFramebufferHeight()); + rlEnableBackfaceCulling(); + //------------------------------------------------------------------------------------------ + + prefilter.width = size; + prefilter.height = size; + prefilter.mipmaps = MAX_MIPMAP_LEVELS; + prefilter.format = PIXELFORMAT_UNCOMPRESSED_R32G32B32; + + return prefilter; +} + +// Generate BRDF texture using cubemap data +// TODO: Review implementation: https://github.com/HectorMF/BRDFGenerator +static Texture2D GenTextureBRDF(Shader shader, int size) +{ + Texture2D brdf = { 0 }; + + // STEP 1: Setup framebuffer + //------------------------------------------------------------------------------------------ + unsigned int rbo = rlLoadTextureDepth(size, size, true); + brdf.id = rlLoadTexture(NULL, size, size, PIXELFORMAT_UNCOMPRESSED_R32G32B32, 1); + + unsigned int fbo = rlLoadFramebuffer(size, size); + rlFramebufferAttach(fbo, rbo, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER, 0); + rlFramebufferAttach(fbo, brdf.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_TEXTURE2D, 0); + //------------------------------------------------------------------------------------------ + + // STEP 2: Draw to framebuffer + //------------------------------------------------------------------------------------------ + // NOTE: Render BRDF LUT into a quad using FBO + rlEnableShader(shader.id); + + rlViewport(0, 0, size, size); + + rlEnableFramebuffer(fbo); + rlClearScreenBuffers(); + + rlLoadDrawQuad(); + //------------------------------------------------------------------------------------------ + + // STEP 3: Unload framebuffer and reset state + //------------------------------------------------------------------------------------------ + rlDisableShader(); // Unbind shader + rlDisableTexture(); // Unbind texture + rlDisableFramebuffer(); // Unbind framebuffer + rlUnloadFramebuffer(fbo); // Unload framebuffer (and automatically attached depth texture/renderbuffer) + + // Reset viewport dimensions to default + rlViewport(0, 0, rlGetFramebufferWidth(), rlGetFramebufferHeight()); + //------------------------------------------------------------------------------------------ + + brdf.width = size; + brdf.height = size; + brdf.mipmaps = 1; + brdf.format = PIXELFORMAT_UNCOMPRESSED_R32G32B32; + + return brdf; +} diff --git a/examples/models/models_mesh_generation.c b/examples/models/models_mesh_generation.c index eaecb2712..095aad827 100644 --- a/examples/models/models_mesh_generation.c +++ b/examples/models/models_mesh_generation.c @@ -11,7 +11,58 @@ #include "raylib.h" -#define NUM_MODELS 8 // Parametric 3d shapes to generate +#define NUM_MODELS 9 // Parametric 3d shapes to generate + +void AllocateMeshData(Mesh* mesh, int triangleCount) +{ + mesh->vertexCount = triangleCount * 3; + mesh->triangleCount = triangleCount; + + mesh->vertices = (float*)MemAlloc(mesh->vertexCount * 3 * sizeof(float)); + mesh->texcoords = (float*)MemAlloc(mesh->vertexCount * 2 * sizeof(float)); + mesh->normals = (float*)MemAlloc(mesh->vertexCount * 3 * sizeof(float)); +} + +// generate a simple triangle mesh from code +Mesh MakeMesh() +{ + Mesh mesh = { 0 }; + AllocateMeshData(&mesh, 1); + + // vertex at the origin + mesh.vertices[0] = 0; + mesh.vertices[1] = 0; + mesh.vertices[2] = 0; + mesh.normals[0] = 0; + mesh.normals[1] = 1; + mesh.normals[2] = 0; + mesh.texcoords[0] = 0; + mesh.texcoords[1] = 0; + + // vertex at 1,0,2 + mesh.vertices[3] = 1; + mesh.vertices[4] = 0; + mesh.vertices[5] = 2; + mesh.normals[3] = 0; + mesh.normals[4] = 1; + mesh.normals[5] = 0; + mesh.texcoords[2] = 0.5f; + mesh.texcoords[3] = 1.0f; + + // vertex at 2,0,0 + mesh.vertices[6] = 2; + mesh.vertices[7] = 0; + mesh.vertices[8] = 0; + mesh.normals[6] = 0; + mesh.normals[7] = 1; + mesh.normals[8] = 0; + mesh.texcoords[4] = 1; + mesh.texcoords[5] =0; + + UploadMesh(&mesh, false); + + return mesh; +} int main(void) { @@ -37,9 +88,10 @@ int main(void) models[5] = LoadModelFromMesh(GenMeshTorus(0.25f, 4.0f, 16, 32)); models[6] = LoadModelFromMesh(GenMeshKnot(1.0f, 2.0f, 16, 128)); models[7] = LoadModelFromMesh(GenMeshPoly(5, 2.0f)); + models[8] = LoadModelFromMesh(MakeMesh()); // Set checked texture as default diffuse component for all models material - for (int i = 0; i < NUM_MODELS; i++) models[i].materials[0].maps[MAP_DIFFUSE].texture = texture; + for (int i = 0; i < NUM_MODELS; i++) models[i].materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Define the camera to look into our 3d world Camera camera = { { 5.0f, 5.0f, 5.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f, 0 }; @@ -61,7 +113,7 @@ int main(void) //---------------------------------------------------------------------------------- UpdateCamera(&camera); // Update internal camera and our camera - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) { currentModel = (currentModel + 1)%NUM_MODELS; // Cycle between the textures } @@ -86,9 +138,8 @@ int main(void) BeginMode3D(camera); - DrawModel(models[currentModel], position, 1.0f, WHITE); - - DrawGrid(10, 1.0); + DrawModel(models[currentModel], position, 1.0f, WHITE); + DrawGrid(10, 1.0); EndMode3D(); @@ -106,6 +157,7 @@ int main(void) case 5: DrawText("TORUS", 680, 10, 20, DARKBLUE); break; case 6: DrawText("KNOT", 680, 10, 20, DARKBLUE); break; case 7: DrawText("POLY", 680, 10, 20, DARKBLUE); break; + case 8: DrawText("Parametric(custom)", 580, 10, 20, DARKBLUE); break; default: break; } diff --git a/examples/models/models_mesh_picking.c b/examples/models/models_mesh_picking.c index 81becbf82..c25aeeafd 100644 --- a/examples/models/models_mesh_picking.c +++ b/examples/models/models_mesh_picking.c @@ -31,26 +31,34 @@ int main(void) camera.target = (Vector3){ 0.0f, 8.0f, 0.0f }; // Camera looking at point camera.up = (Vector3){ 0.0f, 1.6f, 0.0f }; // Camera up vector (rotation towards target) camera.fovy = 45.0f; // Camera field-of-view Y - camera.type = CAMERA_PERSPECTIVE; // Camera mode type + camera.projection = CAMERA_PERSPECTIVE; // Camera mode type Ray ray = { 0 }; // Picking ray Model tower = LoadModel("resources/models/turret.obj"); // Load OBJ model Texture2D texture = LoadTexture("resources/models/turret_diffuse.png"); // Load model texture - tower.materials[0].maps[MAP_DIFFUSE].texture = texture; // Set model diffuse texture + tower.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set model diffuse texture Vector3 towerPos = { 0.0f, 0.0f, 0.0f }; // Set model position - BoundingBox towerBBox = MeshBoundingBox(tower.meshes[0]); // Get mesh bounding box - bool hitMeshBBox = false; - bool hitTriangle = false; + BoundingBox towerBBox = GetMeshBoundingBox(tower.meshes[0]); // Get mesh bounding box + + // Ground quad + Vector3 g0 = (Vector3){ -50.0f, 0.0f, -50.0f }; + Vector3 g1 = (Vector3){ -50.0f, 0.0f, 50.0f }; + Vector3 g2 = (Vector3){ 50.0f, 0.0f, 50.0f }; + Vector3 g3 = (Vector3){ 50.0f, 0.0f, -50.0f }; // Test triangle - Vector3 ta = (Vector3){ -25.0, 0.5, 0.0 }; - Vector3 tb = (Vector3){ -4.0, 2.5, 1.0 }; - Vector3 tc = (Vector3){ -8.0, 6.5, 0.0 }; + Vector3 ta = (Vector3){ -25.0f, 0.5f, 0.0f }; + Vector3 tb = (Vector3){ -4.0f, 2.5f, 1.0f }; + Vector3 tc = (Vector3){ -8.0f, 6.5f, 0.0f }; Vector3 bary = { 0.0f, 0.0f, 0.0f }; + // Test sphere + Vector3 sp = (Vector3){ -30.0f, 5.0f, 5.0f }; + float sr = 4.0f; + SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode SetTargetFPS(60); // Set our game to run at 60 frames-per-second @@ -63,59 +71,67 @@ int main(void) UpdateCamera(&camera); // Update camera // Display information about closest hit - RayHitInfo nearestHit = { 0 }; + RayCollision collision = { 0 }; char *hitObjectName = "None"; - nearestHit.distance = FLT_MAX; - nearestHit.hit = false; + collision.distance = FLT_MAX; + collision.hit = false; Color cursorColor = WHITE; - // Get ray and test against ground, triangle, and mesh + // Get ray and test against objects ray = GetMouseRay(GetMousePosition(), camera); - // Check ray collision aginst ground plane - RayHitInfo groundHitInfo = GetCollisionRayGround(ray, 0.0f); + // Check ray collision against ground quad + RayCollision groundHitInfo = GetRayCollisionQuad(ray, g0, g1, g2, g3); - if ((groundHitInfo.hit) && (groundHitInfo.distance < nearestHit.distance)) + if ((groundHitInfo.hit) && (groundHitInfo.distance < collision.distance)) { - nearestHit = groundHitInfo; + collision = groundHitInfo; cursorColor = GREEN; hitObjectName = "Ground"; } // Check ray collision against test triangle - RayHitInfo triHitInfo = GetCollisionRayTriangle(ray, ta, tb, tc); + RayCollision triHitInfo = GetRayCollisionTriangle(ray, ta, tb, tc); - if ((triHitInfo.hit) && (triHitInfo.distance < nearestHit.distance)) + if ((triHitInfo.hit) && (triHitInfo.distance < collision.distance)) { - nearestHit = triHitInfo; + collision = triHitInfo; cursorColor = PURPLE; hitObjectName = "Triangle"; - bary = Vector3Barycenter(nearestHit.position, ta, tb, tc); - hitTriangle = true; + bary = Vector3Barycenter(collision.point, ta, tb, tc); + } + + // Check ray collision against test sphere + RayCollision sphereHitInfo = GetRayCollisionSphere(ray, sp, sr); + + if ((sphereHitInfo.hit) && (sphereHitInfo.distance < collision.distance)) + { + collision = sphereHitInfo; + cursorColor = ORANGE; + hitObjectName = "Sphere"; } - else hitTriangle = false; - - RayHitInfo meshHitInfo = { 0 }; // Check ray collision against bounding box first, before trying the full ray-mesh test - if (CheckCollisionRayBox(ray, towerBBox)) + RayCollision boxHitInfo = GetRayCollisionBox(ray, towerBBox); + + if ((boxHitInfo.hit) && (boxHitInfo.distance < collision.distance)) { - hitMeshBBox = true; + collision = boxHitInfo; + cursorColor = ORANGE; + hitObjectName = "Box"; // Check ray collision against model // NOTE: It considers model.transform matrix! - meshHitInfo = GetCollisionRayModel(ray, tower); + RayCollision meshHitInfo = GetRayCollisionModel(ray, tower); - if ((meshHitInfo.hit) && (meshHitInfo.distance < nearestHit.distance)) + if (meshHitInfo.hit) { - nearestHit = meshHitInfo; + collision = meshHitInfo; cursorColor = ORANGE; hitObjectName = "Mesh"; } } - - hitMeshBBox = false; //---------------------------------------------------------------------------------- // Draw @@ -128,7 +144,7 @@ int main(void) // Draw the tower // WARNING: If scale is different than 1.0f, - // not considered by GetCollisionRayModel() + // not considered by GetRayCollisionModel() DrawModel(tower, towerPos, 1.0f, WHITE); // Draw the test triangle @@ -136,25 +152,28 @@ int main(void) DrawLine3D(tb, tc, PURPLE); DrawLine3D(tc, ta, PURPLE); + // Draw the test sphere + DrawSphereWires(sp, sr, 8, 8, PURPLE); + // Draw the mesh bbox if we hit it - if (hitMeshBBox) DrawBoundingBox(towerBBox, LIME); + if (boxHitInfo.hit) DrawBoundingBox(towerBBox, LIME); // If we hit something, draw the cursor at the hit point - if (nearestHit.hit) + if (collision.hit) { - DrawCube(nearestHit.position, 0.3, 0.3, 0.3, cursorColor); - DrawCubeWires(nearestHit.position, 0.3, 0.3, 0.3, RED); + DrawCube(collision.point, 0.3f, 0.3f, 0.3f, cursorColor); + DrawCubeWires(collision.point, 0.3f, 0.3f, 0.3f, RED); Vector3 normalEnd; - normalEnd.x = nearestHit.position.x + nearestHit.normal.x; - normalEnd.y = nearestHit.position.y + nearestHit.normal.y; - normalEnd.z = nearestHit.position.z + nearestHit.normal.z; + normalEnd.x = collision.point.x + collision.normal.x; + normalEnd.y = collision.point.y + collision.normal.y; + normalEnd.z = collision.point.z + collision.normal.z; - DrawLine3D(nearestHit.position, normalEnd, RED); + DrawLine3D(collision.point, normalEnd, RED); } DrawRay(ray, MAROON); - + DrawGrid(10, 10.0f); EndMode3D(); @@ -162,23 +181,24 @@ int main(void) // Draw some debug GUI text DrawText(TextFormat("Hit Object: %s", hitObjectName), 10, 50, 10, BLACK); - if (nearestHit.hit) + if (collision.hit) { int ypos = 70; - DrawText(TextFormat("Distance: %3.2f", nearestHit.distance), 10, ypos, 10, BLACK); + DrawText(TextFormat("Distance: %3.2f", collision.distance), 10, ypos, 10, BLACK); DrawText(TextFormat("Hit Pos: %3.2f %3.2f %3.2f", - nearestHit.position.x, - nearestHit.position.y, - nearestHit.position.z), 10, ypos + 15, 10, BLACK); + collision.point.x, + collision.point.y, + collision.point.z), 10, ypos + 15, 10, BLACK); DrawText(TextFormat("Hit Norm: %3.2f %3.2f %3.2f", - nearestHit.normal.x, - nearestHit.normal.y, - nearestHit.normal.z), 10, ypos + 30, 10, BLACK); + collision.normal.x, + collision.normal.y, + collision.normal.z), 10, ypos + 30, 10, BLACK); - if (hitTriangle) DrawText(TextFormat("Barycenter: %3.2f %3.2f %3.2f", bary.x, bary.y, bary.z), 10, ypos + 45, 10, BLACK); + if (triHitInfo.hit && TextIsEqual(hitObjectName, "Triangle")) + DrawText(TextFormat("Barycenter: %3.2f %3.2f %3.2f", bary.x, bary.y, bary.z), 10, ypos + 45, 10, BLACK); } DrawText("Use Mouse to Move Camera", 10, 430, 10, GRAY); diff --git a/examples/models/models_orthographic_projection.c b/examples/models/models_orthographic_projection.c index 8c9b5b1c5..7dd5fde25 100644 --- a/examples/models/models_orthographic_projection.c +++ b/examples/models/models_orthographic_projection.c @@ -40,15 +40,15 @@ int main(void) //---------------------------------------------------------------------------------- if (IsKeyPressed(KEY_SPACE)) { - if (camera.type == CAMERA_PERSPECTIVE) + if (camera.projection == CAMERA_PERSPECTIVE) { camera.fovy = WIDTH_ORTHOGRAPHIC; - camera.type = CAMERA_ORTHOGRAPHIC; + camera.projection = CAMERA_ORTHOGRAPHIC; } else { camera.fovy = FOVY_PERSPECTIVE; - camera.type = CAMERA_PERSPECTIVE; + camera.projection = CAMERA_PERSPECTIVE; } } //---------------------------------------------------------------------------------- @@ -81,8 +81,8 @@ int main(void) DrawText("Press Spacebar to switch camera type", 10, GetScreenHeight() - 30, 20, DARKGRAY); - if (camera.type == CAMERA_ORTHOGRAPHIC) DrawText("ORTHOGRAPHIC", 10, 40, 20, BLACK); - else if (camera.type == CAMERA_PERSPECTIVE) DrawText("PERSPECTIVE", 10, 40, 20, BLACK); + if (camera.projection == CAMERA_ORTHOGRAPHIC) DrawText("ORTHOGRAPHIC", 10, 40, 20, BLACK); + else if (camera.projection == CAMERA_PERSPECTIVE) DrawText("PERSPECTIVE", 10, 40, 20, BLACK); DrawFPS(10, 10); diff --git a/examples/models/models_rlgl_solar_system.c b/examples/models/models_rlgl_solar_system.c index a6698e693..97d692453 100644 --- a/examples/models/models_rlgl_solar_system.c +++ b/examples/models/models_rlgl_solar_system.c @@ -43,7 +43,7 @@ int main(void) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; camera.fovy = 45.0f; - camera.type = CAMERA_PERSPECTIVE; + camera.projection = CAMERA_PERSPECTIVE; SetCameraMode(camera, CAMERA_FREE); @@ -136,6 +136,10 @@ void DrawSphereBasic(Color color) int rings = 16; int slices = 16; + // Make sure there is enough space in the internal render batch + // buffer to store all required vertex, batch is reseted if required + rlCheckRenderBatchLimit((rings + 2)*slices*6); + rlBegin(RL_TRIANGLES); rlColor4ub(color.r, color.g, color.b, color.a); diff --git a/examples/models/models_skybox.c b/examples/models/models_skybox.c index f80fbf7a6..2b98435ac 100644 --- a/examples/models/models_skybox.c +++ b/examples/models/models_skybox.c @@ -10,6 +10,16 @@ ********************************************************************************************/ #include "raylib.h" +#include "rlgl.h" + +#if defined(PLATFORM_DESKTOP) + #define GLSL_VERSION 330 +#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB + #define GLSL_VERSION 100 +#endif + +// Generate cubemap (6 faces) from equirectangular (panorama) texture +static TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int size, int format); int main(void) { @@ -27,36 +37,48 @@ int main(void) Mesh cube = GenMeshCube(1.0f, 1.0f, 1.0f); Model skybox = LoadModelFromMesh(cube); + bool useHDR = true; + // Load skybox shader and set required locations // NOTE: Some locations are automatically set at shader loading -#if defined(PLATFORM_DESKTOP) - skybox.materials[0].shader = LoadShader("resources/shaders/glsl330/skybox.vs", "resources/shaders/glsl330/skybox.fs"); -#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB - skybox.materials[0].shader = LoadShader("resources/shaders/glsl100/skybox.vs", "resources/shaders/glsl100/skybox.fs"); -#endif - SetShaderValue(skybox.materials[0].shader, GetShaderLocation(skybox.materials[0].shader, "environmentMap"), (int[1]){ MAP_CUBEMAP }, UNIFORM_INT); - SetShaderValue(skybox.materials[0].shader, GetShaderLocation(skybox.materials[0].shader, "vflipped"), (int[1]){ 1 }, UNIFORM_INT); + skybox.materials[0].shader = LoadShader(TextFormat("resources/shaders/glsl%i/skybox.vs", GLSL_VERSION), + TextFormat("resources/shaders/glsl%i/skybox.fs", GLSL_VERSION)); + + SetShaderValue(skybox.materials[0].shader, GetShaderLocation(skybox.materials[0].shader, "environmentMap"), (int[1]){ MATERIAL_MAP_CUBEMAP }, SHADER_UNIFORM_INT); + SetShaderValue(skybox.materials[0].shader, GetShaderLocation(skybox.materials[0].shader, "doGamma"), (int[1]) { useHDR ? 1 : 0 }, SHADER_UNIFORM_INT); + SetShaderValue(skybox.materials[0].shader, GetShaderLocation(skybox.materials[0].shader, "vflipped"), (int[1]){ useHDR ? 1 : 0 }, SHADER_UNIFORM_INT); // Load cubemap shader and setup required shader locations -#if defined(PLATFORM_DESKTOP) - Shader shdrCubemap = LoadShader("resources/shaders/glsl330/cubemap.vs", "resources/shaders/glsl330/cubemap.fs"); -#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB - Shader shdrCubemap = LoadShader("resources/shaders/glsl100/cubemap.vs", "resources/shaders/glsl100/cubemap.fs"); -#endif - SetShaderValue(shdrCubemap, GetShaderLocation(shdrCubemap, "equirectangularMap"), (int[1]){ 0 }, UNIFORM_INT); + Shader shdrCubemap = LoadShader(TextFormat("resources/shaders/glsl%i/cubemap.vs", GLSL_VERSION), + TextFormat("resources/shaders/glsl%i/cubemap.fs", GLSL_VERSION)); - // Load HDR panorama (sphere) texture - char panoFileName[256] = { 0 }; - TextCopy(panoFileName, "resources/dresden_square_2k.hdr"); - Texture2D panorama = LoadTexture(panoFileName); + SetShaderValue(shdrCubemap, GetShaderLocation(shdrCubemap, "equirectangularMap"), (int[1]){ 0 }, SHADER_UNIFORM_INT); - // Generate cubemap (texture with 6 quads-cube-mapping) from panorama HDR texture - // NOTE 1: New texture is generated rendering to texture, shader calculates the sphere->cube coordinates mapping - // NOTE 2: It seems on some Android devices WebGL, fbo does not properly support a FLOAT-based attachment, - // despite texture can be successfully created.. so using UNCOMPRESSED_R8G8B8A8 instead of UNCOMPRESSED_R32G32B32A32 - skybox.materials[0].maps[MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, panorama, 1024, UNCOMPRESSED_R8G8B8A8); + char skyboxFileName[256] = { 0 }; + + Texture2D panorama; - UnloadTexture(panorama); // Texture not required anymore, cubemap already generated + if (useHDR) + { + TextCopy(skyboxFileName, "resources/dresden_square_2k.hdr"); + + // Load HDR panorama (sphere) texture + panorama = LoadTexture(skyboxFileName); + + // Generate cubemap (texture with 6 quads-cube-mapping) from panorama HDR texture + // NOTE 1: New texture is generated rendering to texture, shader calculates the sphere->cube coordinates mapping + // NOTE 2: It seems on some Android devices WebGL, fbo does not properly support a FLOAT-based attachment, + // despite texture can be successfully created.. so using PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 instead of PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 + skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, panorama, 1024, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8); + + //UnloadTexture(panorama); // Texture not required anymore, cubemap already generated + } + else + { + Image img = LoadImage("resources/skybox.png"); + skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = LoadTextureCubemap(img, CUBEMAP_LAYOUT_AUTO_DETECT); // CUBEMAP_LAYOUT_PANORAMA + UnloadImage(img); + } SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set a first person camera mode @@ -69,7 +91,7 @@ int main(void) // Update //---------------------------------------------------------------------------------- UpdateCamera(&camera); // Update camera - + // Load new cubemap texture on drag&drop if (IsFileDropped()) { @@ -81,13 +103,23 @@ int main(void) if (IsFileExtension(droppedFiles[0], ".png;.jpg;.hdr;.bmp;.tga")) { // Unload current cubemap texture and load new one - UnloadTexture(skybox.materials[0].maps[MAP_CUBEMAP].texture); - panorama = LoadTexture(droppedFiles[0]); - TextCopy(panoFileName, droppedFiles[0]); - - // Generate cubemap from panorama texture - skybox.materials[0].maps[MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, panorama, 1024, UNCOMPRESSED_R8G8B8A8); - UnloadTexture(panorama); + UnloadTexture(skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture); + if (useHDR) + { + Texture2D panorama = LoadTexture(droppedFiles[0]); + + // Generate cubemap from panorama texture + skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, panorama, 1024, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8); + UnloadTexture(panorama); + } + else + { + Image img = LoadImage(droppedFiles[0]); + skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = LoadTextureCubemap(img, CUBEMAP_LAYOUT_AUTO_DETECT); + UnloadImage(img); + } + + TextCopy(skyboxFileName, droppedFiles[0]); } } @@ -102,11 +134,23 @@ int main(void) ClearBackground(RAYWHITE); BeginMode3D(camera); - DrawModel(skybox, (Vector3){0, 0, 0}, 1.0f, WHITE); - DrawGrid(10, 1.0f); - EndMode3D(); - DrawText(TextFormat("Panorama image from hdrihaven.com: %s", GetFileName(panoFileName)), 10, GetScreenHeight() - 20, 10, BLACK); + // We are inside the cube, we need to disable backface culling! + rlDisableBackfaceCulling(); + rlDisableDepthMask(); + DrawModel(skybox, (Vector3){0, 0, 0}, 1.0f, WHITE); + rlEnableBackfaceCulling(); + rlEnableDepthMask(); + + DrawGrid(10, 1.0f); + + EndMode3D(); + + //DrawTextureEx(panorama, (Vector2){ 0, 0 }, 0.0f, 0.5f, WHITE); + + if (useHDR) DrawText(TextFormat("Panorama image from hdrihaven.com: %s", GetFileName(skyboxFileName)), 10, GetScreenHeight() - 20, 10, BLACK); + else DrawText(TextFormat(": %s", GetFileName(skyboxFileName)), 10, GetScreenHeight() - 20, 10, BLACK); + DrawFPS(10, 10); EndDrawing(); @@ -116,8 +160,8 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- UnloadShader(skybox.materials[0].shader); - UnloadTexture(skybox.materials[0].maps[MAP_CUBEMAP].texture); - + UnloadTexture(skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture); + UnloadModel(skybox); // Unload skybox model CloseWindow(); // Close window and OpenGL context @@ -125,3 +169,92 @@ int main(void) return 0; } + +// Generate cubemap texture from HDR texture +static TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int size, int format) +{ + TextureCubemap cubemap = { 0 }; + + rlDisableBackfaceCulling(); // Disable backface culling to render inside the cube + + // STEP 1: Setup framebuffer + //------------------------------------------------------------------------------------------ + unsigned int rbo = rlLoadTextureDepth(size, size, true); + cubemap.id = rlLoadTextureCubemap(0, size, format); + + unsigned int fbo = rlLoadFramebuffer(size, size); + rlFramebufferAttach(fbo, rbo, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER, 0); + rlFramebufferAttach(fbo, cubemap.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X, 0); + + // Check if framebuffer is complete with attachments (valid) + if (rlFramebufferComplete(fbo)) TraceLog(LOG_INFO, "FBO: [ID %i] Framebuffer object created successfully", fbo); + //------------------------------------------------------------------------------------------ + + // STEP 2: Draw to framebuffer + //------------------------------------------------------------------------------------------ + // NOTE: Shader is used to convert HDR equirectangular environment map to cubemap equivalent (6 faces) + rlEnableShader(shader.id); + + // Define projection matrix and send it to shader + Matrix matFboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR); + rlSetUniformMatrix(shader.locs[SHADER_LOC_MATRIX_PROJECTION], matFboProjection); + + // Define view matrix for every side of the cubemap + Matrix fboViews[6] = { + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ -1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 1.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 1.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, -1.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 1.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), + MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, -1.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }) + }; + + rlViewport(0, 0, size, size); // Set viewport to current fbo dimensions + + // Activate and enable texture for drawing to cubemap faces + rlActiveTextureSlot(0); + rlEnableTexture(panorama.id); + + for (int i = 0; i < 6; i++) + { + // Set the view matrix for the current cube face + rlSetUniformMatrix(shader.locs[SHADER_LOC_MATRIX_VIEW], fboViews[i]); + + // Select the current cubemap face attachment for the fbo + // WARNING: This function by default enables->attach->disables fbo!!! + rlFramebufferAttach(fbo, cubemap.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X + i, 0); + rlEnableFramebuffer(fbo); + + // Load and draw a cube, it uses the current enabled texture + rlClearScreenBuffers(); + rlLoadDrawCube(); + + // ALTERNATIVE: Try to use internal batch system to draw the cube instead of rlLoadDrawCube + // for some reason this method does not work, maybe due to cube triangles definition? normals pointing out? + // TODO: Investigate this issue... + //rlSetTexture(panorama.id); // WARNING: It must be called after enabling current framebuffer if using internal batch system! + //rlClearScreenBuffers(); + //DrawCubeV(Vector3Zero(), Vector3One(), WHITE); + //rlDrawRenderBatchActive(); + } + //------------------------------------------------------------------------------------------ + + // STEP 3: Unload framebuffer and reset state + //------------------------------------------------------------------------------------------ + rlDisableShader(); // Unbind shader + rlDisableTexture(); // Unbind texture + rlDisableFramebuffer(); // Unbind framebuffer + rlUnloadFramebuffer(fbo); // Unload framebuffer (and automatically attached depth texture/renderbuffer) + + // Reset viewport dimensions to default + rlViewport(0, 0, rlGetFramebufferWidth(), rlGetFramebufferHeight()); + rlEnableBackfaceCulling(); + //------------------------------------------------------------------------------------------ + + cubemap.width = size; + cubemap.height = size; + cubemap.mipmaps = 1; + cubemap.format = format; + + return cubemap; +} diff --git a/examples/models/models_waving_cubes.c b/examples/models/models_waving_cubes.c index 764dc5e70..13f098b9d 100644 --- a/examples/models/models_waving_cubes.c +++ b/examples/models/models_waving_cubes.c @@ -30,7 +30,7 @@ int main() camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; camera.fovy = 70.0f; - camera.type = CAMERA_PERSPECTIVE; + camera.projection = CAMERA_PERSPECTIVE; // Specify the amount of blocks in each direction const int numBlocks = 15; @@ -53,7 +53,7 @@ int main() camera.position.x = (float)cos(cameraTime)*40.0f; camera.position.z = (float)sin(cameraTime)*40.0f; //---------------------------------------------------------------------------------- - + // Draw //---------------------------------------------------------------------------------- BeginDrawing(); @@ -64,11 +64,11 @@ int main() DrawGrid(10, 5.0f); - for (int x = 0; x < numBlocks; x++) + for (int x = 0; x < numBlocks; x++) { - for (int y = 0; y < numBlocks; y++) + for (int y = 0; y < numBlocks; y++) { - for (int z = 0; z < numBlocks; z++) + for (int z = 0; z < numBlocks; z++) { // Scale of the blocks depends on x/y/z positions float blockScale = (x + y + z)/30.0f; @@ -94,9 +94,9 @@ int main() } } } - + EndMode3D(); - + DrawFPS(10, 10); EndDrawing(); diff --git a/examples/models/models_yaw_pitch_roll.c b/examples/models/models_yaw_pitch_roll.c index fdd0d6d9b..70fe84777 100644 --- a/examples/models/models_yaw_pitch_roll.c +++ b/examples/models/models_yaw_pitch_roll.c @@ -14,9 +14,6 @@ #include "raylib.h" #include "raymath.h" -// Draw angle gauge controls -void DrawAngleGauge(Texture2D angleGauge, int x, int y, float angle, char title[], Color color); - int main(void) { // Initialization @@ -24,27 +21,19 @@ int main(void) const int screenWidth = 800; const int screenHeight = 450; + //SetConfigFlags(FLAG_MSAA_4X_HINT | FLAG_WINDOW_HIGHDPI); InitWindow(screenWidth, screenHeight, "raylib [models] example - plane rotations (yaw, pitch, roll)"); - Texture2D texAngleGauge = LoadTexture("resources/angle_gauge.png"); - Texture2D texBackground = LoadTexture("resources/background.png"); - Texture2D texPitch = LoadTexture("resources/pitch.png"); - Texture2D texPlane = LoadTexture("resources/plane.png"); - - RenderTexture2D framebuffer = LoadRenderTexture(192, 192); - - // Model loading - Model model = LoadModel("resources/plane.obj"); // Load OBJ model - model.materials[0].maps[MAP_DIFFUSE].texture = LoadTexture("resources/plane_diffuse.png"); // Set map diffuse texture - - GenTextureMipmaps(&model.materials[0].maps[MAP_DIFFUSE].texture); - Camera camera = { 0 }; - camera.position = (Vector3){ 0.0f, 60.0f, -120.0f };// Camera position perspective - camera.target = (Vector3){ 0.0f, 12.0f, 0.0f }; // Camera looking at point + camera.position = (Vector3){ 0.0f, 50.0f, -120.0f };// Camera position perspective + camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) camera.fovy = 30.0f; // Camera field-of-view Y - camera.type = CAMERA_PERSPECTIVE; // Camera type + camera.projection = CAMERA_PERSPECTIVE; // Camera type + + // Model loading + // NOTE: Diffuse map loaded automatically + Model model = LoadModel("resources/plane/plane.gltf"); float pitch = 0.0f; float roll = 0.0f; @@ -58,14 +47,13 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - - // Plane roll (x-axis) controls - if (IsKeyDown(KEY_LEFT)) roll += 1.0f; - else if (IsKeyDown(KEY_RIGHT)) roll -= 1.0f; + // Plane pitch (x-axis) controls + if (IsKeyDown(KEY_DOWN)) pitch += 0.6f; + else if (IsKeyDown(KEY_UP)) pitch -= 0.6f; else { - if (roll > 0.0f) roll -= 0.5f; - else if (roll < 0.0f) roll += 0.5f; + if (pitch > 0.3f) pitch -= 0.3f; + else if (pitch < -0.3f) pitch += 0.3f; } // Plane yaw (y-axis) controls @@ -77,89 +65,42 @@ int main(void) else if (yaw < 0.0f) yaw += 0.5f; } - // Plane pitch (z-axis) controls - if (IsKeyDown(KEY_DOWN)) pitch += 0.6f; - else if (IsKeyDown(KEY_UP)) pitch -= 0.6f; + // Plane roll (z-axis) controls + if (IsKeyDown(KEY_LEFT)) roll += 1.0f; + else if (IsKeyDown(KEY_RIGHT)) roll -= 1.0f; else { - if (pitch > 0.3f) pitch -= 0.3f; - else if (pitch < -0.3f) pitch += 0.3f; + if (roll > 0.0f) roll -= 0.5f; + else if (roll < 0.0f) roll += 0.5f; } - // Wraps the phase of an angle to fit between -180 and +180 degrees - int pitchOffset = pitch; - while (pitchOffset > 180) pitchOffset -= 360; - while (pitchOffset < -180) pitchOffset += 360; - pitchOffset *= 10; - - /* matrix transform done with multiplication to combine rotations - Matrix transform = MatrixIdentity(); - - transform = MatrixMultiply(transform, MatrixRotateZ(DEG2RAD*roll)); - transform = MatrixMultiply(transform, MatrixRotateX(DEG2RAD*pitch)); - transform = MatrixMultiply(transform, MatrixRotateY(DEG2RAD*yaw)); - - model.transform = transform; - */ - // matrix created from multiple axes at once - model.transform = MatrixRotateXYZ((Vector3){DEG2RAD*pitch,DEG2RAD*yaw,DEG2RAD*roll}); - + // Tranformation matrix for rotations + model.transform = MatrixRotateXYZ((Vector3){ DEG2RAD*pitch, DEG2RAD*yaw, DEG2RAD*roll }); //---------------------------------------------------------------------------------- + + // Draw //---------------------------------------------------------------------------------- BeginDrawing(); ClearBackground(RAYWHITE); - // Draw framebuffer texture (Ahrs Display) - int centerX = framebuffer.texture.width/2; - int centerY = framebuffer.texture.height/2; - - BeginTextureMode(framebuffer); - - ClearBackground(RAYWHITE); - BeginBlendMode(BLEND_ALPHA); - - DrawTexturePro(texBackground, (Rectangle){ 0, 0, texBackground.width, texBackground.height }, - (Rectangle){ centerX, centerY, texBackground.width, texBackground.height}, - (Vector2){ texBackground.width/2, texBackground.height/2 + pitchOffset }, roll, WHITE); - - DrawTexturePro(texPitch, (Rectangle){ 0, 0, texPitch.width, texPitch.height }, - (Rectangle){ centerX, centerY, texPitch.width, texPitch.height }, - (Vector2){ texPitch.width/2, texPitch.height/2 + pitchOffset }, roll, WHITE); - - DrawTexturePro(texPlane, (Rectangle){ 0, 0, texPlane.width, texPlane.height }, - (Rectangle){ centerX, centerY, texPlane.width, texPlane.height }, - (Vector2){ texPlane.width/2, texPlane.height/2 }, 0, WHITE); - - EndBlendMode(); - - EndTextureMode(); - // Draw 3D model (recomended to draw 3D always before 2D) BeginMode3D(camera); - DrawModel(model, (Vector3){ 0, 6.0f, 0 }, 1.0f, WHITE); // Draw 3d model with texture + DrawModel(model, (Vector3){ 0.0f, 0.0f, 15.0f }, 0.25f, WHITE); // Draw 3d model with texture DrawGrid(10, 10.0f); EndMode3D(); - // Draw 2D GUI stuff - DrawAngleGauge(texAngleGauge, 80, 70, roll, "roll", RED); - DrawAngleGauge(texAngleGauge, 190, 70, pitch, "pitch", GREEN); - DrawAngleGauge(texAngleGauge, 300, 70, yaw, "yaw", SKYBLUE); + // Draw controls info + DrawRectangle(30, 370, 260, 70, Fade(GREEN, 0.5f)); + DrawRectangleLines(30, 370, 260, 70, Fade(DARKGREEN, 0.5f)); + DrawText("Pitch controlled with: KEY_UP / KEY_DOWN", 40, 380, 10, DARKGRAY); + DrawText("Roll controlled with: KEY_LEFT / KEY_RIGHT", 40, 400, 10, DARKGRAY); + DrawText("Yaw controlled with: KEY_A / KEY_S", 40, 420, 10, DARKGRAY); - DrawRectangle(30, 360, 260, 70, Fade(SKYBLUE, 0.5f)); - DrawRectangleLines(30, 360, 260, 70, Fade(DARKBLUE, 0.5f)); - DrawText("Pitch controlled with: KEY_UP / KEY_DOWN", 40, 370, 10, DARKGRAY); - DrawText("Roll controlled with: KEY_LEFT / KEY_RIGHT", 40, 390, 10, DARKGRAY); - DrawText("Yaw controlled with: KEY_A / KEY_S", 40, 410, 10, DARKGRAY); - - // Draw framebuffer texture - DrawTextureRec(framebuffer.texture, (Rectangle){ 0, 0, framebuffer.texture.width, -framebuffer.texture.height }, - (Vector2){ screenWidth - framebuffer.texture.width - 20, 20 }, Fade(WHITE, 0.8f)); - - DrawRectangleLines(screenWidth - framebuffer.texture.width - 20, 20, framebuffer.texture.width, framebuffer.texture.height, DARKGRAY); + DrawText("(c) WWI Plane Model created by GiaHanLam", screenWidth - 240, screenHeight - 20, 10, DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- @@ -167,34 +108,10 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- + UnloadModel(model); // Unload model data - // Unload all loaded data - UnloadTexture(model.materials[0].maps[MAP_DIFFUSE].texture); - UnloadModel(model); - - UnloadRenderTexture(framebuffer); - - UnloadTexture(texAngleGauge); - UnloadTexture(texBackground); - UnloadTexture(texPitch); - UnloadTexture(texPlane); - - CloseWindow(); // Close window and OpenGL context + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- return 0; } - -// Draw angle gauge controls -void DrawAngleGauge(Texture2D angleGauge, int x, int y, float angle, char title[], Color color) -{ - Rectangle srcRec = { 0, 0, angleGauge.width, angleGauge.height }; - Rectangle dstRec = { x, y, angleGauge.width, angleGauge.height }; - Vector2 origin = { angleGauge.width/2, angleGauge.height/2}; - int textSize = 20; - - DrawTexturePro(angleGauge, srcRec, dstRec, origin, angle, color); - - DrawText(TextFormat("%5.1f", angle), x - MeasureText(TextFormat("%5.1f", angle), textSize) / 2, y + 10, textSize, DARKGRAY); - DrawText(title, x - MeasureText(title, textSize) / 2, y + 60, textSize, DARKGRAY); -} diff --git a/examples/models/models_yaw_pitch_roll.png b/examples/models/models_yaw_pitch_roll.png index 5400304d5..8b36fe394 100644 Binary files a/examples/models/models_yaw_pitch_roll.png and b/examples/models/models_yaw_pitch_roll.png differ diff --git a/examples/models/resources/angle_gauge.png b/examples/models/resources/angle_gauge.png deleted file mode 100644 index 810097d74..000000000 Binary files a/examples/models/resources/angle_gauge.png and /dev/null differ diff --git a/examples/models/resources/background.png b/examples/models/resources/background.png deleted file mode 100644 index 88ece1fc2..000000000 Binary files a/examples/models/resources/background.png and /dev/null differ diff --git a/examples/models/resources/gltf/AnimatedMorphCube.glb b/examples/models/resources/gltf/AnimatedMorphCube.glb new file mode 100644 index 000000000..219d2ac52 Binary files /dev/null and b/examples/models/resources/gltf/AnimatedMorphCube.glb differ diff --git a/examples/models/resources/gltf/AnimatedTriangle.gltf b/examples/models/resources/gltf/AnimatedTriangle.gltf new file mode 100644 index 000000000..d5c095492 --- /dev/null +++ b/examples/models/resources/gltf/AnimatedTriangle.gltf @@ -0,0 +1,118 @@ +{ + "scene" : 0, + "scenes" : [ + { + "nodes" : [ 0 ] + } + ], + + "nodes" : [ + { + "mesh" : 0, + "rotation" : [ 0.0, 0.0, 0.0, 1.0 ] + } + ], + + "meshes" : [ + { + "primitives" : [ { + "attributes" : { + "POSITION" : 1 + }, + "indices" : 0 + } ] + } + ], + + "animations": [ + { + "samplers" : [ + { + "input" : 2, + "interpolation" : "LINEAR", + "output" : 3 + } + ], + "channels" : [ { + "sampler" : 0, + "target" : { + "node" : 0, + "path" : "rotation" + } + } ] + } + ], + + "buffers" : [ + { + "uri" : "data:application/octet-stream;base64,AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAA=", + "byteLength" : 44 + }, + { + "uri" : "data:application/octet-stream;base64,AAAAAAAAgD4AAAA/AABAPwAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAD0/TQ/9P00PwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAPT9ND/0/TS/AAAAAAAAAAAAAAAAAACAPw==", + "byteLength" : 100 + } + ], + "bufferViews" : [ + { + "buffer" : 0, + "byteOffset" : 0, + "byteLength" : 6, + "target" : 34963 + }, + { + "buffer" : 0, + "byteOffset" : 8, + "byteLength" : 36, + "target" : 34962 + }, + { + "buffer" : 1, + "byteOffset" : 0, + "byteLength" : 100 + } + ], + "accessors" : [ + { + "bufferView" : 0, + "byteOffset" : 0, + "componentType" : 5123, + "count" : 3, + "type" : "SCALAR", + "max" : [ 2 ], + "min" : [ 0 ] + }, + { + "bufferView" : 1, + "byteOffset" : 0, + "componentType" : 5126, + "count" : 3, + "type" : "VEC3", + "max" : [ 1.0, 1.0, 0.0 ], + "min" : [ 0.0, 0.0, 0.0 ] + }, + { + "bufferView" : 2, + "byteOffset" : 0, + "componentType" : 5126, + "count" : 5, + "type" : "SCALAR", + "max" : [ 1.0 ], + "min" : [ 0.0 ] + }, + { + "bufferView" : 2, + "byteOffset" : 20, + "componentType" : 5126, + "count" : 5, + "type" : "VEC4", + "max" : [ 0.0, 0.0, 1.0, 1.0 ], + "min" : [ 0.0, 0.0, 0.0, -0.707 ] + } + ], + + "asset" : { + "version" : "2.0" + } + +} \ No newline at end of file diff --git a/examples/models/resources/gltf/BoxAnimated.glb b/examples/models/resources/gltf/BoxAnimated.glb new file mode 100644 index 000000000..69481ec3c Binary files /dev/null and b/examples/models/resources/gltf/BoxAnimated.glb differ diff --git a/examples/models/resources/gltf/GearboxAssy.glb b/examples/models/resources/gltf/GearboxAssy.glb new file mode 100644 index 000000000..78cdad623 Binary files /dev/null and b/examples/models/resources/gltf/GearboxAssy.glb differ diff --git a/examples/models/resources/gltf/LICENSE b/examples/models/resources/gltf/LICENSE new file mode 100644 index 000000000..8617385fa --- /dev/null +++ b/examples/models/resources/gltf/LICENSE @@ -0,0 +1,20 @@ +Rigged Figure model has been created by Cesium (https://cesium.com/cesiumjs/), +and licensed as Creative Commons Attribution 4.0 International License. + +Box Animated model has been created by Cesium (https://cesium.com/cesiumjs/) +and is licensed as Creative Commons Attribution 4.0 International License + +Avocado model is provided by Microsoft +and licensed as CC0 Universal Public Domain + +Animated Morph Cube model is provided by Microsoft +and licensed as CC0 Universal Public Domain + +Animated Triangle model is licensed as CC0 Universal Public Domain + +Gearbox Assy model has been provided by Okino Computer Graphics, using Okino Polytrans Software. +no license information was provided + +Check for details on CC0: https://creativecommons.org/publicdomain/zero/1.0/ +Check for details on CC4: http://creativecommons.org/licenses/by/4.0/ +GLTF sample models for testing are taken from: https://github.com/KhronosGroup/glTF-Sample-Models/ diff --git a/examples/models/resources/gltf/raylib_32x32.glb b/examples/models/resources/gltf/raylib_32x32.glb new file mode 100644 index 000000000..4fc56ad48 Binary files /dev/null and b/examples/models/resources/gltf/raylib_32x32.glb differ diff --git a/examples/models/resources/gltf/rigged_figure.glb b/examples/models/resources/gltf/rigged_figure.glb new file mode 100644 index 000000000..c505a33df Binary files /dev/null and b/examples/models/resources/gltf/rigged_figure.glb differ diff --git a/examples/models/resources/gltf/vertex_colored_object.glb b/examples/models/resources/gltf/vertex_colored_object.glb new file mode 100644 index 000000000..0b57eddbd Binary files /dev/null and b/examples/models/resources/gltf/vertex_colored_object.glb differ diff --git a/examples/models/resources/models/vertex_colored_object.iqm b/examples/models/resources/models/vertex_colored_object.iqm new file mode 100644 index 000000000..ad0db07eb Binary files /dev/null and b/examples/models/resources/models/vertex_colored_object.iqm differ diff --git a/examples/models/resources/pitch.png b/examples/models/resources/pitch.png deleted file mode 100644 index 82f89cd14..000000000 Binary files a/examples/models/resources/pitch.png and /dev/null differ diff --git a/examples/models/resources/plane.obj b/examples/models/resources/plane.obj deleted file mode 100644 index e9100a427..000000000 --- a/examples/models/resources/plane.obj +++ /dev/null @@ -1,10700 +0,0 @@ -# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware -# File Created: 23.07.2017 19:55:30 - -# -# object P_51_Mustang_Proppeler -# - -v 6.98 -5.85 40.44 -v 7.18 -5.71 40.16 -v 7.46 -5.54 40.90 -v 7.65 -5.40 40.61 -v -1.06 6.70 43.10 -v -0.66 7.22 43.05 -v -2.20 7.04 41.37 -v -1.32 8.19 41.26 -v -0.05 7.42 43.02 -v 0.03 8.62 41.20 -v 0.55 7.21 43.04 -v 1.34 8.17 41.23 -v 0.89 6.69 43.08 -v 2.11 7.01 41.33 -v 0.86 6.04 43.14 -v 2.04 5.59 41.46 -v 0.47 5.52 43.19 -v 1.16 4.45 41.57 -v -0.15 5.33 43.22 -v -0.19 4.02 41.63 -v -0.74 5.53 43.20 -v -1.50 4.47 41.60 -v -1.09 6.06 43.16 -v -2.27 5.62 41.50 -v -0.20 3.16 38.93 -v -1.94 3.76 38.90 -v -2.97 5.30 38.76 -v -2.88 7.20 38.59 -v -1.71 8.72 38.44 -v 0.10 9.29 38.37 -v 1.84 8.70 38.40 -v 2.87 7.15 38.54 -v 2.78 5.26 38.71 -v 1.61 3.73 38.86 -v -0.11 6.40 43.97 -v 2.25 5.68 40.33 -v 0.23 3.72 40.34 -v 7.55 -5.03 41.18 -v 6.53 -5.89 40.11 -v -2.39 6.87 40.27 -v -0.36 8.83 39.88 -v -7.68 17.58 39.26 -v -6.63 18.36 38.02 -v -7.10 18.35 38.37 -v -7.59 18.07 38.89 -v -11.88 -2.05 40.51 -v -12.14 -1.59 39.98 -v -11.39 -2.12 40.84 -v -12.14 -1.14 39.60 -v -2.58 5.85 39.82 -v -0.73 3.87 40.17 -v -0.75 3.90 40.52 -v -2.60 5.87 40.18 -v -11.53 -1.92 41.09 -v -12.28 -0.94 39.85 -v -12.28 -1.40 40.23 -v -12.02 -1.86 40.76 -v 7.74 -4.89 40.89 -v 2.27 5.69 39.97 -v 0.25 3.72 39.99 -v 6.72 -5.74 39.83 -v 12.03 14.07 38.30 -v 12.17 13.89 38.58 -v 12.04 13.60 38.00 -v 12.18 13.42 38.29 -v 11.76 14.57 38.74 -v 11.89 14.39 39.03 -v 11.40 14.47 39.35 -v 11.26 14.65 39.07 -v 0.60 8.66 39.71 -v 0.62 8.66 40.07 -v 2.45 6.68 39.69 -v 2.47 6.67 40.05 -v -7.29 18.19 38.11 -v -6.82 18.20 37.77 -v -7.77 17.91 38.63 -v -7.87 17.42 39.01 -v -2.40 6.84 39.91 -v -0.37 8.80 39.53 -# 79 vertices - -vn 0.56 -0.83 -0.03 -vn -0.69 0.31 0.65 -vn -0.42 0.65 0.63 -vn -0.85 0.35 0.40 -vn -0.51 0.77 0.38 -vn 0.01 0.77 0.63 -vn 0.01 0.92 0.38 -vn 0.44 0.62 0.65 -vn 0.55 0.74 0.40 -vn 0.70 0.25 0.66 -vn 0.87 0.27 0.42 -vn 0.70 -0.20 0.68 -vn 0.86 -0.28 0.43 -vn 0.44 -0.56 0.71 -vn 0.53 -0.72 0.45 -vn -0.00 -0.69 0.72 -vn -0.01 -0.88 0.47 -vn -0.45 -0.53 0.72 -vn -0.56 -0.69 0.46 -vn -0.71 -0.14 0.69 -vn -0.88 -0.21 0.43 -vn -0.01 -0.95 0.30 -vn -0.60 -0.75 0.29 -vn -0.94 -0.23 0.27 -vn -0.90 0.36 0.24 -vn -0.54 0.81 0.23 -vn 0.02 0.97 0.23 -vn 0.58 0.78 0.25 -vn 0.92 0.29 0.27 -vn 0.91 -0.30 0.28 -vn 0.57 -0.77 0.30 -vn 0.00 0.07 1.00 -vn -0.01 -0.09 -1.00 -vn -0.05 0.06 1.00 -vn -0.09 0.02 1.00 -vn -0.48 -0.32 0.82 -vn -0.52 -0.35 0.78 -vn -0.53 -0.33 0.78 -vn 0.07 0.13 0.99 -vn 0.11 0.16 0.98 -vn 0.47 0.44 0.76 -vn 0.51 0.47 0.72 -vn 0.52 0.45 0.73 -vn 0.40 -0.58 -0.71 -vn 0.39 -0.54 -0.75 -vn 0.42 -0.57 -0.71 -vn 0.06 -0.19 -0.98 -vn 0.02 -0.15 -0.99 -vn -0.03 0.15 0.99 -vn -0.06 0.19 0.98 -vn -0.39 0.54 0.75 -vn -0.42 0.57 0.71 -vn -0.40 0.58 0.71 -vn 0.84 -0.36 0.40 -vn 0.88 0.46 0.06 -vn 0.88 0.46 0.07 -vn 0.67 0.38 0.64 -vn 0.66 0.38 0.65 -vn -0.70 0.72 -0.02 -vn -0.63 -0.42 -0.65 -vn -0.64 -0.43 -0.64 -vn -0.83 -0.55 -0.07 -vn -0.84 -0.55 -0.06 -vn 0.53 0.33 -0.78 -vn 0.48 0.32 -0.82 -vn 0.52 0.35 -0.78 -vn 0.09 -0.03 -1.00 -vn 0.05 -0.06 -1.00 -vn 0.92 0.21 -0.32 -vn 0.84 0.53 -0.08 -vn 0.38 0.85 0.36 -vn -0.49 0.87 0.03 -vn -0.49 0.87 0.04 -vn -0.34 0.71 0.61 -vn -0.34 0.71 0.62 -vn -0.73 -0.68 0.03 -vn 0.38 -0.68 -0.62 -vn 0.39 -0.69 -0.61 -vn 0.57 -0.82 -0.04 -vn 0.57 -0.82 -0.03 -vn -0.43 0.46 -0.77 -vn -0.42 0.41 -0.81 -vn -0.45 0.45 -0.77 -vn -0.08 0.01 -1.00 -vn -0.04 -0.03 -1.00 -vn 0.05 0.03 1.00 -vn 0.08 -0.00 1.00 -vn 0.42 -0.41 0.81 -vn 0.45 -0.45 0.77 -vn 0.43 -0.46 0.77 -vn -0.29 0.89 -0.35 -vn -0.57 0.82 -0.10 -vn -0.83 0.43 0.35 -vn -0.89 -0.45 0.07 -vn -0.89 -0.45 0.08 -vn -0.69 -0.28 0.67 -vn -0.68 -0.27 0.68 -vn 0.70 -0.72 0.04 -vn 0.65 0.32 -0.69 -vn 0.66 0.32 -0.68 -vn 0.84 0.54 -0.08 -vn 0.84 0.54 -0.07 -vn -0.52 -0.45 -0.73 -vn -0.47 -0.44 -0.77 -vn -0.50 -0.47 -0.72 -vn -0.11 -0.15 -0.98 -vn -0.07 -0.12 -0.99 -vn -0.91 -0.27 -0.32 -vn -0.84 -0.54 -0.06 -vn -0.39 -0.82 0.42 -vn 0.49 -0.87 0.10 -vn 0.49 -0.86 0.11 -vn 0.37 -0.62 0.69 -vn 0.37 -0.62 0.70 -vn 0.73 0.68 -0.00 -vn -0.41 0.59 -0.70 -vn -0.42 0.59 -0.69 -vn -0.57 0.81 -0.11 -vn 0.27 -0.92 -0.28 -# 119 vertex normals - -vt 0.04 0.85 0.00 -vt 0.03 0.85 0.00 -vt 0.92 0.13 0.00 -vt 0.92 0.12 0.00 -vt 0.96 0.13 0.00 -vt 0.96 0.11 0.00 -vt 0.96 0.10 0.00 -vt 0.92 0.14 0.00 -vt 0.96 0.14 0.00 -vt 0.92 0.15 0.00 -vt 0.96 0.16 0.00 -vt 0.96 0.17 0.00 -vt 0.96 0.15 0.00 -vt 1.00 0.18 0.00 -vt 1.00 0.16 0.00 -vt 1.00 0.15 0.00 -vt 1.00 0.13 0.00 -vt 1.00 0.11 0.00 -vt 1.00 0.09 0.00 -vt 0.91 0.13 0.00 -vt 0.80 0.95 0.00 -vt 0.81 0.94 0.00 -vt 0.81 0.96 0.00 -vt 0.82 0.95 0.00 -vt 0.82 0.96 0.00 -vt 0.80 0.96 0.00 -vt 0.38 0.65 0.00 -vt 0.37 0.68 0.00 -vt 0.23 0.65 0.00 -vt 0.23 0.67 0.00 -vt 0.23 0.66 0.00 -vt 0.37 0.66 0.00 -vt 0.37 0.67 0.00 -vt 0.35 0.66 0.00 -vt 0.35 0.67 0.00 -vt 0.06 0.85 0.00 -vt 0.05 0.85 0.00 -# 37 texture coords - -g P_51_Mustang_Proppeler -f 1/1/1 2/1/1 3/2/1 -f 4/2/1 3/2/1 2/1/1 -f 5/3/2 6/4/3 7/5/4 -f 8/6/5 7/5/4 6/4/3 -f 6/4/3 9/4/6 8/6/5 -f 10/7/7 8/6/5 9/4/6 -f 9/4/6 11/4/8 10/7/7 -f 12/6/9 10/7/7 11/4/8 -f 11/4/8 13/3/10 12/6/9 -f 14/5/11 12/6/9 13/3/10 -f 13/3/10 15/8/12 14/5/11 -f 16/9/13 14/5/11 15/8/12 -f 15/8/12 17/10/14 16/9/13 -f 18/11/15 16/9/13 17/10/14 -f 17/10/14 19/10/16 18/11/15 -f 20/12/17 18/11/15 19/10/16 -f 19/10/16 21/10/18 20/12/17 -f 22/11/19 20/12/17 21/10/18 -f 21/10/18 23/8/20 22/11/19 -f 24/13/21 22/11/19 23/8/20 -f 20/12/17 22/11/19 25/14/22 -f 26/15/23 25/14/22 22/11/19 -f 22/11/19 24/13/21 26/15/23 -f 27/16/24 26/15/23 24/13/21 -f 23/8/20 5/3/2 24/13/21 -f 7/5/4 24/13/21 5/3/2 -f 24/13/21 7/5/4 27/16/24 -f 28/17/25 27/16/24 7/5/4 -f 7/5/4 8/6/5 28/17/25 -f 29/18/26 28/17/25 8/6/5 -f 8/6/5 10/7/7 29/18/26 -f 30/19/27 29/18/26 10/7/7 -f 10/7/7 12/6/9 30/19/27 -f 31/18/28 30/19/27 12/6/9 -f 12/6/9 14/5/11 31/18/28 -f 32/17/29 31/18/28 14/5/11 -f 14/5/11 16/9/13 32/17/29 -f 33/16/30 32/17/29 16/9/13 -f 16/9/13 18/11/15 33/16/30 -f 34/15/31 33/16/30 18/11/15 -f 18/11/15 20/12/17 34/15/31 -f 25/14/22 34/15/31 20/12/17 -f 35/20/32 21/10/18 19/10/16 -f 35/20/32 23/8/20 21/10/18 -f 35/20/32 5/3/2 23/8/20 -f 35/20/32 6/4/3 5/3/2 -f 35/20/32 9/4/6 6/4/3 -f 35/20/32 11/4/8 9/4/6 -f 35/20/32 13/3/10 11/4/8 -f 35/20/32 15/8/12 13/3/10 -f 35/20/32 17/10/14 15/8/12 -f 35/20/32 19/10/16 17/10/14 -f 31/21/33 32/22/33 30/21/33 -f 32/22/33 28/23/33 30/21/33 -f 34/24/33 28/23/33 32/22/33 -f 26/25/33 28/23/33 34/24/33 -f 25/24/33 26/25/33 34/24/33 -f 30/21/33 28/23/33 29/26/33 -f 27/23/33 28/23/33 26/25/33 -f 36/27/34 37/28/35 38/29/36 -f 37/28/35 39/30/37 38/29/36 -f 39/30/37 1/31/38 38/29/36 -f 1/31/38 3/31/38 38/29/36 -f 40/27/39 41/28/40 42/29/41 -f 41/28/40 43/30/42 42/29/41 -f 43/30/42 44/31/43 42/29/41 -f 44/31/43 45/31/43 42/29/41 -f 46/31/44 47/31/44 48/29/45 -f 47/31/44 49/30/46 48/29/45 -f 49/30/46 50/28/47 48/29/45 -f 50/28/47 51/27/48 48/29/45 -f 52/27/49 53/28/50 54/29/51 -f 53/28/50 55/30/52 54/29/51 -f 55/30/52 56/31/53 54/29/51 -f 56/31/53 57/31/53 54/29/51 -f 3/30/54 4/31/54 38/30/54 -f 58/31/54 38/30/54 4/31/54 -f 59/32/55 36/33/56 58/31/57 -f 38/30/58 58/31/57 36/33/56 -f 60/34/59 37/35/59 59/32/59 -f 36/33/59 59/32/59 37/35/59 -f 61/31/60 39/30/61 60/34/62 -f 39/30/61 37/35/63 60/34/62 -f 4/31/64 2/31/64 58/29/65 -f 2/31/64 61/30/66 58/29/65 -f 61/30/66 60/28/67 58/29/65 -f 60/28/67 59/27/68 58/29/65 -f 62/1/69 63/1/69 64/36/69 -f 65/37/69 64/36/69 63/1/69 -f 66/2/70 67/2/70 62/1/70 -f 63/1/70 62/1/70 67/2/70 -f 67/30/71 66/31/71 68/30/71 -f 69/31/71 68/30/71 66/31/71 -f 70/32/72 71/33/73 69/31/74 -f 68/30/75 69/31/74 71/33/73 -f 72/34/76 73/35/76 70/32/76 -f 71/33/76 70/32/76 73/35/76 -f 64/31/77 65/30/78 72/34/79 -f 65/30/78 73/35/80 72/34/79 -f 66/31/81 62/31/81 69/29/82 -f 62/31/81 64/30/83 69/29/82 -f 64/30/83 72/28/84 69/29/82 -f 72/28/84 70/27/85 69/29/82 -f 71/27/86 73/28/87 68/29/88 -f 73/28/87 65/30/89 68/29/88 -f 65/30/89 63/31/90 68/29/88 -f 63/31/90 67/31/90 68/29/88 -f 74/1/91 44/1/91 75/2/91 -f 43/2/91 75/2/91 44/1/91 -f 76/37/92 45/36/92 74/1/92 -f 44/1/92 74/1/92 45/36/92 -f 45/30/93 76/31/93 42/30/93 -f 77/31/93 42/30/93 76/31/93 -f 78/32/94 40/33/95 77/31/96 -f 42/30/97 77/31/96 40/33/95 -f 79/34/98 41/35/98 78/32/98 -f 40/33/98 78/32/98 41/35/98 -f 75/31/99 43/30/100 79/34/101 -f 43/30/100 41/35/102 79/34/101 -f 76/31/103 74/31/103 77/29/104 -f 74/31/103 75/30/105 77/29/104 -f 75/30/105 79/28/106 77/29/104 -f 79/28/106 78/27/107 77/29/104 -f 47/1/108 56/1/108 49/2/108 -f 55/2/108 49/2/108 56/1/108 -f 46/37/109 57/37/109 47/1/109 -f 56/1/109 47/1/109 57/37/109 -f 57/30/110 46/31/110 54/30/110 -f 48/31/110 54/30/110 46/31/110 -f 51/32/111 52/33/112 48/31/113 -f 54/30/114 48/31/113 52/33/112 -f 50/34/115 53/35/115 51/32/115 -f 52/33/115 51/32/115 53/35/115 -f 49/31/116 55/30/117 50/34/118 -f 55/30/117 53/35/92 50/34/118 -f 33/22/33 34/24/33 32/22/33 -f 2/1/119 1/1/119 61/36/119 -f 39/37/119 61/36/119 1/1/119 -# 138 faces - -# -# object P_51_Mustang_Right_Rockets -# - -v -34.05 -4.42 7.01 -v -33.98 -4.35 7.01 -v -34.09 -4.33 9.68 -v -34.02 -4.26 9.67 -v -35.60 -3.83 7.68 -v -35.21 -3.94 7.69 -v -35.84 -3.60 19.17 -v -36.18 -3.24 19.14 -v -35.88 -3.53 7.66 -v -36.29 -2.75 19.10 -v -36.09 -2.72 20.16 -v -36.01 -3.10 20.20 -v -35.35 -2.67 21.77 -v -35.74 -3.38 20.22 -v -35.37 -3.49 20.23 -v -35.37 -3.74 19.18 -v -34.88 -3.61 19.16 -v -34.81 -3.84 7.67 -v -34.50 -3.54 7.65 -v -34.50 -3.25 19.13 -v -34.37 -3.14 7.61 -v -34.35 -2.76 19.08 -v -34.46 -2.73 7.57 -v -34.46 -2.27 19.04 -v -34.74 -2.43 7.55 -v -34.79 -1.91 19.01 -v -35.13 -2.32 7.54 -v -35.27 -1.77 19.00 -v -35.54 -2.43 7.55 -v -35.76 -1.90 19.01 -v -35.84 -2.72 7.58 -v -36.13 -2.26 19.05 -v -35.97 -3.13 7.62 -v -35.97 -2.33 20.13 -v -35.68 -2.05 20.10 -v -35.30 -1.95 20.08 -v -34.92 -2.06 20.09 -v -34.66 -2.34 20.12 -v -34.58 -2.73 20.15 -v -34.70 -3.11 20.19 -v -34.99 -3.39 20.21 -v -36.27 -1.89 6.80 -v -35.13 -3.10 7.59 -v -36.34 -1.96 6.81 -v -35.20 -3.17 7.60 -v -36.30 -1.80 9.47 -v -36.38 -1.87 9.47 -v -35.16 -3.02 10.26 -v -35.24 -3.08 10.27 -v -33.90 -1.89 9.45 -v -33.97 -1.82 9.45 -v -35.18 -3.09 10.27 -v -35.25 -3.01 10.26 -v -36.43 -4.31 9.70 -v -36.49 -4.24 9.69 -v -33.87 -1.98 6.79 -v -35.15 -3.17 7.60 -v -36.39 -4.40 7.03 -v -36.46 -4.33 7.02 -v -35.21 -3.10 7.59 -v -33.93 -1.90 6.78 -v -31.30 -4.44 6.99 -v -31.23 -4.37 6.98 -v -31.34 -4.35 9.66 -v -31.26 -4.28 9.65 -v -32.85 -3.85 7.66 -v -32.46 -3.96 7.67 -v -33.09 -3.63 19.15 -v -33.43 -3.26 19.12 -v -33.13 -3.55 7.63 -v -33.53 -2.77 19.08 -v -33.34 -2.74 20.14 -v -33.25 -3.12 20.17 -v -32.60 -2.69 21.75 -v -32.99 -3.41 20.20 -v -32.62 -3.51 20.21 -v -32.61 -3.76 19.16 -v -32.12 -3.63 19.14 -v -32.05 -3.86 7.65 -v -31.75 -3.56 7.62 -v -31.75 -3.28 19.11 -v -31.62 -3.16 7.59 -v -31.60 -2.78 19.06 -v -31.71 -2.75 7.55 -v -31.71 -2.29 19.02 -v -31.99 -2.45 7.52 -v -32.04 -1.93 18.99 -v -32.38 -2.34 7.52 -v -32.52 -1.79 18.98 -v -32.78 -2.45 7.53 -v -33.01 -1.92 18.99 -v -33.09 -2.74 7.56 -v -33.38 -2.28 19.03 -v -33.22 -3.15 7.60 -v -33.22 -2.35 20.10 -v -32.93 -2.07 20.08 -v -32.54 -1.97 20.06 -v -32.17 -2.08 20.07 -v -31.91 -2.36 20.09 -v -31.82 -2.75 20.13 -v -31.94 -3.13 20.16 -v -32.23 -3.41 20.19 -v -33.52 -1.91 6.78 -v -32.38 -3.12 7.57 -v -33.59 -1.98 6.78 -v -32.45 -3.19 7.58 -v -33.55 -1.82 9.44 -v -33.63 -1.89 9.45 -v -32.41 -3.04 10.24 -v -32.48 -3.11 10.25 -v -31.15 -1.91 9.43 -v -31.22 -1.84 9.43 -v -32.43 -3.11 10.24 -v -32.49 -3.04 10.24 -v -33.67 -4.33 9.68 -v -33.74 -4.26 9.67 -v -31.12 -2.00 6.77 -v -32.39 -3.19 7.58 -v -33.64 -4.42 7.01 -v -33.70 -4.35 7.00 -v -32.46 -3.12 7.57 -v -31.18 -1.93 6.76 -v -28.67 -4.46 6.97 -v -28.59 -4.39 6.96 -v -28.70 -4.37 9.64 -v -28.63 -4.30 9.63 -v -30.21 -3.87 7.64 -v -29.82 -3.98 7.65 -v -30.45 -3.65 19.13 -v -30.79 -3.28 19.10 -v -30.49 -3.57 7.61 -v -30.90 -2.79 19.06 -v -30.70 -2.76 20.12 -v -30.62 -3.14 20.15 -v -29.96 -2.71 21.73 -v -30.35 -3.43 20.18 -v -29.98 -3.53 20.19 -v -29.98 -3.78 19.14 -v -29.49 -3.65 19.12 -v -29.42 -3.88 7.63 -v -29.11 -3.58 7.60 -v -29.12 -3.30 19.09 -v -28.98 -3.18 7.57 -v -28.96 -2.81 19.04 -v -29.07 -2.77 7.53 -v -29.07 -2.31 19.00 -v -29.35 -2.47 7.50 -v -29.41 -1.95 18.97 -v -29.74 -2.36 7.50 -v -29.88 -1.81 18.96 -v -30.15 -2.47 7.51 -v -30.37 -1.94 18.97 -v -30.45 -2.76 7.54 -v -30.74 -2.30 19.01 -v -30.58 -3.17 7.58 -v -30.58 -2.37 20.08 -v -30.29 -2.09 20.06 -v -29.91 -1.99 20.04 -v -29.53 -2.10 20.05 -v -29.27 -2.38 20.07 -v -29.19 -2.77 20.11 -v -29.31 -3.15 20.14 -v -29.60 -3.43 20.17 -v -30.88 -1.93 6.76 -v -29.74 -3.14 7.55 -v -30.95 -2.00 6.76 -v -29.81 -3.21 7.56 -v -30.92 -1.84 9.42 -v -30.99 -1.91 9.43 -v -29.77 -3.06 10.22 -v -29.85 -3.13 10.22 -v -28.51 -1.93 9.41 -v -28.58 -1.86 9.41 -v -29.79 -3.13 10.22 -v -29.86 -3.06 10.22 -v -31.04 -4.35 9.66 -v -31.10 -4.28 9.65 -v -28.48 -2.02 6.75 -v -29.76 -3.21 7.56 -v -31.00 -4.44 6.99 -v -31.07 -4.37 6.98 -v -29.82 -3.14 7.55 -v -28.54 -1.95 6.74 -# 183 vertices - -vn 0.69 -0.72 0.03 -vn -0.52 -0.85 0.01 -vn -0.01 -1.00 0.02 -vn -0.52 -0.85 0.11 -vn -0.89 -0.45 0.10 -vn -0.89 -0.46 -0.01 -vn -0.98 -0.20 0.08 -vn -0.94 -0.18 0.29 -vn -0.85 -0.42 0.32 -vn 0.32 -0.56 0.77 -vn -0.50 -0.79 0.34 -vn -0.01 -0.94 0.35 -vn -0.01 -0.99 0.12 -vn 0.49 -0.86 0.12 -vn 0.50 -0.87 0.02 -vn 0.86 -0.52 0.01 -vn 0.85 -0.51 0.12 -vn 1.00 -0.04 -0.00 -vn 0.99 -0.04 0.10 -vn 0.88 0.47 -0.02 -vn 0.88 0.47 0.08 -vn 0.52 0.85 -0.04 -vn 0.52 0.85 0.07 -vn 0.01 1.00 -0.05 -vn 0.01 1.00 0.06 -vn -0.48 0.87 -0.05 -vn -0.49 0.87 0.05 -vn -0.85 0.53 -0.04 -vn -0.85 0.53 0.06 -vn -0.95 0.29 -0.04 -vn -0.95 0.30 0.07 -vn -0.81 0.52 0.27 -vn -0.91 0.31 0.28 -vn -0.43 0.79 0.44 -vn -0.46 0.85 0.27 -vn 0.01 0.96 0.27 -vn 0.49 0.82 0.29 -vn 0.83 0.46 0.30 -vn 0.95 -0.02 0.32 -vn 0.82 -0.47 0.33 -vn 0.47 -0.81 0.34 -vn -0.01 -0.09 -1.00 -vn 0.25 -0.35 -0.90 -vn -0.02 -0.08 -1.00 -vn -0.27 0.19 -0.94 -vn -0.25 0.35 0.90 -vn 0.01 0.09 1.00 -vn 0.02 0.08 1.00 -vn 0.27 -0.19 0.94 -vn 0.73 0.68 -0.01 -vn 0.27 0.33 0.91 -vn -0.00 0.08 1.00 -vn -0.27 -0.17 0.95 -vn 0.27 0.17 -0.95 -vn 0.00 -0.08 -1.00 -vn -0.27 -0.33 -0.91 -vn -0.69 0.72 -0.03 -vn -0.73 -0.68 0.01 -vn -0.98 -0.21 -0.02 -vn -0.00 -0.09 -1.00 -vn 0.00 0.09 1.00 -# 61 vertex normals - -vt 0.71 0.65 0.00 -vt 0.81 0.65 0.00 -vt 0.64 0.57 0.00 -vt 0.64 0.58 0.00 -vt 0.83 0.57 0.00 -vt 0.85 0.57 0.00 -vt 0.89 0.58 0.00 -vt 0.85 0.58 0.00 -vt 0.83 0.58 0.00 -vt 0.64 0.59 0.00 -vt 0.83 0.59 0.00 -vt 0.64 0.60 0.00 -vt 0.83 0.60 0.00 -vt 0.64 0.61 0.00 -vt 0.83 0.61 0.00 -vt 0.85 0.60 0.00 -vt 0.85 0.61 0.00 -vt 0.89 0.60 0.00 -vt 0.85 0.59 0.00 -vt 0.39 0.73 0.00 -vt 0.39 0.74 0.00 -vt 0.39 0.72 0.00 -vt 0.37 0.73 0.00 -vt 0.37 0.72 0.00 -vt 0.38 0.71 0.00 -vt 0.75 0.65 0.00 -vt 0.69 0.65 0.00 -vt 0.98 0.63 0.00 -vt 0.91 0.63 0.00 -vt 0.98 0.66 0.00 -vt 0.91 0.66 0.00 -vt 0.98 0.70 0.00 -vt 0.91 0.70 0.00 -vt 0.37 0.74 0.00 -vt 0.38 0.74 0.00 -# 35 texture coords - -g P_51_Mustang_Right_Rockets -f 80/38/120 81/38/120 82/39/120 -f 83/39/120 82/39/120 81/38/120 -f 84/40/121 85/41/122 86/42/123 -f 86/42/123 87/42/124 84/40/121 -f 88/40/125 84/40/121 87/42/124 -f 87/42/124 89/42/126 88/40/125 -f 89/42/126 87/42/124 90/43/127 -f 91/43/128 90/43/127 87/42/124 -f 90/43/127 91/43/128 92/44/129 -f 91/43/128 93/43/130 92/44/129 -f 93/43/130 94/45/131 92/44/129 -f 94/45/131 93/43/130 95/46/132 -f 95/46/132 96/46/133 94/45/131 -f 96/46/133 95/46/132 97/41/134 -f 97/41/134 98/41/135 96/46/133 -f 99/46/136 96/46/133 98/41/135 -f 98/41/135 100/47/137 99/46/136 -f 101/48/138 99/46/136 100/47/137 -f 100/47/137 102/47/139 101/48/138 -f 103/48/140 101/48/138 102/47/139 -f 87/42/124 86/42/123 91/43/128 -f 93/43/130 91/43/128 86/42/123 -f 86/42/123 95/46/132 93/43/130 -f 95/46/132 86/42/123 85/41/122 -f 85/41/122 97/41/134 95/46/132 -f 102/47/139 104/47/141 103/48/140 -f 105/48/142 103/48/140 104/47/141 -f 104/47/141 106/49/143 105/48/142 -f 107/50/144 105/48/142 106/49/143 -f 106/49/143 108/49/145 107/50/144 -f 109/50/146 107/50/144 108/49/145 -f 108/49/145 110/49/147 109/50/146 -f 111/50/148 109/50/146 110/49/147 -f 110/49/147 112/51/149 111/50/148 -f 89/52/150 111/50/148 112/51/149 -f 111/50/148 89/52/150 113/53/151 -f 90/54/152 113/53/151 89/52/150 -f 113/53/151 90/54/152 92/55/153 -f 114/53/154 113/53/151 92/55/153 -f 115/53/155 114/53/154 92/55/153 -f 114/53/154 115/53/155 109/50/146 -f 107/50/144 109/50/146 115/53/155 -f 115/53/155 116/56/156 107/50/144 -f 116/56/156 115/53/155 92/55/153 -f 105/48/142 107/50/144 116/56/156 -f 116/56/156 117/56/157 105/48/142 -f 103/48/140 105/48/142 117/56/157 -f 117/56/157 118/56/158 103/48/140 -f 101/48/138 103/48/140 118/56/158 -f 118/56/158 119/45/159 101/48/138 -f 99/46/136 101/48/138 119/45/159 -f 119/45/159 120/45/160 99/46/136 -f 96/46/133 99/46/136 120/45/160 -f 120/45/160 94/45/131 96/46/133 -f 94/45/131 120/45/160 92/44/129 -f 120/45/160 119/45/159 92/44/129 -f 119/45/159 118/56/158 92/44/129 -f 118/56/158 117/56/157 92/44/129 -f 117/56/157 116/56/156 92/44/129 -f 102/57/161 100/57/161 104/58/161 -f 100/57/161 97/59/161 104/58/161 -f 97/59/161 112/60/161 104/58/161 -f 84/61/161 112/60/161 97/59/161 -f 88/61/161 112/60/161 84/61/161 -f 98/59/161 97/59/161 100/57/161 -f 85/62/161 84/61/161 97/59/161 -f 121/39/162 122/63/161 123/39/162 -f 124/63/163 123/39/162 122/63/161 -f 124/63/163 122/63/161 80/64/164 -f 81/64/164 80/64/164 122/63/161 -f 125/39/165 126/39/165 127/63/166 -f 128/63/167 127/63/166 126/39/165 -f 127/63/166 128/63/167 83/64/168 -f 82/64/168 83/64/168 128/63/167 -f 121/65/169 125/66/169 122/67/169 -f 127/68/169 122/67/169 125/66/169 -f 122/67/169 127/68/169 81/69/169 -f 83/70/169 81/69/169 127/68/169 -f 129/39/170 130/39/170 131/63/171 -f 132/63/166 131/63/171 130/39/170 -f 131/63/171 132/63/166 133/64/172 -f 134/64/172 133/64/172 132/63/166 -f 135/65/120 129/66/120 136/67/120 -f 131/68/120 136/67/120 129/66/120 -f 136/67/120 131/68/120 137/69/120 -f 133/70/120 137/69/120 131/68/120 -f 137/64/173 138/64/173 136/63/174 -f 139/63/161 136/63/174 138/64/173 -f 139/63/161 140/39/175 136/63/174 -f 135/39/175 136/63/174 140/39/175 -f 138/65/176 134/66/176 139/67/176 -f 132/68/176 139/67/176 134/66/176 -f 139/67/176 132/68/176 140/69/176 -f 130/70/176 140/69/176 132/68/176 -f 80/65/177 82/66/177 124/67/177 -f 128/68/177 124/67/177 82/66/177 -f 124/67/177 128/68/177 123/69/177 -f 126/70/177 123/69/177 128/68/177 -f 121/38/176 123/38/176 125/39/176 -f 126/39/176 125/39/176 123/38/176 -f 138/38/177 137/38/177 134/39/177 -f 133/39/177 134/39/177 137/38/177 -f 135/38/169 140/38/169 129/39/169 -f 130/39/169 129/39/169 140/38/169 -f 109/50/146 111/50/148 114/53/154 -f 113/53/151 114/53/154 111/50/148 -f 112/40/178 88/40/125 89/42/126 -f 110/60/161 108/71/161 112/60/161 -f 112/60/161 108/71/161 104/58/161 -f 104/58/161 108/71/161 106/72/161 -f 141/38/120 142/38/120 143/39/120 -f 144/39/120 143/39/120 142/38/120 -f 145/40/121 146/41/122 147/42/123 -f 147/42/123 148/42/124 145/40/121 -f 149/40/125 145/40/121 148/42/124 -f 148/42/124 150/42/126 149/40/125 -f 150/42/126 148/42/124 151/43/127 -f 152/43/128 151/43/127 148/42/124 -f 151/43/127 152/43/128 153/44/129 -f 152/43/128 154/43/130 153/44/129 -f 154/43/130 155/45/131 153/44/129 -f 155/45/131 154/43/130 156/46/132 -f 156/46/132 157/46/133 155/45/131 -f 157/46/133 156/46/132 158/41/134 -f 158/41/134 159/41/135 157/46/133 -f 160/46/136 157/46/133 159/41/135 -f 159/41/135 161/47/137 160/46/136 -f 162/48/138 160/46/136 161/47/137 -f 161/47/137 163/47/139 162/48/138 -f 164/48/140 162/48/138 163/47/139 -f 148/42/124 147/42/123 152/43/128 -f 154/43/130 152/43/128 147/42/123 -f 147/42/123 156/46/132 154/43/130 -f 156/46/132 147/42/123 146/41/122 -f 146/41/122 158/41/134 156/46/132 -f 163/47/139 165/47/141 164/48/140 -f 166/48/142 164/48/140 165/47/141 -f 165/47/141 167/49/143 166/48/142 -f 168/50/144 166/48/142 167/49/143 -f 167/49/143 169/49/145 168/50/144 -f 170/50/146 168/50/144 169/49/145 -f 169/49/145 171/49/147 170/50/146 -f 172/50/148 170/50/146 171/49/147 -f 171/49/147 173/51/149 172/50/148 -f 150/52/150 172/50/148 173/51/149 -f 172/50/148 150/52/150 174/53/151 -f 151/54/152 174/53/151 150/52/150 -f 174/53/151 151/54/152 153/55/153 -f 175/53/154 174/53/151 153/55/153 -f 176/53/155 175/53/154 153/55/153 -f 175/53/154 176/53/155 170/50/146 -f 168/50/144 170/50/146 176/53/155 -f 176/53/155 177/56/156 168/50/144 -f 177/56/156 176/53/155 153/55/153 -f 166/48/142 168/50/144 177/56/156 -f 177/56/156 178/56/157 166/48/142 -f 164/48/140 166/48/142 178/56/157 -f 178/56/157 179/56/158 164/48/140 -f 162/48/138 164/48/140 179/56/158 -f 179/56/158 180/45/159 162/48/138 -f 160/46/136 162/48/138 180/45/159 -f 180/45/159 181/45/160 160/46/136 -f 157/46/133 160/46/136 181/45/160 -f 181/45/160 155/45/131 157/46/133 -f 155/45/131 181/45/160 153/44/129 -f 181/45/160 180/45/159 153/44/129 -f 180/45/159 179/56/158 153/44/129 -f 179/56/158 178/56/157 153/44/129 -f 178/56/157 177/56/156 153/44/129 -f 163/57/161 161/57/161 165/58/161 -f 161/57/161 158/59/161 165/58/161 -f 158/59/161 173/60/161 165/58/161 -f 145/61/161 173/60/161 158/59/161 -f 149/61/161 173/60/161 145/61/161 -f 159/59/161 158/59/161 161/57/161 -f 146/62/161 145/61/161 158/59/161 -f 182/39/162 183/63/161 184/39/162 -f 185/63/163 184/39/162 183/63/161 -f 185/63/163 183/63/161 141/64/164 -f 142/64/164 141/64/164 183/63/161 -f 186/39/165 187/39/165 188/63/166 -f 189/63/167 188/63/166 187/39/165 -f 188/63/166 189/63/167 144/64/168 -f 143/64/168 144/64/168 189/63/167 -f 182/65/169 186/66/169 183/67/169 -f 188/68/169 183/67/169 186/66/169 -f 183/67/169 188/68/169 142/69/169 -f 144/70/169 142/69/169 188/68/169 -f 190/39/170 191/39/170 192/63/171 -f 193/63/166 192/63/171 191/39/170 -f 192/63/171 193/63/166 194/64/172 -f 195/64/172 194/64/172 193/63/166 -f 196/65/120 190/66/120 197/67/120 -f 192/68/120 197/67/120 190/66/120 -f 197/67/120 192/68/120 198/69/120 -f 194/70/120 198/69/120 192/68/120 -f 198/64/173 199/64/173 197/63/174 -f 200/63/179 197/63/174 199/64/173 -f 200/63/179 201/39/175 197/63/174 -f 196/39/175 197/63/174 201/39/175 -f 199/65/176 195/66/176 200/67/176 -f 193/68/176 200/67/176 195/66/176 -f 200/67/176 193/68/176 201/69/176 -f 191/70/176 201/69/176 193/68/176 -f 141/65/177 143/66/177 185/67/177 -f 189/68/177 185/67/177 143/66/177 -f 185/67/177 189/68/177 184/69/177 -f 187/70/177 184/69/177 189/68/177 -f 182/38/176 184/38/176 186/39/176 -f 187/39/176 186/39/176 184/38/176 -f 199/38/177 198/38/177 195/39/177 -f 194/39/177 195/39/177 198/38/177 -f 196/38/169 201/38/169 190/39/169 -f 191/39/169 190/39/169 201/38/169 -f 170/50/146 172/50/148 175/53/154 -f 174/53/151 175/53/154 172/50/148 -f 173/40/178 149/40/125 150/42/126 -f 171/60/161 169/71/161 173/60/161 -f 173/60/161 169/71/161 165/58/161 -f 165/58/161 169/71/161 167/72/161 -f 202/38/120 203/38/120 204/39/120 -f 205/39/120 204/39/120 203/38/120 -f 206/40/121 207/41/122 208/42/123 -f 208/42/123 209/42/124 206/40/121 -f 210/40/125 206/40/121 209/42/124 -f 209/42/124 211/42/126 210/40/125 -f 211/42/126 209/42/124 212/43/127 -f 213/43/128 212/43/127 209/42/124 -f 212/43/127 213/43/128 214/44/129 -f 213/43/128 215/43/130 214/44/129 -f 215/43/130 216/45/131 214/44/129 -f 216/45/131 215/43/130 217/46/132 -f 217/46/132 218/46/133 216/45/131 -f 218/46/133 217/46/132 219/41/134 -f 219/41/134 220/41/135 218/46/133 -f 221/46/136 218/46/133 220/41/135 -f 220/41/135 222/47/137 221/46/136 -f 223/48/138 221/46/136 222/47/137 -f 222/47/137 224/47/139 223/48/138 -f 225/48/140 223/48/138 224/47/139 -f 209/42/124 208/42/123 213/43/128 -f 215/43/130 213/43/128 208/42/123 -f 208/42/123 217/46/132 215/43/130 -f 217/46/132 208/42/123 207/41/122 -f 207/41/122 219/41/134 217/46/132 -f 224/47/139 226/47/141 225/48/140 -f 227/48/142 225/48/140 226/47/141 -f 226/47/141 228/49/143 227/48/142 -f 229/50/144 227/48/142 228/49/143 -f 228/49/143 230/49/145 229/50/144 -f 231/50/146 229/50/144 230/49/145 -f 230/49/145 232/49/147 231/50/146 -f 233/50/148 231/50/146 232/49/147 -f 232/49/147 234/51/149 233/50/148 -f 211/52/150 233/50/148 234/51/149 -f 233/50/148 211/52/150 235/53/151 -f 212/54/152 235/53/151 211/52/150 -f 235/53/151 212/54/152 214/55/153 -f 236/53/154 235/53/151 214/55/153 -f 237/53/155 236/53/154 214/55/153 -f 236/53/154 237/53/155 231/50/146 -f 229/50/144 231/50/146 237/53/155 -f 237/53/155 238/56/156 229/50/144 -f 238/56/156 237/53/155 214/55/153 -f 227/48/142 229/50/144 238/56/156 -f 238/56/156 239/56/157 227/48/142 -f 225/48/140 227/48/142 239/56/157 -f 239/56/157 240/56/158 225/48/140 -f 223/48/138 225/48/140 240/56/158 -f 240/56/158 241/45/159 223/48/138 -f 221/46/136 223/48/138 241/45/159 -f 241/45/159 242/45/160 221/46/136 -f 218/46/133 221/46/136 242/45/160 -f 242/45/160 216/45/131 218/46/133 -f 216/45/131 242/45/160 214/44/129 -f 242/45/160 241/45/159 214/44/129 -f 241/45/159 240/56/158 214/44/129 -f 240/56/158 239/56/157 214/44/129 -f 239/56/157 238/56/156 214/44/129 -f 224/57/161 222/57/161 226/58/161 -f 222/57/161 219/59/161 226/58/161 -f 219/59/161 234/60/161 226/58/161 -f 206/61/161 234/60/161 219/59/161 -f 210/61/161 234/60/161 206/61/161 -f 220/59/161 219/59/161 222/57/161 -f 207/62/161 206/61/161 219/59/161 -f 243/39/162 244/63/161 245/39/162 -f 246/63/163 245/39/162 244/63/161 -f 246/63/163 244/63/161 202/64/164 -f 203/64/164 202/64/164 244/63/161 -f 247/39/165 248/39/165 249/63/166 -f 250/63/167 249/63/166 248/39/165 -f 249/63/166 250/63/167 205/64/168 -f 204/64/168 205/64/168 250/63/167 -f 243/65/169 247/66/169 244/67/169 -f 249/68/169 244/67/169 247/66/169 -f 244/67/169 249/68/169 203/69/169 -f 205/70/169 203/69/169 249/68/169 -f 251/39/170 252/39/170 253/63/171 -f 254/63/180 253/63/171 252/39/170 -f 253/63/171 254/63/180 255/64/172 -f 256/64/172 255/64/172 254/63/180 -f 257/65/120 251/66/120 258/67/120 -f 253/68/120 258/67/120 251/66/120 -f 258/67/120 253/68/120 259/69/120 -f 255/70/120 259/69/120 253/68/120 -f 259/64/173 260/64/173 258/63/174 -f 261/63/161 258/63/174 260/64/173 -f 261/63/161 262/39/175 258/63/174 -f 257/39/175 258/63/174 262/39/175 -f 260/65/176 256/66/176 261/67/176 -f 254/68/176 261/67/176 256/66/176 -f 261/67/176 254/68/176 262/69/176 -f 252/70/176 262/69/176 254/68/176 -f 202/65/177 204/66/177 246/67/177 -f 250/68/177 246/67/177 204/66/177 -f 246/67/177 250/68/177 245/69/177 -f 248/70/177 245/69/177 250/68/177 -f 243/38/176 245/38/176 247/39/176 -f 248/39/176 247/39/176 245/38/176 -f 260/38/177 259/38/177 256/39/177 -f 255/39/177 256/39/177 259/38/177 -f 257/38/169 262/38/169 251/39/169 -f 252/39/169 251/39/169 262/38/169 -f 231/50/146 233/50/148 236/53/154 -f 235/53/151 236/53/154 233/50/148 -f 234/40/178 210/40/125 211/42/126 -f 232/60/161 230/71/161 234/60/161 -f 234/60/161 230/71/161 226/58/161 -f 226/58/161 230/71/161 228/72/161 -# 330 faces - -# -# object P_51_Mustang_Right_Wing -# - -v -48.14 -0.16 8.05 -v -48.99 -0.03 6.01 -v -48.12 0.14 8.01 -v -29.31 0.19 6.44 -v -37.50 0.25 7.12 -v -30.21 0.47 8.72 -v -37.42 0.46 8.93 -v -44.57 0.16 7.71 -v -44.63 0.35 8.79 -v -47.59 0.24 8.96 -v -44.79 0.51 12.04 -v -47.99 0.25 12.03 -v -45.36 0.48 14.13 -v -48.50 0.36 13.97 -v -48.43 0.22 15.21 -v -49.84 0.07 14.16 -v -49.74 -0.04 15.39 -v -50.25 -0.08 14.12 -v -50.04 -0.09 15.40 -v -49.58 -0.10 16.12 -v -48.28 -0.12 16.74 -v -45.18 0.20 15.46 -v -29.52 0.68 12.85 -v -45.01 -0.15 17.06 -v -37.84 0.31 16.08 -v -37.82 -0.24 17.66 -v -30.95 -0.31 18.28 -v -29.88 0.43 16.64 -v -30.50 0.73 14.92 -v -37.93 0.62 14.50 -v -37.87 0.66 12.48 -v -37.95 -1.08 12.58 -v -38.02 -1.05 14.59 -v -44.85 -0.90 12.10 -v -29.86 -1.33 15.03 -v -37.90 -0.94 16.16 -v -29.38 -1.15 16.73 -v -44.96 -0.79 15.49 -v -48.45 -0.33 15.36 -v -45.08 -0.88 14.18 -v -48.53 -0.34 14.14 -v -48.02 -0.34 12.18 -v -49.75 -0.18 12.22 -v -49.14 -0.12 8.71 -v -47.61 -0.23 9.09 -v -44.67 -0.62 8.83 -v -44.59 -0.38 7.72 -v -37.48 -0.85 9.01 -v -37.54 -0.59 7.18 -v -30.23 -1.03 8.80 -v -29.34 -0.65 6.49 -v -29.61 -1.28 12.96 -v -49.23 0.13 8.56 -v -49.74 0.14 12.03 -v -50.13 -0.08 12.02 -v -49.58 -0.07 8.63 -v -49.75 -0.17 15.42 -v -49.85 -0.23 14.35 -v -29.74 -1.25 16.26 -v -29.78 -2.23 16.37 -v -29.67 -1.06 11.16 -v -29.74 -2.36 12.28 -v -29.92 -2.36 12.29 -v -29.96 -2.23 16.38 -v -29.85 -1.06 11.16 -v -29.92 -1.24 16.26 -v -32.53 -1.18 16.28 -v -32.58 -2.21 16.40 -v -32.35 -1.18 16.27 -v -32.40 -2.21 16.39 -v -32.54 -2.34 12.31 -v -32.36 -2.34 12.30 -v -32.46 -0.98 11.17 -v -32.28 -0.98 11.17 -v -35.27 -1.05 16.29 -v -35.32 -2.19 16.42 -v -35.09 -1.06 16.29 -v -35.15 -2.19 16.42 -v -35.28 -2.32 12.33 -v -35.11 -2.32 12.33 -v -35.21 -0.94 11.19 -v -35.03 -0.95 11.19 -v -29.68 -0.25 3.04 -v -21.55 0.05 5.47 -v -22.30 -1.51 12.76 -v -22.41 -1.49 15.29 -v -22.62 -1.36 17.25 -v -23.33 -0.39 18.94 -v -19.50 -0.44 19.26 -v -19.00 -1.50 17.12 -v -14.13 -0.49 20.28 -v -13.50 -1.56 17.59 -v -14.82 -1.75 15.41 -v -18.80 -1.58 15.14 -v -18.58 -1.57 12.58 -v -22.41 -1.16 8.70 -v -21.59 -0.77 5.53 -v -18.71 -1.36 9.03 -v -18.35 -1.00 6.58 -v -14.07 -1.37 9.24 -v -12.73 -0.99 6.36 -v -18.23 -0.74 5.10 -v -12.47 -0.77 4.38 -v -12.44 -0.05 4.34 -v -18.19 -0.02 5.06 -v -12.67 0.19 6.29 -v -18.29 0.22 6.52 -v -14.04 0.46 9.14 -v -18.63 0.56 8.92 -v -13.44 0.66 12.23 -v -18.47 0.74 12.46 -v -22.34 0.49 8.60 -v -22.20 0.75 12.64 -v -22.31 0.72 15.17 -v -22.53 0.53 17.14 -v -18.91 0.57 17.52 -v -13.40 0.59 18.05 -v -14.35 0.80 15.32 -v -18.69 0.73 15.02 -v -18.32 -0.76 20.39 -v -18.70 -0.53 20.37 -v -18.30 -0.83 18.46 -v -18.68 -0.59 18.44 -v -18.68 -0.07 20.33 -v -18.66 -0.13 18.40 -v -18.28 0.16 20.30 -v -18.26 0.10 18.37 -v -17.89 -0.08 20.32 -v -17.87 -0.14 18.39 -v -17.92 -0.54 20.36 -v -17.90 -0.60 18.43 -v -13.54 -1.60 12.35 -v -19.63 -0.07 20.24 -v -20.01 0.17 20.22 -v -19.65 -0.53 20.28 -v -20.44 -0.52 20.29 -v -20.05 -0.75 20.31 -v -20.41 -0.06 20.25 -v -21.96 -0.75 20.15 -v -22.34 -0.51 20.13 -v -21.94 -0.81 18.22 -v -22.32 -0.57 18.21 -v -22.32 -0.05 20.09 -v -22.30 -0.11 18.16 -v -21.92 0.18 20.07 -v -21.90 0.11 18.14 -v -21.53 -0.06 20.08 -v -21.51 -0.12 18.16 -v -21.56 -0.52 20.13 -v -21.54 -0.58 18.20 -v -26.32 -1.30 15.42 -v -26.39 -2.57 15.66 -v -26.01 -1.30 15.43 -v -26.08 -2.57 15.66 -v -26.38 -2.72 15.16 -v -26.07 -2.72 15.16 -v -25.97 -2.76 11.48 -v -26.29 -2.76 11.48 -v -26.19 -1.32 10.34 -v -25.88 -1.32 10.34 -v -20.03 -0.82 18.38 -v -20.42 -0.58 18.36 -v -20.39 -0.12 18.32 -v -19.99 0.11 18.29 -v -19.61 -0.13 18.31 -v -19.63 -0.59 18.35 -v -24.91 -3.09 9.88 -v -26.21 -2.73 9.87 -v -24.99 -3.07 16.55 -v -26.29 -2.70 16.54 -v -27.54 -3.07 9.90 -v -27.63 -3.05 16.58 -v -28.55 -4.05 9.98 -v -28.64 -4.02 16.65 -v -28.97 -5.38 10.07 -v -29.05 -5.36 16.74 -v -28.68 -6.73 10.15 -v -28.76 -6.70 16.82 -v -27.76 -7.71 10.20 -v -27.85 -7.69 16.87 -v -26.46 -8.08 10.21 -v -26.54 -8.06 16.88 -v -25.13 -7.74 10.18 -v -25.21 -7.71 16.85 -v -24.11 -6.76 10.11 -v -24.20 -6.73 16.78 -v -23.70 -5.42 10.02 -v -23.78 -5.40 16.69 -v -23.99 -4.08 9.93 -v -24.07 -4.06 16.60 -v -28.86 -5.35 18.00 -v -28.59 -6.59 18.07 -v -27.75 -7.50 18.12 -v -26.55 -7.84 18.13 -v -25.32 -7.52 18.10 -v -24.39 -6.62 18.03 -v -24.00 -5.39 17.95 -v -24.27 -4.15 17.87 -v -25.12 -3.24 17.82 -v -26.32 -2.90 17.81 -v -28.10 -6.30 19.61 -v -27.46 -6.99 19.65 -v -27.36 -5.86 20.77 -v -27.47 -5.35 20.74 -v -28.31 -5.35 19.56 -v -27.55 -3.23 17.85 -v -28.48 -4.12 17.91 -v -28.01 -4.41 19.49 -v -27.31 -4.84 20.70 -v -26.47 -5.36 21.07 -v -27.01 -6.24 20.79 -v -26.54 -7.25 19.66 -v -25.60 -7.01 19.63 -v -24.89 -6.32 19.58 -v -24.60 -5.38 19.52 -v -24.80 -4.44 19.46 -v -25.45 -3.74 19.42 -v -26.36 -3.48 19.42 -v -27.30 -3.73 19.44 -v -26.93 -4.47 20.68 -v -26.42 -4.34 20.66 -v -25.92 -4.48 20.67 -v -25.57 -4.86 20.69 -v -25.46 -5.37 20.72 -v -25.62 -5.88 20.75 -v -26.01 -6.25 20.78 -v -26.52 -6.38 20.79 -v -27.02 -4.02 6.72 -v -26.22 -3.82 6.70 -v -25.44 -4.04 6.71 -v -24.89 -4.63 6.74 -v -24.72 -5.43 6.79 -v -24.97 -6.23 6.84 -v -25.57 -6.81 6.89 -v -26.37 -7.02 6.91 -v -27.15 -6.80 6.90 -v -27.70 -6.21 6.87 -v -26.53 -4.91 4.15 -v -26.23 -4.84 4.15 -v -27.87 -5.41 6.82 -v -27.62 -4.61 6.77 -v -26.75 -5.13 4.17 -v -26.26 -5.43 3.93 -v -25.95 -4.92 4.15 -v -25.74 -5.14 4.16 -v -25.68 -5.43 4.18 -v -25.77 -5.73 4.20 -v -25.99 -5.94 4.21 -v -26.29 -6.02 4.22 -v -26.58 -5.94 4.22 -v -26.78 -5.72 4.21 -v -26.85 -5.42 4.19 -# 252 vertices - -vn 0.92 -0.09 -0.39 -vn -0.00 0.99 -0.12 -vn -0.01 0.99 -0.11 -vn -0.00 1.00 -0.09 -vn -0.01 1.00 -0.09 -vn -0.03 0.99 -0.17 -vn -0.03 0.99 -0.12 -vn -0.04 1.00 -0.06 -vn -0.04 1.00 -0.02 -vn -0.06 1.00 -0.03 -vn -0.03 1.00 0.09 -vn -0.11 0.99 0.03 -vn -0.09 0.98 0.16 -vn -0.28 0.96 0.07 -vn -0.18 0.98 0.09 -vn -0.34 0.94 0.05 -vn -0.16 0.99 0.06 -vn -0.14 0.98 0.16 -vn -0.04 0.97 0.22 -vn -0.02 0.98 0.21 -vn -0.01 1.00 -0.04 -vn -0.02 0.97 0.22 -vn -0.02 0.96 0.26 -vn -0.02 0.94 0.34 -vn -0.04 0.92 0.38 -vn -0.03 0.96 0.28 -vn -0.02 1.00 0.08 -vn -0.02 0.99 0.10 -vn -0.01 1.00 -0.02 -vn -0.03 -1.00 -0.03 -vn -0.03 -1.00 0.04 -vn -0.09 -0.99 -0.04 -vn -0.03 -1.00 0.05 -vn -0.04 -0.97 0.25 -vn -0.05 -0.90 0.43 -vn -0.05 -0.91 0.42 -vn -0.05 -0.93 0.38 -vn -0.07 -0.97 0.21 -vn -0.11 -0.97 0.22 -vn -0.13 -0.99 0.07 -vn -0.09 -1.00 0.03 -vn -0.12 -0.99 -0.01 -vn -0.13 -0.99 -0.04 -vn -0.09 -1.00 -0.03 -vn -0.06 -1.00 -0.04 -vn -0.11 -0.99 -0.04 -vn -0.08 -1.00 -0.04 -vn -0.07 -0.99 -0.14 -vn -0.05 -0.98 -0.21 -vn -0.03 -0.99 -0.10 -vn -0.03 -0.99 -0.14 -vn -0.02 -0.99 -0.11 -vn -0.02 -0.99 -0.17 -vn -0.02 -1.00 -0.04 -vn -0.28 0.96 -0.07 -vn -0.29 0.96 -0.04 -vn -0.47 0.88 -0.05 -vn -0.51 0.86 -0.09 -vn -0.15 0.99 -0.08 -vn -0.04 1.00 -0.08 -vn -0.09 -0.98 0.16 -vn -0.13 -0.98 0.15 -vn -0.10 -0.98 0.15 -vn -0.24 -0.96 0.12 -vn -0.28 -0.96 0.08 -vn -0.33 -0.94 0.00 -vn -0.37 -0.93 0.04 -vn -0.26 -0.97 -0.03 -vn -0.11 -0.99 0.06 -vn -0.09 -1.00 0.01 -vn 1.00 -0.05 0.01 -vn -1.00 0.05 -0.01 -vn 0.02 0.12 0.99 -vn -0.01 -1.00 0.03 -vn -0.02 -0.64 -0.77 -vn 0.02 0.11 0.99 -vn -0.08 -0.05 -1.00 -vn -0.08 0.09 -0.99 -vn 1.00 0.02 -0.07 -vn -0.08 -0.06 -0.99 -vn -0.08 -0.08 -0.99 -vn -0.08 0.03 -1.00 -vn -0.10 -0.12 -0.99 -vn 0.93 0.01 0.36 -vn 0.93 -0.02 0.37 -vn 0.99 -0.05 -0.15 -vn 0.99 -0.02 -0.17 -vn 0.87 0.29 0.40 -vn 0.99 -0.04 0.12 -vn 0.92 0.27 -0.29 -vn 0.75 0.27 0.61 -vn -0.02 -0.66 -0.75 -vn 0.99 -0.05 -0.10 -vn -0.02 -1.00 -0.06 -vn -0.03 -0.99 -0.11 -vn -0.04 -0.99 -0.11 -vn -0.01 0.99 -0.13 -vn -0.01 1.00 -0.08 -vn -0.92 0.09 0.39 -vn 0.08 0.12 0.99 -vn 0.08 0.06 0.99 -vn -0.12 -0.06 -0.99 -vn -0.03 -1.00 -0.04 -vn -0.03 -1.00 0.03 -vn -0.02 -1.00 0.04 -vn -0.04 -0.96 0.29 -vn -0.04 -0.96 0.28 -vn -0.06 -0.88 0.47 -vn -0.06 -0.90 0.44 -vn -0.04 -0.97 0.23 -vn -0.05 -0.92 0.38 -vn -0.03 -0.96 0.26 -vn -0.02 -1.00 0.03 -vn -0.03 -1.00 0.01 -vn -0.02 -0.99 -0.16 -vn -0.02 -0.99 -0.10 -vn -0.01 -0.99 -0.16 -vn -0.00 -0.99 -0.11 -vn -0.01 -0.99 -0.13 -vn -0.01 -0.99 -0.17 -vn -0.01 0.99 -0.12 -vn -0.00 0.99 -0.16 -vn 0.00 0.99 -0.14 -vn 0.02 1.00 -0.09 -vn 0.01 1.00 -0.10 -vn 0.02 1.00 -0.05 -vn 0.00 1.00 -0.03 -vn -0.00 1.00 -0.10 -vn -0.01 1.00 -0.03 -vn -0.00 1.00 -0.03 -vn -0.01 1.00 0.05 -vn -0.00 1.00 0.08 -vn -0.02 0.96 0.29 -vn -0.03 0.96 0.27 -vn -0.03 0.90 0.44 -vn -0.07 0.88 0.47 -vn -0.04 0.96 0.28 -vn -0.05 0.90 0.43 -vn -0.01 1.00 0.03 -vn -0.88 -0.48 0.01 -vn -0.89 -0.46 0.01 -vn -0.86 0.51 -0.03 -vn -0.84 0.54 -0.03 -vn 0.01 1.00 -0.03 -vn 0.02 1.00 -0.03 -vn 0.89 0.46 -0.01 -vn 0.88 0.48 -0.01 -vn 0.84 -0.54 0.03 -vn 0.86 -0.51 0.03 -vn -0.00 0.99 -0.14 -vn -0.00 0.99 -0.13 -vn -0.00 1.00 -0.08 -vn -0.01 -1.00 -0.06 -vn 0.01 0.09 1.00 -vn -0.00 0.18 0.98 -vn -0.01 -0.96 0.29 -vn -0.01 -1.00 0.01 -vn -0.00 -0.62 -0.78 -vn -0.02 0.92 0.40 -vn -0.05 -0.90 0.44 -vn 1.00 -0.05 0.03 -vn -1.00 0.05 -0.03 -vn 0.99 -0.04 0.13 -vn 0.98 -0.05 -0.17 -vn 0.98 -0.02 -0.19 -vn 0.91 0.01 0.42 -vn 0.90 -0.02 0.43 -vn 0.91 -0.15 0.37 -vn 0.96 -0.03 0.29 -vn 0.94 0.03 -0.33 -vn 0.85 -0.17 -0.50 -vn 0.96 -0.10 0.27 -vn -0.75 -0.27 -0.61 -vn -0.93 0.02 -0.37 -vn -0.93 -0.01 -0.36 -vn -0.99 0.02 0.15 -vn -0.99 0.05 0.16 -vn -0.99 0.04 -0.12 -vn -0.87 -0.29 -0.40 -vn -0.92 -0.27 0.29 -vn 0.52 0.85 0.00 -vn 0.01 1.00 -0.00 -vn -0.48 0.88 -0.01 -vn -0.50 0.87 -0.01 -vn -0.85 0.53 -0.01 -vn -0.86 0.52 -0.01 -vn -1.00 0.03 -0.01 -vn -0.89 -0.46 -0.01 -vn -0.88 -0.47 -0.01 -vn -0.52 -0.85 -0.00 -vn -0.01 -1.00 0.00 -vn 0.50 -0.87 0.01 -vn 0.48 -0.88 0.01 -vn 0.86 -0.52 0.01 -vn 0.85 -0.53 0.01 -vn 1.00 -0.03 0.01 -vn 0.88 0.47 0.01 -vn 0.89 0.46 0.01 -vn -0.99 0.06 0.15 -vn -0.88 -0.44 0.16 -vn -0.97 0.06 0.24 -vn -0.86 -0.44 0.25 -vn -0.52 -0.84 0.17 -vn -0.51 -0.82 0.26 -vn -0.01 -0.99 0.17 -vn -0.01 -0.96 0.26 -vn 0.49 -0.85 0.17 -vn 0.48 -0.84 0.26 -vn 0.85 -0.50 0.17 -vn 0.83 -0.50 0.26 -vn 0.98 -0.02 0.17 -vn 0.96 -0.03 0.26 -vn 0.87 0.47 0.17 -vn 0.85 0.46 0.26 -vn 0.51 0.84 0.17 -vn 0.50 0.83 0.26 -vn 0.02 0.99 0.16 -vn 0.01 0.97 0.25 -vn -0.79 -0.39 0.47 -vn -0.47 -0.74 0.48 -vn -0.55 -0.24 0.80 -vn -0.62 0.08 0.78 -vn -0.89 0.07 0.45 -vn -0.47 0.87 0.15 -vn -0.47 0.85 0.24 -vn -0.83 0.54 0.15 -vn -0.82 0.52 0.23 -vn -0.75 0.49 0.44 -vn -0.53 0.37 0.76 -vn 0.01 0.06 1.00 -vn -0.32 -0.49 0.81 -vn -0.01 -0.88 0.48 -vn 0.45 -0.76 0.47 -vn 0.76 -0.44 0.47 -vn 0.89 -0.01 0.46 -vn 0.78 0.43 0.46 -vn 0.45 0.76 0.46 -vn 0.01 0.89 0.45 -vn -0.43 0.79 0.44 -vn -0.30 0.58 0.76 -vn 0.01 0.65 0.76 -vn 0.32 0.56 0.76 -vn 0.55 0.33 0.77 -vn 0.63 0.02 0.78 -vn 0.54 -0.29 0.79 -vn 0.32 -0.51 0.80 -vn 0.00 -0.59 0.81 -vn -0.48 0.82 -0.32 -vn 0.01 0.95 -0.33 -vn -0.47 0.81 -0.34 -vn 0.01 0.94 -0.35 -vn 0.50 0.80 -0.32 -vn 0.50 0.80 -0.34 -vn 0.85 0.42 -0.31 -vn 0.84 0.42 -0.33 -vn 0.95 -0.07 -0.30 -vn 0.94 -0.06 -0.32 -vn 0.80 -0.52 -0.29 -vn 0.80 -0.51 -0.31 -vn 0.45 -0.84 -0.30 -vn 0.45 -0.83 -0.32 -vn -0.02 -0.95 -0.31 -vn -0.01 -0.95 -0.33 -vn -0.49 -0.81 -0.32 -vn -0.48 -0.81 -0.34 -vn -0.83 -0.46 -0.32 -vn -0.83 -0.45 -0.34 -vn -0.38 0.63 -0.68 -vn 0.00 0.73 -0.69 -vn -0.95 0.01 -0.32 -vn -0.94 0.02 -0.34 -vn -0.82 0.47 -0.32 -vn -0.81 0.48 -0.34 -vn -0.65 0.36 -0.67 -vn -0.01 -0.05 -1.00 -vn 0.39 0.61 -0.68 -vn 0.67 0.31 -0.67 -vn 0.75 -0.07 -0.65 -vn 0.64 -0.43 -0.64 -vn 0.36 -0.68 -0.63 -vn -0.01 -0.77 -0.64 -vn -0.39 -0.66 -0.64 -vn -0.66 -0.38 -0.65 -vn -0.75 -0.00 -0.66 -# 284 vertex normals - -vt 0.50 0.03 0.00 -vt 0.49 0.03 0.00 -vt 0.71 0.21 0.00 -vt 0.82 0.22 0.00 -vt 0.73 0.24 0.00 -vt 0.82 0.24 0.00 -vt 0.92 0.23 0.00 -vt 0.92 0.25 0.00 -vt 0.96 0.24 0.00 -vt 0.92 0.29 0.00 -vt 0.96 0.29 0.00 -vt 0.93 0.32 0.00 -vt 0.97 0.32 0.00 -vt 0.97 0.34 0.00 -vt 0.99 0.32 0.00 -vt 0.99 0.34 0.00 -vt 0.98 0.35 0.00 -vt 0.97 0.37 0.00 -vt 0.92 0.35 0.00 -vt 0.72 0.31 0.00 -vt 0.92 0.37 0.00 -vt 0.83 0.36 0.00 -vt 0.83 0.38 0.00 -vt 0.73 0.40 0.00 -vt 0.72 0.37 0.00 -vt 0.73 0.34 0.00 -vt 0.83 0.33 0.00 -vt 0.83 0.30 0.00 -vt 0.12 0.42 0.00 -vt 0.14 0.43 0.00 -vt 0.10 0.50 0.00 -vt 0.16 0.34 0.00 -vt 0.16 0.43 0.00 -vt 0.19 0.34 0.00 -vt 0.20 0.36 0.00 -vt 0.18 0.43 0.00 -vt 0.16 0.51 0.00 -vt 0.14 0.50 0.00 -vt 0.15 0.54 0.00 -vt 0.13 0.54 0.00 -vt 0.12 0.50 0.00 -vt 0.12 0.54 0.00 -vt 0.09 0.53 0.00 -vt 0.09 0.55 0.00 -vt 0.05 0.54 0.00 -vt 0.05 0.52 0.00 -vt 0.04 0.52 0.00 -vt 0.06 0.49 0.00 -vt 0.01 0.53 0.00 -vt 0.04 0.49 0.00 -vt 0.07 0.41 0.00 -vt 0.05 0.41 0.00 -vt 0.08 0.33 0.00 -vt 0.05 0.32 0.00 -vt 0.14 0.33 0.00 -vt 0.98 0.23 0.00 -vt 0.99 0.29 0.00 -vt 0.98 0.19 0.00 -vt 0.96 0.23 0.00 -vt 0.14 0.56 0.00 -vt 0.13 0.56 0.00 -vt 0.11 0.56 0.00 -vt 0.12 0.55 0.00 -vt 0.04 0.54 0.00 -vt 0.77 0.13 0.00 -vt 0.77 0.11 0.00 -vt 0.87 0.13 0.00 -vt 0.85 0.11 0.00 -vt 0.01 0.74 0.00 -vt 0.52 0.02 0.00 -vt 0.65 0.02 0.00 -vt 0.52 0.01 0.00 -vt 0.65 0.01 0.00 -vt 0.03 0.73 0.00 -vt 0.04 0.73 0.00 -vt 0.56 0.01 0.00 -vt 0.49 0.01 0.00 -vt 0.47 0.01 0.00 -vt 0.56 0.02 0.00 -vt 0.19 0.51 0.00 -vt 0.20 0.49 0.00 -vt 0.22 0.51 0.00 -vt 0.21 0.49 0.00 -vt 0.20 0.55 0.00 -vt 0.23 0.54 0.00 -vt 0.24 0.56 0.00 -vt 0.20 0.56 0.00 -vt 0.20 0.58 0.00 -vt 0.23 0.57 0.00 -vt 0.22 0.59 0.00 -vt 0.51 0.02 0.00 -vt 0.51 0.03 0.00 -vt 0.48 0.02 0.00 -vt 0.01 0.32 0.00 -vt 0.72 0.15 0.00 -vt 0.96 0.22 0.00 -vt 0.48 0.03 0.00 -vt 0.48 0.01 0.00 -vt 0.59 0.01 0.00 -vt 0.15 0.26 0.00 -vt 0.18 0.26 0.00 -vt 0.21 0.27 0.00 -vt 0.23 0.28 0.00 -vt 0.24 0.24 0.00 -vt 0.21 0.23 0.00 -vt 0.26 0.18 0.00 -vt 0.23 0.17 0.00 -vt 0.20 0.18 0.00 -vt 0.19 0.22 0.00 -vt 0.15 0.22 0.00 -vt 0.09 0.25 0.00 -vt 0.06 0.24 0.00 -vt 0.11 0.21 0.00 -vt 0.07 0.20 0.00 -vt 0.12 0.16 0.00 -vt 0.08 0.14 0.00 -vt 0.06 0.20 0.00 -vt 0.06 0.14 0.00 -vt 0.49 0.18 0.00 -vt 0.56 0.19 0.00 -vt 0.49 0.21 0.00 -vt 0.57 0.21 0.00 -vt 0.51 0.26 0.00 -vt 0.57 0.25 0.00 -vt 0.50 0.31 0.00 -vt 0.57 0.31 0.00 -vt 0.62 0.24 0.00 -vt 0.62 0.31 0.00 -vt 0.62 0.35 0.00 -vt 0.62 0.38 0.00 -vt 0.63 0.41 0.00 -vt 0.58 0.42 0.00 -vt 0.57 0.39 0.00 -vt 0.51 0.43 0.00 -vt 0.50 0.40 0.00 -vt 0.51 0.36 0.00 -vt 0.57 0.35 0.00 -vt 0.25 0.71 0.00 -vt 0.25 0.70 0.00 -vt 0.39 0.71 0.00 -vt 0.39 0.70 0.00 -vt 0.25 0.69 0.00 -vt 0.39 0.69 0.00 -vt 0.25 0.68 0.00 -vt 0.39 0.68 0.00 -vt 0.61 0.19 0.00 -vt 0.16 0.16 0.00 -vt 0.39 0.72 0.00 -vt 0.38 0.71 0.00 -vt 0.39 0.73 0.00 -vt 0.37 0.73 0.00 -vt 0.37 0.72 0.00 -vt 0.38 0.74 0.00 -vt 0.60 0.01 0.00 -vt 0.59 0.02 0.00 -vt 0.02 0.73 0.00 -vt 0.63 0.02 0.00 -vt 0.60 0.02 0.00 -vt 0.63 0.01 0.00 -vt 0.78 0.11 0.00 -vt 0.21 0.50 0.00 -vt 0.20 0.50 0.00 -vt 0.24 0.54 0.00 -vt 0.23 0.52 0.00 -vt 0.19 0.54 0.00 -vt 0.19 0.52 0.00 -vt 0.19 0.56 0.00 -vt 0.24 0.57 0.00 -vt 0.22 0.49 0.00 -vt 0.20 0.51 0.00 -vt 0.23 0.51 0.00 -vt 0.88 0.10 0.00 -vt 0.88 0.11 0.00 -vt 0.75 0.09 0.00 -vt 0.75 0.10 0.00 -vt 0.88 0.08 0.00 -vt 0.75 0.08 0.00 -vt 0.88 0.06 0.00 -vt 0.75 0.05 0.00 -vt 0.88 0.03 0.00 -vt 0.75 0.03 0.00 -vt 0.88 0.02 0.00 -vt 0.75 0.01 0.00 -vt 0.88 0.01 0.00 -vt 0.75 0.00 0.00 -vt 0.73 0.05 0.00 -vt 0.73 0.03 0.00 -vt 0.73 0.02 0.00 -vt 0.73 0.01 0.00 -vt 0.73 0.08 0.00 -vt 0.73 0.09 0.00 -vt 0.73 0.10 0.00 -vt 0.70 0.03 0.00 -vt 0.70 0.02 0.00 -vt 0.68 0.04 0.00 -vt 0.68 0.05 0.00 -vt 0.70 0.05 0.00 -vt 0.70 0.07 0.00 -vt 0.67 0.06 0.00 -vt 0.67 0.05 0.00 -vt 0.70 0.08 0.00 -vt 0.70 0.09 0.00 -vt 0.67 0.07 0.00 -vt 0.68 0.03 0.00 -vt 0.94 0.08 0.00 -vt 0.94 0.09 0.00 -vt 0.94 0.07 0.00 -vt 0.94 0.06 0.00 -vt 0.94 0.04 0.00 -vt 0.94 0.03 0.00 -vt 0.99 0.07 0.00 -vt 0.99 0.06 0.00 -vt 0.99 0.05 0.00 -# 213 texture coords - -g P_51_Mustang_Right_Wing -f 263/73/181 264/74/181 265/73/181 -f 266/75/182 267/76/183 268/77/184 -f 269/78/185 268/77/184 267/76/183 -f 267/76/183 270/79/186 269/78/185 -f 271/80/187 269/78/185 270/79/186 -f 271/80/187 270/79/186 272/81/188 -f 271/80/187 272/81/188 273/82/189 -f 274/83/190 273/82/189 272/81/188 -f 273/82/189 274/83/190 275/84/191 -f 276/85/192 275/84/191 274/83/190 -f 276/85/192 277/86/193 275/84/191 -f 276/85/192 278/87/194 277/86/193 -f 279/88/195 277/86/193 278/87/194 -f 278/87/194 280/87/196 279/88/195 -f 281/88/197 279/88/195 280/87/196 -f 279/88/195 281/88/197 282/89/198 -f 279/88/195 282/89/198 277/86/193 -f 283/90/199 277/86/193 282/89/198 -f 277/86/193 283/90/199 284/91/200 -f 268/77/184 269/78/185 285/92/201 -f 286/93/202 284/91/200 283/90/199 -f 284/91/200 286/93/202 287/94/203 -f 288/95/204 287/94/203 286/93/202 -f 288/95/204 289/96/205 287/94/203 -f 290/97/206 287/94/203 289/96/205 -f 290/97/206 291/98/207 287/94/203 -f 292/99/208 287/94/203 291/98/207 -f 291/98/207 285/92/201 292/99/208 -f 293/100/209 292/99/208 285/92/201 -f 293/100/209 285/92/201 269/78/185 -f 269/78/185 271/80/187 293/100/209 -f 273/82/189 293/100/209 271/80/187 -f 293/100/209 273/82/189 292/99/208 -f 275/84/191 292/99/208 273/82/189 -f 275/84/191 284/91/200 292/99/208 -f 284/91/200 275/84/191 277/86/193 -f 287/94/203 292/99/208 284/91/200 -f 294/101/210 295/102/211 296/103/212 -f 295/102/211 294/101/210 297/104/213 -f 295/102/211 297/104/213 298/105/214 -f 299/106/214 298/105/214 297/104/213 -f 299/106/214 289/107/215 298/105/214 -f 288/108/216 298/105/214 289/107/215 -f 288/108/216 286/109/217 298/105/214 -f 300/110/218 298/105/214 286/109/217 -f 286/109/217 283/111/219 300/110/218 -f 301/112/220 300/110/218 283/111/219 -f 300/110/218 301/112/220 302/113/221 -f 303/114/222 302/113/221 301/112/220 -f 303/114/222 304/115/223 302/113/221 -f 304/115/223 303/114/222 305/116/224 -f 305/116/224 306/117/225 304/115/223 -f 307/118/226 304/115/223 306/117/225 -f 263/119/227 307/118/226 306/117/225 -f 307/118/226 263/119/227 308/120/228 -f 264/121/225 263/119/227 306/117/225 -f 309/122/229 308/120/228 263/119/227 -f 308/120/228 309/122/229 310/123/230 -f 311/124/231 310/123/230 309/122/229 -f 310/123/230 311/124/231 312/125/232 -f 313/126/233 312/125/232 311/124/231 -f 312/125/232 314/127/234 310/123/230 -f 294/101/210 310/123/230 314/127/234 -f 310/123/230 294/101/210 308/120/228 -f 296/103/212 308/120/228 294/101/210 -f 308/120/228 296/103/212 307/118/226 -f 304/115/223 307/118/226 296/103/212 -f 296/103/212 302/113/221 304/115/223 -f 302/113/221 296/103/212 295/102/211 -f 302/113/221 295/102/211 300/110/218 -f 298/105/214 300/110/218 295/102/211 -f 314/127/234 297/104/213 294/101/210 -f 272/81/188 315/128/235 274/83/190 -f 316/129/236 274/83/190 315/128/235 -f 274/83/190 316/129/236 276/85/192 -f 278/87/194 276/85/192 316/129/236 -f 278/87/194 316/129/236 280/87/196 -f 317/129/237 280/87/196 316/129/236 -f 317/129/237 316/129/236 318/128/238 -f 315/128/235 318/128/238 316/129/236 -f 264/130/239 318/128/238 315/128/235 -f 264/130/239 315/128/235 265/131/240 -f 272/81/188 265/131/240 315/128/235 -f 265/131/240 272/81/188 270/79/186 -f 283/111/241 282/132/242 301/112/243 -f 319/133/244 301/112/243 282/132/242 -f 281/133/245 319/133/244 282/132/242 -f 281/133/245 280/134/246 319/133/244 -f 320/135/247 319/133/244 280/134/246 -f 320/135/247 280/134/246 305/116/248 -f 317/116/248 305/116/248 280/134/246 -f 317/116/248 318/136/223 305/116/248 -f 306/117/223 305/116/248 318/136/223 -f 264/121/223 306/117/223 318/136/223 -f 319/133/249 320/135/250 301/112/220 -f 303/114/222 301/112/220 320/135/250 -f 320/135/250 305/116/224 303/114/222 -f 321/137/251 322/138/251 323/139/251 -f 324/140/251 323/139/251 322/138/251 -f 325/140/252 326/138/252 327/139/252 -f 328/137/252 327/139/252 326/138/252 -f 329/141/253 330/141/253 331/141/253 -f 332/141/253 331/141/253 330/141/253 -f 330/142/254 333/143/254 332/144/254 -f 334/145/254 332/144/254 333/143/254 -f 333/146/255 335/147/255 334/146/255 -f 336/147/255 334/146/255 335/147/255 -f 334/140/251 336/139/251 332/138/251 -f 331/137/251 332/138/251 336/139/251 -f 333/140/252 330/138/252 335/139/252 -f 329/137/252 335/139/252 330/138/252 -f 337/141/256 338/141/256 339/141/256 -f 340/141/256 339/141/256 338/141/256 -f 338/142/254 341/143/254 340/144/254 -f 342/145/254 340/144/254 341/143/254 -f 341/146/255 343/147/255 342/146/255 -f 344/147/255 342/146/255 343/147/255 -f 342/140/251 344/139/251 340/138/251 -f 339/137/251 340/138/251 344/139/251 -f 341/140/252 338/138/252 343/139/252 -f 337/137/252 343/139/252 338/138/252 -f 267/144/257 266/148/257 270/149/257 -f 270/149/258 266/148/259 265/150/258 -f 313/151/260 311/142/260 266/148/260 -f 266/148/261 311/142/261 265/150/261 -f 311/142/262 309/149/262 265/150/262 -f 309/149/263 263/150/263 265/150/263 -f 312/152/264 313/153/264 268/154/264 -f 266/155/265 268/154/265 313/153/265 -f 314/156/266 312/152/266 285/157/266 -f 268/154/267 285/157/267 312/152/267 -f 291/158/268 297/159/268 285/157/268 -f 314/156/269 285/157/269 297/159/269 -f 299/160/270 297/159/270 290/161/270 -f 291/158/270 290/161/270 297/159/270 -f 289/162/271 299/160/271 290/161/271 -f 328/141/253 326/141/253 321/141/253 -f 322/141/253 321/141/253 326/141/253 -f 326/142/254 325/143/254 322/144/254 -f 324/145/254 322/144/254 325/143/254 -f 325/146/272 327/147/272 324/146/272 -f 323/147/272 324/146/272 327/147/272 -f 266/163/273 313/164/273 345/165/273 -f 264/121/274 345/166/275 263/119/274 -f 313/126/276 263/119/274 345/166/275 -f 345/167/277 264/130/185 266/75/277 -f 265/168/278 266/75/277 264/130/185 -f 264/73/279 263/169/279 265/169/279 -f 263/143/280 313/165/280 265/145/280 -f 266/170/281 265/145/281 313/165/281 -f 266/148/282 346/171/282 313/151/282 -f 347/172/283 348/173/284 314/127/234 -f 297/104/285 314/127/234 348/173/284 -f 297/104/285 348/173/284 299/106/286 -f 349/174/287 299/106/286 348/173/284 -f 349/174/287 350/175/288 299/106/286 -f 350/175/288 349/174/287 351/176/289 -f 352/177/290 351/176/289 349/174/287 -f 351/176/289 352/177/290 353/178/291 -f 354/179/292 353/178/291 352/177/290 -f 354/179/292 352/177/290 355/180/293 -f 356/181/294 355/180/293 352/177/290 -f 356/181/294 357/182/234 355/180/293 -f 357/182/234 356/181/294 347/172/283 -f 347/172/283 358/183/230 357/182/234 -f 347/172/283 314/127/234 358/183/230 -f 312/125/232 358/183/230 314/127/234 -f 312/125/232 313/126/295 358/183/230 -f 359/184/231 358/183/230 313/126/295 -f 349/174/287 348/173/284 352/177/290 -f 356/181/294 352/177/290 348/173/284 -f 348/173/284 347/172/283 356/181/294 -f 358/183/230 359/184/231 360/185/296 -f 361/186/297 360/185/296 359/184/231 -f 360/185/296 361/186/297 362/187/298 -f 363/188/299 362/187/298 361/186/297 -f 361/186/297 364/189/300 363/188/299 -f 365/190/232 363/188/299 364/189/300 -f 364/189/300 361/186/297 359/184/231 -f 366/191/301 367/192/302 368/193/182 -f 369/194/303 368/193/182 367/192/302 -f 368/193/182 369/194/303 370/195/304 -f 371/196/305 370/195/304 369/194/303 -f 370/195/304 371/196/305 372/197/306 -f 373/198/307 372/197/306 371/196/305 -f 371/196/305 374/199/308 373/198/307 -f 375/200/309 373/198/307 374/199/308 -f 375/200/309 374/199/308 285/92/310 -f 375/200/309 285/92/310 376/201/311 -f 291/98/312 376/201/311 285/92/310 -f 291/98/312 290/97/313 376/201/311 -f 377/202/314 376/201/311 290/97/313 -f 377/202/314 290/97/313 350/203/315 -f 350/203/315 351/204/316 377/202/314 -f 378/205/317 377/202/314 351/204/316 -f 351/204/316 353/206/318 378/205/317 -f 379/207/314 378/205/317 353/206/318 -f 372/197/306 373/198/307 380/208/319 -f 379/207/314 380/208/319 378/205/317 -f 381/209/319 378/205/317 380/208/319 -f 381/209/319 380/208/319 373/198/307 -f 373/198/307 375/200/309 381/209/319 -f 376/201/311 381/209/319 375/200/309 -f 381/209/319 376/201/311 378/205/317 -f 377/202/314 378/205/317 376/201/311 -f 382/210/293 383/211/320 384/212/254 -f 385/213/321 384/212/254 383/211/320 -f 383/211/320 386/214/322 385/213/321 -f 387/215/323 385/213/321 386/214/322 -f 386/214/322 388/216/324 387/215/323 -f 389/217/325 387/215/323 388/216/324 -f 388/216/324 390/214/326 389/217/325 -f 391/215/327 389/217/325 390/214/326 -f 390/214/326 392/211/328 391/215/327 -f 393/213/329 391/215/327 392/211/328 -f 392/211/328 382/210/293 393/213/329 -f 384/212/254 393/213/329 382/210/293 -f 367/192/302 346/218/330 369/194/303 -f 369/194/303 346/218/330 371/196/305 -f 374/199/308 371/196/305 346/218/330 -f 346/218/330 266/75/331 374/199/308 -f 268/77/332 374/199/308 266/75/331 -f 268/77/332 285/92/310 374/199/308 -f 362/187/298 394/219/333 360/185/296 -f 357/182/234 360/185/296 394/219/333 -f 360/185/296 357/182/234 358/183/230 -f 394/219/333 355/180/293 357/182/234 -f 390/220/334 388/221/334 392/222/334 -f 388/221/334 383/223/334 392/222/334 -f 386/224/334 383/223/334 388/221/334 -f 392/222/334 383/223/334 382/225/334 -f 395/220/334 396/221/334 397/222/334 -f 396/221/334 398/223/334 397/222/334 -f 397/222/334 398/223/334 399/225/334 -f 400/224/334 398/223/334 396/221/334 -f 401/210/293 402/211/320 403/212/254 -f 404/213/321 403/212/254 402/211/320 -f 402/211/320 405/214/322 404/213/321 -f 406/215/323 404/213/321 405/214/322 -f 405/214/322 407/216/324 406/215/323 -f 408/217/325 406/215/323 407/216/324 -f 407/216/324 409/214/326 408/217/325 -f 410/215/327 408/217/325 409/214/326 -f 409/214/326 411/211/328 410/215/327 -f 412/213/329 410/215/327 411/211/328 -f 411/211/328 401/210/293 412/213/329 -f 403/212/254 412/213/329 401/210/293 -f 409/220/334 407/221/334 411/222/334 -f 407/221/334 402/223/334 411/222/334 -f 405/224/334 402/223/334 407/221/334 -f 411/222/334 402/223/334 401/225/334 -f 367/226/282 359/227/282 346/171/282 -f 346/171/282 359/227/282 313/151/282 -f 413/141/335 414/141/335 415/141/335 -f 416/141/335 415/141/335 414/141/335 -f 414/228/336 417/228/336 416/228/336 -f 418/228/336 416/228/336 417/228/336 -f 419/147/337 418/228/337 420/147/337 -f 417/228/337 420/147/337 418/228/337 -f 420/146/338 421/147/338 419/146/338 -f 422/147/338 419/146/338 421/147/338 -f 289/96/339 350/203/315 290/97/313 -f 289/107/340 299/106/286 350/175/288 -f 365/229/282 364/230/282 366/231/282 -f 367/226/282 366/231/282 364/230/282 -f 364/230/282 359/227/282 367/226/282 -f 415/137/341 416/138/341 422/139/341 -f 422/139/341 418/232/341 419/140/341 -f 416/138/341 418/232/341 422/139/341 -f 413/137/342 421/139/342 414/138/342 -f 421/139/342 420/140/342 414/138/342 -f 414/138/342 420/140/342 417/232/342 -f 399/210/293 398/211/320 423/212/254 -f 424/213/321 423/212/254 398/211/320 -f 398/211/320 400/214/322 424/213/321 -f 425/215/323 424/213/321 400/214/322 -f 400/214/322 396/216/324 425/215/323 -f 426/217/325 425/215/323 396/216/324 -f 396/216/324 395/214/326 426/217/325 -f 427/215/327 426/217/325 395/214/326 -f 395/214/326 397/211/328 427/215/327 -f 428/213/329 427/215/327 397/211/328 -f 397/211/328 399/210/293 428/213/329 -f 423/212/254 428/213/329 399/210/293 -f 363/154/343 365/233/343 368/152/343 -f 366/234/269 368/152/269 365/233/269 -f 394/235/344 362/236/344 372/237/344 -f 370/238/345 372/237/345 362/236/345 -f 362/236/346 363/154/346 370/238/346 -f 368/152/347 370/238/347 363/154/347 -f 355/158/348 394/235/348 380/239/348 -f 372/237/349 380/239/349 394/235/349 -f 379/160/350 354/240/350 380/239/350 -f 355/158/351 380/239/351 354/240/351 -f 353/162/352 354/240/352 379/160/352 -f 290/160/353 299/240/353 289/162/353 -f 266/153/354 313/241/354 268/242/354 -f 312/243/355 268/242/355 313/241/355 -f 312/243/356 314/235/356 268/242/356 -f 285/156/357 268/242/357 314/235/357 -f 314/235/358 297/158/358 285/156/358 -f 291/159/359 285/156/359 297/158/359 -f 291/159/360 297/158/360 290/160/360 -f 299/240/360 290/160/360 297/158/360 -f 429/244/361 430/245/362 431/246/361 -f 432/247/362 431/246/361 430/245/362 -f 430/245/362 433/244/363 432/247/362 -f 434/246/364 432/247/362 433/244/363 -f 433/244/363 435/248/365 434/246/364 -f 436/249/366 434/246/364 435/248/365 -f 435/248/365 437/250/252 436/249/366 -f 438/251/367 436/249/366 437/250/252 -f 437/250/252 439/252/368 438/251/367 -f 440/253/369 438/251/367 439/252/368 -f 439/252/368 441/254/370 440/253/369 -f 442/255/370 440/253/369 441/254/370 -f 441/254/370 443/256/371 442/255/370 -f 444/257/371 442/255/370 443/256/371 -f 443/256/371 445/254/372 444/257/371 -f 446/255/373 444/257/371 445/254/372 -f 445/254/372 447/252/374 446/255/373 -f 448/253/375 446/255/373 447/252/374 -f 447/252/374 449/250/376 448/253/375 -f 450/251/251 448/253/375 449/250/376 -f 449/250/376 451/248/377 450/251/251 -f 452/249/378 450/251/251 451/248/377 -f 451/248/377 429/244/361 452/249/378 -f 431/246/361 452/249/378 429/244/361 -f 438/251/379 440/253/380 453/258/381 -f 454/259/382 453/258/381 440/253/380 -f 440/253/380 442/255/383 454/259/382 -f 455/260/384 454/259/382 442/255/383 -f 442/255/383 444/257/385 455/260/384 -f 456/261/386 455/260/384 444/257/385 -f 444/257/385 446/255/387 456/261/386 -f 457/260/388 456/261/386 446/255/387 -f 446/255/387 448/253/389 457/260/388 -f 458/259/390 457/260/388 448/253/389 -f 448/253/389 450/251/391 458/259/390 -f 459/258/392 458/259/390 450/251/391 -f 450/251/391 452/249/393 459/258/392 -f 460/262/394 459/258/392 452/249/393 -f 452/249/393 431/246/395 460/262/394 -f 461/263/396 460/262/394 431/246/395 -f 431/246/395 432/247/397 461/263/396 -f 462/264/398 461/263/396 432/247/397 -f 454/259/382 455/260/384 463/265/399 -f 455/260/384 456/261/386 464/266/400 -f 464/266/400 463/265/399 455/260/384 -f 463/265/399 464/266/400 465/267/401 -f 465/267/401 466/268/402 463/265/399 -f 467/269/403 463/265/399 466/268/402 -f 463/265/399 467/269/403 454/259/382 -f 453/258/381 454/259/382 467/269/403 -f 432/247/397 434/246/404 462/264/398 -f 468/263/405 462/264/398 434/246/404 -f 434/246/404 436/249/406 468/263/405 -f 469/262/407 468/263/405 436/249/406 -f 436/249/406 438/251/379 469/262/407 -f 453/258/381 469/262/407 438/251/379 -f 469/262/407 453/258/381 470/270/408 -f 467/269/403 470/270/408 453/258/381 -f 470/270/408 467/269/403 471/271/409 -f 466/268/402 471/271/409 467/269/403 -f 472/272/410 471/271/409 466/268/402 -f 472/272/410 466/268/402 465/267/401 -f 472/272/410 465/267/401 473/267/411 -f 473/267/411 465/267/401 464/266/400 -f 464/266/400 474/266/412 473/267/411 -f 474/266/412 464/266/400 456/261/386 -f 456/261/386 457/260/388 474/266/412 -f 475/266/413 474/266/412 457/260/388 -f 457/260/388 458/259/390 475/266/413 -f 476/265/414 475/266/413 458/259/390 -f 458/259/390 459/258/392 476/265/414 -f 477/269/415 476/265/414 459/258/392 -f 459/258/392 460/262/394 477/269/415 -f 478/270/416 477/269/415 460/262/394 -f 460/262/394 461/263/396 478/270/416 -f 479/273/417 478/270/416 461/263/396 -f 461/263/396 462/264/398 479/273/417 -f 480/274/418 479/273/417 462/264/398 -f 462/264/398 468/263/405 480/274/418 -f 481/273/419 480/274/418 468/263/405 -f 468/263/405 469/262/407 481/273/419 -f 470/270/408 481/273/419 469/262/407 -f 481/273/419 470/270/408 482/275/420 -f 471/271/409 482/275/420 470/270/408 -f 472/272/410 482/275/420 471/271/409 -f 472/272/410 483/275/421 482/275/420 -f 480/274/418 481/273/419 483/275/421 -f 482/275/420 483/275/421 481/273/419 -f 472/272/410 484/275/422 483/275/421 -f 483/275/421 484/275/422 480/274/418 -f 479/273/417 480/274/418 484/275/422 -f 484/275/422 485/271/423 479/273/417 -f 478/270/416 479/273/417 485/271/423 -f 485/271/423 486/268/424 478/270/416 -f 477/269/415 478/270/416 486/268/424 -f 486/268/424 487/267/425 477/269/415 -f 476/265/414 477/269/415 487/267/425 -f 487/267/425 488/267/426 476/265/414 -f 475/266/413 476/265/414 488/267/426 -f 488/267/426 489/276/427 475/266/413 -f 474/266/412 475/266/413 489/276/427 -f 489/276/427 473/267/411 474/266/412 -f 472/272/410 473/267/411 489/276/427 -f 472/272/410 489/276/427 488/267/426 -f 472/272/410 488/267/426 487/267/425 -f 472/272/410 487/267/425 486/268/424 -f 472/272/410 486/268/424 485/271/423 -f 472/272/410 485/271/423 484/275/422 -f 433/244/428 430/245/429 490/277/430 -f 491/278/431 490/277/430 430/245/429 -f 430/245/429 429/244/432 491/278/431 -f 492/277/433 491/278/431 429/244/432 -f 429/244/432 451/248/434 492/277/433 -f 493/279/435 492/277/433 451/248/434 -f 451/248/434 449/250/436 493/279/435 -f 494/280/437 493/279/435 449/250/436 -f 449/250/436 447/252/438 494/280/437 -f 495/281/439 494/280/437 447/252/438 -f 447/252/438 445/254/440 495/281/439 -f 496/282/441 495/281/439 445/254/440 -f 445/254/440 443/256/442 496/282/441 -f 497/282/443 496/282/441 443/256/442 -f 443/256/442 441/254/444 497/282/443 -f 498/282/445 497/282/443 441/254/444 -f 441/254/444 439/252/446 498/282/445 -f 499/281/447 498/282/445 439/252/446 -f 490/277/430 491/278/431 500/283/448 -f 501/283/449 500/283/448 491/278/431 -f 491/278/431 492/277/433 501/283/449 -f 439/252/446 437/250/450 499/281/447 -f 502/280/451 499/281/447 437/250/450 -f 437/250/450 435/248/452 502/280/451 -f 503/279/453 502/280/451 435/248/452 -f 435/248/452 433/244/428 503/279/453 -f 490/277/430 503/279/453 433/244/428 -f 503/279/453 490/277/430 504/284/454 -f 500/283/448 504/284/454 490/277/430 -f 504/284/454 500/283/448 505/284/455 -f 500/283/448 501/283/449 505/284/455 -f 501/283/449 506/283/456 505/284/455 -f 506/283/456 501/283/449 492/277/433 -f 492/277/433 493/279/435 506/283/456 -f 507/284/457 506/283/456 493/279/435 -f 493/279/435 494/280/437 507/284/457 -f 508/284/458 507/284/457 494/280/437 -f 494/280/437 495/281/439 508/284/458 -f 509/285/459 508/284/458 495/281/439 -f 495/281/439 496/282/441 509/285/459 -f 510/285/460 509/285/459 496/282/441 -f 496/282/441 497/282/443 510/285/460 -f 511/285/461 510/285/460 497/282/443 -f 497/282/443 498/282/445 511/285/461 -f 512/285/462 511/285/461 498/282/445 -f 498/282/445 499/281/447 512/285/462 -f 513/285/463 512/285/462 499/281/447 -f 499/281/447 502/280/451 513/285/463 -f 514/284/464 513/285/463 502/280/451 -f 502/280/451 503/279/453 514/284/464 -f 504/284/454 514/284/464 503/279/453 -f 514/284/464 504/284/454 505/284/455 -f 513/285/463 514/284/464 505/284/455 -f 512/285/462 513/285/463 505/284/455 -f 511/285/461 512/285/462 505/284/455 -f 510/285/460 511/285/461 505/284/455 -f 509/285/459 510/285/460 505/284/455 -f 508/284/458 509/285/459 505/284/455 -f 507/284/457 508/284/458 505/284/455 -f 506/283/456 507/284/457 505/284/455 -# 472 faces - -# -# object P_51_Mustang_Right_Landing_Wheel -# - -v -21.65 -7.03 18.48 -v -20.12 -7.12 18.43 -v -21.65 -7.03 18.62 -v -20.12 -7.12 18.57 -v -20.72 -9.30 17.99 -v -20.96 -9.30 18.00 -v -20.29 -0.52 17.44 -v -20.54 -0.52 17.45 -v -21.12 -9.30 18.19 -v -20.70 -0.51 17.64 -v -21.11 -9.30 18.43 -v -20.69 -0.51 17.88 -v -20.93 -9.30 18.59 -v -20.51 -0.51 18.04 -v -20.69 -9.30 18.58 -v -20.27 -0.52 18.03 -v -20.53 -9.30 18.39 -v -20.10 -0.52 17.84 -v -20.54 -9.30 18.15 -v -20.11 -0.52 17.60 -v -20.33 -12.95 18.23 -v -20.20 -10.30 18.07 -v -20.11 -12.93 18.22 -v -19.87 -10.28 18.05 -v -20.30 -9.53 18.02 -v -20.07 -9.01 17.98 -v -20.64 -9.29 18.02 -v -20.61 -8.74 17.98 -v -20.32 -12.95 18.73 -v -20.01 -12.93 18.71 -v -20.20 -10.30 18.56 -v -19.86 -10.28 18.55 -v -20.30 -9.53 18.52 -v -20.07 -9.01 18.48 -v -20.63 -9.29 18.51 -v -20.60 -8.73 18.48 -v -21.23 -1.10 17.16 -v -22.09 -3.52 17.35 -v -21.15 -1.12 18.27 -v -24.19 -9.64 18.88 -v -24.42 -9.57 15.50 -v -24.22 -9.64 15.49 -v -21.89 -3.59 17.34 -v -23.98 -9.71 18.87 -v -20.95 -1.19 18.26 -v -21.02 -1.16 17.16 -v -21.65 -6.86 18.47 -v -21.64 -6.86 18.61 -v -20.11 -6.80 18.41 -v -20.11 -6.80 18.55 -v -20.12 -6.80 17.67 -v -20.13 -7.12 17.69 -v -21.65 -6.86 17.72 -v -21.66 -7.04 17.74 -v -21.66 -7.04 17.88 -v -20.13 -7.12 17.83 -v -21.65 -6.86 17.87 -v -20.11 -6.80 17.81 -v -20.14 -11.43 20.48 -v -20.18 -12.67 20.94 -v -20.12 -10.55 19.48 -v -20.30 -15.29 18.74 -v -20.31 -15.01 17.47 -v -20.27 -14.90 19.94 -v -20.15 -10.67 17.01 -v -20.12 -10.27 18.21 -v -20.23 -13.94 20.74 -v -20.89 -10.51 16.93 -v -20.86 -10.09 18.22 -v -20.86 -10.40 19.58 -v -20.88 -11.34 20.66 -v -20.92 -12.66 21.15 -v -20.97 -14.03 20.94 -v -21.02 -15.05 20.07 -v -21.05 -15.47 18.78 -v -21.06 -15.17 17.42 -v -20.29 -14.13 16.47 -v -21.04 -14.23 16.35 -v -20.25 -12.89 16.01 -v -20.99 -12.90 15.85 -v -20.20 -11.62 16.21 -v -20.94 -11.54 16.07 -v -21.69 -11.63 16.26 -v -21.64 -10.67 17.07 -v -21.61 -10.28 18.27 -v -21.61 -10.56 19.54 -v -21.63 -11.44 20.54 -v -21.67 -12.68 21.00 -v -21.72 -13.94 20.80 -v -21.76 -14.90 19.99 -v -21.79 -15.29 18.79 -v -21.80 -15.01 17.52 -v -21.78 -14.14 16.52 -v -21.74 -12.90 16.06 -# 94 vertices - -vn -0.05 -1.00 0.00 -vn 0.32 -0.07 -0.95 -vn -0.45 -0.03 -0.89 -vn 0.33 -0.07 -0.94 -vn -0.43 -0.04 -0.90 -vn -0.95 0.03 -0.32 -vn -0.94 0.02 -0.35 -vn -0.90 0.07 0.44 -vn -0.90 0.07 0.42 -vn -0.33 0.07 0.94 -vn -0.32 0.07 0.95 -vn 0.43 0.04 0.90 -vn 0.45 0.03 0.89 -vn 0.94 -0.02 0.35 -vn 0.95 -0.03 0.32 -vn 0.90 -0.07 -0.42 -vn 0.90 -0.07 -0.44 -vn -0.03 -0.06 -1.00 -vn 0.03 0.06 1.00 -vn -0.01 -1.00 0.00 -vn 0.01 1.00 -0.00 -vn -0.94 0.34 0.07 -vn 0.94 -0.34 -0.07 -vn -1.00 0.05 0.01 -vn -0.04 1.00 -0.00 -vn 1.00 -0.05 -0.01 -vn 0.46 0.89 -0.01 -vn 0.99 0.16 -0.01 -vn 0.97 -0.10 -0.20 -vn 1.00 -0.06 -0.04 -vn 0.98 -0.10 -0.18 -vn 1.00 -0.06 -0.01 -vn 0.07 -1.00 0.00 -vn 0.06 -1.00 -0.00 -vn 0.05 -1.00 -0.01 -vn -0.99 -0.13 0.01 -vn -0.59 -0.81 0.01 -vn 0.32 0.95 -0.00 -vn 0.06 0.05 1.00 -vn -0.32 -0.95 0.00 -vn 0.05 0.27 -0.96 -vn -0.06 -0.05 -1.00 -vn 1.00 -0.04 -0.01 -vn 0.22 0.81 -0.55 -vn -0.02 0.83 -0.56 -vn 0.24 0.97 -0.05 -vn -0.00 1.00 -0.05 -vn 0.25 0.87 0.44 -vn 0.01 0.89 0.45 -vn 0.26 0.55 0.79 -vn 0.03 0.57 0.82 -vn 0.27 0.10 0.96 -vn 0.03 0.10 0.99 -vn 0.27 -0.40 0.87 -vn 0.03 -0.42 0.91 -vn 0.26 -0.80 0.53 -vn 0.02 -0.83 0.56 -vn 0.24 -0.97 0.04 -vn 0.00 -1.00 0.05 -vn 0.22 -0.87 -0.45 -vn -0.01 -0.89 -0.45 -vn 0.20 -0.55 -0.81 -vn -0.03 -0.57 -0.82 -vn 0.20 -0.10 -0.97 -vn -0.03 -0.10 -0.99 -vn 0.21 0.40 -0.89 -vn -0.03 0.42 -0.91 -vn -0.27 0.40 -0.87 -vn -0.26 0.80 -0.53 -vn -0.24 0.97 -0.04 -vn -0.22 0.87 0.45 -vn -0.20 0.55 0.81 -vn -0.20 0.10 0.97 -vn -0.21 -0.40 0.89 -vn -0.22 -0.81 0.55 -vn -0.24 -0.97 0.05 -vn -0.25 -0.87 -0.44 -vn -0.26 -0.55 -0.79 -vn -0.27 -0.10 -0.96 -vn -1.00 0.04 0.01 -# 80 vertex normals - -vt 0.07 0.76 0.00 -vt 0.30 0.92 0.00 -vt 0.09 0.92 0.00 -vt 0.30 0.93 0.00 -vt 0.09 0.93 0.00 -vt 0.30 0.94 0.00 -vt 0.09 0.94 0.00 -vt 0.44 0.70 0.00 -vt 0.44 0.73 0.00 -vt 0.44 0.74 0.00 -vt 0.43 0.74 0.00 -vt 0.43 0.75 0.00 -vt 0.32 0.98 0.00 -vt 0.31 0.98 0.00 -vt 0.33 0.98 0.00 -vt 0.33 0.99 0.00 -vt 0.32 1.00 0.00 -vt 0.33 1.00 0.00 -vt 0.47 0.08 0.00 -vt 0.53 0.08 0.00 -vt 0.47 0.11 0.00 -vt 0.67 0.11 0.00 -vt 0.66 0.03 0.00 -vt 0.61 0.03 0.00 -vt 0.47 0.00 0.00 -vt 0.66 0.00 0.00 -vt 0.08 0.75 0.00 -vt 0.09 0.75 0.00 -vt 0.07 0.75 0.00 -vt 0.04 0.84 0.00 -vt 0.04 0.85 0.00 -vt 0.03 0.84 0.00 -vt 0.03 0.85 0.00 -vt 0.08 0.76 0.00 -vt 0.09 0.74 0.00 -vt 0.43 0.73 0.00 -vt 0.42 0.73 0.00 -vt 0.42 0.74 0.00 -vt 0.43 0.72 0.00 -vt 0.42 0.72 0.00 -vt 0.46 0.72 0.00 -vt 0.46 0.73 0.00 -vt 0.45 0.73 0.00 -vt 0.03 0.68 0.00 -vt 0.05 0.68 0.00 -vt 0.16 0.67 0.00 -vt 0.03 0.67 0.00 -vt 0.08 0.67 0.00 -vt 0.08 0.68 0.00 -vt 0.07 0.67 0.00 -vt 0.07 0.66 0.00 -vt 0.16 0.66 0.00 -vt 0.03 0.66 0.00 -vt 0.31 0.99 0.00 -vt 0.85 0.94 0.00 -vt 0.85 0.96 0.00 -vt 0.84 0.93 0.00 -vt 0.80 0.99 0.00 -vt 0.78 0.98 0.00 -vt 0.82 0.99 0.00 -vt 0.80 0.92 0.00 -vt 0.82 0.92 0.00 -vt 0.84 0.98 0.00 -vt 0.32 0.78 0.00 -vt 0.32 0.76 0.00 -vt 0.34 0.78 0.00 -vt 0.34 0.76 0.00 -vt 0.36 0.78 0.00 -vt 0.36 0.76 0.00 -vt 0.38 0.78 0.00 -vt 0.38 0.76 0.00 -vt 0.39 0.78 0.00 -vt 0.39 0.76 0.00 -vt 0.31 0.78 0.00 -vt 0.31 0.76 0.00 -vt 0.29 0.78 0.00 -vt 0.29 0.76 0.00 -vt 0.31 0.75 0.00 -vt 0.32 0.75 0.00 -vt 0.34 0.75 0.00 -vt 0.36 0.75 0.00 -vt 0.38 0.75 0.00 -vt 0.39 0.75 0.00 -vt 0.29 0.75 0.00 -vt 0.78 0.96 0.00 -vt 0.78 0.94 0.00 -vt 0.79 0.93 0.00 -# 87 texture coords - -g P_51_Mustang_Right_Landing_Wheel -f 515/286/465 516/286/465 517/286/465 -f 518/286/465 517/286/465 516/286/465 -f 519/287/466 520/287/467 521/288/468 -f 522/288/469 521/288/468 520/287/467 -f 520/287/467 523/289/470 522/288/469 -f 524/290/471 522/288/469 523/289/470 -f 523/289/470 525/291/472 524/290/471 -f 526/292/473 524/290/471 525/291/472 -f 525/291/472 527/291/474 526/292/473 -f 528/292/475 526/292/473 527/291/474 -f 527/291/474 529/291/476 528/292/475 -f 530/292/477 528/292/475 529/291/476 -f 529/291/476 531/291/478 530/292/477 -f 532/292/479 530/292/477 531/291/478 -f 531/291/478 533/289/480 532/292/479 -f 534/290/481 532/292/479 533/289/480 -f 533/289/480 519/287/466 534/290/481 -f 521/288/468 534/290/481 519/287/466 -f 535/293/482 536/294/482 537/293/482 -f 537/293/482 536/294/482 538/294/482 -f 536/294/482 539/295/482 538/294/482 -f 538/294/482 539/295/482 540/295/482 -f 540/295/482 539/295/482 541/296/482 -f 542/297/482 540/295/482 541/296/482 -f 543/293/483 544/293/483 545/294/483 -f 544/293/483 546/294/483 545/294/483 -f 545/294/483 546/294/483 547/295/483 -f 546/294/483 548/295/483 547/295/483 -f 547/295/483 548/295/483 549/296/483 -f 548/295/483 550/297/483 549/296/483 -f 533/298/484 531/299/484 519/300/484 -f 519/300/484 531/299/484 523/301/484 -f 531/299/484 527/302/484 523/301/484 -f 523/301/484 527/302/484 525/303/484 -f 520/300/484 519/300/484 523/301/484 -f 530/303/485 532/301/485 528/302/485 -f 532/301/485 521/300/485 528/302/485 -f 521/300/485 524/299/485 528/302/485 -f 522/298/485 524/299/485 521/300/485 -f 534/300/485 521/300/485 532/301/485 -f 551/304/486 552/305/486 553/306/486 -f 552/305/486 554/307/486 553/306/486 -f 555/308/486 554/307/486 552/305/486 -f 556/304/487 557/309/487 558/310/487 -f 558/310/487 557/309/487 559/311/487 -f 557/309/487 560/308/487 559/311/487 -f 561/312/488 515/312/488 562/312/488 -f 517/312/488 562/312/488 515/312/488 -f 563/313/489 561/312/489 564/313/489 -f 562/312/489 564/313/489 561/312/489 -f 516/314/490 563/314/490 518/314/490 -f 564/314/490 518/314/490 563/314/490 -f 565/315/482 566/316/482 567/317/482 -f 568/318/482 567/317/482 566/316/482 -f 569/316/483 570/318/483 571/315/483 -f 572/317/483 571/315/483 570/318/483 -f 568/319/465 566/286/465 569/312/465 -f 570/314/465 569/312/465 566/286/465 -f 567/313/488 568/313/488 571/313/488 -f 569/313/488 571/313/488 568/313/488 -f 565/312/489 567/312/489 572/312/489 -f 571/312/489 572/312/489 567/312/489 -f 566/320/490 565/320/490 570/320/490 -f 572/320/490 570/320/490 565/320/490 -f 540/321/491 542/322/491 548/296/491 -f 550/323/491 548/296/491 542/322/491 -f 538/324/492 540/325/492 546/321/492 -f 548/322/492 546/321/492 540/325/492 -f 537/326/493 538/324/494 544/327/495 -f 546/321/496 544/327/495 538/324/494 -f 535/296/497 537/321/498 543/296/499 -f 544/321/499 543/296/499 537/321/498 -f 536/328/488 535/322/488 545/328/488 -f 543/322/488 545/328/488 535/322/488 -f 539/327/500 536/328/500 547/327/500 -f 545/328/500 547/327/500 536/328/500 -f 541/296/501 539/296/501 549/323/501 -f 547/323/501 549/323/501 539/296/501 -f 559/329/502 560/330/502 553/329/502 -f 551/330/502 553/329/502 560/330/502 -f 553/331/503 554/332/503 559/331/503 -f 558/332/503 559/331/503 554/332/503 -f 554/333/504 555/332/504 558/334/504 -f 556/329/504 558/334/504 555/332/504 -f 557/335/505 556/331/505 552/336/505 -f 555/337/505 552/336/505 556/331/505 -f 552/336/506 551/338/506 557/335/506 -f 560/332/506 557/335/506 551/338/506 -f 528/302/485 524/299/485 526/339/485 -f 563/315/482 516/316/482 561/317/482 -f 515/318/482 561/317/482 516/316/482 -f 517/316/483 518/318/483 562/315/483 -f 564/317/483 562/315/483 518/318/483 -f 529/339/484 527/302/484 531/299/484 -f 573/340/507 574/341/507 575/342/507 -f 576/343/507 577/344/507 578/345/507 -f 577/344/507 574/341/507 578/345/507 -f 579/346/507 574/341/507 577/344/507 -f 575/342/507 574/341/507 579/346/507 -f 580/347/507 575/342/507 579/346/507 -f 578/345/507 574/341/507 581/348/507 -f 579/349/508 582/350/509 580/351/510 -f 583/352/511 580/351/510 582/350/509 -f 580/351/510 583/352/511 575/353/512 -f 584/354/513 575/353/512 583/352/511 -f 575/353/512 584/354/513 573/355/514 -f 585/356/515 573/355/514 584/354/513 -f 573/355/514 585/356/515 574/357/516 -f 586/358/517 574/357/516 585/356/515 -f 574/357/516 586/358/517 581/355/518 -f 587/356/519 581/355/518 586/358/517 -f 581/355/518 587/356/519 578/353/520 -f 588/354/521 578/353/520 587/356/519 -f 578/353/520 588/354/521 576/351/522 -f 589/352/523 576/351/522 588/354/521 -f 576/351/522 589/352/523 577/349/524 -f 590/350/525 577/349/524 589/352/523 -f 577/349/524 590/350/525 591/359/526 -f 592/360/527 591/359/526 590/350/525 -f 591/359/526 592/360/527 593/361/528 -f 594/362/529 593/361/528 592/360/527 -f 593/361/528 594/362/529 595/359/530 -f 596/360/531 595/359/530 594/362/529 -f 595/359/530 596/360/531 579/349/508 -f 582/350/509 579/349/508 596/360/531 -f 596/360/531 597/363/532 582/350/509 -f 598/364/533 582/350/509 597/363/532 -f 582/350/509 598/364/533 583/352/511 -f 599/365/534 583/352/511 598/364/533 -f 583/352/511 599/365/534 584/354/513 -f 600/366/535 584/354/513 599/365/534 -f 584/354/513 600/366/535 585/356/515 -f 601/367/536 585/356/515 600/366/535 -f 585/356/515 601/367/536 586/358/517 -f 602/368/537 586/358/517 601/367/536 -f 586/358/517 602/368/537 587/356/519 -f 603/367/538 587/356/519 602/368/537 -f 587/356/519 603/367/538 588/354/521 -f 604/366/539 588/354/521 603/367/538 -f 588/354/521 604/366/539 589/352/523 -f 605/365/540 589/352/523 604/366/539 -f 589/352/523 605/365/540 590/350/525 -f 606/364/541 590/350/525 605/365/540 -f 590/350/525 606/364/541 592/360/527 -f 607/363/542 592/360/527 606/364/541 -f 592/360/527 607/363/542 594/362/529 -f 608/369/543 594/362/529 607/363/542 -f 594/362/529 608/369/543 596/360/531 -f 597/363/532 596/360/531 608/369/543 -f 604/344/544 603/370/544 605/343/544 -f 605/343/544 603/370/544 607/348/544 -f 607/348/544 603/370/544 599/347/544 -f 597/340/544 607/348/544 599/347/544 -f 598/342/544 597/340/544 599/347/544 -f 608/341/544 607/348/544 597/340/544 -f 606/345/544 605/343/544 607/348/544 -f 591/370/507 593/371/507 577/344/507 -f 593/371/507 579/346/507 577/344/507 -f 595/372/507 579/346/507 593/371/507 -f 600/346/544 599/347/544 601/372/544 -f 599/347/544 603/370/544 601/372/544 -f 601/372/544 603/370/544 602/371/544 -# 162 faces - -# -# object P_51_Mustang_Hull -# - -v -2.18 8.58 9.73 -v -2.30 8.86 6.02 -v -2.39 8.59 9.73 -v -3.01 6.76 9.95 -v -3.00 7.11 6.05 -v -2.52 8.87 6.26 -v -3.01 7.30 3.85 -v -2.47 9.05 4.06 -v -2.46 9.23 1.97 -v -2.94 7.47 1.76 -v -2.64 7.71 -0.97 -v -2.18 9.48 -0.86 -v -1.61 9.68 -3.39 -v -2.16 7.97 -4.05 -v -1.03 9.75 -4.33 -v -1.12 8.59 -5.66 -v 0.11 9.80 -4.96 -v -0.16 8.78 -6.15 -v 0.64 8.86 -6.31 -v 0.67 9.81 -5.10 -v 1.22 9.79 -4.97 -v 1.42 8.77 -6.17 -v 2.36 8.56 -5.69 -v 2.34 9.73 -4.36 -v 3.35 7.92 -4.07 -v 2.94 9.65 -3.40 -v 3.68 7.66 -1.02 -v 3.37 9.43 -0.91 -v 3.56 9.19 1.92 -v 3.88 7.42 1.70 -v 3.89 7.24 3.80 -v 3.50 9.01 4.01 -v 3.48 8.82 6.21 -v 3.80 7.05 6.00 -v 3.24 8.55 9.69 -v 3.68 6.70 9.89 -v 3.42 6.70 9.89 -v 3.02 8.54 9.69 -v 3.54 7.05 5.77 -v 3.25 8.81 5.98 -v 3.62 7.24 3.66 -v 3.27 9.00 3.86 -v 3.32 9.19 1.84 -v 3.62 7.42 1.64 -v 3.43 7.66 -0.98 -v 3.15 9.44 -0.88 -v 2.76 9.66 -3.28 -v 3.14 7.93 -3.92 -v 2.21 9.73 -4.21 -v 2.21 8.57 -5.48 -v 1.17 9.80 -4.74 -v 1.35 8.78 -5.89 -v 0.63 8.87 -6.03 -v 0.66 9.82 -4.87 -v 0.14 9.81 -4.73 -v -0.11 8.79 -5.88 -v -1.00 8.60 -5.46 -v -0.91 9.76 -4.19 -v -1.97 7.97 -3.90 -v -1.45 9.69 -3.27 -v -2.41 7.71 -0.94 -v -1.97 9.47 -0.84 -v -2.23 9.23 1.89 -v -2.68 7.47 1.69 -v -2.76 7.29 3.71 -v -2.25 9.05 3.90 -v -2.75 7.10 5.82 -v -2.76 6.75 9.94 -v -2.84 6.73 10.23 -v -0.81 12.12 9.64 -v -3.12 6.71 10.24 -v -1.01 12.45 9.62 -v 2.05 12.10 9.61 -v 2.28 12.42 9.59 -v 3.57 6.66 10.17 -v 3.86 6.66 10.17 -v 3.58 6.71 9.84 -v 2.05 12.09 9.29 -v -0.81 12.12 9.32 -v -2.83 6.78 9.90 -v 3.86 6.71 9.84 -v 2.28 12.42 9.26 -v -1.00 12.44 9.30 -v -3.12 6.76 9.90 -v 4.66 -1.79 -1.03 -v 4.25 -0.21 1.79 -v 5.11 -0.16 2.78 -v -3.87 -3.05 -1.87 -v -4.48 -1.72 -0.95 -v -3.60 -2.34 -4.87 -v -3.65 -3.03 1.13 -v -3.68 -1.87 2.11 -v -2.89 -2.82 3.93 -v -2.58 -1.80 4.33 -v -1.34 -1.85 5.56 -v -1.63 -3.21 5.62 -v -0.01 -1.92 6.45 -v -0.09 -3.54 6.63 -v 1.51 -3.23 5.59 -v 1.35 -1.87 5.53 -v 2.85 -2.86 3.87 -v 2.62 -1.84 4.28 -v 3.78 -1.93 2.04 -v 3.66 -3.09 1.06 -v 3.95 -3.11 -1.94 -v 3.82 -2.40 -4.94 -v 3.26 -4.73 -4.88 -v 3.54 -4.03 -1.52 -v 3.30 -4.95 -1.65 -v 2.58 -5.40 -4.82 -v 3.39 -3.91 1.68 -v 2.74 -3.53 4.26 -v 2.35 -3.57 6.63 -v 3.21 -4.15 4.04 -v 3.01 -4.04 6.65 -v 3.11 -5.17 4.28 -v 2.84 -5.09 6.73 -v 2.20 -5.93 4.14 -v 1.97 -5.61 6.76 -v -0.20 -5.90 6.80 -v 3.21 -5.14 1.70 -v 2.63 -5.80 -1.55 -v 2.42 -5.98 1.71 -v -2.81 -5.76 -1.50 -v -3.47 -4.44 -1.52 -v -2.64 -5.36 -4.77 -v -3.41 -5.09 1.76 -v -2.70 -5.94 1.75 -v -3.37 -5.12 4.34 -v -2.53 -5.90 4.18 -v -3.16 -5.04 6.79 -v -2.34 -5.58 6.80 -v -0.18 -6.23 2.91 -v 1.26 -6.32 1.56 -v 1.15 -6.28 -1.34 -v 1.38 -5.76 -5.00 -v 2.45 -4.83 -8.13 -v -3.37 -4.10 4.10 -v -3.47 -3.86 1.74 -v -2.85 -3.49 4.32 -v -3.10 -2.40 -8.95 -v -2.97 -3.71 -8.45 -v -3.25 -4.68 -4.82 -v -2.52 -3.54 6.68 -v -3.23 -3.99 6.71 -v 2.64 7.92 -7.83 -v 0.66 8.54 -8.04 -v 1.70 8.81 -6.12 -v 0.68 8.16 -10.79 -v -1.38 7.95 -7.79 -v -1.27 7.48 -10.79 -v -1.94 6.54 -10.08 -v -1.76 6.04 -15.12 -v -2.35 4.01 -14.71 -v -2.68 4.18 -10.15 -v -2.65 0.18 -14.70 -v -3.13 0.11 -9.48 -v -2.51 -1.75 -14.35 -v -2.17 -2.56 -13.63 -v -2.37 -4.79 -8.08 -v 0.70 7.68 -15.64 -v -0.96 7.14 -15.33 -v 3.16 -3.76 -8.51 -v 2.57 -2.60 -13.68 -v 0.19 -2.88 -13.74 -v 0.33 -0.98 -18.94 -v -1.92 -1.05 -18.81 -v -2.26 -0.55 -18.26 -v -2.16 1.12 -18.78 -v -1.95 3.55 -18.87 -v -1.41 5.63 -19.24 -v -0.63 6.76 -19.48 -v -1.82 0.96 -23.00 -v -1.73 -0.34 -22.73 -v 0.33 -2.07 -22.55 -v 2.58 -1.08 -18.86 -v 3.00 -1.79 -14.41 -v 3.43 -2.45 -9.01 -v 3.70 0.06 -9.54 -v 3.90 0.33 -5.99 -v 3.73 5.02 -6.62 -v 3.92 4.94 -3.00 -v 3.27 7.20 -5.88 -v 3.38 7.92 -4.06 -v 2.45 8.56 -5.59 -v -1.49 3.34 -25.54 -v -1.66 1.28 -25.54 -v -1.68 3.36 -23.04 -v -1.44 -0.13 -25.65 -v 0.43 -0.87 -25.61 -v 2.56 -0.37 -22.78 -v 2.94 -0.59 -18.32 -v 3.33 0.13 -14.76 -v 3.65 4.13 -10.21 -v 3.13 6.50 -10.13 -v 2.56 7.45 -10.83 -v 3.39 3.96 -14.77 -v 3.02 1.08 -18.84 -v -1.36 0.20 -28.16 -v 0.48 -0.62 -27.84 -v 2.38 -0.16 -25.69 -v 2.79 0.93 -23.05 -v 3.03 3.51 -18.93 -v 3.01 6.01 -15.17 -v 2.31 7.11 -15.36 -v 2.69 5.60 -19.28 -v 2.87 3.33 -23.10 -v 2.72 1.24 -25.59 -v 2.39 0.17 -28.20 -v 0.56 -0.18 -32.31 -v -1.02 0.49 -32.48 -v -1.45 1.45 -28.24 -v -1.11 1.83 -32.23 -v -1.22 3.44 -28.23 -v -0.97 3.60 -32.20 -v -0.54 0.61 -36.78 -v -0.65 1.57 -37.11 -v -0.39 0.69 -37.86 -v -0.54 1.56 -37.94 -v -0.40 3.34 -38.12 -v -0.52 3.41 -37.33 -v -0.81 4.47 -34.00 -v -0.80 3.33 -33.98 -v -1.08 4.53 -32.20 -v -1.18 4.91 -28.36 -v -1.43 5.01 -25.55 -v -1.39 5.21 -23.17 -v -1.29 5.80 -25.86 -v -0.82 5.27 -34.30 -v -1.17 5.60 -32.19 -v -0.67 5.70 -35.24 -v -1.25 5.89 -30.06 -v -0.71 6.30 -31.82 -v -1.23 6.04 -28.10 -v -0.11 6.62 -25.95 -v -0.61 6.31 -23.30 -v -0.34 5.20 -38.31 -v 0.09 7.37 -36.51 -v 0.29 7.13 -38.50 -v 0.20 8.38 -37.33 -v 0.34 8.23 -38.61 -v 0.86 15.56 -39.24 -v 0.26 8.62 -35.31 -v 0.18 7.65 -34.16 -v 0.30 8.02 -31.06 -v 0.74 7.30 -20.27 -v 2.04 6.74 -19.51 -v 1.68 6.61 -25.97 -v 2.08 6.29 -23.33 -v 2.78 5.77 -25.91 -v 2.84 4.97 -25.60 -v 2.67 4.88 -28.41 -v 2.57 3.42 -28.27 -v 2.44 3.57 -32.24 -v 2.41 1.80 -32.27 -v 2.28 1.75 -33.92 -v 2.14 0.64 -33.77 -v 1.86 0.59 -36.81 -v 0.59 -0.02 -33.73 -v 0.65 0.31 -37.01 -v 2.30 3.31 -34.01 -v 2.63 4.50 -32.24 -v 2.42 4.44 -34.04 -v 2.83 5.57 -32.24 -v 1.89 16.66 -36.52 -v 1.85 15.87 -36.07 -v 1.97 16.49 -38.45 -v 1.95 15.68 -38.16 -v 1.92 15.55 -39.26 -v 1.73 8.61 -35.34 -v 1.85 8.37 -37.37 -v 1.68 7.64 -34.19 -v 1.83 7.36 -36.54 -v 2.41 6.27 -31.86 -v 2.42 5.67 -35.28 -v 2.88 5.86 -30.11 -v 2.51 5.25 -34.34 -v 2.12 3.39 -37.36 -v 2.07 1.55 -37.14 -v 2.81 6.01 -28.14 -v 1.48 8.01 -31.09 -v 0.89 8.76 -29.21 -v 1.54 8.93 -32.66 -v 0.96 9.49 -30.87 -v 1.34 15.98 -35.15 -v 0.84 15.88 -36.04 -v 0.90 16.67 -36.50 -v 0.87 16.50 -38.43 -v 0.81 15.69 -38.13 -v 0.92 16.38 -39.42 -v 0.38 8.94 -32.64 -v 0.96 17.20 -36.78 -v 1.38 16.76 -35.70 -v 1.06 16.91 -39.48 -v 1.94 16.37 -39.44 -v 1.94 16.37 -39.43 -v 1.94 16.28 -39.43 -v 1.85 16.90 -39.49 -v 1.89 17.19 -36.80 -v 1.41 17.28 -36.06 -v 1.45 17.57 -37.12 -v 1.48 17.32 -39.52 -v 1.44 17.63 -36.65 -v 1.99 1.54 -37.97 -v 1.75 0.67 -37.88 -v 2.02 3.32 -38.14 -v 2.14 5.18 -38.33 -v 1.69 7.13 -38.52 -v 1.75 8.22 -38.63 -v 0.67 0.46 -37.85 -v 3.86 7.51 0.69 -v 3.95 4.68 1.12 -v 3.90 7.06 5.85 -v 3.95 4.60 6.04 -v 3.79 6.68 10.01 -v 3.87 4.45 9.55 -v 3.70 6.44 11.84 -v 3.81 3.46 11.93 -v 3.68 6.42 15.10 -v 3.73 4.91 15.20 -v 3.73 5.37 19.12 -v 3.69 2.76 19.65 -v 3.60 2.71 23.29 -v 3.53 0.63 23.15 -v 3.34 0.90 26.42 -v 3.07 -0.41 26.45 -v 2.86 1.14 31.85 -v 1.48 -0.38 32.12 -v 3.83 2.01 9.53 -v 3.89 1.66 6.29 -v 4.03 1.15 1.42 -v 4.05 0.52 -2.36 -v 4.15 -0.95 -1.80 -v 4.21 0.67 6.43 -v 4.10 1.18 9.55 -v 4.11 1.23 12.19 -v 3.73 2.28 15.62 -v 0.99 0.57 36.00 -v -0.28 -0.63 32.46 -v -0.28 0.36 36.21 -v -1.53 0.59 36.02 -v -2.00 -0.36 32.15 -v -3.23 1.19 31.90 -v -3.45 -0.36 26.51 -v -3.60 0.95 26.49 -v -3.73 0.69 23.22 -v -3.61 2.76 23.36 -v -3.60 2.82 19.72 -v -3.38 5.42 19.19 -v -3.33 4.97 15.27 -v -3.14 6.47 15.16 -v -3.46 3.51 12.00 -v -3.08 6.49 11.90 -v -3.37 4.51 9.62 -v -3.10 6.74 10.07 -v -2.61 -1.47 26.73 -v -0.26 -1.79 26.94 -v -3.76 -0.41 24.24 -v -3.32 -1.40 24.00 -v -2.16 -1.98 24.36 -v -0.25 -2.12 24.38 -v 2.12 -1.51 26.69 -v 2.91 -1.45 23.95 -v 3.44 -0.47 24.18 -v 1.68 -2.00 24.32 -v -3.35 4.66 6.11 -v -3.06 7.12 5.92 -v -3.22 4.74 1.19 -v -2.85 7.57 0.76 -v -3.06 5.00 -2.93 -v -2.21 7.96 -4.00 -v -2.13 7.24 -5.83 -v -1.19 8.59 -5.55 -v -0.40 8.83 -6.10 -v 0.66 8.89 -6.31 -v -2.77 5.07 -6.56 -v -3.39 0.39 -5.92 -v -3.61 0.58 -2.29 -v -3.64 1.21 1.49 -v -3.57 1.72 6.36 -v -3.56 2.07 9.60 -v -3.87 -0.89 -1.73 -v -3.99 -0.15 1.87 -v -3.99 0.73 6.51 -v -3.91 1.24 9.63 -v -3.98 1.29 12.27 -v -3.58 2.34 15.69 -v 3.48 8.59 10.06 -v 3.42 7.85 11.79 -v 3.40 7.97 12.78 -v 3.48 7.69 15.11 -v 3.72 6.84 18.67 -v 3.66 5.67 23.35 -v 3.50 2.82 26.85 -v 3.33 3.01 31.94 -v 2.17 1.58 35.93 -v 2.97 3.24 35.96 -v 1.87 2.09 38.21 -v 2.20 3.58 38.12 -v 3.30 5.02 36.17 -v 0.83 1.30 38.26 -v 2.01 3.59 38.71 -v 2.70 5.55 38.59 -v 3.26 6.60 35.87 -v 2.69 6.79 38.51 -v 2.56 8.39 35.96 -v 2.08 8.17 38.43 -v 2.14 8.94 35.78 -v 1.33 8.81 38.39 -v 1.17 9.51 35.68 -v 0.66 9.21 38.36 -v 0.16 9.58 35.68 -v 0.11 9.29 38.36 -v -0.45 9.22 38.37 -v -0.86 9.52 35.70 -v -1.16 8.83 38.41 -v -1.88 8.97 35.82 -v -1.96 8.20 38.46 -v -2.36 8.43 36.01 -v -0.94 9.87 31.34 -v -0.99 10.19 26.34 -v 0.31 10.34 26.77 -v 0.24 10.10 31.35 -v 1.40 9.85 31.31 -v 2.43 9.42 31.16 -v 2.98 8.72 31.28 -v 3.55 6.98 31.31 -v 3.30 9.02 26.28 -v 2.49 9.75 26.24 -v 2.79 9.81 22.99 -v 1.60 10.17 26.31 -v 1.80 10.21 23.30 -v 2.05 10.21 20.89 -v 0.35 10.44 23.69 -v 0.39 10.50 21.00 -v 0.42 10.41 17.76 -v 0.46 10.45 15.10 -v -1.03 10.08 15.41 -v -3.29 7.11 21.42 -v -3.28 7.11 23.77 -v -2.82 8.99 21.40 -v -2.82 8.71 18.17 -v -2.21 9.52 17.94 -v -2.03 9.13 15.29 -v -2.22 8.81 13.72 -v -1.24 9.98 14.02 -v 0.48 10.47 13.79 -v 1.91 10.06 15.38 -v 2.10 10.07 18.02 -v 2.87 9.77 21.15 -v 3.35 9.04 23.40 -v 3.64 6.98 26.77 -v -3.23 6.90 18.74 -v -3.39 5.73 23.42 -v -2.82 7.74 15.17 -v -2.65 8.02 12.84 -v -3.59 2.87 26.92 -v -2.66 7.90 11.85 -v -2.61 8.64 10.12 -v -2.70 6.83 38.56 -v -3.20 6.62 35.03 -v -2.83 5.59 38.64 -v -3.42 5.07 36.23 -v -2.33 3.62 38.75 -v -2.50 3.62 38.16 -v -3.25 3.29 36.02 -v -2.32 2.13 38.25 -v -2.60 1.62 35.98 -v -1.35 1.32 38.28 -v -3.53 3.06 32.00 -v -3.56 5.54 26.97 -v -3.59 4.96 32.12 -v -3.34 7.04 26.84 -v -2.77 9.09 23.46 -v -2.17 9.81 21.20 -v -1.29 10.09 18.05 -v -1.30 10.23 20.93 -v -1.11 10.24 23.32 -v -2.80 9.06 26.34 -v -2.13 9.85 23.04 -v -1.92 9.78 26.28 -v -2.63 8.76 31.33 -v -3.37 7.03 31.38 -v -2.01 9.46 31.20 -v 3.57 4.91 32.06 -v 3.72 5.49 26.90 -v 3.66 7.05 23.70 -v 3.73 7.06 21.36 -v 3.44 8.94 21.34 -v 3.50 8.66 18.11 -v 2.97 9.48 17.90 -v 2.82 9.09 15.25 -v 3.02 8.77 13.67 -v 2.14 9.95 13.99 -v -8.03 6.05 -27.42 -v -4.52 6.07 -27.32 -v -8.03 5.97 -28.86 -v -11.48 5.96 -28.73 -v -11.12 5.68 -31.09 -v -13.81 5.66 -30.77 -v -14.13 5.91 -28.57 -v -15.24 5.49 -30.33 -v -15.27 5.57 -28.02 -v -14.18 5.73 -27.39 -v -11.49 6.01 -27.59 -v -11.64 5.76 -26.95 -v -8.48 5.76 -26.64 -v -5.05 5.77 -26.30 -v -2.22 5.77 -26.09 -v -1.90 6.05 -27.63 -v -1.72 5.88 -29.69 -v -4.26 5.97 -29.14 -v -4.42 5.63 -31.75 -v -7.79 5.68 -31.43 -v -1.74 5.55 -32.08 -v 4.34 6.11 32.28 -v 4.06 6.10 32.66 -v 4.63 6.10 32.53 -v 4.17 6.09 33.03 -v 4.75 5.76 32.68 -v 4.21 5.75 33.23 -v 4.60 5.42 32.56 -v 4.14 5.41 33.05 -v 4.31 5.43 32.30 -v 4.02 5.42 32.69 -v 4.19 5.77 32.16 -v 3.98 5.77 32.49 -v 3.79 5.77 32.46 -v 3.80 6.10 32.64 -v 3.78 6.10 33.03 -v 3.75 5.75 33.24 -v 3.74 5.42 33.06 -v 3.76 5.42 32.67 -v 13.07 5.77 -29.01 -v 12.75 5.49 -31.56 -v 9.62 5.83 -29.06 -v 9.43 5.54 -31.80 -v 5.87 5.90 -29.25 -v 6.06 5.54 -32.00 -v 3.33 5.84 -29.75 -v 3.46 6.01 -27.69 -v 3.72 5.73 -26.16 -v 6.08 5.99 -27.44 -v 6.55 5.68 -26.43 -v 9.59 5.91 -27.62 -v 9.99 5.62 -26.85 -v 13.05 5.81 -27.87 -v 13.16 5.56 -27.23 -v 15.71 5.50 -27.73 -v 15.71 5.68 -28.91 -v 3.39 5.51 -32.16 -v 16.80 5.32 -28.38 -v 16.83 5.24 -30.69 -v 15.57 5.42 -31.45 -v 16.72 5.01 -33.40 -v 15.72 4.99 -33.73 -v 2.75 5.18 -23.22 -v 2.74 3.31 -25.59 -v 2.61 1.41 -28.29 -v 2.21 0.46 -32.52 -v -0.90 0.66 -33.74 -v -0.94 1.77 -33.88 -v -3.75 5.44 34.55 -v -3.73 5.78 34.73 -v -4.14 5.45 34.56 -v -4.02 5.45 34.19 -v -4.29 5.46 33.81 -v -4.13 5.81 33.67 -v -3.94 5.80 33.99 -v -4.26 6.14 33.78 -v -3.98 6.13 34.16 -v -4.55 6.14 34.05 -v -4.11 6.13 34.53 -v -4.72 5.80 34.19 -v -4.19 5.78 34.73 -v -4.59 5.46 34.07 -v -3.71 6.12 34.53 -v -3.72 6.13 34.14 -v -3.74 5.80 33.96 -v -3.76 5.45 34.16 -v -4.87 -0.09 2.87 -v -4.96 0.33 6.76 -v -4.97 0.69 9.85 -v -4.97 0.81 12.34 -v -4.02 1.40 15.81 -v -5.09 0.90 16.22 -v -4.95 0.55 19.82 -v -3.90 1.32 19.99 -v -4.83 0.16 22.21 -v -4.59 -0.55 23.22 -v 5.14 0.25 6.67 -v 6.54 -0.19 3.45 -v 6.70 0.02 6.36 -v 5.11 0.61 9.76 -v 6.75 0.38 9.22 -v 5.06 0.73 12.25 -v 6.64 0.56 12.08 -v 5.08 0.82 16.12 -v 6.67 0.70 16.38 -v 6.69 0.53 18.92 -v 4.83 0.58 19.72 -v 5.76 -0.33 22.01 -v 4.60 0.08 22.12 -v 4.27 -0.62 23.14 -v 6.08 -0.69 22.43 -v 8.22 -0.70 21.64 -v -2.94 -4.05 6.84 -v -2.50 -4.14 5.16 -v -2.29 -3.64 6.81 -v -1.95 -3.79 5.13 -v -0.10 -3.68 6.76 -v 2.10 -3.67 6.76 -v 1.79 -3.82 5.09 -v 2.71 -4.09 6.78 -v 2.31 -4.18 5.11 -v -2.69 8.37 10.10 -v -1.01 12.37 9.64 -v -2.40 8.38 10.10 -v -0.82 12.04 9.66 -v 2.27 12.34 9.61 -v 2.05 12.02 9.63 -v 3.51 8.33 10.04 -v 3.22 8.33 10.04 -v 3.84 1.26 19.92 -v 4.07 1.34 15.73 -v -4.70 -0.90 3.35 -v -4.70 -1.20 6.48 -v -6.30 -0.85 3.61 -v -6.56 -1.14 6.50 -v -12.47 -0.77 4.38 -v -12.73 -0.99 6.36 -v -6.67 -1.53 9.41 -v -14.07 -1.37 9.24 -v -6.52 -1.75 12.40 -v -13.54 -1.60 12.35 -v -6.88 -1.99 14.90 -v -14.82 -1.75 15.41 -v -7.22 -1.67 18.64 -v -4.86 -2.15 14.61 -v -4.82 -1.75 19.27 -v -3.62 -2.25 14.45 -v -3.44 -1.80 19.64 -v -1.88 -2.40 14.58 -v -1.67 -2.00 20.13 -v -0.19 -2.16 20.12 -v -3.22 -1.95 12.03 -v -4.78 -1.81 12.13 -v -4.74 -1.59 9.42 -v -2.95 -1.72 9.49 -v -1.52 -2.01 12.24 -v -0.12 -2.14 14.54 -v 1.61 -2.42 14.55 -v 1.30 -2.02 20.10 -v 3.10 -1.85 19.57 -v 3.08 -1.79 21.12 -v 4.47 -1.76 20.56 -v 3.43 -1.11 22.63 -v -0.09 -2.11 12.44 -v -2.90 -1.39 6.33 -v -1.41 -1.87 9.61 -v -0.05 -1.96 9.46 -v 1.31 -1.89 9.58 -v 1.35 -2.03 12.21 -v -1.47 -1.58 6.59 -v 1.48 -1.60 6.57 -v 4.85 -0.98 3.26 -v 6.45 -0.95 3.49 -v 4.75 -1.28 6.39 -v 6.61 -1.24 6.37 -v 4.68 -1.66 9.33 -v 6.61 -1.63 9.28 -v 4.63 -1.88 12.04 -v 6.36 -1.85 12.28 -v 4.61 -2.22 14.52 -v 6.63 -2.09 14.77 -v 6.91 -1.78 18.50 -v 4.50 -1.82 19.18 -v 7.17 -1.73 19.64 -v 3.37 -2.30 14.39 -v 3.06 -1.99 11.97 -v 2.87 -1.77 9.44 -v 2.93 -1.44 6.28 -v -0.21 -2.18 21.60 -v 1.16 -2.18 21.93 -v -13.50 -1.56 17.59 -v -7.50 -1.61 19.78 -v -4.83 -1.69 20.65 -v -3.45 -1.74 21.19 -v -1.59 -2.16 21.95 -v -3.78 -1.05 22.70 -v -14.13 -0.49 20.28 -v -8.50 -0.57 21.80 -v -6.38 -0.59 22.55 -v -6.57 0.66 12.21 -v -6.69 0.77 16.50 -v -13.44 0.66 12.23 -v -14.35 0.80 15.32 -v -6.79 0.64 19.05 -v -13.40 0.59 18.05 -v -6.02 -0.24 22.12 -v -14.04 0.46 9.14 -v -6.62 0.48 9.35 -v -6.54 0.12 6.49 -v -6.32 -0.09 3.57 -v -12.44 -0.05 4.34 -v -12.67 0.19 6.29 -v -2.87 -5.00 6.90 -v -2.45 -4.96 5.21 -v 2.56 -5.05 6.85 -v 2.18 -4.99 5.17 -v 1.76 -5.52 6.88 -v 1.50 -5.39 5.19 -v -0.19 -5.70 6.91 -v -2.13 -5.49 6.92 -v -1.81 -5.37 5.22 -v -3.14 5.42 35.50 -v -3.77 5.43 35.52 -v -3.16 5.24 35.02 -v -3.79 5.24 35.05 -v -3.34 5.42 26.54 -v -3.97 5.42 26.57 -v -3.34 5.62 26.05 -v -3.97 5.63 26.08 -v -3.93 6.43 26.05 -v -3.91 6.61 26.52 -v -3.30 6.42 26.02 -v -3.28 6.61 26.49 -v -3.73 6.43 35.00 -v -3.10 6.43 34.97 -v -3.73 6.23 35.49 -v -3.10 6.22 35.46 -v -3.88 5.93 27.60 -v -3.87 6.28 27.39 -v -4.34 5.93 27.59 -v -4.29 5.60 27.42 -v -4.74 5.61 26.94 -v -4.44 5.61 26.67 -v -4.17 5.60 27.05 -v -4.28 5.96 26.53 -v -4.09 5.95 26.85 -v -4.41 6.30 26.65 -v -4.13 6.29 27.02 -v -4.70 6.29 26.91 -v -4.26 6.28 27.39 -v -4.87 5.95 27.05 -v -3.87 6.28 27.00 -v -3.89 5.95 26.82 -v -3.91 5.60 27.03 -v -3.90 5.59 27.42 -v -1.21 9.64 14.41 -v -0.71 12.35 9.95 -v -1.44 9.65 14.42 -v -1.02 12.35 9.90 -v -1.45 9.34 14.15 -v -1.00 12.00 9.77 -v -1.22 9.34 14.15 -v -0.69 12.00 9.83 -v 2.22 12.32 9.86 -v 1.90 12.33 9.92 -v 2.27 9.62 14.38 -v 2.04 9.62 14.38 -v 2.17 11.98 9.74 -v 2.26 9.31 14.12 -v 1.85 11.98 9.80 -v 2.03 9.31 14.12 -v 0.81 -4.99 -22.81 -v -0.46 -4.98 -22.79 -v 0.82 -4.71 -23.17 -v -0.44 -4.70 -23.15 -v 0.89 -3.01 -22.29 -v -0.38 -3.00 -22.28 -v 0.96 -1.67 -22.95 -v -0.30 -1.66 -22.94 -v 0.96 -1.54 -22.03 -v -0.31 -1.53 -22.02 -v 0.89 -2.88 -21.51 -v -0.38 -2.87 -21.49 -v -1.47 -5.74 -4.97 -v -1.38 -6.26 -1.31 -v -1.57 -6.30 1.58 -v -0.12 -6.30 -1.26 -v -0.03 -5.59 -5.78 -v 0.03 -5.10 -8.16 -v 3.48 5.22 -27.47 -v 3.30 5.03 -29.46 -v 3.33 4.89 -32.33 -v 5.82 5.02 -29.12 -v 6.03 4.88 -32.03 -v 9.40 4.92 -31.81 -v 9.58 5.05 -28.94 -v 12.73 4.96 -31.49 -v 13.03 5.07 -28.91 -v 15.50 5.01 -31.28 -v 15.68 5.13 -28.83 -v 13.02 5.21 -27.78 -v 6.03 5.22 -27.32 -v 9.54 5.21 -27.51 -v -0.26 1.32 38.26 -v -15.08 5.26 -33.04 -v -14.07 5.22 -33.39 -v -14.09 5.21 -32.45 -v -13.95 5.24 -30.69 -v -14.16 5.36 -28.49 -v -11.51 5.26 -28.63 -v -11.52 5.40 -27.50 -v -8.05 5.35 -27.31 -v -4.55 5.31 -27.20 -v -1.99 5.26 -27.41 -v -1.77 5.07 -29.40 -v -1.73 4.93 -32.15 -v -4.31 5.09 -29.00 -v -8.06 5.19 -28.74 -v -4.44 4.96 -31.91 -v -7.82 5.05 -31.65 -v -11.33 5.14 -31.30 -v -1.04 1.63 37.01 -v 0.59 1.62 36.99 -v -1.77 2.24 36.99 -v -1.91 3.36 36.92 -v 1.37 2.21 36.96 -v 1.61 3.33 36.89 -v 2.64 -0.09 1.94 -v 2.34 6.46 -0.67 -v -2.37 -0.05 1.99 -v -1.39 6.49 -0.64 -v 2.56 -0.95 10.54 -v -2.59 -0.91 10.59 -v 2.52 4.84 11.25 -v -2.03 4.88 11.29 -v 2.59 6.63 11.43 -v -1.94 6.67 11.48 -v 0.49 10.12 11.77 -v 2.05 9.05 11.64 -v -1.17 9.07 11.67 -v 1.94 3.49 38.22 -v -2.26 3.52 38.26 -v -2.09 2.18 38.33 -v -1.23 1.46 38.36 -v 0.72 1.45 38.34 -v 1.65 2.15 38.30 -v -3.85 5.90 29.03 -v -3.83 6.25 28.83 -v -4.31 5.90 29.03 -v -4.26 5.57 28.86 -v -4.71 5.58 28.37 -v -4.41 5.58 28.11 -v -4.14 5.57 28.49 -v -4.25 5.93 27.97 -v -4.06 5.92 28.29 -v -4.38 6.27 28.08 -v -4.10 6.26 28.46 -v -4.67 6.26 28.35 -v -4.23 6.25 28.83 -v -4.84 5.92 28.49 -v -3.84 6.25 28.44 -v -3.86 5.92 28.26 -v -3.88 5.57 28.46 -v -3.87 5.56 28.85 -v -3.82 5.87 30.47 -v -3.80 6.22 30.26 -v -4.28 5.87 30.46 -v -4.23 5.54 30.29 -v -4.68 5.55 29.81 -v -4.38 5.55 29.54 -v -4.10 5.54 29.92 -v -4.22 5.90 29.40 -v -4.03 5.89 29.72 -v -4.35 6.24 29.52 -v -4.07 6.23 29.89 -v -4.64 6.23 29.78 -v -4.20 6.22 30.26 -v -4.80 5.89 29.92 -v -3.81 6.22 29.87 -v -3.83 5.89 29.69 -v -3.85 5.54 29.90 -v -3.84 5.53 30.29 -v -3.79 5.84 31.87 -v -3.78 6.19 31.66 -v -4.25 5.84 31.87 -v -4.20 5.51 31.69 -v -4.65 5.52 31.21 -v -4.35 5.52 30.95 -v -4.08 5.51 31.32 -v -4.19 5.87 30.80 -v -4.00 5.86 31.12 -v -4.32 6.21 30.92 -v -4.04 6.20 31.30 -v -4.61 6.20 31.18 -v -4.17 6.19 31.67 -v -4.78 5.86 31.33 -v -3.78 6.19 31.27 -v -3.80 5.86 31.09 -v -3.82 5.51 31.30 -v -3.81 5.50 31.69 -v -3.76 5.81 33.31 -v -3.74 6.16 33.10 -v -4.22 5.81 33.31 -v -4.17 5.48 33.13 -v -4.62 5.49 32.65 -v -4.32 5.49 32.38 -v -4.05 5.48 32.76 -v -4.16 5.84 32.24 -v -3.97 5.83 32.56 -v -4.29 6.17 32.36 -v -4.01 6.16 32.73 -v -4.58 6.17 32.62 -v -4.14 6.16 33.11 -v -4.75 5.83 32.77 -v -3.75 6.16 32.71 -v -3.77 5.83 32.53 -v -3.79 5.48 32.74 -v -3.78 5.47 33.13 -v 4.13 5.56 26.00 -v 4.09 5.36 26.49 -v 3.50 5.57 25.99 -v 3.46 5.36 26.48 -v 3.69 5.18 34.98 -v 3.06 5.19 34.96 -v 3.67 5.37 35.45 -v 3.04 5.37 35.44 -v 3.08 6.18 35.41 -v 3.71 6.17 35.42 -v 3.11 6.38 34.92 -v 3.74 6.38 34.93 -v 3.52 6.56 26.43 -v 4.15 6.55 26.45 -v 3.53 6.37 25.96 -v 4.16 6.37 25.97 -v 4.02 5.53 27.34 -v 4.41 5.53 27.34 -v 4.03 5.87 27.52 -v 4.49 5.87 27.51 -v 4.05 6.21 27.31 -v 4.45 6.21 27.31 -v 4.07 6.22 26.92 -v 4.33 6.22 26.94 -v 4.06 5.89 26.74 -v 4.26 5.88 26.77 -v 4.04 5.54 26.95 -v 4.30 5.54 26.97 -v 4.59 5.54 26.59 -v 4.87 5.54 26.85 -v 5.03 5.87 26.96 -v 4.90 6.22 26.82 -v 4.62 6.23 26.56 -v 4.46 5.89 26.45 -v 3.95 5.50 28.78 -v 4.34 5.50 28.78 -v 3.96 5.84 28.96 -v 4.42 5.84 28.95 -v 3.98 6.19 28.75 -v 4.38 6.18 28.75 -v 4.00 6.19 28.36 -v 4.26 6.19 28.38 -v 4.00 5.86 28.18 -v 4.19 5.85 28.21 -v 3.97 5.51 28.39 -v 4.23 5.51 28.41 -v 4.52 5.52 28.03 -v 4.80 5.51 28.28 -v 4.96 5.84 28.40 -v 4.83 6.19 28.26 -v 4.55 6.20 28.00 -v 4.39 5.86 27.88 -v 3.88 5.47 30.21 -v 4.27 5.47 30.21 -v 3.89 5.81 30.39 -v 4.35 5.81 30.38 -v 3.91 6.16 30.19 -v 4.31 6.15 30.18 -v 3.93 6.16 29.80 -v 4.19 6.16 29.81 -v 3.93 5.83 29.62 -v 4.12 5.82 29.64 -v 3.90 5.48 29.82 -v 4.16 5.48 29.84 -v 4.45 5.49 29.46 -v 4.73 5.48 29.72 -v 4.89 5.81 29.83 -v 4.77 6.16 29.69 -v 4.48 6.17 29.43 -v 4.32 5.83 29.32 -v 3.81 5.45 31.62 -v 4.21 5.44 31.61 -v 3.82 5.78 31.80 -v 4.28 5.78 31.79 -v 3.85 6.13 31.59 -v 4.24 6.12 31.59 -v 3.87 6.13 31.20 -v 4.12 6.13 31.22 -v 3.86 5.80 31.02 -v 4.05 5.80 31.05 -v 3.83 5.45 31.23 -v 4.09 5.45 31.25 -v 4.38 5.46 30.86 -v 4.67 5.45 31.12 -v 4.82 5.79 31.24 -v 4.70 6.13 31.09 -v 4.41 6.14 30.84 -v 4.26 5.80 30.72 -v 3.68 5.39 34.48 -v 4.07 5.38 34.48 -v 3.68 5.72 34.66 -v 4.14 5.72 34.65 -v 3.71 6.07 34.46 -v 4.10 6.06 34.45 -v 3.73 6.08 34.07 -v 3.99 6.07 34.08 -v 3.72 5.74 33.89 -v 3.91 5.74 33.91 -v 3.69 5.39 34.09 -v 3.95 5.39 34.11 -v 4.24 5.40 33.73 -v 4.53 5.39 33.99 -v 4.69 5.73 34.10 -v 4.56 6.07 33.96 -v 4.28 6.08 33.70 -v 4.12 5.74 33.59 -v 2.00 9.86 13.69 -v 0.48 10.50 13.49 -v 2.82 8.80 13.37 -v 3.16 8.00 12.53 -v 3.18 7.88 11.58 -v 3.25 8.63 9.91 -v 3.52 6.72 9.87 -v 3.62 7.10 5.87 -v 3.59 7.56 0.92 -v 3.15 7.97 -3.64 -v 2.31 8.62 -5.12 -v 1.61 8.87 -5.63 -v 0.65 8.95 -5.81 -v -0.32 8.88 -5.61 -v -1.05 8.64 -5.08 -v -1.99 8.01 -3.59 -v -2.58 7.61 0.98 -v -2.78 7.15 5.93 -v -2.82 6.77 9.93 -v -2.37 8.67 9.96 -v -2.41 7.93 11.63 -v -2.41 8.05 12.58 -v -2.01 8.84 13.42 -v -1.11 9.89 13.72 -v 2.65 -0.56 6.70 -v -2.55 -0.52 6.75 -v -2.25 3.17 2.89 -v 2.75 3.13 2.84 -v -1.08 9.58 0.57 -v 2.23 9.55 0.54 -v -2.17 3.24 6.44 -v 2.58 3.21 6.40 -v -2.27 0.09 6.82 -v 2.37 0.05 6.77 -v -1.09 9.25 -0.17 -v 2.22 9.22 -0.20 -v -1.96 -0.05 1.55 -v 2.19 -0.09 1.51 -v 3.50 8.34 10.37 -v 2.27 12.35 9.94 -v -1.02 12.37 9.97 -v -2.69 8.38 10.43 -v 3.22 8.34 10.37 -v 2.04 12.02 9.96 -v -0.82 12.04 9.99 -v -2.41 8.39 10.42 -v 1.01 7.38 -18.16 -v 1.12 12.77 -18.66 -v 0.72 7.40 -17.87 -v 0.98 12.78 -18.51 -v 0.43 7.39 -18.16 -v 0.84 12.77 -18.65 -v 0.72 7.38 -18.45 -v 0.98 12.77 -18.80 -v 15.64 4.97 -32.81 -# 1073 vertices - -vn 0.05 1.00 0.07 -vn -0.95 0.32 0.03 -vn -0.95 0.31 0.03 -vn -0.96 0.27 0.04 -vn -0.96 0.28 0.01 -vn -0.96 0.29 0.01 -vn -0.96 0.27 -0.04 -vn -0.96 0.27 -0.05 -vn -0.95 0.28 -0.12 -vn -0.96 0.26 -0.14 -vn -0.88 0.37 -0.28 -vn -0.88 0.40 -0.26 -vn -0.66 0.56 -0.49 -vn -0.59 0.64 -0.49 -vn -0.29 0.75 -0.59 -vn -0.31 0.76 -0.57 -vn 0.00 0.78 -0.62 -vn 0.00 0.79 -0.62 -vn 0.30 0.74 -0.60 -vn 0.32 0.75 -0.58 -vn 0.60 0.62 -0.50 -vn 0.69 0.52 -0.50 -vn 0.91 0.34 -0.25 -vn 0.91 0.30 -0.27 -vn 0.98 0.19 -0.09 -vn 0.98 0.18 -0.10 -vn 0.98 0.19 -0.01 -vn 0.98 0.18 -0.02 -vn 0.98 0.19 0.03 -vn 0.98 0.21 0.04 -vn 0.98 0.18 0.06 -vn 0.97 0.22 0.06 -vn 0.97 0.24 0.05 -vn -0.97 -0.22 -0.05 -vn -0.98 -0.20 -0.05 -vn -0.98 -0.17 -0.06 -vn -0.98 -0.16 -0.06 -vn -0.98 -0.18 -0.03 -vn -0.98 -0.19 -0.04 -vn -0.99 -0.17 0.01 -vn -0.99 -0.17 0.02 -vn -0.98 -0.18 0.08 -vn -0.98 -0.16 0.10 -vn -0.92 -0.28 0.27 -vn -0.92 -0.31 0.24 -vn -0.69 -0.51 0.51 -vn -0.62 -0.60 0.51 -vn -0.30 -0.73 0.62 -vn -0.33 -0.73 0.60 -vn -0.00 -0.77 0.64 -vn -0.00 -0.78 0.63 -vn 0.29 -0.74 0.61 -vn 0.32 -0.74 0.59 -vn 0.60 -0.62 0.50 -vn 0.67 -0.55 0.50 -vn 0.89 -0.38 0.25 -vn 0.89 -0.35 0.28 -vn 0.96 -0.26 0.11 -vn 0.96 -0.25 0.13 -vn 0.97 -0.26 0.04 -vn 0.97 -0.25 0.04 -vn 0.96 -0.26 -0.01 -vn 0.96 -0.28 -0.01 -vn 0.97 -0.25 -0.03 -vn 0.96 -0.29 -0.03 -vn 0.95 -0.30 -0.02 -vn 0.01 0.11 0.99 -vn 0.03 0.08 1.00 -vn 0.01 0.10 0.99 -vn -0.01 0.08 1.00 -vn -0.96 -0.28 -0.06 -vn -0.62 -0.79 -0.00 -vn -0.59 -0.81 -0.00 -vn 0.59 -0.81 0.01 -vn 0.54 -0.84 0.01 -vn 0.93 -0.36 -0.03 -vn 0.93 -0.36 -0.04 -vn -0.01 -0.10 -0.99 -vn 0.01 -0.08 -1.00 -vn -0.03 -0.08 -1.00 -vn 0.01 1.00 0.09 -vn -0.07 0.99 0.07 -vn -0.01 1.00 0.08 -vn -0.01 1.00 0.09 -vn 0.10 0.99 0.09 -vn 0.25 0.97 0.08 -vn -0.11 0.99 0.08 -vn 0.08 0.99 0.08 -vn -0.03 1.00 0.07 -vn -0.75 0.66 0.05 -vn 0.13 0.99 0.09 -vn 0.20 0.98 0.09 -vn -0.03 1.00 0.08 -vn -0.03 1.00 0.09 -vn 0.05 1.00 0.08 -vn 0.03 1.00 0.05 -vn 0.05 1.00 -0.03 -vn 0.08 0.99 -0.08 -vn 0.06 1.00 0.01 -vn 0.08 1.00 0.03 -vn 0.06 1.00 0.05 -vn -0.01 1.00 0.05 -vn -0.05 1.00 0.04 -vn -0.07 1.00 0.03 -vn -0.04 1.00 0.01 -vn -0.07 0.99 -0.09 -vn -0.04 1.00 -0.03 -vn -0.05 -0.95 -0.32 -vn -0.21 -0.95 -0.25 -vn -0.32 -0.93 -0.19 -vn -0.19 -0.98 -0.10 -vn -0.26 -0.93 0.26 -vn -0.13 -0.99 0.03 -vn 0.11 -0.99 0.04 -vn 0.21 -0.95 -0.25 -vn 0.31 -0.94 -0.16 -vn 0.18 -0.98 -0.08 -vn 0.25 -0.93 0.28 -vn 0.03 -0.95 -0.32 -vn 0.08 -0.99 -0.08 -vn -0.50 -0.86 -0.08 -vn -0.04 -1.00 -0.09 -vn -0.09 -0.99 -0.09 -vn -0.18 -0.98 -0.09 -vn -0.01 -1.00 -0.09 -vn -0.04 -0.99 -0.09 -vn 0.02 -1.00 -0.08 -vn -0.03 -1.00 -0.09 -vn 0.47 -0.88 -0.06 -vn -0.09 -0.99 -0.08 -vn -0.14 -0.99 -0.08 -vn -0.00 -1.00 -0.09 -vn 0.02 -1.00 -0.09 -vn 0.07 -0.99 -0.08 -vn 0.96 0.27 0.06 -vn 0.60 0.80 0.00 -vn 0.62 0.78 0.00 -vn -0.55 0.84 -0.01 -vn -0.59 0.81 -0.01 -vn -0.94 0.35 0.03 -vn -0.94 0.35 0.04 -vn 0.41 0.82 -0.40 -vn -0.95 -0.30 -0.05 -vn -1.00 0.04 -0.08 -vn -0.99 -0.05 -0.12 -vn -0.96 -0.21 0.16 -vn -0.94 -0.19 0.29 -vn -0.89 0.08 0.45 -vn -0.78 -0.00 0.62 -vn -0.65 0.14 0.75 -vn -0.63 0.51 0.59 -vn 0.02 0.13 0.99 -vn -0.01 0.11 0.99 -vn 0.65 0.46 0.61 -vn 0.66 0.08 0.75 -vn 0.89 -0.00 0.46 -vn 0.78 -0.07 0.62 -vn 0.91 -0.27 0.30 -vn 0.94 -0.30 0.18 -vn 1.00 -0.03 -0.06 -vn 0.92 -0.40 -0.02 -vn 0.99 -0.14 -0.10 -vn 0.86 -0.51 -0.10 -vn 0.95 -0.32 0.04 -vn 0.89 -0.45 -0.02 -vn 0.52 -0.85 -0.13 -vn 0.98 -0.12 0.13 -vn 0.84 0.44 0.32 -vn 0.51 0.86 0.05 -vn 0.96 0.25 0.09 -vn 0.91 0.41 0.06 -vn 0.88 -0.46 0.08 -vn 0.82 -0.55 0.13 -vn 0.38 -0.92 0.10 -vn 0.32 -0.94 0.14 -vn -0.01 -0.99 0.11 -vn 0.90 -0.43 0.03 -vn 0.56 -0.82 -0.06 -vn 0.52 -0.86 0.02 -vn -0.65 -0.76 -0.09 -vn -0.94 -0.35 -0.03 -vn -0.56 -0.82 -0.13 -vn -0.93 -0.36 0.00 -vn -0.55 -0.84 0.00 -vn -0.92 -0.40 0.06 -vn -0.41 -0.91 0.09 -vn -0.86 -0.50 0.12 -vn -0.35 -0.93 0.14 -vn -0.01 -1.00 0.08 -vn 0.13 -0.99 0.03 -vn 0.15 -0.99 -0.08 -vn 0.13 -0.98 -0.17 -vn 0.47 -0.84 -0.26 -vn -0.94 0.33 0.07 -vn -0.99 -0.03 0.11 -vn -0.81 0.51 0.29 -vn -0.99 -0.10 -0.13 -vn -0.92 -0.35 -0.19 -vn -0.89 -0.45 -0.10 -vn -0.48 0.87 0.03 -vn -0.89 0.46 0.04 -vn 0.66 0.74 -0.13 -vn 0.01 0.98 -0.20 -vn 0.46 0.85 -0.26 -vn 0.01 0.99 -0.13 -vn -0.62 0.77 -0.14 -vn -0.62 0.77 -0.12 -vn -0.91 0.41 -0.10 -vn -0.90 0.42 -0.10 -vn -0.98 0.17 -0.09 -vn -0.98 0.19 -0.08 -vn -1.00 -0.00 -0.09 -vn -1.00 0.03 -0.09 -vn -0.94 -0.31 -0.14 -vn -0.56 -0.78 -0.29 -vn -0.50 -0.82 -0.28 -vn 0.01 0.99 -0.10 -vn -0.60 0.79 -0.11 -vn 0.89 -0.42 -0.16 -vn 0.52 -0.81 -0.27 -vn -0.01 -0.93 -0.36 -vn -0.01 -1.00 0.00 -vn -0.58 -0.81 -0.14 -vn -0.97 -0.19 -0.14 -vn -0.99 0.05 -0.10 -vn -0.98 0.16 -0.09 -vn -0.91 0.40 -0.09 -vn -0.63 0.77 -0.09 -vn -1.00 -0.02 -0.08 -vn -0.87 -0.47 -0.16 -vn -0.02 -0.99 -0.17 -vn 0.54 -0.83 -0.11 -vn 0.91 -0.39 -0.12 -vn 0.98 -0.19 -0.11 -vn 1.00 -0.06 -0.06 -vn 1.00 -0.02 -0.06 -vn 0.99 0.13 -0.06 -vn 1.00 0.08 -0.05 -vn 0.91 0.39 -0.13 -vn 0.96 0.25 -0.14 -vn -0.99 0.07 -0.07 -vn -1.00 -0.03 -0.07 -vn -0.99 0.11 -0.06 -vn -0.77 -0.62 -0.11 -vn -0.01 -0.99 -0.17 -vn 0.83 -0.54 -0.13 -vn 0.95 -0.28 -0.11 -vn 0.99 -0.09 -0.07 -vn 0.99 0.10 -0.06 -vn 0.94 0.34 -0.08 -vn 0.66 0.74 -0.11 -vn 0.99 0.08 -0.07 -vn 1.00 -0.04 -0.08 -vn -0.81 -0.58 -0.11 -vn -0.01 -0.99 -0.11 -vn 0.74 -0.67 -0.08 -vn 0.99 -0.11 -0.05 -vn 1.00 0.07 -0.07 -vn 0.93 0.35 -0.09 -vn 0.63 0.77 -0.10 -vn 0.94 0.32 -0.07 -vn 1.00 0.02 -0.03 -vn 0.99 -0.12 -0.04 -vn 0.78 -0.63 -0.08 -vn -0.01 -0.99 -0.10 -vn -0.81 -0.57 -0.12 -vn -1.00 0.01 -0.08 -vn -1.00 0.02 -0.09 -vn -0.99 0.07 -0.08 -vn -1.00 -0.02 -0.07 -vn -0.75 -0.65 -0.12 -vn -0.99 -0.05 -0.11 -vn -0.72 -0.67 -0.16 -vn -0.99 -0.06 -0.13 -vn -0.99 0.05 -0.13 -vn -0.98 0.14 -0.14 -vn -0.99 -0.03 -0.13 -vn -0.99 0.03 -0.10 -vn -0.99 -0.09 -0.09 -vn -1.00 0.02 -0.07 -vn -0.99 0.15 0.00 -vn -0.93 0.36 -0.04 -vn -0.84 0.53 0.04 -vn -0.98 -0.05 -0.18 -vn -0.91 0.39 -0.13 -vn -0.97 0.20 -0.11 -vn -0.71 0.70 -0.06 -vn -0.80 0.60 -0.04 -vn -0.49 0.87 0.01 -vn -0.72 0.69 0.04 -vn -0.70 0.71 -0.03 -vn -0.98 0.16 -0.12 -vn -0.97 0.22 -0.07 -vn -1.00 0.07 -0.05 -vn -0.99 0.05 -0.11 -vn -0.99 0.10 0.02 -vn -0.95 0.32 0.00 -vn -0.94 0.32 0.07 -vn -0.00 1.00 -0.06 -vn 0.67 0.73 -0.07 -vn 0.75 0.65 0.06 -vn 0.84 0.55 -0.03 -vn 0.88 0.48 0.07 -vn 1.00 0.06 0.03 -vn 1.00 -0.07 -0.05 -vn 1.00 -0.03 -0.05 -vn 0.99 -0.11 -0.04 -vn 1.00 -0.07 -0.06 -vn 0.99 -0.08 -0.07 -vn 0.80 -0.59 -0.09 -vn 0.71 -0.70 -0.10 -vn -0.01 -0.99 -0.12 -vn 1.00 -0.06 -0.07 -vn 0.98 -0.18 -0.06 -vn 0.99 -0.13 -0.09 -vn 0.94 0.33 -0.11 -vn 0.96 0.13 0.26 -vn 0.96 0.11 0.26 -vn 0.99 0.13 0.01 -vn 1.00 -0.03 0.02 -vn 1.00 -0.03 -0.01 -vn 1.00 0.01 0.06 -vn 1.00 -0.02 -0.02 -vn 0.97 0.25 0.04 -vn 0.99 0.14 -0.03 -vn 0.83 0.55 -0.02 -vn 0.98 0.16 -0.09 -vn 0.75 0.66 -0.04 -vn 0.99 -0.11 -0.11 -vn 0.99 -0.05 -0.09 -vn 0.99 -0.14 -0.08 -vn 0.52 0.85 0.02 -vn 0.96 0.26 0.10 -vn 0.02 0.97 0.22 -vn 0.99 0.08 0.14 -vn 0.03 0.82 0.57 -vn 0.01 0.55 0.84 -vn -0.95 0.20 0.23 -vn -0.95 0.22 0.24 -vn -0.98 0.19 -0.06 -vn -1.00 0.07 -0.02 -vn -0.63 0.76 -0.13 -vn -0.98 0.18 0.11 -vn -0.98 0.17 -0.08 -vn -0.83 0.53 0.15 -vn 0.01 0.57 0.82 -vn -0.86 0.50 -0.08 -vn 1.00 -0.03 -0.02 -vn 1.00 0.03 -0.03 -vn 0.90 0.44 -0.05 -vn 0.87 0.46 0.16 -vn -0.06 0.74 0.67 -vn -0.06 1.00 0.01 -vn 0.04 0.99 -0.10 -vn -1.00 0.05 -0.02 -vn 0.98 -0.15 -0.10 -vn 0.70 -0.71 -0.13 -vn 0.99 -0.05 -0.13 -vn 0.99 0.08 -0.11 -vn 0.99 0.08 -0.08 -vn 1.00 0.06 -0.02 -vn 1.00 0.03 -0.00 -vn 1.00 0.02 0.01 -vn 1.00 0.01 0.02 -vn 1.00 0.08 0.06 -vn 1.00 0.01 0.03 -vn 0.99 0.11 0.03 -vn 1.00 0.07 0.02 -vn 1.00 0.09 -0.00 -vn 1.00 -0.00 0.01 -vn 1.00 0.03 0.03 -vn 1.00 -0.03 0.03 -vn 1.00 -0.03 0.07 -vn 0.99 -0.14 0.07 -vn 0.89 -0.42 0.16 -vn 0.88 -0.44 0.17 -vn 0.49 -0.84 0.25 -vn 0.98 0.17 -0.05 -vn 0.99 0.14 -0.00 -vn 1.00 0.08 -0.01 -vn 1.00 0.03 -0.04 -vn 0.97 0.21 -0.13 -vn 0.98 0.19 -0.04 -vn 0.95 0.30 -0.03 -vn 0.96 0.27 -0.05 -vn 0.99 0.15 0.03 -vn 0.99 0.17 0.02 -vn 0.50 -0.83 0.25 -vn -0.01 -0.97 0.24 -vn -0.01 -0.97 0.26 -vn -0.53 -0.81 0.25 -vn -0.52 -0.82 0.24 -vn -0.92 -0.37 0.15 -vn -0.93 -0.35 0.14 -vn -1.00 -0.05 0.05 -vn -1.00 0.07 0.05 -vn -1.00 0.06 0.01 -vn -0.99 0.13 0.00 -vn -1.00 0.09 -0.02 -vn -0.99 0.11 -0.02 -vn -0.98 0.18 -0.03 -vn -0.99 0.16 -0.01 -vn -0.98 0.20 0.00 -vn -0.99 0.10 0.00 -vn -0.98 0.17 0.03 -vn -0.51 -0.84 0.20 -vn -0.01 -0.99 0.17 -vn -0.98 -0.10 0.14 -vn -0.73 -0.67 0.14 -vn -0.27 -0.95 0.15 -vn -0.01 -0.99 0.16 -vn 0.47 -0.86 0.20 -vn 0.69 -0.71 0.15 -vn 0.97 -0.18 0.16 -vn 0.25 -0.96 0.16 -vn -0.99 0.10 -0.01 -vn -0.99 0.12 -0.01 -vn -0.99 0.12 -0.03 -vn -0.99 0.15 -0.05 -vn -0.98 0.17 -0.07 -vn -0.93 0.33 -0.16 -vn -0.88 0.46 -0.15 -vn -0.66 0.56 -0.50 -vn -0.43 0.86 -0.26 -vn -0.97 0.22 -0.08 -vn -0.99 0.12 -0.06 -vn -0.98 0.17 -0.03 -vn -0.97 0.22 -0.02 -vn -0.96 0.25 -0.07 -vn -0.95 0.29 -0.15 -vn -0.96 0.28 -0.06 -vn -0.92 0.38 -0.05 -vn -0.94 0.35 -0.08 -vn -0.97 0.24 0.00 -vn -0.97 0.25 -0.00 -vn 0.98 0.16 0.10 -vn 0.98 0.19 0.05 -vn 0.97 0.25 -0.00 -vn 0.96 0.28 -0.03 -vn 1.00 0.06 -0.01 -vn 1.00 -0.02 0.01 -vn 0.99 -0.09 0.04 -vn 0.98 -0.20 0.08 -vn 0.78 -0.59 0.20 -vn 0.94 -0.29 0.20 -vn 0.79 -0.54 0.29 -vn 0.91 -0.25 0.32 -vn 0.98 -0.09 0.19 -vn 0.61 -0.75 0.26 -vn 0.91 -0.31 0.29 -vn 0.96 -0.12 0.25 -vn 0.97 0.19 0.14 -vn 0.96 0.21 0.20 -vn 0.85 0.50 0.16 -vn 0.78 0.58 0.22 -vn 0.63 0.76 0.15 -vn 0.56 0.80 0.21 -vn 0.30 0.94 0.13 -vn 0.30 0.94 0.15 -vn 0.01 0.99 0.12 -vn 0.01 0.99 0.11 -vn -0.28 0.95 0.14 -vn -0.28 0.95 0.12 -vn -0.52 0.83 0.19 -vn -0.60 0.79 0.13 -vn -0.75 0.63 0.20 -vn -0.83 0.54 0.13 -vn -0.28 0.96 0.08 -vn -0.27 0.96 0.04 -vn 0.01 1.00 0.05 -vn 0.01 1.00 0.07 -vn 0.31 0.95 0.09 -vn 0.61 0.79 0.09 -vn 0.87 0.48 0.09 -vn 0.98 0.16 0.06 -vn 0.87 0.48 0.05 -vn 0.55 0.83 0.07 -vn 0.61 0.79 0.03 -vn 0.29 0.96 0.05 -vn 0.28 0.96 0.03 -vn 0.33 0.95 -0.01 -vn 0.01 1.00 0.02 -vn 0.01 1.00 -0.01 -vn 0.01 1.00 -0.02 -vn -0.46 0.89 -0.04 -vn -0.99 0.14 -0.02 -vn -0.98 0.17 -0.01 -vn -0.90 0.44 -0.02 -vn -0.91 0.41 -0.08 -vn -0.69 0.72 -0.09 -vn -0.77 0.63 -0.10 -vn -0.84 0.54 0.01 -vn -0.58 0.82 0.03 -vn 0.49 0.87 -0.03 -vn 0.39 0.92 -0.04 -vn 0.67 0.75 -0.01 -vn 0.92 0.39 0.02 -vn 0.99 0.11 0.02 -vn -0.99 0.15 -0.04 -vn -0.93 0.36 -0.06 -vn -0.94 0.34 -0.02 -vn -1.00 0.00 0.01 -vn -0.96 0.27 0.02 -vn -0.97 0.24 0.08 -vn -0.95 0.28 0.14 -vn -0.95 0.29 0.09 -vn -0.98 -0.02 0.21 -vn -0.98 0.04 0.17 -vn -0.93 -0.23 0.27 -vn -0.94 -0.17 0.31 -vn -0.96 -0.21 0.18 -vn -0.83 -0.48 0.28 -vn -0.82 -0.54 0.19 -vn -0.64 -0.72 0.26 -vn -0.99 -0.11 0.06 -vn -1.00 0.08 -0.01 -vn -1.00 0.04 0.03 -vn -0.98 0.20 -0.01 -vn -0.89 0.46 -0.00 -vn -0.63 0.78 -0.03 -vn -0.36 0.93 -0.05 -vn -0.30 0.95 -0.02 -vn -0.26 0.97 0.03 -vn -0.84 0.54 0.03 -vn -0.58 0.82 0.02 -vn -0.52 0.85 0.05 -vn -0.84 0.54 0.07 -vn -0.97 0.25 0.04 -vn -0.57 0.82 0.07 -vn 1.00 -0.06 0.05 -vn 1.00 0.08 0.01 -vn 1.00 0.05 0.01 -vn 0.93 0.37 0.01 -vn 0.94 0.34 -0.06 -vn 0.73 0.68 -0.07 -vn 0.81 0.58 -0.08 -vn 0.88 0.47 0.03 -vn 0.62 0.78 0.04 -vn -0.02 0.99 0.14 -vn -0.01 0.99 0.11 -vn -0.01 1.00 -0.08 -vn -0.02 1.00 -0.08 -vn -0.02 0.99 -0.12 -vn -0.09 0.99 -0.12 -vn -0.15 0.99 0.00 -vn -0.18 0.98 -0.10 -vn -0.14 0.98 0.16 -vn -0.04 0.99 0.16 -vn -0.05 0.93 0.35 -vn -0.03 0.94 0.33 -vn -0.02 0.96 0.28 -vn -0.02 0.98 0.18 -vn 0.02 1.00 0.05 -vn -0.03 0.99 0.15 -vn -0.01 1.00 -0.02 -vn -0.08 0.99 -0.09 -vn -0.03 0.99 -0.10 -vn 0.00 1.00 -0.09 -vn -0.01 0.99 -0.12 -vn 0.01 0.99 -0.14 -vn -0.43 0.85 -0.29 -vn -0.14 0.94 -0.32 -vn 0.37 0.86 0.35 -vn 0.25 0.81 0.54 -vn 0.72 0.00 0.70 -vn 0.39 0.00 0.92 -vn 0.37 -0.86 0.35 -vn 0.24 -0.81 0.53 -vn -0.43 -0.84 -0.34 -vn -0.15 -0.93 -0.34 -vn -0.83 0.06 -0.55 -vn -0.44 -0.00 -0.90 -vn 0.13 -0.05 -0.99 -vn 0.04 0.86 -0.51 -vn 0.01 0.85 0.52 -vn 0.02 0.02 1.00 -vn -0.00 -0.86 0.51 -vn 0.04 -0.86 -0.51 -vn 0.03 1.00 -0.08 -vn 0.03 0.99 -0.11 -vn 0.02 1.00 -0.08 -vn 0.02 0.99 -0.11 -vn 0.01 1.00 -0.09 -vn 0.00 0.99 -0.13 -vn -0.00 1.00 0.05 -vn 0.09 0.99 -0.08 -vn 0.02 1.00 -0.02 -vn 0.04 0.99 0.15 -vn 0.04 0.98 0.18 -vn 0.02 0.99 0.11 -vn 0.04 0.96 0.28 -vn 0.04 0.99 0.14 -vn 0.05 0.94 0.33 -vn 0.06 0.98 0.16 -vn 0.08 0.93 0.36 -vn 0.16 0.97 0.17 -vn 0.17 0.99 0.01 -vn -0.01 0.99 -0.14 -vn 0.22 0.97 -0.09 -vn 0.12 0.99 -0.11 -vn 0.08 0.98 -0.15 -vn 0.04 0.98 -0.18 -vn 0.96 0.28 -0.02 -vn 1.00 -0.02 -0.04 -vn 1.00 -0.08 -0.05 -vn 0.78 -0.62 -0.10 -vn -0.84 -0.54 -0.12 -vn -0.99 0.01 -0.10 -vn 0.00 -0.86 0.51 -vn -0.00 0.04 1.00 -vn -0.26 -0.80 0.54 -vn 0.13 -0.94 -0.32 -vn 0.40 -0.86 -0.32 -vn 0.84 -0.02 -0.54 -vn 0.43 -0.04 -0.90 -vn 0.47 0.83 -0.30 -vn 0.15 0.93 -0.33 -vn -0.34 0.87 0.34 -vn -0.21 0.82 0.53 -vn -0.72 0.04 0.69 -vn -0.38 0.03 0.92 -vn -0.39 -0.85 0.35 -vn 0.01 0.87 0.50 -vn -0.04 0.86 -0.51 -vn -0.15 -0.02 -0.99 -vn -0.06 -0.85 -0.53 -vn -0.14 0.97 -0.18 -vn -0.17 0.97 -0.18 -vn -0.39 0.91 -0.13 -vn -0.41 0.90 -0.12 -vn -0.46 0.88 -0.07 -vn -0.47 0.88 -0.06 -vn -0.44 0.90 -0.04 -vn -0.44 0.90 0.01 -vn -0.41 0.91 0.05 -vn -0.58 0.81 0.10 -vn -0.59 0.80 0.11 -vn -0.63 0.72 0.30 -vn -0.67 0.62 0.41 -vn -0.71 0.49 0.51 -vn -0.71 0.49 0.50 -vn 0.07 0.99 -0.11 -vn 0.12 0.99 -0.10 -vn 0.08 0.99 -0.10 -vn 0.12 0.99 -0.08 -vn 0.11 0.99 -0.10 -vn 0.11 0.99 -0.04 -vn 0.10 0.99 -0.04 -vn 0.07 1.00 0.01 -vn 0.07 1.00 0.02 -vn 0.11 0.98 0.18 -vn 0.15 0.96 0.22 -vn 0.25 0.87 0.42 -vn 0.34 0.83 0.44 -vn 0.29 0.76 0.58 -vn 0.21 0.82 0.53 -vn 0.19 0.92 0.36 -vn 0.53 -0.83 0.18 -vn 0.31 -0.94 0.15 -vn 0.24 -0.96 0.13 -vn -0.00 -1.00 0.08 -vn -0.33 -0.93 0.14 -vn -0.27 -0.95 0.14 -vn -0.56 -0.81 0.18 -vn -0.97 0.22 0.05 -vn -0.91 0.42 0.01 -vn -0.01 -0.11 -0.99 -vn 0.99 0.13 0.07 -vn 0.94 0.34 0.03 -vn 0.73 0.43 0.53 -vn 0.70 0.56 0.44 -vn 0.65 0.69 0.32 -vn 0.58 0.80 0.14 -vn 0.57 0.81 0.13 -vn 0.46 0.89 0.02 -vn 0.44 0.90 0.05 -vn 0.46 0.89 -0.03 -vn 0.47 0.88 -0.03 -vn 0.50 0.87 -0.06 -vn 0.49 0.87 -0.06 -vn 0.44 0.89 -0.11 -vn 0.41 0.90 -0.12 -vn 0.19 0.97 -0.17 -vn 0.16 0.97 -0.18 -vn -0.67 0.00 -0.74 -vn 0.67 -0.06 -0.74 -vn -0.05 -0.99 -0.10 -vn -0.06 -0.99 -0.11 -vn -0.04 -0.99 -0.10 -vn -0.03 -0.99 -0.12 -vn -0.02 -0.99 -0.11 -vn -0.02 -0.99 -0.13 -vn -0.03 -0.99 -0.10 -vn -0.02 -0.99 -0.10 -vn -0.03 -1.00 -0.07 -vn -0.05 -1.00 -0.01 -vn -0.03 -1.00 0.02 -vn -0.04 -1.00 0.07 -vn -0.08 -1.00 -0.02 -vn -0.05 -1.00 0.07 -vn -0.08 -1.00 -0.03 -vn -0.09 -0.99 0.06 -vn 0.02 -1.00 -0.04 -vn -0.12 -0.99 0.01 -vn -0.01 -1.00 0.02 -vn -0.06 -0.99 -0.12 -vn -0.07 -0.99 -0.11 -vn -0.05 -0.99 -0.11 -vn -0.08 -0.99 -0.10 -vn -0.01 -1.00 -0.05 -vn -0.03 -1.00 -0.05 -vn 0.11 -0.99 0.02 -vn 0.07 -1.00 0.06 -vn 0.19 -0.97 0.14 -vn 0.10 -0.97 0.22 -vn 0.53 -0.80 0.29 -vn -0.01 -1.00 -0.03 -vn -0.11 -0.99 -0.10 -vn -0.08 -0.99 -0.07 -vn 0.07 -1.00 -0.07 -vn 0.01 -1.00 -0.09 -vn -0.18 -0.98 0.08 -vn -0.88 -0.16 0.45 -vn -0.86 -0.25 0.44 -vn -0.24 -0.94 0.22 -vn -0.01 -0.97 0.23 -vn 0.23 -0.95 0.22 -vn 0.16 -0.98 0.08 -vn 0.83 -0.32 0.45 -vn 0.86 -0.24 0.45 -vn 0.03 -1.00 -0.09 -vn 0.03 -0.99 -0.10 -vn 0.04 -0.99 -0.11 -vn 0.02 -0.99 -0.12 -vn 0.03 -0.99 -0.11 -vn 0.02 -0.99 -0.11 -vn 0.05 -0.99 -0.11 -vn 0.04 -0.99 -0.10 -vn 0.06 -1.00 -0.02 -vn 0.07 -1.00 -0.00 -vn 0.04 -1.00 0.07 -vn 0.09 -0.97 0.23 -vn 0.07 -1.00 -0.03 -vn 0.06 -0.99 -0.10 -vn 0.09 -0.99 -0.10 -vn -0.01 -1.00 -0.02 -vn 0.13 -0.99 0.00 -vn 0.61 -0.78 0.12 -vn 0.66 -0.70 0.29 -vn 0.23 -0.89 0.39 -vn 0.14 -0.91 0.40 -vn 0.14 -0.91 0.39 -vn -0.07 -0.98 0.20 -vn -0.10 -0.97 0.23 -vn -0.11 -0.97 0.22 -vn -0.21 -0.97 0.13 -vn -0.14 -0.99 0.00 -vn -0.01 -1.00 0.05 -vn 0.25 -0.97 0.02 -vn -0.56 -0.78 0.28 -vn -0.11 -0.93 0.35 -vn -0.14 -0.91 0.39 -vn -0.14 -0.90 0.40 -vn -0.25 -0.89 0.39 -vn -0.69 -0.67 0.28 -vn -0.66 -0.75 0.11 -vn -0.27 -0.96 0.01 -vn -0.08 -0.99 -0.09 -vn -0.18 -0.98 0.03 -vn -0.01 -1.00 -0.07 -vn -0.01 -1.00 -0.01 -vn 0.16 -0.99 0.03 -vn 0.06 -0.99 -0.09 -vn -0.11 -0.99 -0.09 -vn -0.46 -0.88 0.13 -vn -0.19 -0.98 0.07 -vn -0.46 -0.87 0.18 -vn 0.44 -0.88 0.19 -vn 0.18 -0.98 0.08 -vn 0.43 -0.89 0.14 -vn 0.09 -0.99 -0.09 -vn -0.09 0.99 -0.04 -vn -0.04 1.00 -0.04 -vn 0.00 1.00 -0.05 -vn -0.00 1.00 0.01 -vn -0.03 0.98 0.17 -vn -0.06 0.97 0.23 -vn -0.21 0.89 0.42 -vn -0.20 0.84 0.51 -vn -0.27 0.78 0.57 -vn -0.32 0.86 0.40 -vn -0.09 0.97 0.21 -vn -0.10 0.91 0.41 -vn -0.15 0.87 0.46 -vn -0.00 1.00 -0.08 -vn -0.04 0.99 -0.09 -vn -0.10 0.99 -0.08 -vn -0.05 0.99 -0.10 -vn -0.10 0.99 -0.10 -vn -0.04 1.00 -0.09 -vn -0.05 0.99 -0.11 -vn 0.01 0.99 -0.11 -vn 0.97 0.08 0.25 -vn -0.51 0.85 0.14 -vn -0.32 0.94 0.12 -vn -0.26 0.96 0.14 -vn 0.06 0.97 0.23 -vn 0.32 0.93 0.16 -vn 0.26 0.96 0.12 -vn 0.54 0.83 0.16 -vn -0.96 0.17 0.22 -vn 0.01 -0.93 0.36 -vn 0.00 -0.98 0.17 -vn 0.00 -0.98 0.18 -vn -0.02 -0.98 -0.21 -vn -0.02 -0.98 -0.20 -vn -0.02 -0.92 -0.39 -vn -0.01 0.93 -0.36 -vn -0.00 0.98 -0.17 -vn -0.00 0.98 -0.18 -vn 0.02 0.98 0.21 -vn 0.02 0.98 0.20 -vn 0.02 0.92 0.39 -vn 0.04 0.04 1.00 -vn -1.00 0.05 0.02 -vn -0.04 -0.04 -1.00 -vn -0.08 0.86 0.51 -vn 0.01 0.86 0.52 -vn -1.00 0.08 -0.05 -vn -0.99 -0.02 -0.11 -vn -0.99 -0.02 -0.12 -vn -0.01 -0.85 -0.52 -vn 0.08 -0.85 -0.52 -vn 0.09 -0.85 -0.52 -vn 0.99 -0.09 0.07 -vn 0.99 0.01 0.12 -vn 0.99 0.02 0.12 -vn 0.11 0.85 0.51 -vn 0.02 0.85 0.52 -vn 0.99 -0.11 -0.09 -vn -0.11 -0.85 -0.52 -vn -0.02 -0.85 -0.52 -vn -0.99 0.11 0.10 -vn -1.00 0.01 0.04 -vn -1.00 0.00 0.04 -vn -0.01 -0.10 -1.00 -vn -0.01 -0.79 -0.61 -vn -0.00 0.46 -0.89 -vn -0.01 -0.44 -0.90 -vn 0.01 0.36 0.93 -vn 0.00 -0.53 0.85 -vn -1.00 0.05 -0.01 -vn 1.00 -0.05 0.01 -vn -0.16 -0.97 -0.18 -vn -0.17 -0.98 -0.08 -vn -0.14 -0.99 0.02 -vn -0.01 -1.00 -0.08 -vn -0.01 -0.98 -0.21 -vn -0.01 -0.96 -0.29 -vn 0.01 0.95 0.30 -vn 0.74 -0.64 0.19 -vn 0.81 -0.47 -0.35 -vn 0.04 -0.94 0.35 -vn 0.03 -0.97 0.25 -vn 0.02 -0.93 0.37 -vn 0.27 -0.96 0.13 -vn 0.19 -0.98 0.08 -vn 0.48 -0.88 0.05 -vn 0.25 -0.97 0.05 -vn -0.00 -1.00 0.05 -vn 0.01 -1.00 0.05 -vn 0.01 -1.00 0.08 -vn 0.01 -1.00 0.04 -vn 0.08 -0.98 0.15 -vn 0.15 -0.99 0.04 -vn 0.10 -0.98 0.16 -vn 0.07 -0.94 0.34 -vn 0.04 -0.94 0.34 -vn 0.07 -0.85 0.53 -vn 0.01 -0.96 0.28 -vn 0.02 -0.95 0.31 -vn 0.04 -0.86 0.50 -vn 0.03 -0.89 0.45 -vn 0.14 0.98 -0.13 -vn -0.22 -0.92 0.32 -vn -0.01 -0.94 0.35 -vn -0.07 -0.92 0.39 -vn -0.00 -0.91 0.42 -vn 0.06 -0.92 0.39 -vn 0.21 -0.93 0.32 -vn 0.42 -0.10 -0.90 -vn 0.13 -0.53 -0.83 -vn -0.14 0.03 -0.99 -vn 0.17 0.25 -0.95 -vn -0.00 0.06 1.00 -vn 0.00 0.07 1.00 -vn 0.02 0.06 1.00 -vn 0.01 0.07 1.00 -vn -0.08 -1.00 0.03 -vn -0.04 -1.00 -0.02 -vn -0.10 -0.99 0.04 -vn -0.17 -0.99 0.04 -vn -0.12 -0.99 0.04 -vn -0.10 -0.98 0.15 -vn -0.03 -1.00 0.08 -vn -0.05 -0.94 0.34 -vn -0.03 -0.95 0.31 -vn -0.04 -0.86 0.50 -vn -0.03 -0.89 0.45 -vn -0.02 -0.96 0.28 -vn -0.03 -0.93 0.37 -vn -0.04 -0.97 0.25 -vn -0.05 -0.94 0.35 -vn -0.29 -0.95 0.12 -vn -0.20 -0.98 0.07 -vn -0.50 -0.86 0.04 -vn -0.29 -0.96 0.04 -vn -0.02 -1.00 0.08 -vn -0.02 -1.00 0.05 -vn -0.02 -1.00 0.04 -vn -0.07 -0.85 0.53 -vn -0.08 -0.94 0.34 -vn -0.11 -0.98 0.16 -vn -0.06 0.99 -0.14 -vn -0.02 0.99 -0.16 -vn -0.39 0.83 -0.40 -vn -0.84 -0.40 -0.38 -vn -0.78 -0.60 0.17 -vn -0.13 0.98 -0.14 -vn 0.01 0.05 1.00 -vn 0.01 0.06 1.00 -vn -0.12 -0.06 -0.99 -vn -0.15 -0.52 -0.84 -vn -0.43 -0.06 -0.90 -vn -0.19 -0.01 -0.98 -vn 0.00 0.12 -0.99 -vn 0.01 0.37 0.93 -vn -0.01 0.12 -0.99 -vn -0.01 0.10 -0.99 -vn -0.01 0.11 -0.99 -vn -0.01 0.09 -1.00 -vn 0.27 0.23 0.93 -vn 0.19 0.41 0.89 -vn 0.34 -0.13 0.93 -vn -0.16 0.43 0.89 -vn -0.25 0.25 0.93 -vn -0.31 -0.16 0.94 -vn -0.33 -0.11 0.94 -vn -0.11 -0.42 0.90 -vn -0.17 -0.38 0.91 -vn 0.12 -0.44 0.89 -vn 0.01 -0.61 0.79 -vn 0.17 -0.39 0.90 -vn 0.32 -0.19 0.93 -vn -0.95 0.22 0.21 -vn -0.01 -0.99 0.12 -vn 0.96 0.13 0.24 -vn -0.59 0.79 0.16 -vn -0.31 0.94 0.15 -vn -0.30 0.94 0.15 -vn 0.35 0.92 0.16 -vn 0.63 0.76 0.18 -vn 0.02 0.69 0.72 -vn 0.22 0.53 0.82 -vn -0.07 0.70 0.71 -vn -0.20 0.55 0.81 -vn -0.32 0.28 0.91 -vn -0.34 0.21 0.92 -vn -0.33 -0.24 0.91 -vn -0.35 -0.12 0.93 -vn -0.14 -0.63 0.77 -vn -0.24 -0.49 0.84 -vn -0.01 -0.48 0.88 -vn 0.16 -0.61 0.78 -vn 0.25 -0.50 0.83 -vn 0.34 -0.27 0.90 -vn 0.36 -0.14 0.92 -vn 0.34 0.25 0.91 -vn 0.35 0.19 0.92 -vn 0.09 0.71 0.70 -vn 0.00 -0.92 -0.39 -vn -0.00 -0.98 -0.21 -vn -0.00 -0.98 -0.20 -vn -0.01 -0.98 0.17 -vn -0.01 -0.98 0.18 -vn -0.02 -0.93 0.36 -vn -0.00 0.92 0.39 -vn 0.00 0.98 0.21 -vn 0.00 0.98 0.20 -vn 0.01 0.98 -0.17 -vn 0.01 0.98 -0.18 -vn 0.02 0.93 -0.36 -vn -0.03 0.04 1.00 -vn 1.00 -0.05 0.05 -vn 0.03 -0.04 -1.00 -vn 0.31 0.87 -0.39 -vn 0.37 0.92 0.09 -vn 0.68 0.61 -0.41 -vn 0.63 0.62 -0.46 -vn 0.55 0.72 -0.42 -vn 0.64 0.67 -0.37 -vn 0.24 0.96 -0.12 -vn 0.26 0.96 -0.12 -vn -0.11 0.92 0.39 -vn -0.23 0.89 0.39 -vn 0.47 0.10 -0.88 -vn 0.54 0.10 -0.84 -vn 0.16 0.98 0.09 -vn 0.08 0.99 0.10 -vn 0.24 0.97 0.08 -vn 0.31 0.95 0.05 -vn 0.23 0.97 0.07 -vn 0.51 0.86 0.06 -vn 0.45 0.88 0.13 -vn 0.34 0.94 -0.05 -vn 0.34 0.94 -0.00 -vn 0.10 0.99 -0.11 -vn 0.10 0.99 -0.09 -vn -0.08 0.99 -0.10 -vn -0.09 0.99 -0.11 -vn -0.34 0.94 -0.05 -vn -0.40 0.91 0.10 -vn -0.50 0.87 0.05 -vn -0.21 0.98 0.05 -vn -0.30 0.95 0.04 -vn -0.14 0.99 0.08 -vn -0.23 0.97 0.08 -vn -0.07 0.99 0.09 -vn -0.14 0.99 0.09 -vn -0.54 0.16 -0.83 -vn -0.47 0.13 -0.87 -vn 0.24 0.89 0.39 -vn 0.14 0.90 0.41 -vn -0.24 0.96 -0.12 -vn -0.23 0.97 -0.12 -vn -0.59 0.72 -0.36 -vn -0.54 0.73 -0.43 -vn -0.62 0.64 -0.46 -vn -0.64 0.66 -0.40 -vn -0.26 0.96 0.09 -vn -0.38 0.83 -0.41 -vn 0.40 0.85 -0.33 -vn 0.55 0.82 -0.18 -vn 0.74 0.63 -0.24 -vn -0.23 0.66 -0.71 -vn 0.90 0.23 -0.37 -vn -0.90 0.43 -0.07 -vn -0.98 0.21 0.05 -vn 0.02 0.10 -0.99 -vn -0.38 -0.03 -0.92 -vn -0.92 0.04 -0.38 -vn -0.99 0.13 0.02 -vn -0.99 0.13 0.01 -vn -0.83 0.17 0.53 -vn 0.10 0.89 0.44 -vn 0.02 0.90 0.44 -vn 0.03 0.90 0.44 -vn -0.00 0.90 0.43 -vn 0.00 0.90 0.43 -vn 0.01 0.90 0.44 -vn -0.07 0.90 0.44 -vn 0.78 0.61 0.15 -vn 1.00 0.04 0.04 -vn 1.00 0.03 0.04 -vn 1.00 0.03 0.01 -vn 0.74 -0.16 -0.65 -vn 0.85 -0.02 -0.52 -vn 0.93 0.33 0.17 -vn 0.95 -0.02 -0.30 -vn 0.93 0.36 -0.05 -vn -0.72 0.64 -0.26 -vn -0.71 0.28 -0.65 -vn -0.70 0.67 -0.25 -vn -0.38 0.91 -0.20 -vn -0.50 0.81 -0.31 -vn 0.01 0.99 0.10 -vn 0.01 1.00 0.10 -vn 0.01 0.34 0.94 -vn 0.01 0.12 0.99 -vn 0.00 0.91 -0.41 -vn -0.99 0.16 -0.06 -vn -0.99 0.14 -0.10 -vn -0.96 0.04 -0.28 -vn -0.96 0.04 -0.29 -vn 0.96 -0.05 -0.27 -vn 1.00 0.05 -0.08 -vn 0.96 -0.05 -0.26 -vn 1.00 0.07 -0.04 -vn -0.01 -0.18 -0.98 -vn 0.83 0.10 0.55 -vn -0.74 0.66 0.13 -vn 0.94 -0.32 -0.07 -vn 0.83 -0.56 0.01 -vn -0.09 -0.40 -0.91 -vn -0.12 0.12 -0.99 -vn -0.07 -0.68 -0.73 -vn -0.07 0.27 -0.96 -vn 0.02 1.00 -0.09 -vn -0.12 0.53 -0.84 -vn -0.10 -0.26 -0.96 -vn -0.12 -0.15 -0.98 -vn 0.05 -0.53 -0.85 -vn 0.03 -0.38 -0.93 -vn 0.03 -0.98 -0.21 -vn 0.09 -0.09 -0.99 -vn 0.07 0.04 -1.00 -vn 0.08 0.14 -0.99 -vn 0.05 0.26 -0.96 -vn -0.99 0.12 -0.09 -vn 0.96 0.29 0.00 -vn 0.58 0.81 0.00 -vn 0.61 0.79 0.00 -vn -0.53 0.85 -0.01 -vn -0.57 0.82 -0.01 -vn -0.92 0.38 -0.02 -vn -0.95 -0.30 -0.00 -vn -0.61 -0.80 -0.00 -vn -0.58 -0.82 -0.00 -vn 0.57 -0.82 0.01 -vn 0.52 -0.85 0.01 -vn 0.92 -0.40 0.02 -vn 0.99 -0.12 -0.07 -vn 1.00 -0.07 -0.01 -vn 1.00 -0.08 -0.01 -vn 0.99 -0.11 0.07 -vn 1.00 -0.07 0.04 -vn 1.00 -0.01 -0.00 -vn 0.98 -0.13 -0.12 -vn 1.00 0.03 -0.08 -vn 0.88 0.04 -0.48 -vn 0.96 0.13 -0.23 -vn -0.96 0.10 -0.27 -vn -0.99 0.04 -0.13 -vn -0.99 0.04 -0.12 -vn -0.91 0.02 -0.42 -vn -0.90 -0.01 -0.43 -vn -0.99 0.02 0.17 -vn -0.98 0.06 0.19 -vn -0.96 0.03 -0.29 -vn -0.91 0.15 -0.37 -vn -0.85 0.17 0.50 -vn -0.94 -0.03 0.33 -vn 0.71 0.05 0.71 -vn -0.02 0.12 0.99 -vn 0.02 0.12 0.99 -vn -0.70 0.12 0.70 -vn -0.71 -0.01 -0.71 -vn -0.02 -0.06 -1.00 -vn 0.02 -0.06 -1.00 -vn 0.71 -0.08 -0.70 -vn 0.01 1.00 -0.03 -vn 0.03 -1.00 -0.02 -vn 0.06 -1.00 0.04 -vn 0.08 -1.00 0.04 -# 1154 vertex normals - -vt 0.41 0.82 0.00 -vt 0.39 0.82 0.00 -vt 0.42 0.80 0.00 -vt 0.39 0.80 0.00 -vt 0.37 0.80 0.00 -vt 0.37 0.82 0.00 -vt 0.35 0.82 0.00 -vt 0.35 0.80 0.00 -vt 0.33 0.80 0.00 -vt 0.33 0.81 0.00 -vt 0.31 0.81 0.00 -vt 0.30 0.80 0.00 -vt 0.30 0.81 0.00 -vt 0.29 0.80 0.00 -vt 0.29 0.81 0.00 -vt 0.28 0.80 0.00 -vt 0.34 0.81 0.00 -vt 0.30 0.82 0.00 -vt 0.34 0.82 0.00 -vt 0.39 0.81 0.00 -vt 0.43 0.81 0.00 -vt 0.43 0.82 0.00 -vt 0.98 0.38 0.00 -vt 0.98 0.42 0.00 -vt 0.97 0.44 0.00 -vt 0.50 0.74 0.00 -vt 0.49 0.75 0.00 -vt 0.54 0.75 0.00 -vt 0.47 0.74 0.00 -vt 0.45 0.75 0.00 -vt 0.43 0.74 0.00 -vt 0.43 0.75 0.00 -vt 0.41 0.75 0.00 -vt 0.41 0.74 0.00 -vt 0.40 0.75 0.00 -vt 0.40 0.74 0.00 -vt 0.42 0.75 0.00 -vt 0.46 0.74 0.00 -vt 0.54 0.72 0.00 -vt 0.50 0.73 0.00 -vt 0.50 0.72 0.00 -vt 0.54 0.71 0.00 -vt 0.46 0.73 0.00 -vt 0.43 0.73 0.00 -vt 0.40 0.73 0.00 -vt 0.43 0.72 0.00 -vt 0.40 0.72 0.00 -vt 0.43 0.71 0.00 -vt 0.40 0.71 0.00 -vt 0.43 0.70 0.00 -vt 0.40 0.70 0.00 -vt 0.40 0.69 0.00 -vt 0.46 0.71 0.00 -vt 0.50 0.71 0.00 -vt 0.46 0.70 0.00 -vt 0.45 0.69 0.00 -vt 0.46 0.69 0.00 -vt 0.50 0.70 0.00 -vt 0.54 0.70 0.00 -vt 0.58 0.71 0.00 -vt 0.59 0.75 0.00 -vt 0.58 0.73 0.00 -vt 0.56 0.88 0.00 -vt 0.56 0.91 0.00 -vt 0.54 0.89 0.00 -vt 0.60 0.90 0.00 -vt 0.60 0.88 0.00 -vt 0.59 0.86 0.00 -vt 0.65 0.85 0.00 -vt 0.65 0.83 0.00 -vt 0.59 0.83 0.00 -vt 0.65 0.78 0.00 -vt 0.59 0.78 0.00 -vt 0.65 0.76 0.00 -vt 0.64 0.75 0.00 -vt 0.65 0.90 0.00 -vt 0.65 0.88 0.00 -vt 0.64 0.74 0.00 -vt 0.70 0.75 0.00 -vt 0.70 0.76 0.00 -vt 0.70 0.77 0.00 -vt 0.70 0.79 0.00 -vt 0.70 0.82 0.00 -vt 0.70 0.85 0.00 -vt 0.70 0.87 0.00 -vt 0.75 0.79 0.00 -vt 0.75 0.78 0.00 -vt 0.75 0.75 0.00 -vt 0.58 0.75 0.00 -vt 0.55 0.78 0.00 -vt 0.55 0.84 0.00 -vt 0.50 0.83 0.00 -vt 0.54 0.86 0.00 -vt 0.51 0.87 0.00 -vt 0.53 0.88 0.00 -vt 0.78 0.82 0.00 -vt 0.78 0.80 0.00 -vt 0.75 0.82 0.00 -vt 0.78 0.78 0.00 -vt 0.78 0.76 0.00 -vt 0.69 0.77 0.00 -vt 0.81 0.79 0.00 -vt 0.81 0.77 0.00 -vt 0.86 0.78 0.00 -vt 0.86 0.79 0.00 -vt 0.81 0.80 0.00 -vt 0.86 0.81 0.00 -vt 0.81 0.83 0.00 -vt 0.86 0.83 0.00 -vt 0.92 0.80 0.00 -vt 0.92 0.81 0.00 -vt 0.93 0.80 0.00 -vt 0.93 0.81 0.00 -vt 0.93 0.83 0.00 -vt 0.92 0.83 0.00 -vt 0.88 0.84 0.00 -vt 0.88 0.83 0.00 -vt 0.86 0.84 0.00 -vt 0.81 0.84 0.00 -vt 0.78 0.84 0.00 -vt 0.75 0.85 0.00 -vt 0.78 0.85 0.00 -vt 0.88 0.85 0.00 -vt 0.86 0.85 0.00 -vt 0.89 0.86 0.00 -vt 0.83 0.86 0.00 -vt 0.85 0.86 0.00 -vt 0.81 0.86 0.00 -vt 0.78 0.86 0.00 -vt 0.75 0.86 0.00 -vt 0.93 0.85 0.00 -vt 0.91 0.88 0.00 -vt 0.93 0.87 0.00 -vt 0.91 0.89 0.00 -vt 0.93 0.89 0.00 -vt 0.93 0.97 0.00 -vt 0.89 0.89 0.00 -vt 0.88 0.88 0.00 -vt 0.84 0.88 0.00 -vt 0.71 0.90 0.00 -vt 0.88 0.81 0.00 -vt 0.88 0.80 0.00 -vt 0.88 0.78 0.00 -vt 0.92 0.78 0.00 -vt 0.89 0.99 0.00 -vt 0.89 0.98 0.00 -vt 0.92 0.98 0.00 -vt 0.82 0.90 0.00 -vt 0.86 0.89 0.00 -vt 0.83 0.91 0.00 -vt 0.88 0.98 0.00 -vt 0.93 0.98 0.00 -vt 0.90 0.99 0.00 -vt 0.93 0.99 0.00 -vt 0.90 1.00 0.00 -vt 0.93 1.00 0.00 -vt 0.93 0.79 0.00 -vt 0.46 0.86 0.00 -vt 0.46 0.83 0.00 -vt 0.40 0.86 0.00 -vt 0.40 0.83 0.00 -vt 0.35 0.85 0.00 -vt 0.32 0.85 0.00 -vt 0.29 0.85 0.00 -vt 0.29 0.83 0.00 -vt 0.24 0.83 0.00 -vt 0.23 0.80 0.00 -vt 0.19 0.80 0.00 -vt 0.20 0.77 0.00 -vt 0.16 0.78 0.00 -vt 0.16 0.76 0.00 -vt 0.09 0.78 0.00 -vt 0.09 0.75 0.00 -vt 0.36 0.80 0.00 -vt 0.40 0.79 0.00 -vt 0.46 0.79 0.00 -vt 0.50 0.78 0.00 -vt 0.50 0.76 0.00 -vt 0.45 0.77 0.00 -vt 0.40 0.78 0.00 -vt 0.36 0.79 0.00 -vt 0.33 0.78 0.00 -vt 0.04 0.76 0.00 -vt 0.09 0.74 0.00 -vt 0.04 0.74 0.00 -vt 0.24 0.80 0.00 -vt 0.33 0.85 0.00 -vt 0.36 0.82 0.00 -vt 0.16 0.74 0.00 -vt 0.15 0.73 0.00 -vt 0.19 0.76 0.00 -vt 0.19 0.74 0.00 -vt 0.18 0.73 0.00 -vt 0.18 0.76 0.00 -vt 0.18 0.74 0.00 -vt 0.51 0.83 0.00 -vt 0.54 0.92 0.00 -vt 0.34 0.87 0.00 -vt 0.32 0.86 0.00 -vt 0.31 0.86 0.00 -vt 0.28 0.86 0.00 -vt 0.24 0.85 0.00 -vt 0.19 0.83 0.00 -vt 0.15 0.80 0.00 -vt 0.09 0.80 0.00 -vt 0.04 0.78 0.00 -vt 0.04 0.80 0.00 -vt 0.01 0.78 0.00 -vt 0.01 0.80 0.00 -vt 0.03 0.82 0.00 -vt 0.01 0.77 0.00 -vt 0.00 0.83 0.00 -vt 0.04 0.84 0.00 -vt 0.00 0.84 0.00 -vt 0.03 0.86 0.00 -vt 0.00 0.86 0.00 -vt 0.03 0.88 0.00 -vt 0.00 0.87 0.00 -vt 0.04 0.89 0.00 -vt 0.00 0.89 0.00 -vt 0.04 0.91 0.00 -vt 0.00 0.90 0.00 -vt 0.04 0.88 0.00 -vt 0.09 0.89 0.00 -vt 0.15 0.90 0.00 -vt 0.14 0.91 0.00 -vt 0.09 0.91 0.00 -vt 0.09 0.88 0.00 -vt 0.09 0.87 0.00 -vt 0.09 0.85 0.00 -vt 0.15 0.87 0.00 -vt 0.15 0.89 0.00 -vt 0.19 0.89 0.00 -vt 0.18 0.90 0.00 -vt 0.21 0.90 0.00 -vt 0.18 0.92 0.00 -vt 0.21 0.92 0.00 -vt 0.25 0.92 0.00 -vt 0.28 0.92 0.00 -vt 0.28 0.90 0.00 -vt 0.21 0.85 0.00 -vt 0.18 0.85 0.00 -vt 0.21 0.87 0.00 -vt 0.25 0.87 0.00 -vt 0.25 0.88 0.00 -vt 0.28 0.88 0.00 -vt 0.30 0.87 0.00 -vt 0.30 0.90 0.00 -vt 0.30 0.92 0.00 -vt 0.25 0.90 0.00 -vt 0.21 0.89 0.00 -vt 0.18 0.87 0.00 -vt 0.14 0.85 0.00 -vt 0.29 0.86 0.00 -vt 0.05 0.84 0.00 -vt 0.01 0.83 0.00 -vt 0.15 0.83 0.00 -vt 0.08 0.82 0.00 -vt 0.15 0.85 0.00 -vt 0.14 0.83 0.00 -vt 0.35 0.31 0.00 -vt 0.35 0.37 0.00 -vt 0.33 0.31 0.00 -vt 0.33 0.26 0.00 -vt 0.29 0.27 0.00 -vt 0.29 0.23 0.00 -vt 0.33 0.22 0.00 -vt 0.30 0.21 0.00 -vt 0.34 0.20 0.00 -vt 0.35 0.22 0.00 -vt 0.34 0.26 0.00 -vt 0.35 0.26 0.00 -vt 0.36 0.31 0.00 -vt 0.36 0.36 0.00 -vt 0.37 0.40 0.00 -vt 0.35 0.41 0.00 -vt 0.37 0.42 0.00 -vt 0.34 0.42 0.00 -vt 0.31 0.42 0.00 -vt 0.32 0.41 0.00 -vt 0.32 0.37 0.00 -vt 0.28 0.37 0.00 -vt 0.29 0.32 0.00 -vt 0.28 0.41 0.00 -vt 0.69 0.72 0.00 -vt 0.71 0.73 0.00 -vt 0.70 0.71 0.00 -vt 0.72 0.73 0.00 -vt 0.71 0.70 0.00 -vt 0.73 0.73 0.00 -vt 0.69 0.73 0.00 -vt 0.70 0.73 0.00 -vt 0.70 0.74 0.00 -vt 0.71 0.74 0.00 -vt 0.72 0.74 0.00 -vt 0.73 0.74 0.00 -vt 0.33 0.58 0.00 -vt 0.29 0.57 0.00 -vt 0.33 0.52 0.00 -vt 0.29 0.52 0.00 -vt 0.32 0.47 0.00 -vt 0.28 0.47 0.00 -vt 0.32 0.43 0.00 -vt 0.35 0.43 0.00 -vt 0.37 0.44 0.00 -vt 0.35 0.47 0.00 -vt 0.37 0.48 0.00 -vt 0.35 0.52 0.00 -vt 0.36 0.53 0.00 -vt 0.35 0.58 0.00 -vt 0.36 0.58 0.00 -vt 0.35 0.62 0.00 -vt 0.33 0.62 0.00 -vt 0.28 0.43 0.00 -vt 0.34 0.63 0.00 -vt 0.31 0.63 0.00 -vt 0.29 0.61 0.00 -vt 0.26 0.63 0.00 -vt 0.26 0.62 0.00 -vt 0.38 0.14 0.00 -vt 0.39 0.16 0.00 -vt 0.38 0.22 0.00 -vt 0.39 0.22 0.00 -vt 0.37 0.27 0.00 -vt 0.39 0.27 0.00 -vt 0.38 0.31 0.00 -vt 0.39 0.31 0.00 -vt 0.38 0.37 0.00 -vt 0.39 0.37 0.00 -vt 0.39 0.43 0.00 -vt 0.39 0.47 0.00 -vt 0.37 0.49 0.00 -vt 0.38 0.49 0.00 -vt 0.37 0.50 0.00 -vt 0.97 0.50 0.00 -vt 0.95 0.45 0.00 -vt 0.95 0.50 0.00 -vt 0.97 0.56 0.00 -vt 0.95 0.55 0.00 -vt 0.97 0.60 0.00 -vt 0.95 0.59 0.00 -vt 0.97 0.66 0.00 -vt 0.95 0.66 0.00 -vt 0.95 0.70 0.00 -vt 0.98 0.72 0.00 -vt 0.96 0.75 0.00 -vt 0.98 0.76 0.00 -vt 0.98 0.77 0.00 -vt 0.96 0.76 0.00 -vt 0.93 0.75 0.00 -vt 0.47 0.73 0.00 -vt 0.46 0.75 0.00 -vt 0.44 0.73 0.00 -vt 0.42 0.73 0.00 -vt 0.41 0.73 0.00 -vt 0.23 0.78 0.00 -vt 0.28 0.78 0.00 -vt 0.29 0.82 0.00 -vt 0.45 0.82 0.00 -vt 1.00 0.79 0.00 -vt 1.00 0.77 0.00 -vt 0.99 0.72 0.00 -vt 0.99 0.65 0.00 -vt 0.99 0.60 0.00 -vt 0.99 0.55 0.00 -vt 0.99 0.50 0.00 -vt 0.67 0.71 0.00 -vt 0.68 0.72 0.00 -vt 0.66 0.71 0.00 -vt 0.66 0.74 0.00 -vt 0.67 0.74 0.00 -vt 0.65 0.72 0.00 -vt 0.06 0.05 0.00 -vt 0.10 0.06 0.00 -vt 0.06 0.07 0.00 -vt 0.10 0.08 0.00 -vt 0.06 0.14 0.00 -vt 0.08 0.14 0.00 -vt 0.13 0.08 0.00 -vt 0.12 0.16 0.00 -vt 0.17 0.09 0.00 -vt 0.16 0.16 0.00 -vt 0.20 0.09 0.00 -vt 0.20 0.18 0.00 -vt 0.25 0.11 0.00 -vt 0.20 0.07 0.00 -vt 0.27 0.08 0.00 -vt 0.20 0.06 0.00 -vt 0.27 0.07 0.00 -vt 0.21 0.04 0.00 -vt 0.28 0.05 0.00 -vt 0.28 0.03 0.00 -vt 0.17 0.05 0.00 -vt 0.17 0.07 0.00 -vt 0.14 0.06 0.00 -vt 0.14 0.04 0.00 -vt 0.18 0.03 0.00 -vt 0.21 0.02 0.00 -vt 0.29 0.07 0.00 -vt 0.28 0.09 0.00 -vt 0.31 0.08 0.00 -vt 0.18 0.02 0.00 -vt 0.10 0.04 0.00 -vt 0.15 0.03 0.00 -vt 0.15 0.01 0.00 -vt 0.11 0.02 0.00 -vt 0.04 0.04 0.00 -vt 0.07 0.03 0.00 -vt 0.09 0.02 0.00 -vt 0.11 0.01 0.00 -vt 0.20 0.10 0.00 -vt 0.27 0.11 0.00 -vt 0.30 0.04 0.00 -vt 0.31 0.05 0.00 -vt 0.33 0.08 0.00 -vt 0.32 0.09 0.00 -vt 0.31 0.11 0.00 -vt 0.29 0.13 0.00 -vt 0.23 0.17 0.00 -vt 0.28 0.08 0.00 -vt 0.34 0.04 0.00 -vt 0.34 0.06 0.00 -vt 0.26 0.18 0.00 -vt 0.33 0.07 0.00 -vt 0.41 0.31 0.00 -vt 0.41 0.38 0.00 -vt 0.50 0.31 0.00 -vt 0.51 0.36 0.00 -vt 0.41 0.42 0.00 -vt 0.50 0.40 0.00 -vt 0.40 0.47 0.00 -vt 0.41 0.47 0.00 -vt 0.51 0.43 0.00 -vt 0.43 0.46 0.00 -vt 0.51 0.26 0.00 -vt 0.41 0.26 0.00 -vt 0.41 0.21 0.00 -vt 0.41 0.17 0.00 -vt 0.49 0.18 0.00 -vt 0.49 0.21 0.00 -vt 0.45 0.73 0.00 -vt 0.44 0.75 0.00 -vt 0.09 1.00 0.00 -vt 0.09 0.98 0.00 -vt 0.10 1.00 0.00 -vt 0.10 0.98 0.00 -vt 0.27 1.00 0.00 -vt 0.27 0.98 0.00 -vt 0.28 1.00 0.00 -vt 0.28 0.98 0.00 -vt 0.28 0.96 0.00 -vt 0.27 0.96 0.00 -vt 0.28 0.94 0.00 -vt 0.27 0.94 0.00 -vt 0.10 0.96 0.00 -vt 0.10 0.94 0.00 -vt 0.09 0.96 0.00 -vt 0.09 0.94 0.00 -vt 0.15 0.96 0.00 -vt 0.15 0.95 0.00 -vt 0.13 0.96 0.00 -vt 0.13 0.95 0.00 -vt 0.45 0.81 0.00 -vt 0.36 0.81 0.00 -vt 0.41 0.81 0.00 -vt 0.42 0.82 0.00 -vt 0.42 0.81 0.00 -vt 0.44 0.81 0.00 -vt 0.48 0.76 0.00 -vt 0.44 0.70 0.00 -vt 0.45 0.70 0.00 -vt 0.50 0.68 0.00 -vt 0.55 0.69 0.00 -vt 0.58 0.70 0.00 -vt 0.49 0.04 0.00 -vt 0.47 0.04 0.00 -vt 0.48 0.03 0.00 -vt 0.47 0.03 0.00 -vt 0.01 0.72 0.00 -vt 0.02 0.70 0.00 -vt 0.02 0.72 0.00 -vt 0.01 0.68 0.00 -vt 0.02 0.67 0.00 -vt 0.01 0.62 0.00 -vt 0.02 0.62 0.00 -vt 0.06 0.67 0.00 -vt 0.06 0.63 0.00 -vt 0.11 0.63 0.00 -vt 0.11 0.67 0.00 -vt 0.16 0.64 0.00 -vt 0.16 0.67 0.00 -vt 0.20 0.64 0.00 -vt 0.20 0.68 0.00 -vt 0.22 0.65 0.00 -vt 0.22 0.68 0.00 -vt 0.20 0.69 0.00 -vt 0.16 0.69 0.00 -vt 0.17 0.70 0.00 -vt 0.06 0.70 0.00 -vt 0.11 0.70 0.00 -vt 0.12 0.71 0.00 -vt 0.07 0.71 0.00 -vt 0.28 0.42 0.00 -vt 0.01 0.75 0.00 -vt 0.48 0.02 0.00 -vt 0.47 0.02 0.00 -vt 0.01 0.63 0.00 -vt 0.08 0.91 0.00 -vt 0.05 1.00 0.00 -vt 0.07 0.99 0.00 -vt 0.06 1.00 0.00 -vt 0.08 0.98 0.00 -vt 0.04 1.00 0.00 -vt 0.03 0.99 0.00 -vt 0.00 0.96 0.00 -vt 0.01 0.91 0.00 -vt 0.00 0.94 0.00 -vt 0.01 0.98 0.00 -vt 0.22 0.61 0.00 -vt 0.20 0.60 0.00 -vt 0.20 0.62 0.00 -vt 0.16 0.68 0.00 -vt 0.16 0.63 0.00 -vt 0.26 0.21 0.00 -vt 0.25 0.22 0.00 -vt 0.38 0.09 0.00 -vt 0.44 0.82 0.00 -vt 0.93 0.78 0.00 -vt 0.94 0.78 0.00 -vt 0.49 0.05 0.00 -vt 0.49 0.06 0.00 -vt 0.48 0.04 0.00 -vt 0.47 0.06 0.00 -vt 0.23 0.73 0.00 -vt 0.27 0.73 0.00 -vt 0.21 0.74 0.00 -vt 0.29 0.74 0.00 -vt 0.29 0.77 0.00 -vt 0.63 0.01 0.00 -vt 0.66 0.01 0.00 -vt 0.63 0.02 0.00 -vt 0.66 0.02 0.00 -vt 0.90 0.76 0.00 -vt 0.90 0.75 0.00 -vt 0.89 0.76 0.00 -vt 0.89 0.74 0.00 -vt 0.84 0.74 0.00 -vt 0.83 0.76 0.00 -vt 0.84 0.76 0.00 -vt 0.83 0.75 0.00 -vt 0.68 0.90 0.00 -vt 0.61 0.96 0.00 -vt 0.67 0.96 0.00 -vt 0.61 0.97 0.00 -vt 0.67 0.97 0.00 -vt 0.64 1.00 0.00 -vt 0.62 0.99 0.00 -vt 0.66 0.99 0.00 -vt 0.93 0.77 0.00 -vt 0.94 0.77 0.00 -vt 0.36 0.87 0.00 -vt 0.37 0.87 0.00 -vt 0.38 0.87 0.00 -vt 0.53 0.97 0.00 -vt 0.53 0.96 0.00 -vt 0.55 0.97 0.00 -vt 0.52 0.96 0.00 -vt 0.53 0.95 0.00 -vt 0.59 0.99 0.00 -vt 0.59 0.96 0.00 -vt 0.59 0.98 0.00 -vt 0.60 0.97 0.00 -vt 0.59 0.97 0.00 -vt 0.59 0.93 0.00 -vt 0.56 0.97 0.00 -vt 0.57 0.93 0.00 -vt 0.54 0.97 0.00 -vt 0.54 0.93 0.00 -vt 0.52 0.93 0.00 -vt 0.52 0.94 0.00 -vt 0.53 0.98 0.00 -vt 0.55 0.98 0.00 -vt 0.56 0.98 0.00 -vt 0.56 0.94 0.00 -vt 0.57 0.96 0.00 -vt 0.51 0.93 0.00 -vt 0.58 0.97 0.00 -vt 0.58 0.96 0.00 -vt 0.58 0.95 0.00 -vt 0.57 0.97 0.00 -vt 0.47 0.75 0.00 -vt 0.40 0.01 0.00 -vt 0.40 0.07 0.00 -vt 0.46 0.02 0.00 -vt 0.46 0.06 0.00 -vt 0.38 0.01 0.00 -vt 0.38 0.07 0.00 -vt 0.35 0.02 0.00 -vt 0.35 0.06 0.00 -vt 0.46 0.03 0.00 -vt 0.46 0.04 0.00 -vt 0.41 0.03 0.00 -vt 0.39 0.05 0.00 -vt 0.39 0.07 0.00 -vt 0.39 0.02 0.00 -vt 0.58 0.93 0.00 -vt 0.52 0.03 0.00 -vt 0.49 0.03 0.00 -vt 0.57 0.01 0.00 -vt 0.62 0.01 0.00 -vt 0.52 0.01 0.00 -vt 0.62 0.02 0.00 -vt 0.57 0.02 0.00 -vt 0.51 0.02 0.00 -vt 0.48 0.01 0.00 -vt 0.52 0.02 0.00 -vt 0.62 0.03 0.00 -vt 0.57 0.03 0.00 -vt 0.51 0.04 0.00 -vt 0.21 0.51 0.00 -vt 0.19 0.51 0.00 -vt 0.20 0.49 0.00 -vt 0.19 0.49 0.00 -vt 0.22 0.52 0.00 -vt 0.20 0.52 0.00 -vt 0.20 0.54 0.00 -vt 0.23 0.54 0.00 -vt 0.24 0.56 0.00 -vt 0.21 0.55 0.00 -vt 0.24 0.57 0.00 -vt 0.22 0.57 0.00 -vt 0.24 0.59 0.00 -vt 0.22 0.58 0.00 -vt 0.20 0.58 0.00 -vt 0.22 0.59 0.00 -vt 0.21 0.49 0.00 -vt 0.21 0.50 0.00 -vt 0.19 0.50 0.00 -vt 0.19 0.52 0.00 -vt 0.19 0.54 0.00 -vt 0.19 0.56 0.00 -vt 0.48 0.73 0.00 -# 642 texture coords - -g P_51_Mustang_Hull -f 609/373/545 610/374/545 611/373/545 -f 612/375/546 611/373/547 613/376/548 -f 614/374/548 613/376/548 611/373/547 -f 613/376/548 614/374/548 615/377/549 -f 616/378/550 615/377/549 614/374/548 -f 616/378/550 617/379/551 615/377/549 -f 618/380/552 615/377/549 617/379/551 -f 618/380/552 617/379/551 619/381/553 -f 620/382/554 619/381/553 617/379/551 -f 620/382/554 621/383/555 619/381/553 -f 622/384/556 619/381/553 621/383/555 -f 621/383/555 623/385/557 622/384/556 -f 624/386/558 622/384/556 623/385/557 -f 623/385/557 625/387/559 624/386/558 -f 626/388/560 624/386/558 625/387/559 -f 626/388/560 625/387/559 627/388/561 -f 628/387/562 627/388/561 625/387/559 -f 628/387/562 629/387/563 627/388/561 -f 630/388/564 627/388/561 629/387/563 -f 630/388/564 629/387/563 631/386/565 -f 632/385/566 631/386/565 629/387/563 -f 631/386/565 632/385/566 633/384/567 -f 634/383/568 633/384/567 632/385/566 -f 633/384/567 634/383/568 635/381/569 -f 636/382/570 635/381/569 634/383/568 -f 636/382/570 637/379/571 635/381/569 -f 638/380/572 635/381/569 637/379/571 -f 638/380/572 637/379/571 639/377/573 -f 640/378/574 639/377/573 637/379/571 -f 640/378/574 641/374/575 639/377/573 -f 642/376/575 639/377/573 641/374/575 -f 641/374/575 643/373/576 642/376/575 -f 644/375/577 642/376/575 643/373/576 -f 645/375/578 646/373/579 647/376/580 -f 648/374/581 647/376/580 646/373/579 -f 647/376/580 648/374/581 649/377/582 -f 650/378/583 649/377/582 648/374/581 -f 650/378/583 651/379/584 649/377/582 -f 652/380/585 649/377/582 651/379/584 -f 652/380/585 651/379/584 653/381/586 -f 654/382/587 653/381/586 651/379/584 -f 654/382/587 655/383/588 653/381/586 -f 656/384/589 653/381/586 655/383/588 -f 655/383/588 657/385/590 656/384/589 -f 658/386/591 656/384/589 657/385/590 -f 657/385/590 659/387/592 658/386/591 -f 660/388/593 658/386/591 659/387/592 -f 660/388/593 659/387/592 661/388/594 -f 662/387/595 661/388/594 659/387/592 -f 662/387/595 663/387/596 661/388/594 -f 664/388/597 661/388/594 663/387/596 -f 664/388/597 663/387/596 665/386/598 -f 666/385/599 665/386/598 663/387/596 -f 665/386/598 666/385/599 667/384/600 -f 668/383/601 667/384/600 666/385/599 -f 667/384/600 668/383/601 669/381/602 -f 670/382/603 669/381/602 668/383/601 -f 670/382/603 671/379/604 669/381/602 -f 672/380/605 669/381/602 671/379/604 -f 672/380/605 671/379/604 673/377/606 -f 674/378/607 673/377/606 671/379/604 -f 674/378/607 610/374/608 673/377/606 -f 675/376/608 673/377/606 610/374/608 -f 610/374/608 609/373/609 675/376/608 -f 676/375/610 675/376/608 609/373/609 -f 677/385/611 678/389/612 679/390/613 -f 680/391/612 679/390/613 678/389/612 -f 678/389/612 681/392/614 680/391/612 -f 682/374/614 680/391/612 681/392/614 -f 681/392/614 683/393/613 682/374/614 -f 684/394/613 682/374/614 683/393/613 -f 683/394/615 681/374/616 685/393/615 -f 686/392/617 685/393/615 681/374/616 -f 681/374/616 678/391/618 686/392/617 -f 687/389/619 686/392/617 678/391/618 -f 678/391/618 677/390/620 687/389/619 -f 688/385/621 687/389/619 677/390/620 -f 685/394/622 686/374/623 689/393/622 -f 690/392/623 689/393/622 686/374/623 -f 686/374/623 687/391/624 690/392/623 -f 691/389/624 690/392/623 687/391/624 -f 687/391/624 688/390/622 691/389/624 -f 692/385/622 691/389/624 688/390/622 -f 674/378/625 671/379/625 610/374/625 -f 668/383/626 621/383/626 670/382/626 -f 621/383/627 620/382/627 670/382/627 -f 670/382/628 620/382/628 671/379/628 -f 617/379/625 616/378/625 620/382/625 -f 620/382/629 616/378/629 671/379/629 -f 671/379/629 616/378/629 610/374/629 -f 610/374/630 616/378/630 611/373/630 -f 616/378/631 614/374/631 611/373/631 -f 655/383/632 654/382/632 634/383/632 -f 650/378/625 648/374/625 651/379/625 -f 646/373/633 643/373/633 648/374/633 -f 648/374/634 643/373/634 651/379/634 -f 641/374/635 640/378/635 643/373/635 -f 640/378/636 637/379/636 643/373/636 -f 643/373/637 637/379/637 651/379/637 -f 651/379/638 637/379/638 654/382/638 -f 654/382/639 637/379/639 634/383/639 -f 637/379/625 636/382/625 634/383/625 -f 629/387/640 628/387/640 632/385/640 -f 662/387/641 659/387/641 628/387/641 -f 628/387/642 659/387/642 632/385/642 -f 659/387/643 657/385/643 632/385/643 -f 632/385/644 657/385/644 634/383/644 -f 657/385/645 655/383/645 634/383/645 -f 625/387/646 623/385/646 628/387/646 -f 621/383/647 668/383/647 623/385/647 -f 668/383/648 666/385/648 623/385/648 -f 666/385/649 663/387/649 623/385/649 -f 623/385/650 663/387/650 628/387/650 -f 628/387/651 663/387/651 662/387/651 -f 630/388/652 631/386/652 627/388/652 -f 633/384/653 656/384/653 631/386/653 -f 656/384/654 658/386/654 631/386/654 -f 658/386/655 660/388/655 631/386/655 -f 631/386/656 660/388/656 627/388/656 -f 627/388/657 660/388/657 661/388/657 -f 661/388/658 664/388/658 627/388/658 -f 667/384/659 622/384/659 665/386/659 -f 622/384/660 624/386/660 665/386/660 -f 665/386/661 624/386/661 664/388/661 -f 664/388/662 624/386/662 627/388/662 -f 624/386/663 626/388/663 627/388/663 -f 667/384/664 669/381/664 622/384/664 -f 675/376/665 676/375/665 673/377/665 -f 612/375/666 613/376/666 676/375/666 -f 676/375/667 613/376/667 673/377/667 -f 673/377/668 613/376/668 672/380/668 -f 615/377/669 618/380/669 613/376/669 -f 613/376/666 618/380/666 672/380/666 -f 672/380/670 618/380/670 669/381/670 -f 669/381/671 618/380/671 622/384/671 -f 618/380/672 619/381/672 622/384/672 -f 647/376/673 649/377/673 645/375/673 -f 656/384/674 633/384/674 653/381/674 -f 653/381/675 633/384/675 652/380/675 -f 635/381/676 638/380/676 633/384/676 -f 633/384/677 638/380/677 652/380/677 -f 652/380/677 638/380/677 649/377/677 -f 639/377/669 642/376/669 638/380/669 -f 638/380/678 642/376/678 649/377/678 -f 649/377/678 642/376/678 645/375/678 -f 642/376/677 644/375/677 645/375/677 -f 689/394/679 690/374/680 684/393/679 -f 682/392/681 684/393/679 690/374/680 -f 690/374/680 691/391/682 682/392/681 -f 680/389/683 682/392/681 691/391/682 -f 691/391/682 692/390/684 680/389/683 -f 679/385/685 680/389/683 692/390/684 -f 693/395/686 694/396/686 695/397/686 -f 696/398/687 697/399/688 698/400/689 -f 696/398/687 699/401/690 697/399/688 -f 700/402/691 697/399/688 699/401/690 -f 699/401/690 701/403/692 700/402/691 -f 702/404/693 700/402/691 701/403/692 -f 702/404/693 701/403/692 703/405/694 -f 704/406/695 703/405/694 701/403/692 -f 703/405/694 704/406/695 705/407/696 -f 706/408/697 705/407/696 704/406/695 -f 706/408/697 707/406/698 705/407/696 -f 708/405/699 705/407/696 707/406/698 -f 707/406/698 709/403/700 708/405/699 -f 710/409/701 708/405/699 709/403/700 -f 710/409/701 709/403/700 711/402/702 -f 712/410/703 711/402/702 709/403/700 -f 711/402/702 712/410/703 693/399/704 -f 713/398/705 693/399/704 712/410/703 -f 693/399/704 713/398/705 714/400/706 -f 715/411/707 713/398/705 716/412/708 -f 713/398/705 712/410/703 716/412/708 -f 715/411/707 717/413/709 718/414/710 -f 715/411/707 716/412/708 717/413/709 -f 716/412/708 719/415/711 717/413/709 -f 719/415/711 716/412/708 712/410/703 -f 712/410/703 709/403/700 719/415/711 -f 720/416/712 719/415/711 709/403/700 -f 707/406/698 720/416/712 709/403/700 -f 707/406/698 721/417/713 720/416/712 -f 720/416/712 721/417/713 722/418/714 -f 723/419/715 722/418/714 721/417/713 -f 722/418/714 723/419/715 724/420/716 -f 725/421/717 724/420/716 723/419/715 -f 724/420/716 725/421/717 726/422/718 -f 727/423/719 726/422/718 725/421/717 -f 727/423/719 728/424/720 726/422/718 -f 720/416/712 722/418/714 719/415/711 -f 719/415/711 722/418/714 729/425/721 -f 729/425/721 717/413/709 719/415/711 -f 717/413/709 729/425/721 730/426/722 -f 730/426/722 718/414/710 717/413/709 -f 724/420/716 729/425/721 722/418/714 -f 729/425/721 724/420/716 731/427/723 -f 731/427/723 730/426/722 729/425/721 -f 726/422/718 731/427/723 724/420/716 -f 732/426/724 733/413/725 734/414/726 -f 733/413/725 732/426/724 735/425/727 -f 736/427/728 735/425/727 732/426/724 -f 735/425/727 736/427/728 737/420/729 -f 738/422/730 737/420/729 736/427/728 -f 737/420/729 738/422/730 739/421/731 -f 740/423/732 739/421/731 738/422/730 -f 740/423/732 738/422/730 728/424/720 -f 741/428/733 728/424/720 738/422/730 -f 741/428/733 726/422/718 728/424/720 -f 741/428/733 742/429/734 726/422/718 -f 731/427/723 726/422/718 742/429/734 -f 742/429/734 743/430/735 731/427/723 -f 730/426/722 731/427/723 743/430/735 -f 743/430/735 744/431/736 730/426/722 -f 718/414/710 730/426/722 744/431/736 -f 718/414/710 744/431/736 745/432/737 -f 718/414/710 745/432/737 715/411/707 -f 737/420/729 746/418/738 735/425/727 -f 735/425/727 747/415/739 733/413/725 -f 747/415/739 735/425/727 746/418/738 -f 746/418/738 748/416/740 747/415/739 -f 749/433/741 750/434/742 698/400/689 -f 751/411/743 698/400/689 750/434/742 -f 751/411/743 696/398/687 698/400/689 -f 696/398/687 751/411/743 733/413/725 -f 696/398/687 733/413/725 699/401/690 -f 747/415/739 699/401/690 733/413/725 -f 699/401/690 747/415/739 701/403/692 -f 748/416/740 701/403/692 747/415/739 -f 748/416/740 704/406/695 701/403/692 -f 752/417/744 704/406/695 748/416/740 -f 748/416/740 746/418/738 752/417/744 -f 753/419/745 752/417/744 746/418/738 -f 746/418/738 737/420/729 753/419/745 -f 739/421/731 753/419/745 737/420/729 -f 754/435/746 755/436/747 756/437/748 -f 755/436/747 754/435/746 757/438/749 -f 755/436/747 757/438/749 758/435/750 -f 759/439/751 758/435/750 757/438/749 -f 759/439/751 760/440/752 758/435/750 -f 760/440/752 759/439/751 761/441/753 -f 761/441/753 762/442/754 760/440/752 -f 763/443/755 760/440/752 762/442/754 -f 762/442/754 764/444/756 763/443/755 -f 765/445/757 763/443/755 764/444/756 -f 764/444/756 766/446/758 765/445/757 -f 749/433/741 765/445/757 766/446/758 -f 766/446/758 767/447/759 749/433/741 -f 750/434/742 749/433/741 767/447/759 -f 768/432/760 750/434/742 767/447/759 -f 750/434/742 768/432/760 751/411/743 -f 734/414/726 751/411/743 768/432/760 -f 751/411/743 734/414/726 733/413/725 -f 769/448/761 770/449/762 757/438/749 -f 759/439/751 757/438/749 770/449/762 -f 770/449/762 761/441/753 759/439/751 -f 713/398/705 715/411/707 714/400/706 -f 715/411/707 771/434/763 714/400/706 -f 771/434/763 715/411/707 745/432/737 -f 771/434/763 745/432/737 772/447/764 -f 772/447/764 745/432/737 773/450/765 -f 773/450/765 774/451/766 772/447/764 -f 773/450/765 767/447/759 774/451/766 -f 775/452/767 774/451/766 767/447/759 -f 767/447/759 766/446/758 775/452/767 -f 776/453/768 775/452/767 766/446/758 -f 766/446/758 764/444/756 776/453/768 -f 777/454/769 776/453/768 764/444/756 -f 764/444/756 762/442/754 777/454/769 -f 778/455/770 777/454/769 762/442/754 -f 762/442/754 761/441/753 778/455/770 -f 779/456/771 778/455/770 761/441/753 -f 761/441/753 770/449/762 779/456/771 -f 780/457/772 779/456/771 770/449/762 -f 781/458/773 782/459/774 777/454/769 -f 776/453/768 777/454/769 782/459/774 -f 776/453/768 782/459/774 775/452/767 -f 783/460/775 775/452/767 782/459/774 -f 775/452/767 783/460/775 774/451/766 -f 783/460/775 784/452/776 774/451/766 -f 784/452/776 772/447/764 774/451/766 -f 772/447/764 784/452/776 785/446/777 -f 785/446/777 786/461/778 772/447/764 -f 786/461/778 785/446/777 787/445/779 -f 787/445/779 788/462/780 786/461/778 -f 788/462/780 787/445/779 789/463/781 -f 789/463/781 790/464/782 788/462/780 -f 789/463/781 791/465/783 790/464/782 -f 792/466/784 790/464/782 791/465/783 -f 792/466/784 791/465/783 793/467/566 -f 793/467/566 791/465/783 756/437/748 -f 754/435/746 756/437/748 791/465/783 -f 794/468/785 795/469/786 796/470/787 -f 781/458/773 796/470/787 795/469/786 -f 795/469/786 797/471/788 781/458/773 -f 782/459/774 781/458/773 797/471/788 -f 797/471/788 798/472/789 782/459/774 -f 783/460/775 782/459/774 798/472/789 -f 783/460/775 798/472/789 799/459/790 -f 783/460/775 799/459/790 784/452/776 -f 800/473/791 784/452/776 799/459/790 -f 800/473/791 785/446/777 784/452/776 -f 785/446/777 800/473/791 801/444/792 -f 801/444/792 787/445/779 785/446/777 -f 787/445/779 801/444/792 802/443/793 -f 802/443/793 789/463/781 787/445/779 -f 802/443/793 803/440/794 789/463/781 -f 791/465/783 789/463/781 803/440/794 -f 791/465/783 803/440/794 754/435/746 -f 804/439/795 754/435/746 803/440/794 -f 802/443/793 805/442/796 803/440/794 -f 805/442/796 802/443/793 801/444/792 -f 801/444/792 806/454/797 805/442/796 -f 806/454/797 801/444/792 800/473/791 -f 800/473/791 799/459/790 806/454/797 -f 797/471/788 795/469/786 807/474/798 -f 807/474/798 808/475/799 797/471/788 -f 798/472/789 797/471/788 808/475/799 -f 798/472/789 808/475/799 809/471/800 -f 809/471/800 799/459/790 798/472/789 -f 799/459/790 809/471/800 810/458/801 -f 810/458/801 806/454/797 799/459/790 -f 806/454/797 810/458/801 811/455/802 -f 811/455/802 805/442/796 806/454/797 -f 805/442/796 811/455/802 812/441/803 -f 812/441/803 803/440/794 805/442/796 -f 803/440/794 812/441/803 804/439/795 -f 813/449/804 804/439/795 812/441/803 -f 812/441/803 814/456/805 813/449/804 -f 814/456/805 812/441/803 811/455/802 -f 811/455/802 815/470/806 814/456/805 -f 815/470/806 811/455/802 810/458/801 -f 810/458/801 816/469/807 815/470/806 -f 816/469/807 810/458/801 809/471/800 -f 809/471/800 817/474/808 816/469/807 -f 817/474/808 809/471/800 808/475/799 -f 808/475/799 818/476/809 817/474/808 -f 808/475/799 807/474/798 818/476/809 -f 819/477/810 818/476/809 807/474/798 -f 807/474/798 820/478/811 819/477/810 -f 821/479/812 819/477/810 820/478/811 -f 820/478/811 822/480/813 821/479/812 -f 823/481/814 821/479/812 822/480/813 -f 822/480/813 820/478/811 794/468/785 -f 795/469/786 794/468/785 820/478/811 -f 820/478/811 807/474/798 795/469/786 -f 824/482/815 825/483/816 826/484/817 -f 827/485/818 826/484/817 825/483/816 -f 827/485/818 825/483/816 828/486/819 -f 829/487/820 828/486/819 825/483/816 -f 829/487/820 830/488/821 828/486/819 -f 829/487/820 831/489/822 830/488/821 -f 830/488/821 831/489/822 832/490/823 -f 823/481/814 832/490/823 831/489/822 -f 832/490/823 823/481/814 833/491/824 -f 822/480/813 833/491/824 823/481/814 -f 833/491/824 822/480/813 834/492/825 -f 794/468/785 834/492/825 822/480/813 -f 834/492/825 794/468/785 835/493/826 -f 796/470/787 835/493/826 794/468/785 -f 835/493/826 796/470/787 779/456/771 -f 778/455/770 779/456/771 796/470/787 -f 796/470/787 781/458/773 778/455/770 -f 777/454/769 778/455/770 781/458/773 -f 836/494/827 833/491/824 834/492/825 -f 837/495/828 830/488/821 838/496/829 -f 837/495/828 838/496/829 839/497/830 -f 838/496/829 840/498/831 839/497/830 -f 840/498/831 841/499/832 839/497/830 -f 840/498/831 842/500/833 841/499/832 -f 842/500/833 843/501/834 841/499/832 -f 836/494/827 843/501/834 842/500/833 -f 836/494/827 844/502/835 843/501/834 -f 836/494/827 834/492/825 844/502/835 -f 835/493/826 844/502/835 834/492/825 -f 844/502/835 835/493/826 780/457/772 -f 779/456/771 780/457/772 835/493/826 -f 832/490/823 838/496/829 830/488/821 -f 837/495/828 839/497/830 830/488/821 -f 830/488/821 839/497/830 828/486/819 -f 839/497/830 845/503/836 828/486/819 -f 839/497/830 846/504/837 845/503/836 -f 847/505/836 845/503/836 846/504/837 -f 846/504/837 848/506/838 847/505/836 -f 849/507/839 847/505/836 848/506/838 -f 850/508/838 849/507/839 848/506/838 -f 848/506/838 851/509/840 850/508/838 -f 851/509/840 848/506/838 852/510/841 -f 852/510/841 853/511/842 851/509/840 -f 853/511/842 852/510/841 843/501/834 -f 841/499/832 843/501/834 852/510/841 -f 852/510/841 846/504/837 841/499/832 -f 839/497/830 841/499/832 846/504/837 -f 846/504/837 852/510/841 848/506/838 -f 770/449/762 769/448/761 780/457/772 -f 854/512/843 780/457/772 769/448/761 -f 854/512/843 769/448/761 855/457/844 -f 854/512/843 855/457/844 856/501/845 -f 857/502/846 856/501/845 855/457/844 -f 857/502/846 858/494/847 856/501/845 -f 858/494/847 857/502/846 859/492/848 -f 860/491/849 858/494/847 859/492/848 -f 860/491/849 859/492/848 861/480/850 -f 861/480/850 862/481/851 860/491/849 -f 862/481/851 861/480/850 863/479/852 -f 863/479/852 864/513/853 862/481/851 -f 864/513/853 863/479/852 865/514/854 -f 865/514/854 866/482/855 864/513/853 -f 865/514/854 867/515/669 866/482/855 -f 868/516/856 866/482/855 867/515/669 -f 868/516/856 867/515/669 824/482/815 -f 824/482/815 826/484/817 868/516/856 -f 869/489/857 862/481/851 864/513/853 -f 862/481/851 869/489/857 870/490/858 -f 870/490/858 860/491/849 862/481/851 -f 871/488/859 870/490/858 869/489/857 -f 870/490/858 871/488/859 872/496/860 -f 873/517/861 874/518/862 875/519/863 -f 876/519/864 875/519/863 874/518/862 -f 877/508/865 875/519/863 876/519/864 -f 876/519/864 878/509/866 877/508/865 -f 879/506/867 877/508/865 878/509/866 -f 878/509/866 880/510/868 879/506/867 -f 881/504/869 879/506/867 880/510/868 -f 880/510/868 882/499/870 881/504/869 -f 883/497/871 881/504/869 882/499/870 -f 882/499/870 884/498/872 883/497/871 -f 884/498/872 872/496/860 883/497/871 -f 872/496/860 885/495/873 883/497/871 -f 885/495/873 872/496/860 871/488/859 -f 885/495/873 871/488/859 886/487/874 -f 869/489/857 886/487/874 871/488/859 -f 886/487/874 869/489/857 887/483/875 -f 864/513/853 887/483/875 869/489/857 -f 887/483/875 864/513/853 866/482/855 -f 888/500/876 884/498/872 882/499/870 -f 858/494/847 888/500/876 856/501/845 -f 856/501/845 888/500/876 882/499/870 -f 882/499/870 880/510/868 856/501/845 -f 889/511/877 856/501/845 880/510/868 -f 880/510/868 878/509/866 889/511/877 -f 854/512/843 856/501/845 890/520/878 -f 889/511/877 890/520/878 856/501/845 -f 889/511/877 891/521/879 890/520/878 -f 891/521/879 889/511/877 878/509/866 -f 878/509/866 876/519/864 891/521/879 -f 874/518/862 891/521/879 876/519/864 -f 891/521/879 874/518/862 892/522/880 -f 893/523/881 892/522/880 874/518/862 -f 893/523/881 894/518/882 892/522/880 -f 894/518/882 893/523/881 895/517/883 -f 895/517/883 896/519/884 894/518/882 -f 897/519/885 894/518/882 896/519/884 -f 896/519/884 898/524/886 897/519/885 -f 892/522/880 890/520/878 891/521/879 -f 892/522/880 899/521/887 890/520/878 -f 899/521/887 892/522/880 894/518/882 -f 894/518/882 897/519/885 899/521/887 -f 780/457/772 854/512/843 844/502/835 -f 843/501/834 844/502/835 854/512/843 -f 854/512/843 890/520/878 843/501/834 -f 853/511/842 843/501/834 890/520/878 -f 853/511/842 890/520/878 899/521/887 -f 899/521/887 851/509/840 853/511/842 -f 851/509/840 899/521/887 897/519/885 -f 897/519/885 850/508/838 851/509/840 -f 850/508/838 897/519/885 898/524/886 -f 898/524/886 849/507/839 850/508/838 -f 898/524/888 849/507/839 898/524/886 -f 898/524/886 896/519/884 898/524/888 -f 898/524/888 896/519/884 900/525/889 -f 900/525/889 896/519/884 895/517/883 -f 895/517/883 901/517/890 900/525/889 -f 901/517/890 895/517/883 893/523/881 -f 901/517/890 893/523/881 873/517/861 -f 874/518/862 873/517/861 893/523/881 -f 902/526/891 898/524/888 900/525/889 -f 903/524/892 904/524/893 905/524/892 -f 905/524/892 904/524/893 877/508/865 -f 904/524/893 875/519/863 877/508/865 -f 904/524/893 906/526/894 875/519/863 -f 875/519/863 906/526/894 873/517/861 -f 906/526/894 907/525/895 873/517/861 -f 873/517/861 907/525/895 901/517/890 -f 908/517/896 901/517/890 907/525/895 -f 908/517/896 900/525/889 901/517/890 -f 900/525/889 908/517/896 909/527/897 -f 900/525/889 909/527/897 902/526/891 -f 910/528/898 902/526/891 909/527/897 -f 910/528/898 909/527/897 906/526/894 -f 907/525/895 906/526/894 909/527/897 -f 907/525/895 909/527/897 908/517/896 -f 909/527/897 908/517/896 911/527/899 -f 912/485/900 887/483/875 913/484/901 -f 887/483/875 912/485/900 886/487/874 -f 914/486/902 886/487/874 912/485/900 -f 914/486/902 915/503/903 886/487/874 -f 915/503/903 885/495/873 886/487/874 -f 883/497/871 885/495/873 915/503/903 -f 883/497/871 915/503/903 881/504/869 -f 916/505/904 881/504/869 915/503/903 -f 881/504/869 916/505/904 879/506/867 -f 917/507/797 879/506/867 916/505/904 -f 879/506/867 917/507/797 877/508/865 -f 905/524/892 877/508/865 917/507/797 -f 866/482/855 913/484/901 887/483/875 -f 866/482/855 868/516/856 913/484/901 -f 918/529/789 913/484/901 868/516/856 -f 918/529/789 868/516/856 826/484/817 -f 792/466/784 919/530/905 790/464/782 -f 920/531/906 790/464/782 919/530/905 -f 919/530/905 921/532/907 920/531/906 -f 922/533/908 920/531/906 921/532/907 -f 921/532/907 923/534/909 922/533/908 -f 924/379/910 922/533/908 923/534/909 -f 923/534/909 925/535/911 924/379/910 -f 926/382/912 924/379/910 925/535/911 -f 925/535/911 927/536/913 926/382/912 -f 928/537/907 926/382/912 927/536/913 -f 928/537/907 927/536/913 929/538/914 -f 929/538/914 930/539/915 928/537/907 -f 930/539/915 929/538/914 931/540/916 -f 931/540/916 932/541/917 930/539/915 -f 932/541/917 931/540/916 933/542/918 -f 933/542/918 934/543/919 932/541/917 -f 933/542/918 935/544/920 934/543/919 -f 936/545/921 934/543/919 935/544/920 -f 926/382/912 937/546/922 924/379/910 -f 937/546/922 938/547/923 924/379/910 -f 922/533/908 924/379/910 938/547/923 -f 938/547/923 939/548/924 922/533/908 -f 920/531/906 922/533/908 939/548/924 -f 939/548/924 940/549/925 920/531/906 -f 790/464/782 920/531/906 940/549/925 -f 940/549/925 788/462/780 790/464/782 -f 771/434/763 772/447/764 786/461/778 -f 786/461/778 714/400/706 771/434/763 -f 714/400/706 786/461/778 788/462/780 -f 788/462/780 940/549/925 714/400/706 -f 941/550/926 714/400/706 940/549/925 -f 940/549/925 939/548/924 941/550/926 -f 694/551/927 941/550/926 939/548/924 -f 939/548/924 938/547/923 694/551/927 -f 942/552/928 694/551/927 938/547/923 -f 938/547/923 937/546/922 942/552/928 -f 943/553/929 942/552/928 937/546/922 -f 937/546/922 926/382/912 943/553/929 -f 944/554/930 943/553/929 926/382/912 -f 926/382/912 945/388/931 944/554/930 -f 945/388/931 926/382/912 928/537/907 -f 945/388/931 928/537/907 930/539/915 -f 694/551/927 693/399/704 941/550/926 -f 941/550/926 693/399/704 714/400/706 -f 936/545/921 935/544/920 946/555/932 -f 936/545/921 946/555/932 947/556/933 -f 948/557/934 947/556/933 946/555/932 -f 948/557/934 949/555/935 947/556/933 -f 950/545/936 947/556/933 949/555/935 -f 950/545/936 949/555/935 951/544/937 -f 950/545/936 951/544/937 952/543/938 -f 953/542/939 952/543/938 951/544/937 -f 953/542/939 954/541/940 952/543/938 -f 954/541/940 953/542/939 955/540/941 -f 955/540/941 956/558/942 954/541/940 -f 956/558/942 955/540/941 957/538/943 -f 957/538/943 958/537/944 956/558/942 -f 958/537/944 957/538/943 959/536/945 -f 958/537/944 959/536/945 960/382/946 -f 961/559/947 960/382/946 959/536/945 -f 960/382/946 961/559/947 962/560/948 -f 963/534/949 962/560/948 961/559/947 -f 947/556/933 964/561/950 965/562/951 -f 947/556/933 950/545/936 964/561/950 -f 952/543/938 964/561/950 950/545/936 -f 966/563/952 952/543/938 954/541/940 -f 966/563/952 967/564/953 952/543/938 -f 964/561/950 952/543/938 967/564/953 -f 968/564/954 964/561/950 967/564/953 -f 968/564/954 969/565/955 964/561/950 -f 965/562/951 964/561/950 969/565/955 -f 965/562/951 969/565/955 970/561/956 -f 970/561/956 947/556/933 965/562/951 -f 947/556/933 970/561/956 936/545/921 -f 934/543/919 936/545/921 970/561/956 -f 970/561/956 971/564/957 934/543/919 -f 972/566/958 934/543/919 971/564/957 -f 972/566/958 932/541/917 934/543/919 -f 970/561/956 973/567/959 971/564/957 -f 973/567/959 970/561/956 969/565/955 -f 962/560/948 963/534/949 974/533/960 -f 975/532/961 974/533/960 963/534/949 -f 974/533/960 975/532/961 976/531/962 -f 977/530/963 976/531/962 975/532/961 -f 976/531/962 977/530/963 978/568/964 -f 979/466/965 978/568/964 977/530/963 -f 979/466/965 980/465/966 978/568/964 -f 980/465/966 979/466/965 981/467/967 -f 981/467/967 982/437/968 980/465/966 -f 758/435/750 980/465/966 982/437/968 -f 758/435/750 982/437/968 755/436/747 -f 983/569/747 755/436/747 982/437/968 -f 983/569/747 756/437/748 755/436/747 -f 984/463/969 978/568/964 980/465/966 -f 984/463/969 985/462/813 978/568/964 -f 986/549/970 978/568/964 985/462/813 -f 978/568/964 986/549/970 976/531/962 -f 987/548/971 976/531/962 986/549/970 -f 976/531/962 987/548/971 974/533/960 -f 988/547/972 974/533/960 987/548/971 -f 974/533/960 988/547/972 962/560/948 -f 989/546/973 962/560/948 988/547/972 -f 989/546/973 960/382/946 962/560/948 -f 980/465/966 758/435/750 760/440/752 -f 980/465/966 760/440/752 984/463/969 -f 763/443/755 984/463/969 760/440/752 -f 763/443/755 765/445/757 984/463/969 -f 985/462/813 984/463/969 765/445/757 -f 765/445/757 749/433/741 985/462/813 -f 698/400/689 985/462/813 749/433/741 -f 985/462/813 698/400/689 986/549/970 -f 990/550/974 986/549/970 698/400/689 -f 986/549/970 990/550/974 987/548/971 -f 991/551/975 987/548/971 990/550/974 -f 987/548/971 991/551/975 988/547/972 -f 992/552/976 988/547/972 991/551/975 -f 988/547/972 992/552/976 989/546/973 -f 993/553/977 989/546/973 992/552/976 -f 989/546/973 993/553/977 960/382/946 -f 994/554/978 960/382/946 993/553/977 -f 960/382/946 994/554/978 995/388/979 -f 697/399/688 990/550/974 698/400/689 -f 697/399/688 991/551/975 990/550/974 -f 996/570/980 997/571/981 923/534/909 -f 925/535/911 923/534/909 997/571/981 -f 925/535/911 997/571/981 998/572/982 -f 999/573/983 925/535/911 998/572/982 -f 927/536/913 925/535/911 999/573/983 -f 927/536/913 999/573/983 1000/574/984 -f 1000/574/984 929/538/914 927/536/913 -f 1000/574/984 1001/575/985 929/538/914 -f 1001/575/985 931/540/916 929/538/914 -f 931/540/916 1001/575/985 1002/576/986 -f 1002/576/986 933/542/918 931/540/916 -f 933/542/918 1002/576/986 935/544/920 -f 1003/577/987 935/544/920 1002/576/986 -f 935/544/920 1003/577/987 1004/578/988 -f 1005/579/989 1004/578/988 1003/577/987 -f 1004/578/988 1005/579/989 1006/580/990 -f 1007/581/991 1006/580/990 1005/579/989 -f 1008/582/992 1007/581/991 1005/579/989 -f 1006/580/990 1009/583/993 1004/578/988 -f 946/555/932 1004/578/988 1009/583/993 -f 1004/578/988 946/555/932 935/544/920 -f 1010/581/994 1007/581/991 1008/582/992 -f 1011/584/995 1010/581/994 1008/582/992 -f 1008/582/992 1012/585/996 1011/584/995 -f 1013/586/997 1011/584/995 1012/585/996 -f 1012/585/996 1014/587/998 1013/586/997 -f 1015/588/999 1013/586/997 1014/587/998 -f 1014/587/998 1016/589/1000 1015/588/999 -f 1017/590/1001 1015/588/999 1016/589/1000 -f 1016/589/1000 1018/591/1002 1017/590/1001 -f 1019/592/1003 1017/590/1001 1018/591/1002 -f 1018/591/1002 1020/593/1004 1019/592/1003 -f 1021/594/1005 1019/592/1003 1020/593/1004 -f 1021/594/1005 1020/593/1004 1022/592/1006 -f 1023/591/1007 1022/592/1006 1020/593/1004 -f 1022/592/1006 1023/591/1007 1024/590/1008 -f 1025/595/1009 1024/590/1008 1023/591/1007 -f 1024/590/1008 1025/595/1009 1026/588/1010 -f 1027/587/1011 1026/588/1010 1025/595/1009 -f 1023/591/1007 1028/596/1012 1025/595/1009 -f 1029/597/1013 1028/596/1012 1030/598/1014 -f 1031/599/1015 1030/598/1014 1028/596/1012 -f 1028/596/1012 1023/591/1007 1031/599/1015 -f 1020/593/1004 1031/599/1015 1023/591/1007 -f 1020/593/1004 1018/591/1002 1031/599/1015 -f 1032/596/1016 1031/599/1015 1018/591/1002 -f 1018/591/1002 1016/589/1000 1032/596/1016 -f 1033/600/1017 1032/596/1016 1016/589/1000 -f 1016/589/1000 1014/587/998 1033/600/1017 -f 1034/601/1018 1033/600/1017 1014/587/998 -f 1014/587/998 1012/585/996 1034/601/1018 -f 1035/602/1019 1034/601/1018 1012/585/996 -f 1012/585/996 1008/582/992 1035/602/1019 -f 1034/601/1018 1035/602/1019 1036/603/1020 -f 1033/600/1017 1034/601/1018 1037/604/1021 -f 1036/603/1020 1037/604/1021 1034/601/1018 -f 1037/604/1021 1036/603/1020 1038/605/1022 -f 1032/596/1016 1033/600/1017 1039/597/1023 -f 1037/604/1021 1039/597/1023 1033/600/1017 -f 1039/597/1023 1037/604/1021 1040/606/1024 -f 1038/605/1022 1040/606/1024 1037/604/1021 -f 1040/606/1024 1038/605/1022 1041/607/1025 -f 1031/599/1015 1032/596/1016 1030/598/1014 -f 1039/597/1023 1030/598/1014 1032/596/1016 -f 1030/598/1014 1039/597/1023 1042/608/1026 -f 1040/606/1024 1042/608/1026 1039/597/1023 -f 1042/608/1026 1040/606/1024 1043/609/1027 -f 1041/607/1025 1043/609/1027 1040/606/1024 -f 1043/609/1027 1041/607/1025 1044/610/1028 -f 1045/611/1026 1046/612/1029 1044/610/1028 -f 1047/613/1030 1048/614/1031 1049/615/1032 -f 1049/615/1032 1050/616/1033 1047/613/1030 -f 1050/616/1033 1049/615/1032 1051/617/1034 -f 1051/617/1034 1052/618/1035 1050/616/1033 -f 1052/618/1035 1051/617/1034 1046/612/1029 -f 1052/618/1035 1046/612/1029 1053/619/1036 -f 1054/620/1037 1053/619/1036 1046/612/1029 -f 1054/620/1037 1046/612/1029 1055/621/1027 -f 1045/611/1026 1055/621/1027 1046/612/1029 -f 1045/611/1026 1056/612/1038 1055/621/1027 -f 1045/611/1026 1044/610/1028 1056/612/1038 -f 1057/622/1039 1056/612/1038 1044/610/1028 -f 1057/622/1039 1044/610/1028 1041/607/1025 -f 1041/607/1025 1058/623/1040 1057/622/1039 -f 1058/623/1040 1041/607/1025 1038/605/1022 -f 1038/605/1022 1059/624/1041 1058/623/1040 -f 1059/624/1041 1038/605/1022 1036/603/1020 -f 1036/603/1020 1060/625/1042 1059/624/1041 -f 1047/613/1030 1061/574/1043 1062/575/885 -f 1061/574/1043 1047/613/1030 1050/616/1033 -f 1050/616/1033 1063/626/1044 1061/574/1043 -f 1063/626/1044 1050/616/1033 1052/618/1035 -f 1063/626/1044 1052/618/1035 1064/572/1045 -f 1053/619/1036 1064/572/1045 1052/618/1035 -f 953/542/939 951/544/937 1065/576/1046 -f 1065/576/1046 955/540/941 953/542/939 -f 955/540/941 1065/576/1046 1062/575/885 -f 1062/575/885 957/538/943 955/540/941 -f 1062/575/885 1061/574/1043 957/538/943 -f 1061/574/1043 959/536/945 957/538/943 -f 959/536/945 1061/574/1043 1063/626/1044 -f 959/536/945 1063/626/1044 961/559/947 -f 961/559/947 1063/626/1044 1064/572/1045 -f 1066/571/1047 961/559/947 1064/572/1045 -f 961/559/947 1066/571/1047 963/534/949 -f 1067/570/1048 963/534/949 1066/571/1047 -f 1026/588/1010 1027/587/1011 1068/586/1049 -f 1069/627/1050 1068/586/1049 1027/587/1011 -f 1068/586/1049 1069/627/1050 1070/628/1051 -f 1071/582/1052 1070/628/1051 1069/627/1050 -f 1070/628/1051 1071/582/1052 1072/581/1053 -f 1072/581/1053 1071/582/1052 1073/581/1054 -f 1073/581/1054 1071/582/1052 1074/579/1055 -f 1073/581/1054 1074/579/1055 1075/580/1056 -f 1076/578/1057 1075/580/1056 1074/579/1055 -f 1075/580/1056 1076/578/1057 1077/583/1058 -f 949/555/935 1077/583/1058 1076/578/1057 -f 1076/578/1057 951/544/937 949/555/935 -f 951/544/937 1076/578/1057 1078/577/1059 -f 1078/577/1059 1065/576/1046 951/544/937 -f 1065/576/1046 1078/577/1059 1079/629/1060 -f 1079/629/1060 1062/575/885 1065/576/1046 -f 1062/575/885 1079/629/1060 1048/614/1031 -f 1048/614/1031 1047/613/1030 1062/575/885 -f 1074/579/1055 1078/577/1059 1076/578/1057 -f 1078/577/1059 1074/579/1055 1080/630/1061 -f 1080/630/1061 1079/629/1060 1078/577/1059 -f 1079/629/1060 1080/630/1061 1081/631/1062 -f 1081/631/1062 1048/614/1031 1079/629/1060 -f 1081/631/1062 1082/624/1063 1048/614/1031 -f 1082/624/1063 1049/615/1032 1048/614/1031 -f 1049/615/1032 1082/624/1063 1083/623/1064 -f 1083/623/1064 1051/617/1034 1049/615/1032 -f 1051/617/1034 1083/623/1064 1084/622/1065 -f 1084/622/1065 1046/612/1029 1051/617/1034 -f 1084/622/1065 1044/610/1028 1046/612/1029 -f 1084/622/1065 1085/607/1066 1044/610/1028 -f 1043/609/1027 1044/610/1028 1085/607/1066 -f 1085/607/1066 1086/606/1067 1043/609/1027 -f 1042/608/1026 1043/609/1027 1086/606/1067 -f 1086/606/1067 1029/597/1013 1042/608/1026 -f 1030/598/1014 1042/608/1026 1029/597/1013 -f 1087/603/1068 1082/624/1063 1081/631/1062 -f 1088/605/1069 1083/623/1064 1082/624/1063 -f 1082/624/1063 1087/603/1068 1088/605/1069 -f 1089/604/1070 1088/605/1069 1087/603/1068 -f 1087/603/1068 1090/601/1071 1089/604/1070 -f 1090/601/1071 1087/603/1068 1091/602/1072 -f 1091/602/1072 1087/603/1068 1081/631/1062 -f 1091/602/1072 1081/631/1062 1080/630/1061 -f 1092/600/1073 1089/604/1070 1090/601/1071 -f 1085/607/1066 1084/622/1065 1083/623/1064 -f 1083/623/1064 1088/605/1069 1085/607/1066 -f 1086/606/1067 1085/607/1066 1088/605/1069 -f 1088/605/1069 1089/604/1070 1086/606/1067 -f 1029/597/1013 1086/606/1067 1089/604/1070 -f 1089/604/1070 1092/600/1073 1029/597/1013 -f 1028/596/1012 1029/597/1013 1092/600/1073 -f 1092/600/1073 1025/595/1009 1028/596/1012 -f 1025/595/1009 1092/600/1073 1027/587/1011 -f 1090/601/1071 1027/587/1011 1092/600/1073 -f 1027/587/1011 1090/601/1071 1069/627/1050 -f 1091/602/1072 1069/627/1050 1090/601/1071 -f 1069/627/1050 1091/602/1072 1071/582/1052 -f 1080/630/1061 1071/582/1052 1091/602/1072 -f 1071/582/1052 1080/630/1061 1074/579/1055 -f 1035/602/1019 1060/625/1042 1036/603/1020 -f 1035/602/1019 1093/630/1074 1060/625/1042 -f 1093/630/1074 1035/602/1019 1008/582/992 -f 1008/582/992 1005/579/989 1093/630/1074 -f 1003/577/987 1093/630/1074 1005/579/989 -f 1093/630/1074 1003/577/987 1094/632/985 -f 1002/576/986 1094/632/985 1003/577/987 -f 1094/632/985 1002/576/986 1001/575/985 -f 1001/575/985 1095/614/1075 1094/632/985 -f 1095/614/1075 1001/575/985 1096/613/1076 -f 1096/613/1076 1097/615/1077 1095/614/1075 -f 1097/615/1077 1096/613/1076 1098/616/1078 -f 1098/616/1078 1099/617/1079 1097/615/1077 -f 1099/617/1079 1098/616/1078 1100/618/1080 -f 1100/618/1080 1056/612/1038 1099/617/1079 -f 1100/618/1080 1101/619/1081 1056/612/1038 -f 1102/620/1082 1056/612/1038 1101/619/1081 -f 1102/620/1082 1055/621/1027 1056/612/1038 -f 1094/632/985 1060/625/1042 1093/630/1074 -f 1060/625/1042 1094/632/985 1095/614/1075 -f 1059/624/1041 1060/625/1042 1095/614/1075 -f 1059/624/1041 1095/614/1075 1097/615/1077 -f 1097/615/1077 1058/623/1040 1059/624/1041 -f 1058/623/1040 1097/615/1077 1099/617/1079 -f 1099/617/1079 1057/622/1039 1058/623/1040 -f 1057/622/1039 1099/617/1079 1056/612/1038 -f 1103/633/1083 1104/634/1084 1105/635/1085 -f 1105/635/1085 1106/636/1086 1103/633/1083 -f 1106/636/1086 1105/635/1085 1107/637/1087 -f 1107/637/1087 1108/638/1088 1106/636/1086 -f 1109/639/1089 1106/636/1086 1108/638/1088 -f 1108/638/1088 1110/640/1090 1109/639/1089 -f 1111/641/1013 1109/639/1089 1110/640/1090 -f 1111/641/1013 1112/642/1091 1109/639/1089 -f 1112/642/1091 1113/643/1092 1109/639/1089 -f 1112/642/1091 1114/644/1093 1113/643/1092 -f 1114/644/1093 1115/645/1094 1113/643/1092 -f 1103/633/1083 1113/643/1092 1115/645/1094 -f 1115/645/1094 1116/646/1095 1103/633/1083 -f 1104/634/1084 1103/633/1083 1116/646/1095 -f 1116/646/1095 1117/647/1096 1104/634/1084 -f 1118/648/1097 1104/634/1084 1117/647/1096 -f 1117/647/1096 836/649/1098 1118/648/1097 -f 842/650/1099 1118/648/1097 836/649/1098 -f 1113/643/1092 1103/633/1083 1106/636/1086 -f 1106/636/1086 1109/639/1089 1113/643/1092 -f 842/650/1099 840/651/1100 1118/648/1097 -f 1119/652/1101 1118/648/1097 840/651/1100 -f 1119/652/1101 1120/653/1102 1118/648/1097 -f 1120/653/1102 1119/652/1101 1121/654/749 -f 1121/654/749 1122/655/1103 1120/653/1102 -f 1105/635/1085 1120/653/1102 1122/655/1103 -f 1122/655/1103 1107/637/1087 1105/635/1085 -f 1123/656/1104 1121/654/749 1119/652/1101 -f 1124/657/1105 1125/658/1106 1126/659/1107 -f 1127/660/1108 1126/659/1107 1125/658/1106 -f 1126/659/1107 1127/660/1108 1128/661/1109 -f 1129/662/1110 1128/661/1109 1127/660/1108 -f 1128/661/1109 1129/662/1110 1130/659/1111 -f 1131/660/1112 1130/659/1111 1129/662/1110 -f 1130/659/1111 1131/660/1112 1132/657/1113 -f 1133/658/1114 1132/657/1113 1131/660/1112 -f 1132/657/1113 1133/658/1114 1134/663/1115 -f 1135/664/1116 1134/663/1115 1133/658/1114 -f 1134/663/1115 1135/664/1116 1124/657/1105 -f 1125/658/1106 1124/657/1105 1135/664/1116 -f 1135/664/1116 1136/665/1117 1125/658/1106 -f 1137/666/1118 1125/658/1106 1136/665/1117 -f 1125/658/1106 1137/666/1118 1127/660/1108 -f 1138/667/1119 1127/660/1108 1137/666/1118 -f 1127/660/1108 1138/667/1119 1129/662/1110 -f 1139/668/1120 1129/662/1110 1138/667/1119 -f 1129/662/1110 1139/668/1120 1131/660/1112 -f 1140/667/1121 1131/660/1112 1139/668/1120 -f 1131/660/1112 1140/667/1121 1133/658/1114 -f 1141/666/1122 1133/658/1114 1140/667/1121 -f 1133/658/1114 1141/666/1122 1135/664/1116 -f 1136/665/1117 1135/664/1116 1141/666/1122 -f 1142/669/1123 1143/670/1124 1144/671/1125 -f 1145/672/1126 1144/671/1125 1143/670/1124 -f 1144/671/1125 1145/672/1126 1146/673/1127 -f 1147/674/1128 1146/673/1127 1145/672/1126 -f 1146/673/1127 1147/674/1128 1148/675/898 -f 1148/675/898 1149/676/1129 1146/673/1127 -f 1148/675/898 884/651/1130 1149/676/1129 -f 888/650/1131 1149/676/1129 884/651/1130 -f 888/650/1131 858/649/1132 1149/676/1129 -f 1150/677/1133 1149/676/1129 858/649/1132 -f 1149/676/1129 1150/677/1133 1151/678/1134 -f 1152/679/1135 1151/678/1134 1150/677/1133 -f 1151/678/1134 1152/679/1135 1153/680/1136 -f 1154/681/1137 1153/680/1136 1152/679/1135 -f 1153/680/1136 1154/681/1137 1155/682/1138 -f 1156/683/1139 1155/682/1138 1154/681/1137 -f 1156/683/1139 1157/684/1140 1155/682/1138 -f 1157/684/1140 1158/685/1141 1155/682/1138 -f 1159/686/1142 1148/675/898 1147/674/1128 -f 1157/684/1140 1160/687/1023 1158/685/1141 -f 1160/687/1023 1161/688/1143 1158/685/1141 -f 1162/689/1144 1158/685/1141 1161/688/1143 -f 1161/688/1143 1163/690/1145 1162/689/1144 -f 1164/691/1146 1162/689/1144 1163/690/1145 -f 1151/678/1134 1146/673/1127 1149/676/1129 -f 1146/673/1127 1151/678/1134 1144/671/1125 -f 1153/680/1136 1144/671/1125 1151/678/1134 -f 1144/671/1125 1153/680/1136 1142/669/1123 -f 1155/682/1138 1142/669/1123 1153/680/1136 -f 1142/669/1123 1155/682/1138 1158/685/1141 -f 1158/685/1141 1162/689/1144 1142/669/1123 -f 1143/670/1124 1142/669/1123 1162/689/1144 -f 804/439/795 757/438/749 754/435/746 -f 804/439/795 813/449/804 757/438/749 -f 769/448/761 757/438/749 813/449/804 -f 813/449/804 855/457/844 769/448/761 -f 855/457/844 813/449/804 814/456/805 -f 814/456/805 1165/493/1147 855/457/844 -f 1165/493/1147 814/456/805 815/470/806 -f 815/470/806 1166/468/1148 1165/493/1147 -f 1166/468/1148 815/470/806 816/469/807 -f 816/469/807 1167/478/1149 1166/468/1148 -f 1167/478/1149 816/469/807 817/474/808 -f 817/474/808 1168/477/1150 1167/478/1149 -f 1168/477/1150 817/474/808 818/476/809 -f 818/476/809 867/515/669 1168/477/1150 -f 818/476/809 819/477/810 867/515/669 -f 1169/514/1151 867/515/669 819/477/810 -f 819/477/810 821/479/812 1169/514/1151 -f 1170/513/1152 1169/514/1151 821/479/812 -f 1169/514/1151 824/482/815 867/515/669 -f 1169/514/1151 1170/513/1152 824/482/815 -f 825/483/816 824/482/815 1170/513/1152 -f 821/479/812 823/481/814 1170/513/1152 -f 831/489/822 1170/513/1152 823/481/814 -f 1170/513/1152 831/489/822 825/483/816 -f 829/487/820 825/483/816 831/489/822 -f 1171/667/1153 1172/668/1154 1173/660/1155 -f 1173/660/1155 1174/658/1156 1171/667/1153 -f 1174/658/1156 1173/660/1155 1175/657/1157 -f 1175/657/1157 1176/663/1158 1174/658/1156 -f 1177/664/1159 1174/658/1156 1176/663/1158 -f 1176/663/1158 1178/657/1160 1177/664/1159 -f 1179/658/1161 1177/664/1159 1178/657/1160 -f 1178/657/1160 1180/659/1162 1179/658/1161 -f 1181/660/1163 1179/658/1161 1180/659/1162 -f 1180/659/1162 1182/661/1164 1181/660/1163 -f 1183/662/1165 1181/660/1163 1182/661/1164 -f 1182/661/1164 1184/659/1166 1183/662/1165 -f 1173/660/1155 1183/662/1165 1184/659/1166 -f 1184/659/1166 1175/657/1157 1173/660/1155 -f 1183/662/1165 1173/660/1155 1172/668/1154 -f 1172/668/1154 1185/667/1167 1183/662/1165 -f 1181/660/1163 1183/662/1165 1185/667/1167 -f 1185/667/1167 1186/666/1168 1181/660/1163 -f 1179/658/1161 1181/660/1163 1186/666/1168 -f 1186/666/1168 1187/665/1169 1179/658/1161 -f 1177/664/1159 1179/658/1161 1187/665/1169 -f 1187/665/1169 1188/666/1170 1177/664/1159 -f 1174/658/1156 1177/664/1159 1188/666/1170 -f 1188/666/1170 1171/667/1153 1174/658/1156 -f 991/692/1171 1189/693/1172 992/694/1173 -f 1190/695/1174 992/694/1173 1189/693/1172 -f 992/694/1173 1190/695/1174 993/696/1175 -f 1191/697/1176 993/696/1175 1190/695/1174 -f 993/696/1175 1191/697/1176 994/698/1177 -f 1192/699/1177 994/698/1177 1191/697/1176 -f 994/698/1177 1192/699/1177 1193/700/1178 -f 1194/701/1179 1193/700/1178 1192/699/1177 -f 1194/701/1179 1195/702/1180 1193/700/1178 -f 1196/677/1181 1193/700/1178 1195/702/1180 -f 1195/702/1180 1197/703/1182 1196/677/1181 -f 954/704/1183 1196/677/1181 1197/703/1182 -f 1197/703/1182 1198/705/1184 954/704/1183 -f 966/706/1185 954/704/1183 1198/705/1184 -f 695/397/1186 1199/707/1187 1200/708/1188 -f 1201/709/1187 1200/708/1188 1199/707/1187 -f 1199/707/1187 1202/710/1189 1201/709/1187 -f 1203/711/1190 1201/709/1187 1202/710/1189 -f 1202/710/1189 1204/712/1191 1203/711/1190 -f 1205/713/1192 1203/711/1190 1204/712/1191 -f 1204/712/1191 1206/714/1193 1205/713/1192 -f 1207/715/1194 1205/713/1192 1206/714/1193 -f 1207/715/1194 1206/714/1193 1208/716/1195 -f 1209/717/1196 1208/716/1195 1206/714/1193 -f 1208/716/1195 1209/717/1196 1210/718/1197 -f 1211/719/1198 1210/718/1197 1209/717/1196 -f 1211/719/1198 1212/720/1199 1210/718/1197 -f 1213/721/1200 1210/718/1197 1212/720/1199 -f 1213/721/1200 1214/722/1201 1210/718/1197 -f 1208/716/1195 1210/718/1197 1214/722/1201 -f 1215/723/1202 1216/724/1202 1217/415/1203 -f 1218/724/1204 1217/415/1203 1216/724/1202 -f 1217/415/1203 1218/724/1204 1219/725/1205 -f 1219/725/1205 1218/724/1204 1220/726/1206 -f 1218/724/1204 1221/409/1207 1220/726/1206 -f 1220/726/1206 1221/409/1207 1222/727/1208 -f 1223/405/1208 1222/727/1208 1221/409/1207 -f 960/382/946 995/388/979 958/537/944 -f 995/388/979 956/558/942 958/537/944 -f 956/558/942 995/388/979 1196/728/1209 -f 1196/728/1209 954/541/940 956/558/942 -f 1193/729/1210 995/388/979 994/554/978 -f 1193/729/1210 1196/728/1209 995/388/979 -f 1224/730/1211 1225/391/624 1226/730/1211 -f 1227/391/624 1226/730/1211 1225/391/624 -f 1225/391/624 1228/374/623 1227/391/624 -f 1229/374/623 1227/391/624 1228/374/623 -f 1228/374/623 1230/731/1211 1229/374/623 -f 1231/731/1211 1229/374/623 1230/731/1211 -f 1232/728/1212 930/539/915 932/541/917 -f 930/539/915 1232/728/1212 945/388/931 -f 1233/729/1213 945/388/931 1232/728/1212 -f 1233/729/1213 944/554/930 945/388/931 -f 972/732/1214 1212/720/1214 932/733/1215 -f 1211/719/1216 932/733/1215 1212/720/1214 -f 932/733/1215 1211/719/1216 1232/734/1217 -f 1209/717/1218 1232/734/1217 1211/719/1216 -f 1232/734/1217 1209/717/1218 1233/735/1219 -f 1206/714/1220 1233/735/1219 1209/717/1218 -f 1206/714/1220 1204/712/1221 1233/735/1219 -f 944/736/1222 1233/735/1219 1204/712/1221 -f 1204/712/1221 1202/710/1223 944/736/1222 -f 943/737/1224 944/736/1222 1202/710/1223 -f 1202/710/1223 1199/707/1225 943/737/1224 -f 942/738/1226 943/737/1224 1199/707/1225 -f 1199/707/1225 695/397/1227 942/738/1226 -f 694/396/1228 942/738/1226 695/397/1227 -f 1096/613/1076 1001/575/985 1000/574/984 -f 1000/574/984 1098/616/1078 1096/613/1076 -f 1098/616/1078 1000/574/984 999/573/983 -f 999/573/983 1100/618/1080 1098/616/1078 -f 999/573/983 998/572/982 1100/618/1080 -f 1101/619/1081 1100/618/1080 998/572/982 -f 1178/739/1229 1176/740/1229 1180/741/1229 -f 1176/740/1229 1184/742/1229 1180/741/1229 -f 1175/743/1229 1184/742/1229 1176/740/1229 -f 1180/741/1229 1184/742/1229 1182/744/1229 -f 1132/743/1230 1134/740/1230 1130/742/1230 -f 1134/740/1230 1126/741/1230 1130/742/1230 -f 1124/739/1230 1126/741/1230 1134/740/1230 -f 1130/742/1230 1126/741/1230 1128/744/1230 -f 857/502/846 855/457/844 1165/493/1147 -f 1165/493/1147 859/492/848 857/502/846 -f 859/492/848 1165/493/1147 1166/468/1148 -f 1166/468/1148 861/480/850 859/492/848 -f 861/480/850 1166/468/1148 1167/478/1149 -f 1167/478/1149 863/479/852 861/480/850 -f 863/479/852 1167/478/1149 1168/477/1150 -f 1168/477/1150 865/514/854 863/479/852 -f 865/514/854 1168/477/1150 867/515/669 -f 1234/745/1231 1235/746/1232 1236/747/1233 -f 1237/748/1234 1236/747/1233 1235/746/1232 -f 1236/747/1233 1237/748/1234 1238/749/1235 -f 1239/750/1236 1238/749/1235 1237/748/1234 -f 1237/748/1234 1240/751/1237 1239/750/1236 -f 1241/752/1238 1239/750/1236 1240/751/1237 -f 1240/751/1237 1242/753/670 1241/752/1238 -f 1243/754/1239 1241/752/1238 1242/753/670 -f 1242/753/670 1244/755/1240 1243/754/1239 -f 1245/756/1241 1243/754/1239 1244/755/1240 -f 1244/755/1240 1246/757/1242 1245/756/1241 -f 1244/755/1240 1247/758/1243 1246/757/1242 -f 1248/759/1244 1246/757/1242 1247/758/1243 -f 1247/758/1243 1249/760/1245 1248/759/1244 -f 1250/761/1246 1248/759/1244 1249/760/1245 -f 1249/760/1245 1251/762/1247 1250/761/1246 -f 1252/763/1248 1250/761/1246 1251/762/1247 -f 1252/763/1248 1251/762/1247 1253/764/1249 -f 1249/760/1245 1254/765/1250 1251/762/1247 -f 1247/758/1243 1255/766/1251 1249/760/1245 -f 1254/765/1250 1249/760/1245 1255/766/1251 -f 1255/766/1251 1256/767/1252 1254/765/1250 -f 1244/755/1240 1242/753/670 1247/758/1243 -f 1255/766/1251 1247/758/1243 1242/753/670 -f 1242/753/670 1240/751/1237 1255/766/1251 -f 1256/767/1252 1255/766/1251 1240/751/1237 -f 1240/751/1237 1237/748/1234 1256/767/1252 -f 1235/746/1232 1256/767/1252 1237/748/1234 -f 1256/767/1252 1235/746/1232 1257/768/1253 -f 1257/768/1253 1254/765/1250 1256/767/1252 -f 1254/765/1250 1257/768/1253 1258/769/672 -f 1258/769/672 1251/762/1247 1254/765/1250 -f 1251/762/1247 1258/769/672 1259/770/1254 -f 1259/770/1254 1253/764/1249 1251/762/1247 -f 1259/770/1254 1260/762/1255 1253/764/1249 -f 1261/763/1256 1253/764/1249 1260/762/1255 -f 1261/763/1256 1260/762/1255 1262/761/1257 -f 1262/761/1257 1263/771/1258 1261/763/1256 -f 1263/771/1258 1262/761/1257 1264/772/1259 -f 1264/772/1259 1265/773/1260 1263/771/1258 -f 1266/774/1261 1259/770/1254 1258/769/672 -f 1267/775/1262 1257/768/1253 1235/746/1232 -f 1257/768/1253 1267/775/1262 1268/776/1263 -f 1268/776/1263 1258/769/672 1257/768/1253 -f 1258/769/672 1268/776/1263 1266/774/1261 -f 1269/777/1254 1266/774/1261 1268/776/1263 -f 1269/777/1254 1270/776/1264 1266/774/1261 -f 1271/769/1265 1266/774/1261 1270/776/1264 -f 1266/774/1261 1271/769/1265 1259/770/1254 -f 1260/762/1255 1259/770/1254 1271/769/1265 -f 1272/778/1266 1268/776/1263 1267/775/1262 -f 700/779/1267 702/780/1268 1272/778/1266 -f 703/781/1269 1272/778/1266 702/780/1268 -f 703/781/1269 705/782/1270 1272/778/1266 -f 705/782/1270 708/781/1271 1273/778/1272 -f 708/781/1271 710/780/1273 1273/778/1272 -f 711/779/1274 1273/778/1272 710/780/1273 -f 1274/745/1275 1275/747/1276 1276/746/1277 -f 1277/748/1278 1276/746/1277 1275/747/1276 -f 1276/746/1277 1277/748/1278 1278/767/1279 -f 1279/751/1280 1278/767/1279 1277/748/1278 -f 1278/767/1279 1279/751/1280 1280/766/1281 -f 1281/753/1282 1280/766/1281 1279/751/1280 -f 1280/766/1281 1281/753/1282 1282/758/1283 -f 1283/783/1284 1282/758/1283 1281/753/1282 -f 1283/783/1284 1284/757/1285 1282/758/1283 -f 1285/759/1285 1282/758/1283 1284/757/1285 -f 1284/757/1285 1286/784/1286 1285/759/1285 -f 1264/772/1259 1285/759/1285 1286/784/1286 -f 1285/759/1285 1264/772/1259 1262/761/1257 -f 1262/761/1257 1287/760/1287 1285/759/1285 -f 1287/760/1287 1262/761/1257 1260/762/1255 -f 1287/760/1287 1260/762/1255 1288/765/1277 -f 1271/769/1265 1288/765/1277 1260/762/1255 -f 1288/765/1277 1271/769/1265 1289/768/1288 -f 1270/776/1264 1289/768/1288 1271/769/1265 -f 1289/768/1288 1270/776/1264 1290/775/1289 -f 1273/778/1272 1290/775/1289 1270/776/1264 -f 1290/775/1289 1276/746/1277 1289/768/1288 -f 1278/767/1279 1289/768/1288 1276/746/1277 -f 1289/768/1288 1278/767/1279 1288/765/1277 -f 1280/766/1281 1288/765/1277 1278/767/1279 -f 1288/765/1277 1280/766/1281 1287/760/1287 -f 1282/758/1283 1287/760/1287 1280/766/1281 -f 1282/758/1283 1285/759/1285 1287/760/1287 -f 1253/764/1249 1291/785/1290 1252/763/1248 -f 1253/764/1249 1261/763/1256 1291/785/1290 -f 1292/786/1291 1291/785/1290 1261/763/1256 -f 1292/786/1291 1261/763/1256 1263/771/1258 -f 1292/786/1291 1263/771/1258 971/787/1292 -f 1265/773/1260 971/787/1292 1263/771/1258 -f 971/787/1292 1265/773/1260 972/787/1293 -f 1212/788/1294 972/787/1293 1265/773/1260 -f 1264/772/1259 1212/788/1294 1265/773/1260 -f 1212/788/1294 1264/772/1259 1213/789/1295 -f 1264/772/1259 1286/784/1286 1213/789/1295 -f 1214/790/1296 1213/789/1295 1286/784/1286 -f 1293/791/1297 1245/756/1241 1246/757/1242 -f 1293/791/1297 1246/757/1242 1294/784/1298 -f 1246/757/1242 1248/759/1244 1294/784/1298 -f 1295/792/1299 1294/784/1298 1248/759/1244 -f 1248/759/1244 1250/761/1246 1295/792/1299 -f 1296/771/1300 1295/792/1299 1250/761/1246 -f 1250/761/1246 1252/763/1248 1296/771/1300 -f 1297/786/1301 1296/771/1300 1252/763/1248 -f 1297/786/1301 1252/763/1248 1291/785/1290 -f 1291/785/1290 969/793/1302 1297/786/1301 -f 1291/785/1290 1292/786/1291 969/793/1302 -f 973/794/1303 969/793/1302 1292/786/1291 -f 1292/786/1291 971/787/1292 973/794/1303 -f 1298/773/1304 1295/792/1299 1296/771/1300 -f 1299/795/1305 1293/791/1297 1300/790/1306 -f 1294/784/1298 1300/790/1306 1293/791/1297 -f 1300/790/1306 1294/784/1298 1301/789/1307 -f 1295/792/1299 1301/789/1307 1294/784/1298 -f 1295/792/1299 1198/788/1308 1301/789/1307 -f 1198/788/1308 1295/792/1299 1298/773/1304 -f 1198/788/1308 1298/773/1304 966/787/1309 -f 967/796/1310 966/787/1309 1298/773/1304 -f 1298/773/1304 1296/771/1300 967/796/1310 -f 1297/786/1301 967/796/1310 1296/771/1300 -f 967/796/1310 1297/786/1301 968/794/1311 -f 968/794/1311 1297/786/1301 969/793/1302 -f 1268/776/1312 1272/778/1313 1269/777/1314 -f 705/782/1315 1269/777/1314 1272/778/1313 -f 705/782/1315 1273/778/1316 1269/777/1314 -f 1270/776/1317 1269/777/1314 1273/778/1316 -f 1235/746/1318 1234/745/1319 1267/775/1320 -f 700/779/1321 1267/775/1320 1234/745/1319 -f 700/779/1321 1272/778/1313 1267/775/1320 -f 1273/778/1316 711/779/1322 1290/775/1323 -f 711/779/1322 1274/745/1324 1290/775/1323 -f 1276/746/1325 1290/775/1323 1274/745/1324 -f 1120/653/1102 1105/635/1085 1104/634/1084 -f 1104/634/1084 1118/648/1097 1120/653/1102 -f 1192/699/1326 1302/797/1327 1194/701/897 -f 1303/798/649 1194/701/897 1302/797/1327 -f 1302/797/1327 1304/799/1328 1303/798/649 -f 1305/800/1329 1303/798/649 1304/799/1328 -f 1303/798/649 1305/800/1329 1306/801/1330 -f 1307/802/1331 1306/801/1330 1305/800/1329 -f 1306/801/1330 1307/802/1331 1308/803/1332 -f 1308/803/1332 1307/802/1331 1301/804/1333 -f 1301/804/1333 1198/705/1334 1308/803/1332 -f 1197/703/1335 1308/803/1332 1198/705/1334 -f 1197/703/1335 1195/702/1336 1308/803/1332 -f 1306/801/1330 1308/803/1332 1195/702/1336 -f 1195/702/1336 1194/701/897 1306/801/1330 -f 1303/798/649 1306/801/1330 1194/701/897 -f 1299/805/1337 1300/806/1338 1307/802/1331 -f 1307/802/1331 1300/806/1338 1301/804/1333 -f 1304/799/1328 1302/797/1327 1309/807/1339 -f 1310/808/1340 1309/807/1339 1302/797/1327 -f 1302/797/1327 1192/699/1326 1310/808/1340 -f 1191/697/1341 1310/808/1340 1192/699/1326 -f 1310/808/1340 1191/697/1341 1311/809/1342 -f 1190/695/1343 1311/809/1342 1191/697/1341 -f 1311/809/1342 1190/695/1343 1312/810/1344 -f 1189/693/1345 1312/810/1344 1190/695/1343 -f 1312/810/1344 1313/811/1346 1311/809/1342 -f 1314/812/1346 1311/809/1342 1313/811/1346 -f 1311/809/1342 1314/812/1346 1310/808/1340 -f 1309/807/1339 1310/808/1340 1314/812/1346 -f 1315/813/1347 1316/402/1347 1215/725/1347 -f 1216/814/1347 1215/725/1347 1316/402/1347 -f 1317/723/1348 1318/724/1348 1319/415/1349 -f 1320/724/1350 1319/415/1349 1318/724/1348 -f 1319/415/1349 1320/724/1350 1321/725/1351 -f 1321/725/1351 1320/724/1350 1322/726/1352 -f 1320/724/1350 1323/409/1353 1322/726/1352 -f 1322/726/1352 1323/409/1353 1315/727/1354 -f 1316/405/1354 1315/727/1354 1323/409/1353 -f 1222/404/1355 1223/416/1355 1317/814/1355 -f 1318/725/1355 1317/814/1355 1223/416/1355 -f 1324/815/1356 1325/816/1356 1326/817/1357 -f 1327/818/1358 1326/817/1357 1325/816/1356 -f 1326/817/1357 1327/818/1358 1328/819/1359 -f 1329/820/1360 1328/819/1359 1327/818/1358 -f 1328/819/1359 1329/820/1360 1330/821/1361 -f 1331/822/1361 1330/821/1361 1329/820/1360 -f 1332/823/1362 1333/824/1363 1334/825/1362 -f 1335/826/1364 1334/825/1362 1333/824/1363 -f 1333/824/1363 1336/827/1365 1335/826/1364 -f 1337/828/1366 1335/826/1364 1336/827/1365 -f 1336/827/1365 1338/829/1367 1337/828/1366 -f 1339/830/1367 1337/828/1366 1338/829/1367 -f 1339/831/1368 1338/832/1368 1324/833/1368 -f 1325/834/1368 1324/833/1368 1338/832/1368 -f 1338/829/1369 1336/827/1369 1325/816/1369 -f 1327/818/1369 1325/816/1369 1336/827/1369 -f 1336/827/1369 1333/824/1369 1327/818/1369 -f 1329/820/1369 1327/818/1369 1333/824/1369 -f 1333/824/1369 1332/823/1369 1329/820/1369 -f 1331/822/1369 1329/820/1369 1332/823/1369 -f 1332/832/1370 1334/831/1370 1331/834/1370 -f 1330/833/1370 1331/834/1370 1334/831/1370 -f 1340/668/1154 1341/667/1167 1342/662/1165 -f 1342/662/1165 1343/660/1155 1340/668/1154 -f 1343/660/1155 1342/662/1165 1344/659/1166 -f 1344/659/1166 1345/657/1157 1343/660/1155 -f 1346/658/1156 1343/660/1155 1345/657/1157 -f 1345/657/1157 1347/663/1158 1346/658/1156 -f 1348/664/1159 1346/658/1156 1347/663/1158 -f 1347/663/1158 1349/657/1160 1348/664/1159 -f 1350/658/1161 1348/664/1159 1349/657/1160 -f 1349/657/1160 1351/659/1162 1350/658/1161 -f 1352/660/1163 1350/658/1161 1351/659/1162 -f 1351/659/1162 1353/661/1164 1352/660/1163 -f 1342/662/1165 1352/660/1163 1353/661/1164 -f 1353/661/1164 1344/659/1166 1342/662/1165 -f 1352/660/1163 1342/662/1165 1341/667/1167 -f 1341/667/1167 1354/666/1168 1352/660/1163 -f 1350/658/1161 1352/660/1163 1354/666/1168 -f 1354/666/1168 1355/665/1169 1350/658/1161 -f 1348/664/1159 1350/658/1161 1355/665/1169 -f 1355/665/1169 1356/666/1170 1348/664/1159 -f 1346/658/1156 1348/664/1159 1356/666/1170 -f 1356/666/1170 1357/667/1153 1346/658/1156 -f 1343/660/1155 1346/658/1156 1357/667/1153 -f 1357/667/1153 1340/668/1154 1343/660/1155 -f 1349/739/1229 1347/740/1229 1351/741/1229 -f 1347/740/1229 1344/742/1229 1351/741/1229 -f 1345/743/1229 1344/742/1229 1347/740/1229 -f 1351/741/1229 1344/742/1229 1353/744/1229 -f 1358/731/1119 1359/374/1371 1360/835/1372 -f 1361/392/1371 1360/835/1372 1359/374/1371 -f 1360/731/1373 1361/374/1374 1362/835/838 -f 1363/392/1375 1362/835/838 1361/374/1374 -f 1362/731/1376 1363/374/1377 1364/835/1376 -f 1365/392/1378 1364/835/1376 1363/374/1377 -f 1364/731/1379 1365/374/1380 1358/835/1379 -f 1359/392/1381 1358/835/1379 1365/374/1380 -f 1366/392/1382 1367/374/1382 1368/835/1383 -f 1369/731/1119 1368/835/1383 1367/374/1382 -f 1370/392/1384 1366/374/1384 1371/835/867 -f 1368/731/867 1371/835/867 1366/374/1384 -f 1372/392/1385 1370/374/1385 1373/835/1386 -f 1371/731/1376 1373/835/1386 1370/374/1385 -f 1367/392/1387 1372/374/1387 1369/835/1388 -f 1373/731/1389 1369/835/1388 1372/374/1387 -f 904/836/1390 917/837/1390 906/836/1390 -f 917/837/1390 898/836/1390 906/836/1390 -f 898/836/1390 902/836/1390 906/836/1390 -f 906/836/1390 902/836/1390 910/836/1390 -f 918/835/1390 826/731/1390 913/835/1390 -f 913/835/1390 826/731/1390 914/393/1390 -f 914/393/1390 826/731/1390 845/838/1390 -f 916/837/1390 914/393/1390 845/838/1390 -f 847/837/1390 916/837/1390 845/838/1390 -f 916/837/1390 847/837/1390 917/837/1390 -f 847/837/1390 898/836/1390 917/837/1390 -f 849/837/1390 898/836/1390 847/837/1390 -f 915/839/1390 914/393/1390 916/837/1390 -f 912/840/1390 913/835/1390 914/393/1390 -f 1374/550/1391 1375/841/1391 1376/550/1391 -f 1377/841/1391 1376/550/1391 1375/841/1391 -f 1376/415/1392 1377/724/1392 1378/416/1392 -f 1379/404/1392 1378/416/1392 1377/724/1392 -f 1378/416/1393 1379/404/1393 1380/727/1393 -f 1381/405/1393 1380/727/1393 1379/404/1393 -f 1382/415/1394 1383/724/1394 1384/725/1394 -f 1385/814/1394 1384/725/1394 1383/724/1394 -f 1384/725/1395 1385/814/1395 1374/727/1395 -f 1375/405/1395 1374/727/1395 1385/814/1395 -f 1377/842/1396 1375/842/1396 1379/726/1396 -f 1385/727/1396 1379/726/1396 1375/842/1396 -f 1385/727/1396 1383/405/1396 1379/726/1396 -f 1381/404/1396 1379/726/1396 1383/405/1396 -f 1380/404/1397 1382/405/1397 1378/726/1397 -f 1384/727/1397 1378/726/1397 1382/405/1397 -f 1384/727/1397 1374/842/1397 1378/726/1397 -f 1376/843/1397 1378/726/1397 1374/842/1397 -f 734/414/726 1386/431/1398 732/426/724 -f 1387/430/1399 732/426/724 1386/431/1398 -f 732/426/724 1387/430/1399 736/427/728 -f 1388/429/1400 736/427/728 1387/430/1399 -f 736/427/728 1388/429/1400 738/422/730 -f 741/428/733 738/422/730 1388/429/1400 -f 741/428/733 1388/429/1400 1389/844/1401 -f 741/428/733 1389/844/1401 742/429/734 -f 743/430/735 742/429/734 1389/844/1401 -f 1389/844/1401 1390/845/1402 743/430/735 -f 744/431/736 743/430/735 1390/845/1402 -f 744/431/736 1390/845/1402 745/432/737 -f 1391/846/1403 745/432/737 1390/845/1402 -f 1391/846/1403 773/450/765 745/432/737 -f 1391/846/1403 768/432/760 773/450/765 -f 767/447/759 773/450/765 768/432/760 -f 1387/430/1399 1389/844/1401 1388/429/1400 -f 1389/844/1401 1387/430/1399 1390/845/1402 -f 1386/431/1398 1390/845/1402 1387/430/1399 -f 1386/431/1398 768/432/760 1390/845/1402 -f 1386/431/1398 734/414/726 768/432/760 -f 1391/846/1403 1390/845/1402 768/432/760 -f 706/408/1404 721/417/1404 707/406/1404 -f 752/417/1404 706/408/1404 704/406/1404 -f 693/847/1405 695/848/1405 711/849/1405 -f 1274/850/1406 711/849/1406 695/848/1406 -f 858/851/1407 1392/852/1408 1150/853/1409 -f 858/851/1407 860/854/1410 1392/852/1408 -f 1393/855/1411 1392/852/1408 860/854/1410 -f 860/854/1410 870/856/1412 1393/855/1411 -f 1394/857/1413 1393/855/1411 870/856/1412 -f 1393/855/1411 1394/857/1413 1395/858/1205 -f 1396/859/1414 1395/858/1205 1394/857/1413 -f 1396/859/1414 1397/860/1415 1395/858/1205 -f 1398/861/1416 1395/858/1205 1397/860/1415 -f 1397/860/1415 1399/862/1417 1398/861/1416 -f 1400/863/1416 1398/861/1416 1399/862/1417 -f 1399/862/1417 1401/864/658 1400/863/1416 -f 1402/865/1418 1400/863/1416 1401/864/658 -f 1401/864/658 1161/866/1419 1402/865/1418 -f 1160/867/1420 1402/865/1418 1161/866/1419 -f 1402/865/1418 1160/867/1420 1157/868/1421 -f 1157/868/1421 1403/869/1422 1402/865/1418 -f 1403/869/1422 1157/868/1421 1156/870/1423 -f 1395/858/1205 1398/861/1416 1404/871/1424 -f 1405/872/1425 1404/871/1424 1398/861/1416 -f 1398/861/1416 1400/863/1416 1405/872/1425 -f 1403/869/1422 1405/872/1425 1400/863/1416 -f 1400/863/1416 1402/865/1418 1403/869/1422 -f 1156/870/1423 1154/873/1426 1403/869/1422 -f 1405/872/1425 1403/869/1422 1154/873/1426 -f 1154/873/1426 1152/874/1427 1405/872/1425 -f 1404/871/1424 1405/872/1425 1152/874/1427 -f 1152/874/1427 1150/853/1409 1404/871/1424 -f 1392/852/1408 1404/871/1424 1150/853/1409 -f 1404/871/1424 1392/852/1408 1395/858/1205 -f 1393/855/1411 1395/858/1205 1392/852/1408 -f 884/651/1428 1148/675/1428 872/875/1428 -f 1159/686/1428 872/875/1428 1148/675/1428 -f 949/555/1429 948/557/1430 1077/583/1431 -f 1406/876/1432 1077/583/1431 948/557/1430 -f 1406/876/1432 948/557/1430 1009/583/1433 -f 946/555/1434 1009/583/1433 948/557/1430 -f 1200/877/1435 1275/877/1435 695/878/1435 -f 1274/878/1436 695/878/1436 1275/877/1436 -f 870/856/1437 872/879/1437 1394/857/1437 -f 1159/857/1438 1394/857/1438 872/879/1438 -f 1011/830/1439 1013/829/1439 1010/880/1439 -f 1013/829/1439 1021/881/1439 1010/880/1439 -f 1017/882/1439 1021/881/1439 1013/829/1439 -f 1019/883/1439 1021/881/1439 1017/882/1439 -f 1015/884/1440 1017/882/1440 1013/829/1440 -f 1022/885/1441 1024/886/1441 1021/881/1441 -f 1024/886/1441 1068/887/1441 1021/881/1441 -f 1068/887/1441 1072/888/1441 1021/881/1441 -f 1070/889/1441 1072/888/1441 1068/887/1441 -f 1026/890/1441 1068/887/1441 1024/886/1441 -f 1021/881/1442 1072/888/1442 1010/880/1442 -f 1407/891/1443 1408/892/1444 1409/893/1445 -f 1407/891/1443 1409/893/1445 1110/866/1446 -f 1410/864/1447 1110/866/1446 1409/893/1445 -f 1410/864/1447 1411/865/1448 1110/866/1446 -f 1411/865/1448 1410/864/1447 1412/894/1449 -f 1412/894/1449 1413/869/1450 1411/865/1448 -f 1413/869/1450 1412/894/1449 1414/872/1451 -f 1414/872/1451 1115/873/1452 1413/869/1450 -f 1115/873/1452 1414/872/1451 1116/874/1453 -f 1415/871/1454 1116/874/1453 1414/872/1451 -f 1116/874/1453 1415/871/1454 1117/853/1455 -f 1416/852/1456 1117/853/1455 1415/871/1454 -f 1416/852/1456 836/851/1457 1117/853/1455 -f 836/851/1457 1416/852/1456 833/854/1458 -f 1417/855/1459 833/854/1458 1416/852/1456 -f 833/854/1458 1417/855/1459 832/856/1460 -f 1418/857/1461 832/856/1460 1417/855/1459 -f 1417/855/1459 1419/858/733 1418/857/1461 -f 1420/861/1462 1414/872/1451 1412/894/1449 -f 1414/872/1451 1420/861/1462 1415/871/1454 -f 1419/858/733 1415/871/1454 1420/861/1462 -f 1415/871/1454 1419/858/733 1416/852/1456 -f 1417/855/1459 1416/852/1456 1419/858/733 -f 1421/859/1302 1418/857/1461 1419/858/733 -f 1421/859/1302 1419/858/733 1422/860/1463 -f 1420/861/1462 1422/860/1463 1419/858/733 -f 1422/860/1463 1420/861/1462 1423/895/1464 -f 1412/894/1449 1423/895/1464 1420/861/1462 -f 1423/895/1464 1412/894/1449 1410/864/1447 -f 1114/870/1465 1413/869/1450 1115/873/1452 -f 1112/868/1466 1413/869/1450 1114/870/1465 -f 1112/868/1466 1411/865/1448 1413/869/1450 -f 1111/867/1467 1411/865/1448 1112/868/1466 -f 1111/867/1467 1110/866/1446 1411/865/1448 -f 1110/640/1090 1108/638/1088 1407/896/1468 -f 1408/897/1469 1407/896/1468 1108/638/1088 -f 991/692/1470 697/898/1470 1189/693/1470 -f 845/838/1390 826/731/1390 828/394/1390 -f 826/731/1390 827/899/1390 828/394/1390 -f 1007/900/766 1010/900/766 1073/901/766 -f 1072/901/766 1073/901/766 1010/900/766 -f 1234/902/1471 1189/903/1471 700/904/1471 -f 697/905/1472 700/904/1472 1189/903/1472 -f 1123/656/1473 1119/652/1473 838/875/1473 -f 840/651/1473 838/875/1473 1119/652/1473 -f 1424/906/1474 1425/907/1474 1426/908/1474 -f 1426/908/1475 1425/907/1475 1427/541/1475 -f 1425/907/1474 1428/909/1474 1427/541/1474 -f 1428/909/1475 1429/910/1475 1427/541/1475 -f 1313/911/1476 1312/912/1476 1238/913/1476 -f 1236/914/1476 1238/913/1476 1312/912/1476 -f 1234/914/1477 1236/914/1477 1189/912/1477 -f 1312/912/1478 1189/912/1478 1236/914/1478 -f 838/879/1479 832/856/1479 1123/857/1479 -f 1418/857/1480 1123/857/1480 832/856/1480 -f 1216/915/1442 1316/916/1442 1218/917/1442 -f 1323/918/1474 1320/919/1474 1316/916/1474 -f 1316/916/1475 1320/919/1475 1218/917/1475 -f 1223/920/1442 1221/921/1442 1318/922/1442 -f 1318/922/1439 1221/921/1439 1320/919/1439 -f 1320/919/1475 1221/921/1475 1218/917/1475 -f 1430/814/1481 1431/405/1481 1432/725/1481 -f 1433/406/1481 1432/725/1481 1431/405/1481 -f 1434/438/1482 1435/923/1482 1436/924/1482 -f 1437/925/1482 1436/924/1482 1435/923/1482 -f 1438/926/1483 1436/924/1483 1439/927/1483 -f 1437/925/1483 1439/927/1483 1436/924/1483 -f 1440/928/1484 1441/929/1484 1442/930/1484 -f 1441/929/1485 1438/926/1485 1442/930/1485 -f 1442/930/1485 1438/926/1485 1439/927/1485 -f 1007/931/1486 1443/931/1487 1006/931/1488 -f 1443/931/1487 1007/931/1486 1444/932/1489 -f 1073/932/1490 1444/932/1489 1007/931/1486 -f 1444/932/1489 1073/932/1490 1445/901/1491 -f 1075/901/1492 1445/901/1491 1073/932/1490 -f 1445/901/1491 1075/901/1492 1446/901/1493 -f 1077/901/1494 1446/901/1493 1075/901/1492 -f 1447/901/1495 1446/901/1493 1077/901/1494 -f 1406/901/1496 1447/901/1495 1077/901/1494 -f 1009/901/1497 1447/901/1495 1406/901/1496 -f 1447/901/1495 1009/901/1497 1448/931/1498 -f 1006/931/1488 1448/931/1498 1009/901/1497 -f 1448/931/1498 1006/931/1488 1443/931/1487 -f 1443/814/1499 1429/725/1499 1448/724/1499 -f 1428/415/1499 1448/724/1499 1429/725/1499 -f 1444/723/1500 1427/724/1500 1443/727/1500 -f 1429/405/1500 1443/727/1500 1427/724/1500 -f 1445/813/1501 1426/402/1501 1444/416/1501 -f 1427/404/1501 1444/416/1501 1426/402/1501 -f 1448/723/1502 1428/724/1502 1447/813/1503 -f 1425/402/1504 1447/813/1503 1428/724/1502 -f 1447/813/1503 1425/402/1504 1446/726/1505 -f 1424/404/1352 1446/726/1505 1425/402/1504 -f 1446/726/1505 1424/404/1352 1445/727/1506 -f 1426/409/1506 1445/727/1506 1424/404/1352 -f 706/408/1507 1219/417/1507 721/417/1508 -f 1219/417/1507 706/408/1507 1217/417/1509 -f 752/417/1510 1217/417/1509 706/408/1507 -f 1217/417/1509 752/417/1510 1215/419/1511 -f 753/419/1512 1215/419/1511 752/417/1510 -f 1215/419/1511 753/419/1512 1315/421/1513 -f 739/421/1514 1315/421/1513 753/419/1512 -f 1315/421/1513 739/421/1514 1322/423/1515 -f 740/423/1516 1322/423/1515 739/421/1514 -f 1322/423/1515 740/423/1516 1321/423/1517 -f 728/424/1517 1321/423/1517 740/423/1516 -f 1321/423/1517 728/424/1517 1319/423/1518 -f 727/423/1519 1319/423/1518 728/424/1517 -f 1319/423/1518 727/423/1519 1317/421/1520 -f 725/421/1521 1317/421/1520 727/423/1519 -f 1317/421/1520 725/421/1521 1222/419/1522 -f 723/419/1523 1222/419/1522 725/421/1521 -f 1222/419/1522 723/419/1523 1220/417/1524 -f 721/417/1508 1220/417/1524 723/419/1523 -f 1220/417/1524 721/417/1508 1219/417/1507 -f 1449/668/1154 1450/667/1167 1451/662/1165 -f 1451/662/1165 1452/660/1155 1449/668/1154 -f 1452/660/1155 1451/662/1165 1453/659/1166 -f 1453/659/1166 1454/657/1157 1452/660/1155 -f 1455/658/1156 1452/660/1155 1454/657/1157 -f 1454/657/1157 1456/663/1158 1455/658/1156 -f 1457/664/1159 1455/658/1156 1456/663/1158 -f 1456/663/1158 1458/657/1160 1457/664/1159 -f 1459/658/1161 1457/664/1159 1458/657/1160 -f 1458/657/1160 1460/659/1162 1459/658/1161 -f 1461/660/1163 1459/658/1161 1460/659/1162 -f 1460/659/1162 1462/661/1164 1461/660/1163 -f 1451/662/1165 1461/660/1163 1462/661/1164 -f 1462/661/1164 1453/659/1166 1451/662/1165 -f 1461/660/1163 1451/662/1165 1450/667/1167 -f 1450/667/1167 1463/666/1168 1461/660/1163 -f 1459/658/1161 1461/660/1163 1463/666/1168 -f 1463/666/1168 1464/665/1169 1459/658/1161 -f 1457/664/1159 1459/658/1161 1464/665/1169 -f 1464/665/1169 1465/666/1170 1457/664/1159 -f 1455/658/1156 1457/664/1159 1465/666/1170 -f 1465/666/1170 1466/667/1153 1455/658/1156 -f 1452/660/1155 1455/658/1156 1466/667/1153 -f 1466/667/1153 1449/668/1154 1452/660/1155 -f 1458/739/1229 1456/740/1229 1460/741/1229 -f 1456/740/1229 1453/742/1229 1460/741/1229 -f 1454/743/1229 1453/742/1229 1456/740/1229 -f 1460/741/1229 1453/742/1229 1462/744/1229 -f 1467/668/1154 1468/667/1167 1469/662/1165 -f 1469/662/1165 1470/660/1155 1467/668/1154 -f 1470/660/1155 1469/662/1165 1471/659/1166 -f 1471/659/1166 1472/657/1157 1470/660/1155 -f 1473/658/1156 1470/660/1155 1472/657/1157 -f 1472/657/1157 1474/663/1158 1473/658/1156 -f 1475/664/1159 1473/658/1156 1474/663/1158 -f 1474/663/1158 1476/657/1160 1475/664/1159 -f 1477/658/1161 1475/664/1159 1476/657/1160 -f 1476/657/1160 1478/659/1162 1477/658/1161 -f 1479/660/1163 1477/658/1161 1478/659/1162 -f 1478/659/1162 1480/661/1164 1479/660/1163 -f 1469/662/1165 1479/660/1163 1480/661/1164 -f 1480/661/1164 1471/659/1166 1469/662/1165 -f 1479/660/1163 1469/662/1165 1468/667/1167 -f 1468/667/1167 1481/666/1168 1479/660/1163 -f 1477/658/1161 1479/660/1163 1481/666/1168 -f 1481/666/1168 1482/665/1169 1477/658/1161 -f 1475/664/1159 1477/658/1161 1482/665/1169 -f 1482/665/1169 1483/666/1170 1475/664/1159 -f 1473/658/1156 1475/664/1159 1483/666/1170 -f 1483/666/1170 1484/667/1153 1473/658/1156 -f 1470/660/1155 1473/658/1156 1484/667/1153 -f 1484/667/1153 1467/668/1154 1470/660/1155 -f 1476/739/1229 1474/740/1229 1478/741/1229 -f 1474/740/1229 1471/742/1229 1478/741/1229 -f 1472/743/1229 1471/742/1229 1474/740/1229 -f 1478/741/1229 1471/742/1229 1480/744/1229 -f 1485/668/1154 1486/667/1167 1487/662/1165 -f 1487/662/1165 1488/660/1155 1485/668/1154 -f 1488/660/1155 1487/662/1165 1489/659/1166 -f 1489/659/1166 1490/657/1157 1488/660/1155 -f 1491/658/1156 1488/660/1155 1490/657/1157 -f 1490/657/1157 1492/663/1158 1491/658/1156 -f 1493/664/1159 1491/658/1156 1492/663/1158 -f 1492/663/1158 1494/657/1160 1493/664/1159 -f 1495/658/1161 1493/664/1159 1494/657/1160 -f 1494/657/1160 1496/659/1162 1495/658/1161 -f 1497/660/1163 1495/658/1161 1496/659/1162 -f 1496/659/1162 1498/661/1164 1497/660/1163 -f 1487/662/1165 1497/660/1163 1498/661/1164 -f 1498/661/1164 1489/659/1166 1487/662/1165 -f 1497/660/1163 1487/662/1165 1486/667/1167 -f 1486/667/1167 1499/666/1168 1497/660/1163 -f 1495/658/1161 1497/660/1163 1499/666/1168 -f 1499/666/1168 1500/665/1169 1495/658/1161 -f 1493/664/1159 1495/658/1161 1500/665/1169 -f 1500/665/1169 1501/666/1170 1493/664/1159 -f 1491/658/1156 1493/664/1159 1501/666/1170 -f 1501/666/1170 1502/667/1153 1491/658/1156 -f 1488/660/1155 1491/658/1156 1502/667/1153 -f 1502/667/1153 1485/668/1154 1488/660/1155 -f 1494/739/1229 1492/740/1229 1496/741/1229 -f 1492/740/1229 1489/742/1229 1496/741/1229 -f 1490/743/1229 1489/742/1229 1492/740/1229 -f 1496/741/1229 1489/742/1229 1498/744/1229 -f 1503/668/1154 1504/667/1167 1505/662/1165 -f 1505/662/1165 1506/660/1155 1503/668/1154 -f 1506/660/1155 1505/662/1165 1507/659/1166 -f 1507/659/1166 1508/657/1157 1506/660/1155 -f 1509/658/1156 1506/660/1155 1508/657/1157 -f 1508/657/1157 1510/663/1158 1509/658/1156 -f 1511/664/1159 1509/658/1156 1510/663/1158 -f 1510/663/1158 1512/657/1160 1511/664/1159 -f 1513/658/1161 1511/664/1159 1512/657/1160 -f 1512/657/1160 1514/659/1162 1513/658/1161 -f 1515/660/1163 1513/658/1161 1514/659/1162 -f 1514/659/1162 1516/661/1164 1515/660/1163 -f 1505/662/1165 1515/660/1163 1516/661/1164 -f 1516/661/1164 1507/659/1166 1505/662/1165 -f 1515/660/1163 1505/662/1165 1504/667/1167 -f 1504/667/1167 1517/666/1168 1515/660/1163 -f 1513/658/1161 1515/660/1163 1517/666/1168 -f 1517/666/1168 1518/665/1169 1513/658/1161 -f 1511/664/1159 1513/658/1161 1518/665/1169 -f 1518/665/1169 1519/666/1170 1511/664/1159 -f 1509/658/1156 1511/664/1159 1519/666/1170 -f 1519/666/1170 1520/667/1153 1509/658/1156 -f 1506/660/1155 1509/658/1156 1520/667/1153 -f 1520/667/1153 1503/668/1154 1506/660/1155 -f 1512/739/1229 1510/740/1229 1514/741/1229 -f 1510/740/1229 1507/742/1229 1514/741/1229 -f 1508/743/1229 1507/742/1229 1510/740/1229 -f 1514/741/1229 1507/742/1229 1516/744/1229 -f 1521/822/1525 1522/820/1526 1523/821/1525 -f 1524/819/1527 1523/821/1525 1522/820/1526 -f 1522/820/1526 1525/818/1528 1524/819/1527 -f 1526/817/1529 1524/819/1527 1525/818/1528 -f 1525/818/1528 1527/816/1530 1526/817/1529 -f 1528/815/1530 1526/817/1529 1527/816/1530 -f 1529/830/1531 1530/829/1531 1531/828/1532 -f 1532/827/1533 1531/828/1532 1530/829/1531 -f 1531/828/1532 1532/827/1533 1533/826/1534 -f 1534/824/1535 1533/826/1534 1532/827/1533 -f 1533/826/1534 1534/824/1535 1535/825/1536 -f 1536/823/1536 1535/825/1536 1534/824/1535 -f 1527/833/1537 1530/831/1537 1528/834/1537 -f 1529/832/1537 1528/834/1537 1530/831/1537 -f 1521/822/1538 1536/823/1538 1522/820/1538 -f 1534/824/1538 1522/820/1538 1536/823/1538 -f 1522/820/1538 1534/824/1538 1525/818/1538 -f 1532/827/1538 1525/818/1538 1534/824/1538 -f 1525/818/1538 1532/827/1538 1527/816/1538 -f 1530/829/1538 1527/816/1538 1532/827/1538 -f 1523/834/1539 1535/832/1539 1521/833/1539 -f 1536/831/1539 1521/833/1539 1535/832/1539 -f 1537/667/1121 1538/660/1112 1539/668/1120 -f 1540/662/1110 1539/668/1120 1538/660/1112 -f 1539/668/1120 1540/662/1110 1541/667/1119 -f 1542/660/1108 1541/667/1119 1540/662/1110 -f 1541/667/1119 1542/660/1108 1543/666/1118 -f 1544/658/1106 1543/666/1118 1542/660/1108 -f 1543/666/1118 1544/658/1106 1545/665/1117 -f 1546/664/1116 1545/665/1117 1544/658/1106 -f 1545/665/1117 1546/664/1116 1547/666/1122 -f 1548/658/1114 1547/666/1122 1546/664/1116 -f 1547/666/1122 1548/658/1114 1537/667/1121 -f 1538/660/1112 1537/667/1121 1548/658/1114 -f 1548/658/1114 1549/657/1113 1538/660/1112 -f 1550/659/1111 1538/660/1112 1549/657/1113 -f 1538/660/1112 1550/659/1111 1540/662/1110 -f 1551/661/1109 1540/662/1110 1550/659/1111 -f 1540/662/1110 1551/661/1109 1542/660/1108 -f 1552/659/1107 1542/660/1108 1551/661/1109 -f 1542/660/1108 1552/659/1107 1544/658/1106 -f 1553/657/1105 1544/658/1106 1552/659/1107 -f 1544/658/1106 1553/657/1105 1546/664/1116 -f 1554/663/1115 1546/664/1116 1553/657/1105 -f 1546/664/1116 1554/663/1115 1548/658/1114 -f 1549/657/1113 1548/658/1114 1554/663/1115 -f 1549/743/1230 1554/740/1230 1550/742/1230 -f 1554/740/1230 1552/741/1230 1550/742/1230 -f 1553/739/1230 1552/741/1230 1554/740/1230 -f 1550/742/1230 1552/741/1230 1551/744/1230 -f 1555/667/1121 1556/660/1112 1557/668/1120 -f 1558/662/1110 1557/668/1120 1556/660/1112 -f 1557/668/1120 1558/662/1110 1559/667/1119 -f 1560/660/1108 1559/667/1119 1558/662/1110 -f 1559/667/1119 1560/660/1108 1561/666/1118 -f 1562/658/1106 1561/666/1118 1560/660/1108 -f 1561/666/1118 1562/658/1106 1563/665/1117 -f 1564/664/1116 1563/665/1117 1562/658/1106 -f 1563/665/1117 1564/664/1116 1565/666/1122 -f 1566/658/1114 1565/666/1122 1564/664/1116 -f 1565/666/1122 1566/658/1114 1555/667/1121 -f 1556/660/1112 1555/667/1121 1566/658/1114 -f 1566/658/1114 1567/657/1113 1556/660/1112 -f 1568/659/1111 1556/660/1112 1567/657/1113 -f 1556/660/1112 1568/659/1111 1558/662/1110 -f 1569/661/1109 1558/662/1110 1568/659/1111 -f 1558/662/1110 1569/661/1109 1560/660/1108 -f 1570/659/1107 1560/660/1108 1569/661/1109 -f 1560/660/1108 1570/659/1107 1562/658/1106 -f 1571/657/1105 1562/658/1106 1570/659/1107 -f 1562/658/1106 1571/657/1105 1564/664/1116 -f 1572/663/1115 1564/664/1116 1571/657/1105 -f 1564/664/1116 1572/663/1115 1566/658/1114 -f 1567/657/1113 1566/658/1114 1572/663/1115 -f 1567/743/1230 1572/740/1230 1568/742/1230 -f 1572/740/1230 1570/741/1230 1568/742/1230 -f 1571/739/1230 1570/741/1230 1572/740/1230 -f 1568/742/1230 1570/741/1230 1569/744/1230 -f 1573/667/1121 1574/660/1112 1575/668/1120 -f 1576/662/1110 1575/668/1120 1574/660/1112 -f 1575/668/1120 1576/662/1110 1577/667/1119 -f 1578/660/1108 1577/667/1119 1576/662/1110 -f 1577/667/1119 1578/660/1108 1579/666/1118 -f 1580/658/1106 1579/666/1118 1578/660/1108 -f 1579/666/1118 1580/658/1106 1581/665/1117 -f 1582/664/1116 1581/665/1117 1580/658/1106 -f 1581/665/1117 1582/664/1116 1583/666/1122 -f 1584/658/1114 1583/666/1122 1582/664/1116 -f 1583/666/1122 1584/658/1114 1573/667/1121 -f 1574/660/1112 1573/667/1121 1584/658/1114 -f 1584/658/1114 1585/657/1113 1574/660/1112 -f 1586/659/1111 1574/660/1112 1585/657/1113 -f 1574/660/1112 1586/659/1111 1576/662/1110 -f 1587/661/1109 1576/662/1110 1586/659/1111 -f 1576/662/1110 1587/661/1109 1578/660/1108 -f 1588/659/1107 1578/660/1108 1587/661/1109 -f 1578/660/1108 1588/659/1107 1580/658/1106 -f 1589/657/1105 1580/658/1106 1588/659/1107 -f 1580/658/1106 1589/657/1105 1582/664/1116 -f 1590/663/1115 1582/664/1116 1589/657/1105 -f 1582/664/1116 1590/663/1115 1584/658/1114 -f 1585/657/1113 1584/658/1114 1590/663/1115 -f 1585/743/1230 1590/740/1230 1586/742/1230 -f 1590/740/1230 1588/741/1230 1586/742/1230 -f 1589/739/1230 1588/741/1230 1590/740/1230 -f 1586/742/1230 1588/741/1230 1587/744/1230 -f 1591/667/1121 1592/660/1112 1593/668/1120 -f 1594/662/1110 1593/668/1120 1592/660/1112 -f 1593/668/1120 1594/662/1110 1595/667/1119 -f 1596/660/1108 1595/667/1119 1594/662/1110 -f 1595/667/1119 1596/660/1108 1597/666/1118 -f 1598/658/1106 1597/666/1118 1596/660/1108 -f 1597/666/1118 1598/658/1106 1599/665/1117 -f 1600/664/1116 1599/665/1117 1598/658/1106 -f 1599/665/1117 1600/664/1116 1601/666/1122 -f 1602/658/1114 1601/666/1122 1600/664/1116 -f 1601/666/1122 1602/658/1114 1591/667/1121 -f 1592/660/1112 1591/667/1121 1602/658/1114 -f 1602/658/1114 1603/657/1113 1592/660/1112 -f 1604/659/1111 1592/660/1112 1603/657/1113 -f 1592/660/1112 1604/659/1111 1594/662/1110 -f 1605/661/1109 1594/662/1110 1604/659/1111 -f 1594/662/1110 1605/661/1109 1596/660/1108 -f 1606/659/1107 1596/660/1108 1605/661/1109 -f 1596/660/1108 1606/659/1107 1598/658/1106 -f 1607/657/1105 1598/658/1106 1606/659/1107 -f 1598/658/1106 1607/657/1105 1600/664/1116 -f 1608/663/1115 1600/664/1116 1607/657/1105 -f 1600/664/1116 1608/663/1115 1602/658/1114 -f 1603/657/1113 1602/658/1114 1608/663/1115 -f 1603/743/1230 1608/740/1230 1604/742/1230 -f 1608/740/1230 1606/741/1230 1604/742/1230 -f 1607/739/1230 1606/741/1230 1608/740/1230 -f 1604/742/1230 1606/741/1230 1605/744/1230 -f 1609/667/1121 1610/660/1112 1611/668/1120 -f 1612/662/1110 1611/668/1120 1610/660/1112 -f 1611/668/1120 1612/662/1110 1613/667/1119 -f 1614/660/1108 1613/667/1119 1612/662/1110 -f 1613/667/1119 1614/660/1108 1615/666/1118 -f 1616/658/1106 1615/666/1118 1614/660/1108 -f 1615/666/1118 1616/658/1106 1617/665/1117 -f 1618/664/1116 1617/665/1117 1616/658/1106 -f 1617/665/1117 1618/664/1116 1619/666/1122 -f 1620/658/1114 1619/666/1122 1618/664/1116 -f 1619/666/1122 1620/658/1114 1609/667/1121 -f 1610/660/1112 1609/667/1121 1620/658/1114 -f 1620/658/1114 1621/657/1113 1610/660/1112 -f 1622/659/1111 1610/660/1112 1621/657/1113 -f 1610/660/1112 1622/659/1111 1612/662/1110 -f 1623/661/1109 1612/662/1110 1622/659/1111 -f 1612/662/1110 1623/661/1109 1614/660/1108 -f 1624/659/1107 1614/660/1108 1623/661/1109 -f 1614/660/1108 1624/659/1107 1616/658/1106 -f 1625/657/1105 1616/658/1106 1624/659/1107 -f 1616/658/1106 1625/657/1105 1618/664/1116 -f 1626/663/1115 1618/664/1116 1625/657/1105 -f 1618/664/1116 1626/663/1115 1620/658/1114 -f 1621/657/1113 1620/658/1114 1626/663/1115 -f 1621/743/1230 1626/740/1230 1622/742/1230 -f 1626/740/1230 1624/741/1230 1622/742/1230 -f 1625/739/1230 1624/741/1230 1626/740/1230 -f 1622/742/1230 1624/741/1230 1623/744/1230 -f 1102/620/1540 1627/933/1540 1055/621/1540 -f 1628/933/1541 1055/621/1541 1627/933/1541 -f 1101/619/1542 1629/933/1542 1102/620/1542 -f 1627/933/1543 1102/620/1543 1629/933/1543 -f 998/572/1544 1630/933/1544 1101/619/1544 -f 1629/933/1545 1101/619/1545 1630/933/1545 -f 997/571/1546 1631/933/1546 998/572/1546 -f 1630/933/1547 998/572/1547 1631/933/1547 -f 996/570/1548 1632/934/1548 997/571/1548 -f 1631/933/1549 997/571/1549 1632/934/1549 -f 923/534/1550 1633/934/1550 996/570/1550 -f 1632/934/1551 996/570/1551 1633/934/1551 -f 921/532/1552 1634/934/1552 923/534/1552 -f 1633/934/1553 923/534/1553 1634/934/1553 -f 919/530/1554 1635/935/1554 921/532/1554 -f 1634/934/1552 921/532/1552 1635/935/1552 -f 792/466/1555 1636/935/1555 919/530/1555 -f 1635/935/1556 919/530/1556 1636/935/1556 -f 793/467/1557 1637/935/1557 792/466/1557 -f 1636/935/1558 792/466/1558 1637/935/1558 -f 756/437/1559 1638/935/1559 793/467/1559 -f 1637/935/1560 793/467/1560 1638/935/1560 -f 983/569/1561 1639/935/1561 756/437/1561 -f 1638/935/1562 756/437/1562 1639/935/1562 -f 982/437/1563 1640/935/1563 983/569/1563 -f 1639/935/1564 983/569/1564 1640/935/1564 -f 981/467/1066 1641/935/1066 982/437/1066 -f 1640/935/1565 982/437/1565 1641/935/1565 -f 979/466/1566 1642/935/1566 981/467/1566 -f 1641/935/1567 981/467/1567 1642/935/1567 -f 977/530/1568 1643/935/1568 979/466/1568 -f 1642/935/1569 979/466/1569 1643/935/1569 -f 975/532/1570 1644/934/1570 977/530/1570 -f 1643/935/1571 977/530/1571 1644/934/1571 -f 963/534/1572 1645/934/1572 975/532/1572 -f 1644/934/1573 975/532/1573 1645/934/1573 -f 1067/570/1574 1646/934/1574 963/534/1574 -f 1645/934/1575 963/534/1575 1646/934/1575 -f 1066/571/1576 1647/933/1576 1067/570/1576 -f 1646/934/1577 1067/570/1577 1647/933/1577 -f 1064/572/1578 1648/933/1578 1066/571/1578 -f 1647/933/1579 1066/571/1579 1648/933/1579 -f 1053/619/1580 1649/933/1580 1064/572/1580 -f 1648/933/1581 1064/572/1581 1649/933/1581 -f 1054/620/1582 1650/933/1582 1053/619/1582 -f 1649/933/1583 1053/619/1583 1650/933/1583 -f 1055/621/1584 1628/933/1584 1054/620/1584 -f 1650/933/1585 1054/620/1585 1628/933/1585 -f 1627/936/1586 1441/937/1586 1628/938/1586 -f 1440/938/1587 1628/938/1587 1441/937/1587 -f 1629/937/1588 1441/937/1588 1627/936/1588 -f 1630/939/1589 1438/940/1589 1629/937/1589 -f 1441/937/1590 1629/937/1590 1438/940/1590 -f 1631/939/1591 1438/940/1591 1630/939/1591 -f 1632/941/1592 1436/942/1592 1631/943/1592 -f 1438/944/1593 1631/943/1593 1436/942/1593 -f 1633/945/1594 1434/946/1594 1632/941/1594 -f 1436/942/1595 1632/941/1595 1434/946/1595 -f 1634/947/961 1651/948/961 1633/945/961 -f 1434/946/961 1633/945/961 1651/948/961 -f 1635/949/1596 1430/950/1596 1634/947/1596 -f 1651/948/1597 1634/947/1597 1430/950/1597 -f 1431/951/1598 1430/950/1598 1635/949/1598 -f 1642/939/1599 1433/952/1599 1641/936/1599 -f 1641/936/1600 1433/952/1600 1640/953/1600 -f 1640/953/1601 1433/952/1601 1639/954/1601 -f 1639/954/1602 1433/952/1602 1638/955/1602 -f 1638/955/1603 1433/952/1603 1637/947/1603 -f 1433/952/1604 1431/956/1604 1637/947/1604 -f 1637/947/1605 1431/956/1605 1636/957/1605 -f 1643/958/1606 1433/952/1606 1642/939/1606 -f 1644/947/1607 1652/948/1607 1643/949/1607 -f 1432/950/1608 1643/949/1608 1652/948/1608 -f 1645/959/1609 1435/946/1609 1644/947/1609 -f 1652/948/1609 1644/947/1609 1435/946/1609 -f 1646/941/1610 1437/942/1610 1645/959/1610 -f 1435/946/1611 1645/959/1611 1437/942/1611 -f 1647/943/1612 1439/944/1612 1646/941/1612 -f 1437/942/1613 1646/941/1613 1439/944/1613 -f 1648/960/1614 1439/961/1614 1647/960/1614 -f 1649/960/1615 1442/957/1615 1648/960/1615 -f 1439/961/1616 1648/960/1616 1442/957/1616 -f 1650/962/1617 1442/957/1617 1649/960/1617 -f 1628/938/1618 1440/938/1618 1650/962/1618 -f 1442/957/1619 1650/962/1619 1440/938/1619 -f 1435/723/1620 1434/963/1620 1652/415/1620 -f 1434/963/1620 1651/724/1620 1652/415/1620 -f 1651/724/1621 1430/814/1621 1652/415/1621 -f 1652/415/1621 1430/814/1621 1432/725/1621 -f 1653/964/1622 1654/965/1622 1655/966/1622 -f 1656/967/1622 1655/966/1622 1654/965/1622 -f 1657/968/1028 1658/969/1028 1653/964/1028 -f 1654/965/1028 1653/964/1028 1658/969/1028 -f 1659/970/1623 1660/971/1623 1657/968/1623 -f 1658/969/1623 1657/968/1623 1660/971/1623 -f 1655/966/1624 1656/967/1624 1661/878/1624 -f 1662/905/1624 1661/878/1624 1656/967/1624 -f 1655/972/1625 1661/973/1626 1653/974/1627 -f 1663/975/1628 1653/974/1627 1661/973/1626 -f 1664/975/1629 1662/973/1630 1654/974/1631 -f 1656/972/1632 1654/974/1631 1662/973/1630 -f 1664/976/1633 1663/977/1633 1662/967/1633 -f 1661/966/1633 1662/967/1633 1663/977/1633 -f 1432/950/1634 1433/958/1634 1643/949/1634 -f 1636/957/1635 1431/956/1635 1635/978/1635 -f 1410/979/1636 1409/980/1636 1108/979/1636 -f 1408/850/1637 1108/979/1637 1409/980/1637 -f 1122/981/1638 1121/982/1638 1107/983/1638 -f 1123/912/1639 1418/914/1639 1121/982/1639 -f 1421/984/1640 1422/985/1640 1418/914/1640 -f 1418/914/1641 1422/985/1641 1121/982/1641 -f 1423/986/1642 1410/878/1642 1422/985/1642 -f 1422/985/1643 1410/878/1643 1121/982/1643 -f 1121/982/1644 1410/878/1644 1107/983/1644 -f 1107/983/1645 1410/878/1645 1108/987/1645 -f 1145/985/1646 1143/984/1646 1147/988/1646 -f 1162/914/1647 1401/914/1647 1143/984/1647 -f 1399/989/1648 1397/990/1648 1401/914/1648 -f 1401/914/1649 1397/990/1649 1143/984/1649 -f 1143/984/1650 1397/990/1650 1147/988/1650 -f 1397/990/1651 1394/850/1651 1147/988/1651 -f 1147/988/1652 1394/850/1652 1159/877/1652 -f 1162/849/1653 1164/991/1653 1401/848/1653 -f 1230/731/1654 1228/374/1655 1665/731/1654 -f 1666/374/1656 1665/731/1654 1228/374/1655 -f 1228/374/1655 1225/391/1657 1666/374/1656 -f 1667/391/1658 1666/374/1656 1225/391/1657 -f 1225/391/1657 1224/730/1659 1667/391/1658 -f 1668/730/1659 1667/391/1658 1224/730/1659 -f 1665/731/611 1666/374/614 1669/731/611 -f 1670/374/614 1669/731/611 1666/374/614 -f 1666/374/614 1667/391/612 1670/374/614 -f 1671/391/612 1670/374/614 1667/391/612 -f 1667/391/612 1668/730/611 1671/391/612 -f 1672/730/611 1671/391/612 1668/730/611 -f 1669/731/1660 1670/374/1661 1231/731/1660 -f 1229/374/1662 1231/731/1660 1670/374/1661 -f 1670/374/1661 1671/391/1663 1229/374/1662 -f 1227/391/1664 1229/374/1662 1671/391/1663 -f 1671/391/1663 1672/730/1665 1227/391/1664 -f 1226/730/1665 1227/391/1664 1672/730/1665 -f 1201/992/1149 1277/993/1149 1200/994/1149 -f 1275/995/1666 1200/994/1666 1277/993/1666 -f 1203/996/1667 1279/997/1667 1201/992/1667 -f 1277/993/1668 1201/992/1668 1279/997/1668 -f 1281/998/1669 1279/997/1669 1205/999/1669 -f 1203/996/1670 1205/999/1670 1279/997/1670 -f 1207/1000/1671 1283/1001/1671 1205/999/1671 -f 1281/998/1672 1205/999/1672 1283/1001/1672 -f 1208/1002/913 1284/1003/913 1207/1000/913 -f 1283/1001/1673 1207/1000/1673 1284/1003/1673 -f 1214/1004/1674 1286/1005/1674 1208/1002/1674 -f 1286/1005/1675 1284/1003/1675 1208/1002/1675 -f 1307/1006/1676 1293/1002/1676 1299/1007/1676 -f 1238/1008/1677 1239/1009/1677 1313/994/1677 -f 1314/1010/1678 1313/994/1678 1239/1009/1678 -f 1239/1009/1679 1241/996/1679 1314/1010/1679 -f 1309/1011/1680 1314/1010/1680 1241/996/1680 -f 1241/996/1681 1243/999/1681 1309/1011/1681 -f 1304/1012/1682 1309/1011/1682 1243/999/1682 -f 1304/1012/1683 1243/999/1683 1305/1013/1683 -f 1245/1000/1684 1305/1013/1684 1243/999/1684 -f 1245/1000/1685 1293/1002/1685 1305/1013/1685 -f 1307/1006/1686 1305/1013/1686 1293/1002/1686 -f 1673/417/1687 1674/1014/1687 1675/417/1688 -f 1676/1014/1689 1675/417/1688 1674/1014/1687 -f 1675/417/1688 1676/1014/1689 1677/417/1690 -f 1678/1014/1690 1677/417/1690 1676/1014/1689 -f 1677/417/1691 1678/1014/1691 1679/417/1692 -f 1680/1014/1693 1679/417/1692 1678/1014/1691 -f 1679/417/1692 1680/1014/1693 1673/417/1694 -f 1674/1014/1694 1673/417/1694 1680/1014/1693 -f 1674/726/1695 1680/726/1695 1676/727/1695 -f 1678/727/1695 1676/727/1695 1680/726/1695 -f 1164/892/1696 1163/891/1697 1681/893/1698 -f 1163/891/1697 1161/866/1419 1681/893/1698 -f 1401/864/658 1681/893/1698 1161/866/1419 -# 1961 faces - -# -# object P_51_Mustang_Right_Wing_Flap -# - -v -4.86 -0.53 -0.60 -v -4.41 -0.27 3.38 -v -4.43 -0.76 3.40 -v -29.11 -0.39 3.17 -v -28.77 -0.08 6.47 -v -28.79 -0.68 6.50 -# 6 vertices - -vn 0.99 -0.05 -0.11 -vn -0.01 1.00 -0.09 -vn -0.00 1.00 -0.07 -vn -0.00 1.00 -0.06 -vn 0.13 0.05 0.99 -vn 0.13 0.03 0.99 -vn -0.01 -1.00 -0.09 -vn -0.01 -1.00 -0.08 -vn -0.01 -1.00 -0.06 -vn -0.99 0.05 0.10 -# 10 vertex normals - -vt 0.29 0.02 0.00 -vt 0.23 0.01 0.00 -vt 0.23 0.02 0.00 -vt 0.71 0.15 0.00 -vt 0.71 0.21 0.00 -vt 0.39 0.10 0.00 -vt 0.38 0.16 0.00 -vt 0.23 0.00 0.00 -vt 0.46 0.00 0.00 -vt 0.46 0.01 0.00 -vt 0.05 0.31 0.00 -vt 0.01 0.31 0.00 -vt 0.06 0.05 0.00 -vt 0.01 0.04 0.00 -vt 0.33 0.02 0.00 -vt 0.28 0.01 0.00 -vt 0.33 0.01 0.00 -# 17 texture coords - -g P_51_Mustang_Right_Wing_Flap -f 1682/1015/1699 1683/1016/1699 1684/1017/1699 -f 1685/1018/1700 1686/1019/1700 1682/1020/1701 -f 1683/1021/1702 1682/1020/1701 1686/1019/1700 -f 1686/1022/1703 1687/1016/1703 1683/1023/1704 -f 1684/1024/1704 1683/1023/1704 1687/1016/1703 -f 1687/1025/1705 1685/1026/1706 1684/1027/1707 -f 1682/1028/1707 1684/1027/1707 1685/1026/1706 -f 1686/1029/1708 1685/1030/1708 1687/1031/1708 -# 8 faces - -# -# object P_51_Mustang_Left_Wing -# - -v 21.73 -0.34 5.07 -v 29.47 -0.26 5.88 -v 29.43 -1.11 5.94 -v 13.89 -0.70 20.02 -v 13.32 0.44 17.79 -v 8.22 -0.70 21.64 -v 6.69 0.53 18.92 -v 13.59 0.59 15.01 -v 6.67 0.70 16.38 -v 13.51 0.45 11.97 -v 6.64 0.56 12.08 -v 12.99 0.26 8.88 -v 6.75 0.38 9.22 -v 12.85 -0.11 6.05 -v 18.46 -0.07 6.17 -v 18.38 -0.30 4.71 -v 18.77 0.27 8.57 -v 22.48 0.10 8.18 -v 18.54 0.45 12.11 -v 22.26 0.41 12.21 -v 18.69 0.44 14.67 -v 22.30 0.37 14.75 -v 19.28 -0.74 18.90 -v 18.83 0.28 17.17 -v 22.46 0.18 16.71 -v 23.13 -0.75 18.50 -v 30.30 -0.03 16.07 -v 30.77 -0.79 17.69 -v 29.80 0.01 8.15 -v 29.00 0.22 12.29 -v 29.20 0.27 14.36 -v 6.63 -2.09 14.77 -v 13.47 -1.97 15.15 -v 6.91 -1.78 18.50 -v 13.40 -1.81 12.10 -v 18.43 -1.86 12.23 -v 18.67 -1.64 8.68 -v 22.40 -1.51 8.27 -v 21.69 -1.11 5.12 -v 29.73 -1.49 8.23 -v 28.90 -1.73 12.40 -v 22.15 -1.85 12.34 -v 22.20 -1.84 14.87 -v 18.58 -1.87 14.79 -v 18.75 -1.79 16.77 -v 13.22 -1.77 17.34 -v 7.17 -1.73 19.64 -v 22.37 -1.71 16.82 -v 30.16 -1.61 16.17 -v 29.10 -1.79 14.47 -v 18.09 -0.19 18.03 -v 18.07 -0.12 19.96 -v 18.47 -0.42 18.05 -v 17.66 -0.35 19.98 -v 17.68 -0.41 18.05 -v 17.64 -0.81 20.03 -v 17.66 -0.87 18.10 -v 18.02 -1.05 20.04 -v 18.04 -1.11 18.11 -v 18.43 -0.82 20.02 -v 18.45 -0.88 18.09 -v 18.45 -0.36 19.98 -v 19.42 -0.43 17.94 -v 19.40 -0.37 19.87 -v 19.82 -0.20 17.92 -v 19.37 -0.83 19.91 -v 19.40 -0.89 17.98 -v 19.76 -1.06 19.93 -v 19.78 -1.12 18.00 -v 20.16 -0.83 19.90 -v 20.18 -0.90 17.98 -v 20.18 -0.37 19.86 -v 20.20 -0.44 17.93 -v 19.80 -0.14 19.84 -v 21.31 -0.91 17.79 -v 21.29 -0.85 19.72 -v 21.33 -0.45 17.75 -v 21.67 -1.08 19.74 -v 21.69 -1.15 17.81 -v 22.07 -0.85 19.71 -v 22.09 -0.92 17.79 -v 22.09 -0.39 19.67 -v 22.12 -0.46 17.74 -v 21.71 -0.16 19.65 -v 21.73 -0.22 17.73 -v 21.31 -0.39 19.68 -v 6.36 -1.85 12.28 -v 12.90 -1.58 8.99 -v 18.40 -1.29 6.24 -v 18.34 -1.03 4.76 -v 12.79 -1.19 6.11 -v 12.60 -0.96 4.14 -v 6.61 -1.24 6.37 -v 6.45 -0.95 3.49 -v 6.61 -1.63 9.28 -v 6.54 -0.19 3.45 -v 12.64 -0.25 4.10 -v 6.70 0.02 6.36 -v 25.72 -2.97 15.17 -v 26.04 -2.97 15.16 -v 25.78 -1.70 14.94 -v 26.10 -1.70 14.93 -v 25.71 -3.12 14.67 -v 26.03 -3.12 14.66 -v 26.02 -3.16 10.99 -v 25.71 -3.16 10.99 -v 25.78 -1.72 9.85 -v 26.09 -1.72 9.85 -v 49.14 -0.79 5.08 -v 48.24 -0.91 6.93 -v 48.25 -0.61 6.89 -v 48.48 -0.39 13.06 -v 45.09 -0.22 13.27 -v 48.37 -0.52 14.30 -v 49.79 -0.70 13.22 -v 49.65 -0.81 14.45 -v 50.18 -0.86 13.17 -v 49.94 -0.86 14.46 -v 49.46 -0.86 15.18 -v 48.14 -0.86 15.82 -v 45.11 -0.50 14.61 -v 44.86 -0.85 16.21 -v 37.77 -0.27 15.37 -v 37.66 -0.83 16.94 -v 37.87 0.03 13.78 -v 37.92 0.07 11.77 -v 37.54 -0.12 8.23 -v 44.74 -0.34 7.95 -v 44.69 -0.53 6.74 -v 47.69 -0.50 8.05 -v 49.33 -0.63 7.63 -v 49.65 -0.83 7.70 -v 49.74 -0.63 11.09 -v 50.12 -0.85 11.07 -v 48.01 -0.49 11.12 -v 44.83 -0.18 11.19 -v 37.83 -1.66 11.86 -v 44.77 -1.59 11.25 -v 37.86 -1.64 13.87 -v 37.71 -1.53 15.44 -v 44.80 -1.48 14.64 -v 48.34 -1.08 14.45 -v 44.94 -1.58 13.33 -v 48.44 -1.09 13.22 -v 47.98 -1.08 11.27 -v 49.72 -0.95 11.28 -v 49.21 -0.88 7.78 -v 47.66 -0.96 8.19 -v 44.69 -1.31 7.98 -v 44.66 -1.07 6.82 -v 37.47 -1.43 8.30 -v 37.60 -1.17 6.48 -v 49.77 -1.00 13.41 -v 49.64 -0.94 14.48 -v 37.65 -0.33 6.41 -v 29.53 -2.84 10.92 -v 29.47 -2.71 15.01 -v 29.60 -1.55 9.80 -v 29.51 -1.73 14.90 -v 29.69 -1.73 14.90 -v 29.64 -2.71 15.01 -v 29.78 -1.55 9.80 -v 29.70 -2.84 10.92 -v 32.08 -2.73 14.99 -v 32.26 -2.73 14.99 -v 32.13 -1.70 14.87 -v 32.31 -1.70 14.87 -v 32.14 -2.86 10.90 -v 32.32 -2.87 10.90 -v 32.22 -1.51 9.77 -v 32.40 -1.51 9.77 -v 34.83 -2.75 14.96 -v 35.01 -2.75 14.96 -v 34.88 -1.62 14.83 -v 35.06 -1.62 14.83 -v 34.89 -2.89 10.87 -v 35.07 -2.89 10.87 -v 34.97 -1.51 9.74 -v 35.15 -1.51 9.74 -v 25.90 -3.10 16.05 -v 25.99 -3.13 9.38 -v 24.57 -3.45 16.08 -v 27.29 -3.50 9.39 -v 27.20 -3.47 16.06 -v 28.21 -4.49 9.44 -v 28.12 -4.46 16.11 -v 28.50 -5.83 9.52 -v 28.41 -5.80 16.19 -v 28.08 -7.16 9.61 -v 28.00 -7.14 16.28 -v 27.07 -8.14 9.68 -v 26.98 -8.11 16.36 -v 25.73 -8.49 9.72 -v 25.65 -8.46 16.39 -v 24.43 -8.12 9.71 -v 24.35 -8.09 16.38 -v 23.51 -7.13 9.66 -v 23.43 -7.10 16.33 -v 23.22 -5.79 9.57 -v 23.14 -5.76 16.24 -v 23.64 -4.45 9.48 -v 23.56 -4.42 16.15 -v 24.65 -3.48 9.41 -v 25.98 -4.22 6.21 -v 25.18 -4.43 6.23 -v 24.57 -5.01 6.27 -v 24.32 -5.81 6.33 -v 24.50 -6.61 6.37 -v 25.04 -7.20 6.41 -v 25.82 -7.42 6.41 -v 26.62 -7.21 6.39 -v 27.23 -6.63 6.35 -v 27.48 -5.83 6.30 -v 25.96 -5.24 3.65 -v 25.66 -5.32 3.66 -v 27.30 -5.03 6.25 -v 26.75 -4.44 6.21 -v 26.25 -5.32 3.65 -v 25.93 -5.83 3.43 -v 25.44 -5.53 3.68 -v 25.35 -5.83 3.70 -v 25.41 -6.12 3.71 -v 25.62 -6.34 3.73 -v 25.90 -6.42 3.73 -v 26.20 -6.35 3.72 -v 26.42 -6.13 3.70 -v 26.52 -5.84 3.68 -v 26.45 -5.54 3.67 -v 23.60 -6.99 17.58 -v 23.33 -5.76 17.50 -v 23.72 -4.53 17.42 -v 24.65 -3.63 17.35 -v 25.88 -3.31 17.32 -v 27.08 -3.65 17.33 -v 27.92 -4.56 17.38 -v 28.19 -5.79 17.46 -v 27.80 -7.03 17.54 -v 26.87 -7.92 17.61 -v 23.89 -5.75 19.06 -v 24.18 -4.81 19.00 -v 24.72 -5.76 20.24 -v 24.83 -6.27 20.28 -v 24.09 -6.70 19.12 -v 25.64 -8.24 17.64 -v 24.44 -7.90 17.63 -v 24.74 -7.39 19.16 -v 25.18 -6.64 20.30 -v 25.72 -5.76 20.57 -v 24.88 -5.25 20.21 -v 24.89 -4.13 18.95 -v 25.83 -3.88 18.92 -v 26.75 -4.14 18.93 -v 27.39 -4.84 18.97 -v 27.60 -5.78 19.03 -v 27.30 -6.72 19.09 -v 26.59 -7.41 19.14 -v 25.65 -7.65 19.16 -v 25.68 -6.78 20.30 -v 26.19 -6.65 20.29 -v 26.57 -6.28 20.26 -v 26.73 -5.77 20.22 -v 26.62 -5.26 20.19 -v 26.27 -4.89 20.17 -v 25.77 -4.74 20.17 -v 25.27 -4.88 20.18 -v 29.89 -0.71 2.47 -# 266 vertices - -vn 0.10 -0.07 -0.99 -vn 0.10 0.89 0.44 -vn 0.06 0.97 0.24 -vn 0.09 0.92 0.39 -vn 0.05 0.98 0.21 -vn 0.02 1.00 0.01 -vn 0.02 1.00 0.02 -vn 0.01 1.00 -0.05 -vn 0.02 1.00 -0.05 -vn 0.00 1.00 -0.10 -vn 0.02 1.00 -0.09 -vn 0.01 0.99 -0.10 -vn 0.01 0.99 -0.15 -vn 0.02 0.99 -0.15 -vn 0.02 1.00 -0.10 -vn 0.02 0.99 -0.10 -vn 0.01 1.00 -0.03 -vn 0.02 1.00 -0.03 -vn 0.02 1.00 0.03 -vn 0.03 1.00 0.05 -vn 0.09 0.87 0.48 -vn 0.06 0.96 0.28 -vn 0.05 0.96 0.28 -vn 0.06 0.89 0.44 -vn 0.04 0.95 0.31 -vn 0.05 0.91 0.41 -vn 0.01 0.99 -0.12 -vn 0.01 1.00 -0.09 -vn 0.02 1.00 -0.04 -vn 0.02 1.00 0.08 -vn 0.01 -1.00 -0.01 -vn 0.01 -1.00 0.02 -vn 0.01 -1.00 0.07 -vn -0.00 -1.00 -0.06 -vn 0.01 -1.00 -0.04 -vn 0.00 -0.99 -0.10 -vn 0.02 -0.99 -0.10 -vn 0.01 -0.99 -0.14 -vn 0.00 -0.99 -0.16 -vn 0.00 -0.99 -0.11 -vn 0.01 -1.00 0.03 -vn 0.03 -0.97 0.23 -vn 0.04 -0.98 0.22 -vn 0.08 -0.97 0.23 -vn 0.13 -0.92 0.38 -vn 0.07 -0.93 0.36 -vn 0.05 -0.90 0.44 -vn 0.03 -0.96 0.28 -vn 0.05 -0.88 0.48 -vn 0.03 -0.94 0.33 -vn 0.04 -0.89 0.46 -vn 0.01 -1.00 0.04 -vn 0.88 0.48 -0.01 -vn -0.86 0.51 -0.03 -vn -0.84 0.54 -0.03 -vn -0.88 -0.48 0.01 -vn -0.89 -0.46 0.01 -vn -0.02 -1.00 0.03 -vn -0.01 -1.00 0.03 -vn 0.84 -0.54 0.03 -vn 0.86 -0.51 0.03 -vn 0.89 0.46 -0.01 -vn 0.00 -1.00 -0.09 -vn -0.01 -0.99 -0.10 -vn -0.01 -0.99 -0.16 -vn -0.01 -0.99 -0.17 -vn -0.00 -0.99 -0.13 -vn 0.01 -0.99 -0.12 -vn 0.01 -0.99 -0.10 -vn 0.11 -0.07 -0.99 -vn 0.02 1.00 -0.07 -vn 0.01 0.09 1.00 -vn 0.02 0.18 0.98 -vn 0.00 -0.96 0.29 -vn -0.00 -1.00 0.01 -vn -0.02 -0.62 -0.78 -vn -1.00 0.05 0.00 -vn 1.00 -0.05 -0.00 -vn 0.99 -0.06 -0.14 -vn 0.99 -0.06 -0.10 -vn 0.99 -0.05 -0.10 -vn 0.98 -0.04 0.19 -vn 0.85 -0.11 -0.52 -vn 0.83 -0.07 -0.55 -vn 0.94 -0.10 -0.32 -vn -1.00 0.08 0.01 -vn -1.00 0.07 0.01 -vn -0.99 0.12 0.05 -vn -1.00 0.08 0.06 -vn -1.00 0.01 0.00 -vn -0.98 0.13 0.12 -vn -0.99 0.11 -0.07 -vn -1.00 0.07 -0.04 -vn -0.88 -0.04 0.48 -vn -0.99 -0.11 0.08 -vn -1.00 0.01 0.01 -vn -0.96 -0.13 0.23 -vn -0.90 -0.01 -0.44 -vn 0.13 0.99 0.04 -vn 0.05 0.99 0.10 -vn 0.11 0.98 0.16 -vn 0.30 0.95 0.08 -vn 0.20 0.97 0.10 -vn 0.37 0.93 0.06 -vn 0.18 0.98 0.07 -vn 0.16 0.97 0.17 -vn 0.06 0.97 0.22 -vn 0.04 0.98 0.21 -vn 0.04 0.97 0.23 -vn 0.04 0.96 0.26 -vn 0.04 0.94 0.34 -vn 0.06 0.92 0.40 -vn 0.05 0.97 0.25 -vn 0.04 0.99 0.10 -vn 0.03 1.00 -0.02 -vn 0.02 1.00 -0.08 -vn 0.04 0.99 -0.11 -vn 0.04 0.99 -0.15 -vn 0.06 1.00 -0.05 -vn 0.05 1.00 -0.07 -vn 0.31 0.95 -0.06 -vn 0.17 0.98 -0.07 -vn 0.54 0.84 -0.08 -vn 0.31 0.95 -0.03 -vn 0.50 0.86 -0.04 -vn 0.08 1.00 -0.03 -vn 0.06 1.00 -0.02 -vn 0.01 -1.00 -0.03 -vn 0.08 -1.00 -0.04 -vn 0.02 -1.00 0.04 -vn 0.03 -0.97 0.25 -vn 0.03 -0.97 0.24 -vn 0.05 -0.89 0.45 -vn 0.04 -0.91 0.42 -vn 0.04 -0.93 0.38 -vn 0.06 -0.98 0.21 -vn 0.10 -0.97 0.22 -vn 0.11 -0.99 0.08 -vn 0.08 -1.00 0.03 -vn 0.10 -1.00 -0.01 -vn 0.11 -0.99 -0.03 -vn 0.07 -1.00 -0.03 -vn 0.05 -1.00 -0.03 -vn 0.09 -1.00 -0.03 -vn 0.05 -0.99 -0.13 -vn 0.06 -1.00 -0.04 -vn 0.03 -0.98 -0.20 -vn 0.01 -0.99 -0.11 -vn 0.00 -0.99 -0.17 -vn 0.11 -0.99 -0.04 -vn 0.24 -0.97 -0.02 -vn 0.24 -0.97 -0.03 -vn 0.31 -0.95 0.01 -vn 0.35 -0.94 0.05 -vn 0.22 -0.97 0.13 -vn 0.26 -0.96 0.09 -vn 0.11 -0.98 0.15 -vn 0.08 -0.98 0.15 -vn 0.08 -0.98 0.16 -vn 0.03 0.99 -0.11 -vn 0.02 0.99 -0.12 -vn 0.08 -1.00 0.01 -vn 0.10 -0.99 0.06 -vn -1.00 0.05 -0.02 -vn 1.00 -0.05 0.02 -vn 0.00 0.12 0.99 -vn -0.00 -1.00 0.03 -vn -0.00 -0.64 -0.77 -vn 0.00 0.11 0.99 -vn 0.05 -0.47 -0.88 -vn 0.07 -0.07 -1.00 -vn 0.05 0.63 -0.77 -vn 0.05 -0.19 -0.98 -vn 0.04 -0.08 -1.00 -vn 0.04 -0.11 -0.99 -vn -0.34 -0.94 0.05 -vn -0.19 0.98 -0.09 -vn -0.32 -0.95 0.05 -vn -0.99 0.06 0.14 -vn -1.00 -0.05 0.08 -vn -0.10 0.99 0.04 -vn -0.80 0.60 -0.05 -vn -0.85 0.11 0.52 -vn -0.94 0.10 0.32 -vn -0.00 -0.66 -0.75 -vn 0.01 1.00 -0.00 -vn -0.50 0.87 -0.01 -vn 0.52 0.85 0.00 -vn 0.88 0.47 0.01 -vn 0.89 0.46 0.01 -vn 1.00 -0.03 0.01 -vn 1.00 -0.05 0.01 -vn 0.86 -0.52 0.01 -vn 0.85 -0.53 0.01 -vn 0.50 -0.87 0.01 -vn 0.48 -0.88 0.01 -vn -0.01 -1.00 0.00 -vn -0.52 -0.85 -0.00 -vn -0.89 -0.46 -0.01 -vn -0.88 -0.47 -0.01 -vn -1.00 0.05 -0.01 -vn -1.00 0.03 -0.01 -vn -0.85 0.53 -0.01 -vn -0.86 0.52 -0.01 -vn -0.48 0.88 -0.01 -vn 0.01 0.95 -0.33 -vn 0.01 0.94 -0.35 -vn -0.48 0.82 -0.32 -vn -0.47 0.81 -0.34 -vn -0.82 0.47 -0.32 -vn -0.81 0.48 -0.34 -vn -0.95 0.01 -0.32 -vn -0.94 0.02 -0.34 -vn -0.83 -0.46 -0.32 -vn -0.83 -0.45 -0.34 -vn -0.49 -0.81 -0.32 -vn -0.48 -0.81 -0.34 -vn -0.02 -0.95 -0.31 -vn -0.01 -0.95 -0.33 -vn 0.45 -0.84 -0.30 -vn 0.45 -0.83 -0.32 -vn 0.80 -0.52 -0.29 -vn 0.80 -0.51 -0.31 -vn 0.95 -0.07 -0.30 -vn 0.94 -0.06 -0.32 -vn 0.00 0.73 -0.69 -vn -0.38 0.63 -0.68 -vn 0.85 0.42 -0.31 -vn 0.84 0.42 -0.33 -vn 0.50 0.80 -0.32 -vn 0.50 0.80 -0.34 -vn 0.39 0.61 -0.68 -vn -0.01 -0.05 -1.00 -vn -0.65 0.36 -0.67 -vn -0.75 -0.00 -0.66 -vn -0.66 -0.38 -0.65 -vn -0.39 -0.66 -0.64 -vn -0.01 -0.77 -0.64 -vn 0.36 -0.68 -0.63 -vn 0.64 -0.43 -0.64 -vn 0.75 -0.07 -0.65 -vn 0.67 0.31 -0.67 -vn -0.88 -0.44 0.16 -vn -0.86 -0.44 0.25 -vn -0.99 0.06 0.15 -vn -0.97 0.06 0.24 -vn -0.83 0.54 0.15 -vn -0.82 0.52 0.23 -vn -0.47 0.87 0.15 -vn -0.47 0.85 0.24 -vn 0.02 0.99 0.16 -vn 0.01 0.97 0.25 -vn 0.51 0.84 0.17 -vn 0.50 0.83 0.26 -vn 0.87 0.47 0.17 -vn 0.85 0.46 0.26 -vn 0.98 -0.02 0.17 -vn 0.96 -0.03 0.26 -vn 0.85 -0.50 0.17 -vn 0.83 -0.50 0.26 -vn 0.49 -0.85 0.17 -vn 0.48 -0.84 0.26 -vn -0.89 0.07 0.45 -vn -0.75 0.49 0.44 -vn -0.62 0.08 0.78 -vn -0.55 -0.24 0.80 -vn -0.79 -0.39 0.47 -vn -0.01 -0.99 0.17 -vn -0.01 -0.96 0.26 -vn -0.52 -0.84 0.17 -vn -0.51 -0.82 0.26 -vn -0.47 -0.74 0.48 -vn -0.32 -0.49 0.81 -vn 0.01 0.06 1.00 -vn -0.53 0.37 0.76 -vn -0.43 0.79 0.44 -vn 0.01 0.89 0.45 -vn 0.45 0.76 0.46 -vn 0.78 0.43 0.46 -vn 0.89 -0.01 0.46 -vn 0.76 -0.44 0.47 -vn 0.45 -0.76 0.47 -vn -0.01 -0.88 0.48 -vn 0.00 -0.59 0.81 -vn 0.32 -0.51 0.80 -vn 0.54 -0.29 0.79 -vn 0.63 0.02 0.78 -vn 0.55 0.33 0.77 -vn 0.32 0.56 0.76 -vn 0.01 0.65 0.76 -vn -0.30 0.58 0.76 -vn -0.99 0.04 -0.13 -vn 0.02 0.99 -0.13 -vn 0.03 0.99 -0.13 -vn 0.01 -1.00 -0.07 -vn 0.01 -1.00 -0.06 -vn 0.90 0.01 0.44 -vn -0.05 0.07 1.00 -vn -0.05 0.11 0.99 -# 299 vertex normals - -vt 0.55 0.02 0.00 -vt 0.58 0.02 0.00 -vt 0.86 0.72 0.00 -vt 0.86 0.69 0.00 -vt 0.93 0.75 0.00 -vt 0.95 0.70 0.00 -vt 0.86 0.64 0.00 -vt 0.95 0.66 0.00 -vt 0.86 0.59 0.00 -vt 0.95 0.59 0.00 -vt 0.87 0.54 0.00 -vt 0.95 0.55 0.00 -vt 0.87 0.50 0.00 -vt 0.80 0.50 0.00 -vt 0.80 0.48 0.00 -vt 0.75 0.48 0.00 -vt 0.79 0.54 0.00 -vt 0.74 0.54 0.00 -vt 0.79 0.60 0.00 -vt 0.75 0.60 0.00 -vt 0.79 0.64 0.00 -vt 0.74 0.64 0.00 -vt 0.78 0.71 0.00 -vt 0.79 0.68 0.00 -vt 0.74 0.67 0.00 -vt 0.73 0.70 0.00 -vt 0.64 0.67 0.00 -vt 0.63 0.69 0.00 -vt 0.65 0.50 0.00 -vt 0.64 0.54 0.00 -vt 0.66 0.60 0.00 -vt 0.65 0.64 0.00 -vt 0.20 0.10 0.00 -vt 0.20 0.17 0.00 -vt 0.25 0.11 0.00 -vt 0.16 0.16 0.00 -vt 0.15 0.22 0.00 -vt 0.11 0.21 0.00 -vt 0.10 0.25 0.00 -vt 0.06 0.24 0.00 -vt 0.05 0.32 0.00 -vt 0.08 0.33 0.00 -vt 0.14 0.33 0.00 -vt 0.15 0.26 0.00 -vt 0.18 0.26 0.00 -vt 0.19 0.22 0.00 -vt 0.21 0.23 0.00 -vt 0.23 0.17 0.00 -vt 0.27 0.11 0.00 -vt 0.29 0.13 0.00 -vt 0.26 0.19 0.00 -vt 0.24 0.24 0.00 -vt 0.21 0.27 0.00 -vt 0.23 0.28 0.00 -vt 0.19 0.35 0.00 -vt 0.21 0.36 0.00 -vt 0.16 0.34 0.00 -vt 0.39 0.68 0.00 -vt 0.25 0.68 0.00 -vt 0.39 0.69 0.00 -vt 0.25 0.69 0.00 -vt 0.25 0.70 0.00 -vt 0.39 0.70 0.00 -vt 0.25 0.71 0.00 -vt 0.39 0.71 0.00 -vt 0.17 0.09 0.00 -vt 0.12 0.15 0.00 -vt 0.08 0.20 0.00 -vt 0.06 0.20 0.00 -vt 0.08 0.14 0.00 -vt 0.06 0.14 0.00 -vt 0.10 0.08 0.00 -vt 0.06 0.07 0.00 -vt 0.13 0.08 0.00 -vt 0.48 0.02 0.00 -vt 0.51 0.02 0.00 -vt 0.53 0.02 0.00 -vt 0.55 0.03 0.00 -vt 0.87 0.46 0.00 -vt 0.95 0.50 0.00 -vt 0.95 0.45 0.00 -vt 0.37 0.72 0.00 -vt 0.38 0.71 0.00 -vt 0.37 0.73 0.00 -vt 0.39 0.73 0.00 -vt 0.39 0.72 0.00 -vt 0.38 0.74 0.00 -vt 0.01 0.74 0.00 -vt 0.02 0.73 0.00 -vt 0.04 0.73 0.00 -vt 0.03 0.73 0.00 -vt 0.77 0.13 0.00 -vt 0.87 0.13 0.00 -vt 0.77 0.11 0.00 -vt 0.78 0.11 0.00 -vt 0.85 0.11 0.00 -vt 0.20 0.52 0.00 -vt 0.20 0.50 0.00 -vt 0.22 0.51 0.00 -vt 0.21 0.50 0.00 -vt 0.21 0.57 0.00 -vt 0.20 0.55 0.00 -vt 0.23 0.56 0.00 -vt 0.23 0.55 0.00 -vt 0.21 0.58 0.00 -vt 0.23 0.57 0.00 -vt 0.23 0.59 0.00 -vt 0.21 0.51 0.00 -vt 0.21 0.53 0.00 -vt 0.20 0.53 0.00 -vt 0.21 0.56 0.00 -vt 0.21 0.54 0.00 -vt 0.22 0.54 0.00 -vt 0.22 0.58 0.00 -vt 0.23 0.58 0.00 -vt 0.48 0.06 0.00 -vt 0.47 0.06 0.00 -vt 0.39 0.62 0.00 -vt 0.44 0.63 0.00 -vt 0.40 0.64 0.00 -vt 0.38 0.63 0.00 -vt 0.38 0.65 0.00 -vt 0.37 0.63 0.00 -vt 0.38 0.66 0.00 -vt 0.40 0.67 0.00 -vt 0.44 0.65 0.00 -vt 0.44 0.67 0.00 -vt 0.54 0.66 0.00 -vt 0.54 0.68 0.00 -vt 0.54 0.63 0.00 -vt 0.54 0.60 0.00 -vt 0.54 0.54 0.00 -vt 0.44 0.54 0.00 -vt 0.45 0.52 0.00 -vt 0.40 0.54 0.00 -vt 0.40 0.53 0.00 -vt 0.38 0.54 0.00 -vt 0.39 0.49 0.00 -vt 0.38 0.59 0.00 -vt 0.37 0.59 0.00 -vt 0.40 0.59 0.00 -vt 0.44 0.59 0.00 -vt 0.12 0.42 0.00 -vt 0.10 0.50 0.00 -vt 0.14 0.43 0.00 -vt 0.16 0.43 0.00 -vt 0.18 0.43 0.00 -vt 0.16 0.51 0.00 -vt 0.14 0.51 0.00 -vt 0.15 0.54 0.00 -vt 0.13 0.54 0.00 -vt 0.13 0.50 0.00 -vt 0.12 0.54 0.00 -vt 0.09 0.53 0.00 -vt 0.09 0.55 0.00 -vt 0.05 0.54 0.00 -vt 0.05 0.52 0.00 -vt 0.04 0.52 0.00 -vt 0.06 0.49 0.00 -vt 0.01 0.53 0.00 -vt 0.04 0.49 0.00 -vt 0.07 0.41 0.00 -vt 0.05 0.41 0.00 -vt 0.12 0.56 0.00 -vt 0.13 0.56 0.00 -vt 0.14 0.56 0.00 -vt 0.54 0.51 0.00 -vt 0.65 0.01 0.00 -vt 0.65 0.02 0.00 -vt 0.52 0.01 0.00 -vt 0.52 0.02 0.00 -vt 0.62 0.03 0.00 -vt 0.66 0.02 0.00 -vt 0.62 0.02 0.00 -vt 0.22 0.56 0.00 -vt 0.20 0.49 0.00 -vt 0.21 0.49 0.00 -vt 0.23 0.54 0.00 -vt 0.24 0.56 0.00 -vt 0.24 0.57 0.00 -vt 0.75 0.10 0.00 -vt 0.88 0.11 0.00 -vt 0.75 0.09 0.00 -vt 0.88 0.10 0.00 -vt 0.88 0.08 0.00 -vt 0.75 0.08 0.00 -vt 0.88 0.06 0.00 -vt 0.75 0.05 0.00 -vt 0.88 0.03 0.00 -vt 0.75 0.03 0.00 -vt 0.88 0.02 0.00 -vt 0.75 0.01 0.00 -vt 0.88 0.01 0.00 -vt 0.75 0.00 0.00 -vt 0.94 0.09 0.00 -vt 0.94 0.08 0.00 -vt 0.94 0.07 0.00 -vt 0.94 0.06 0.00 -vt 0.94 0.04 0.00 -vt 0.94 0.03 0.00 -vt 0.99 0.07 0.00 -vt 0.99 0.06 0.00 -vt 0.99 0.05 0.00 -vt 0.73 0.03 0.00 -vt 0.73 0.05 0.00 -vt 0.73 0.08 0.00 -vt 0.73 0.09 0.00 -vt 0.73 0.10 0.00 -vt 0.73 0.02 0.00 -vt 0.70 0.05 0.00 -vt 0.70 0.07 0.00 -vt 0.68 0.05 0.00 -vt 0.68 0.04 0.00 -vt 0.70 0.03 0.00 -vt 0.73 0.01 0.00 -vt 0.70 0.02 0.00 -vt 0.67 0.05 0.00 -vt 0.67 0.06 0.00 -vt 0.70 0.08 0.00 -vt 0.70 0.09 0.00 -vt 0.68 0.03 0.00 -vt 0.67 0.07 0.00 -vt 0.48 0.03 0.00 -vt 0.64 0.44 0.00 -vt 0.40 0.52 0.00 -vt 0.01 0.32 0.00 -vt 0.49 0.03 0.00 -vt 0.48 0.01 0.00 -vt 0.66 0.01 0.00 -# 229 texture coords - -g P_51_Mustang_Left_Wing -f 1688/1032/1709 1689/1033/1709 1690/1033/1709 -f 1691/1034/1710 1692/1035/1711 1693/1036/1712 -f 1694/1037/1713 1693/1036/1712 1692/1035/1711 -f 1692/1035/1711 1695/1038/1714 1694/1037/1713 -f 1696/1039/1715 1694/1037/1713 1695/1038/1714 -f 1695/1038/1714 1697/1040/1716 1696/1039/1715 -f 1698/1041/1717 1696/1039/1715 1697/1040/1716 -f 1697/1040/1716 1699/1042/1718 1698/1041/1717 -f 1700/1043/1719 1698/1041/1717 1699/1042/1718 -f 1699/1042/1718 1701/1044/1720 1700/1043/1719 -f 1701/1044/1720 1699/1042/1718 1702/1045/1721 -f 1702/1045/1721 1703/1046/1721 1701/1044/1720 -f 1688/1047/1722 1703/1046/1721 1702/1045/1721 -f 1702/1045/1721 1704/1048/1723 1688/1047/1722 -f 1705/1049/1724 1688/1047/1722 1704/1048/1723 -f 1704/1048/1723 1706/1050/1725 1705/1049/1724 -f 1707/1051/1726 1705/1049/1724 1706/1050/1725 -f 1706/1050/1725 1708/1052/1727 1707/1051/1726 -f 1709/1053/1728 1707/1051/1726 1708/1052/1727 -f 1710/1054/1729 1711/1055/1730 1691/1034/1710 -f 1692/1035/1711 1691/1034/1710 1711/1055/1730 -f 1692/1035/1711 1711/1055/1730 1695/1038/1714 -f 1708/1052/1727 1695/1038/1714 1711/1055/1730 -f 1708/1052/1727 1706/1050/1725 1695/1038/1714 -f 1697/1040/1716 1695/1038/1714 1706/1050/1725 -f 1706/1050/1725 1704/1048/1723 1697/1040/1716 -f 1699/1042/1718 1697/1040/1716 1704/1048/1723 -f 1704/1048/1723 1702/1045/1721 1699/1042/1718 -f 1708/1052/1727 1711/1055/1730 1709/1053/1728 -f 1712/1056/1731 1709/1053/1728 1711/1055/1730 -f 1711/1055/1730 1710/1054/1729 1712/1056/1731 -f 1713/1057/1732 1712/1056/1731 1710/1054/1729 -f 1712/1056/1731 1713/1057/1732 1714/1058/1733 -f 1715/1059/1734 1714/1058/1733 1713/1057/1732 -f 1688/1047/1722 1705/1049/1724 1689/1060/1735 -f 1716/1061/1736 1689/1060/1735 1705/1049/1724 -f 1716/1061/1736 1705/1049/1724 1717/1062/1737 -f 1707/1051/1726 1717/1062/1737 1705/1049/1724 -f 1707/1051/1726 1709/1053/1728 1717/1062/1737 -f 1718/1063/1738 1717/1062/1737 1709/1053/1728 -f 1718/1063/1738 1709/1053/1728 1714/1058/1733 -f 1712/1056/1731 1714/1058/1733 1709/1053/1728 -f 1719/1064/1739 1720/1065/1740 1721/1066/1741 -f 1720/1065/1740 1719/1064/1739 1722/1067/1742 -f 1722/1067/1742 1723/1068/1743 1720/1065/1740 -f 1723/1068/1743 1722/1067/1742 1724/1069/1744 -f 1724/1069/1744 1725/1070/1745 1723/1068/1743 -f 1725/1070/1745 1724/1069/1744 1726/1071/1746 -f 1726/1071/1746 1690/1072/1747 1725/1070/1745 -f 1727/1073/1748 1725/1070/1745 1690/1072/1747 -f 1727/1073/1748 1728/1074/1743 1725/1070/1745 -f 1729/1075/1743 1725/1070/1745 1728/1074/1743 -f 1729/1075/1743 1728/1074/1743 1730/1076/1749 -f 1730/1076/1749 1731/1077/1740 1729/1075/1743 -f 1731/1077/1740 1730/1076/1749 1732/1078/1750 -f 1731/1077/1740 1732/1078/1750 1720/1065/1740 -f 1733/1079/1751 1720/1065/1740 1732/1078/1750 -f 1733/1079/1751 1721/1066/1741 1720/1065/1740 -f 1721/1066/1741 1733/1079/1751 1734/1080/1752 -f 1734/1080/1752 1733/1079/1751 1693/1081/1753 -f 1729/1075/1743 1723/1068/1743 1725/1070/1745 -f 1723/1068/1743 1729/1075/1743 1731/1077/1740 -f 1731/1077/1740 1720/1065/1740 1723/1068/1743 -f 1691/1082/1754 1693/1081/1753 1733/1079/1751 -f 1733/1079/1751 1732/1078/1750 1691/1082/1754 -f 1710/1083/1755 1691/1082/1754 1732/1078/1750 -f 1732/1078/1750 1735/1084/1756 1710/1083/1755 -f 1713/1085/1757 1710/1083/1755 1735/1084/1756 -f 1735/1084/1756 1736/1086/1758 1713/1085/1757 -f 1715/1087/1759 1713/1085/1757 1736/1086/1758 -f 1737/1088/1760 1730/1076/1749 1728/1074/1743 -f 1737/1088/1760 1736/1086/1758 1730/1076/1749 -f 1735/1084/1756 1730/1076/1749 1736/1086/1758 -f 1735/1084/1756 1732/1078/1750 1730/1076/1749 -f 1738/1089/1726 1739/1090/1725 1740/1091/1761 -f 1739/1090/1725 1738/1089/1726 1741/1092/1762 -f 1742/1091/1763 1741/1092/1762 1738/1089/1726 -f 1741/1092/1762 1742/1091/1763 1743/1093/1764 -f 1744/1094/1765 1743/1093/1764 1742/1091/1763 -f 1743/1093/1764 1744/1094/1765 1745/1095/1766 -f 1746/1096/1767 1745/1095/1766 1744/1094/1765 -f 1745/1095/1766 1746/1096/1767 1747/1093/1768 -f 1748/1094/1769 1747/1093/1768 1746/1096/1767 -f 1747/1093/1768 1748/1094/1769 1749/1092/1770 -f 1740/1091/1761 1749/1092/1770 1748/1094/1769 -f 1749/1092/1770 1740/1091/1761 1739/1090/1725 -f 1750/1091/1763 1751/1092/1762 1752/1089/1726 -f 1751/1092/1762 1750/1091/1763 1753/1093/1764 -f 1754/1094/1765 1753/1093/1764 1750/1091/1763 -f 1753/1093/1764 1754/1094/1765 1755/1095/1766 -f 1756/1096/1767 1755/1095/1766 1754/1094/1765 -f 1755/1095/1766 1756/1096/1767 1757/1093/1768 -f 1758/1094/1769 1757/1093/1768 1756/1096/1767 -f 1757/1093/1768 1758/1094/1769 1759/1092/1770 -f 1760/1091/1761 1759/1092/1770 1758/1094/1769 -f 1759/1092/1770 1760/1091/1761 1761/1090/1725 -f 1752/1089/1726 1761/1090/1725 1760/1091/1761 -f 1761/1090/1725 1752/1089/1726 1751/1092/1762 -f 1762/1094/1765 1763/1093/1764 1764/1091/1763 -f 1763/1093/1764 1762/1094/1765 1765/1095/1766 -f 1766/1096/1767 1765/1095/1766 1762/1094/1765 -f 1765/1095/1766 1766/1096/1767 1767/1093/1768 -f 1768/1094/1769 1767/1093/1768 1766/1096/1767 -f 1767/1093/1768 1768/1094/1769 1769/1092/1770 -f 1770/1091/1761 1769/1092/1770 1768/1094/1769 -f 1769/1092/1770 1770/1091/1761 1771/1090/1725 -f 1772/1089/1726 1771/1090/1725 1770/1091/1761 -f 1771/1090/1725 1772/1089/1726 1773/1092/1762 -f 1764/1091/1763 1773/1092/1762 1772/1089/1726 -f 1773/1092/1762 1764/1091/1763 1763/1093/1764 -f 1774/1097/1771 1722/1067/1742 1719/1064/1739 -f 1722/1067/1742 1774/1097/1771 1775/1098/1772 -f 1775/1098/1772 1724/1069/1744 1722/1067/1742 -f 1724/1069/1744 1775/1098/1772 1776/1099/1773 -f 1776/1099/1773 1726/1071/1746 1724/1069/1744 -f 1776/1099/1773 1777/1100/1774 1726/1071/1746 -f 1776/1099/1773 1778/1101/1775 1777/1100/1774 -f 1779/1102/1748 1777/1100/1774 1778/1101/1775 -f 1778/1101/1775 1780/1103/1776 1779/1102/1748 -f 1781/1104/1777 1779/1102/1748 1780/1103/1776 -f 1782/1105/1744 1775/1098/1772 1774/1097/1771 -f 1775/1098/1772 1782/1105/1744 1778/1101/1775 -f 1778/1101/1775 1776/1099/1773 1775/1098/1772 -f 1780/1103/1776 1778/1101/1775 1782/1105/1744 -f 1783/1106/1778 1779/1107/1778 1781/1106/1778 -f 1784/1107/1778 1779/1107/1778 1783/1106/1778 -f 1777/1108/1778 1779/1107/1778 1784/1107/1778 -f 1703/1108/1778 1777/1108/1778 1784/1107/1778 -f 1777/1108/1778 1703/1108/1778 1726/1109/1778 -f 1703/1108/1778 1688/1032/1778 1726/1109/1778 -f 1726/1109/1778 1688/1032/1778 1690/1033/1778 -f 1784/1110/1779 1701/1044/1720 1703/1046/1721 -f 1701/1044/1720 1784/1110/1779 1785/1111/1723 -f 1785/1111/1723 1700/1043/1719 1701/1044/1720 -f 1783/1112/1779 1785/1111/1723 1784/1110/1779 -f 1749/1113/1780 1739/1114/1780 1747/1115/1780 -f 1739/1114/1780 1743/1116/1780 1747/1115/1780 -f 1741/1117/1780 1743/1116/1780 1739/1114/1780 -f 1747/1115/1780 1743/1116/1780 1745/1118/1780 -f 1759/1113/1780 1761/1114/1780 1757/1115/1780 -f 1761/1114/1780 1753/1116/1780 1757/1115/1780 -f 1751/1117/1780 1753/1116/1780 1761/1114/1780 -f 1757/1115/1780 1753/1116/1780 1755/1118/1780 -f 1769/1113/1780 1771/1114/1780 1767/1115/1780 -f 1771/1114/1780 1763/1116/1780 1767/1115/1780 -f 1773/1117/1780 1763/1116/1780 1771/1114/1780 -f 1767/1115/1780 1763/1116/1780 1765/1118/1780 -f 1786/1119/1781 1787/1119/1781 1788/1119/1781 -f 1789/1119/1781 1788/1119/1781 1787/1119/1781 -f 1790/1120/1782 1791/1120/1782 1786/1120/1782 -f 1787/1120/1782 1786/1120/1782 1791/1120/1782 -f 1791/1120/1783 1790/1120/1783 1792/1121/1783 -f 1793/1121/1783 1792/1121/1783 1790/1120/1783 -f 1794/1121/1784 1795/1121/1784 1793/1122/1784 -f 1792/1122/1784 1793/1122/1784 1795/1121/1784 -f 1788/1123/1785 1794/1124/1785 1786/1125/1785 -f 1790/1126/1785 1794/1124/1785 1793/1127/1785 -f 1786/1125/1785 1794/1124/1785 1790/1126/1785 -f 1789/1123/1786 1787/1125/1786 1795/1124/1786 -f 1795/1124/1786 1787/1125/1786 1792/1127/1786 -f 1792/1127/1786 1787/1125/1786 1791/1126/1786 -f 1727/1128/1787 1690/1129/1787 1716/1130/1787 -f 1689/1131/1787 1716/1130/1787 1690/1129/1787 -f 1737/1132/1788 1728/1133/1789 1718/1134/1789 -f 1717/1135/1789 1718/1134/1789 1728/1133/1789 -f 1717/1135/1790 1728/1133/1790 1716/1130/1790 -f 1727/1128/1790 1716/1130/1790 1728/1133/1790 -f 1736/1136/1791 1737/1132/1791 1714/1137/1791 -f 1718/1134/1792 1714/1137/1792 1737/1132/1792 -f 1715/1138/1793 1736/1136/1793 1714/1137/1793 -f 1780/1139/1794 1782/1140/1794 1785/1128/1794 -f 1700/1141/1795 1785/1128/1795 1782/1140/1795 -f 1783/1129/1796 1781/1129/1796 1785/1128/1796 -f 1780/1139/1797 1785/1128/1797 1781/1129/1797 -f 1696/1142/1798 1698/1143/1798 1719/1135/1798 -f 1774/1144/1799 1719/1135/1799 1698/1143/1799 -f 1774/1144/1800 1698/1143/1800 1782/1140/1800 -f 1700/1141/1801 1782/1140/1801 1698/1143/1801 -f 1693/1138/1802 1694/1145/1802 1734/1146/1802 -f 1721/1137/1803 1694/1145/1803 1719/1135/1803 -f 1696/1142/1804 1719/1135/1804 1694/1145/1804 -f 1734/1146/1805 1694/1145/1805 1721/1137/1805 -f 1796/1147/1806 1797/1148/1806 1798/1148/1806 -f 1799/1149/1807 1800/1150/1808 1801/1151/1809 -f 1799/1149/1807 1801/1151/1809 1802/1152/1810 -f 1803/1153/1811 1802/1152/1810 1801/1151/1809 -f 1802/1152/1810 1803/1153/1811 1804/1154/1812 -f 1805/1153/1813 1804/1154/1812 1803/1153/1811 -f 1805/1153/1813 1803/1153/1811 1806/1155/1814 -f 1803/1153/1811 1801/1151/1809 1806/1155/1814 -f 1807/1156/1815 1806/1155/1814 1801/1151/1809 -f 1801/1151/1809 1808/1157/1816 1807/1156/1815 -f 1809/1158/1817 1807/1156/1815 1808/1157/1816 -f 1808/1157/1816 1810/1159/1818 1809/1158/1817 -f 1811/1160/1819 1809/1158/1817 1810/1159/1818 -f 1811/1160/1819 1810/1159/1818 1715/1059/1820 -f 1714/1058/1821 1715/1059/1820 1810/1159/1818 -f 1714/1058/1821 1810/1159/1818 1718/1063/1728 -f 1812/1161/1822 1718/1063/1728 1810/1159/1818 -f 1718/1063/1728 1812/1161/1822 1717/1062/1726 -f 1813/1162/1823 1717/1062/1726 1812/1161/1822 -f 1810/1159/1818 1808/1157/1816 1812/1161/1822 -f 1800/1150/1808 1812/1161/1822 1808/1157/1816 -f 1808/1157/1816 1801/1151/1809 1800/1150/1808 -f 1813/1162/1823 1814/1163/1824 1717/1062/1726 -f 1814/1163/1824 1813/1162/1823 1815/1164/1825 -f 1815/1164/1825 1816/1165/1826 1814/1163/1824 -f 1815/1164/1825 1817/1166/1827 1816/1165/1826 -f 1798/1167/1828 1816/1165/1826 1817/1166/1827 -f 1817/1166/1827 1818/1168/1829 1798/1167/1828 -f 1796/1169/1830 1798/1167/1828 1818/1168/1829 -f 1819/1168/1831 1796/1169/1830 1818/1168/1829 -f 1818/1168/1829 1820/1170/1832 1819/1168/1831 -f 1821/1171/1833 1819/1168/1831 1820/1170/1832 -f 1821/1171/1833 1820/1170/1832 1804/1154/1812 -f 1802/1152/1810 1804/1154/1812 1820/1170/1832 -f 1802/1152/1810 1820/1170/1832 1799/1149/1807 -f 1822/1172/1834 1799/1149/1807 1820/1170/1832 -f 1799/1149/1807 1822/1172/1834 1800/1150/1808 -f 1823/1173/1835 1800/1150/1808 1822/1172/1834 -f 1800/1150/1808 1823/1173/1835 1812/1161/1822 -f 1813/1162/1823 1812/1161/1822 1823/1173/1835 -f 1823/1173/1835 1815/1164/1825 1813/1162/1823 -f 1815/1164/1825 1823/1173/1835 1817/1166/1827 -f 1822/1172/1834 1817/1166/1827 1823/1173/1835 -f 1817/1166/1827 1822/1172/1834 1818/1168/1829 -f 1820/1170/1832 1818/1168/1829 1822/1172/1834 -f 1824/1174/1836 1825/1175/1837 1826/1176/1838 -f 1826/1176/1838 1737/1088/1740 1824/1174/1836 -f 1826/1176/1838 1827/1177/1839 1737/1088/1740 -f 1736/1086/1840 1737/1088/1740 1827/1177/1839 -f 1736/1086/1840 1827/1177/1839 1715/1087/1841 -f 1811/1178/1842 1715/1087/1841 1827/1177/1839 -f 1811/1178/1842 1827/1177/1839 1809/1179/1843 -f 1828/1180/1844 1809/1179/1843 1827/1177/1839 -f 1809/1179/1843 1828/1180/1844 1807/1181/1845 -f 1829/1182/1846 1807/1181/1845 1828/1180/1844 -f 1828/1180/1844 1830/1183/1847 1829/1182/1846 -f 1831/1184/1848 1829/1182/1846 1830/1183/1847 -f 1831/1184/1848 1830/1183/1847 1832/1185/1849 -f 1832/1185/1849 1833/1186/1850 1831/1184/1848 -f 1833/1186/1850 1832/1185/1849 1834/1187/1851 -f 1835/1188/1852 1834/1187/1851 1832/1185/1849 -f 1835/1188/1852 1797/1189/1850 1834/1187/1851 -f 1835/1188/1852 1836/1190/1853 1797/1189/1850 -f 1797/1189/1850 1796/1191/1854 1834/1187/1851 -f 1837/1192/1855 1797/1189/1850 1836/1190/1853 -f 1836/1190/1853 1838/1193/1777 1837/1192/1855 -f 1839/1194/1746 1837/1192/1855 1838/1193/1777 -f 1838/1193/1777 1727/1073/1856 1839/1194/1746 -f 1690/1072/1857 1839/1194/1746 1727/1073/1856 -f 1727/1073/1856 1838/1193/1777 1728/1074/1743 -f 1824/1174/1836 1728/1074/1743 1838/1193/1777 -f 1838/1193/1777 1836/1190/1853 1824/1174/1836 -f 1825/1175/1837 1824/1174/1836 1836/1190/1853 -f 1836/1190/1853 1835/1188/1852 1825/1175/1837 -f 1832/1185/1849 1825/1175/1837 1835/1188/1852 -f 1825/1175/1837 1832/1185/1849 1830/1183/1847 -f 1830/1183/1847 1826/1176/1838 1825/1175/1837 -f 1830/1183/1847 1828/1180/1844 1826/1176/1838 -f 1827/1177/1839 1826/1176/1838 1828/1180/1844 -f 1728/1074/1743 1824/1174/1836 1737/1088/1740 -f 1834/1187/1858 1796/1191/1858 1819/1187/1858 -f 1834/1187/1858 1819/1187/1858 1833/1186/1859 -f 1821/1186/1860 1833/1186/1859 1819/1187/1858 -f 1821/1186/1860 1804/1195/1861 1833/1186/1859 -f 1840/1195/1862 1833/1186/1859 1804/1195/1861 -f 1840/1195/1862 1804/1195/1861 1841/1196/1863 -f 1805/1196/1864 1841/1196/1863 1804/1195/1861 -f 1841/1196/1863 1805/1196/1864 1806/1197/1865 -f 1841/1196/1863 1806/1197/1865 1829/1182/1866 -f 1807/1181/1867 1829/1182/1866 1806/1197/1865 -f 1842/1198/1868 1814/1163/1824 1816/1165/1826 -f 1814/1163/1824 1842/1198/1868 1716/1061/1824 -f 1716/1061/1824 1717/1062/1726 1814/1163/1824 -f 1689/1060/1869 1716/1061/1824 1842/1198/1868 -f 1840/1195/1870 1831/1184/1848 1833/1186/1850 -f 1831/1184/1848 1840/1195/1870 1829/1182/1846 -f 1841/1196/1871 1829/1182/1846 1840/1195/1870 -f 1843/1127/1872 1844/1125/1872 1845/1124/1872 -f 1846/1123/1872 1845/1124/1872 1844/1125/1872 -f 1847/1123/1873 1848/1125/1873 1849/1124/1873 -f 1850/1127/1873 1849/1124/1873 1848/1125/1873 -f 1851/1119/1874 1852/1119/1874 1853/1119/1874 -f 1854/1119/1874 1853/1119/1874 1852/1119/1874 -f 1855/1199/1875 1856/1200/1875 1851/1201/1875 -f 1852/1202/1875 1851/1201/1875 1856/1200/1875 -f 1857/1121/1876 1858/1121/1876 1855/1122/1876 -f 1856/1122/1876 1855/1122/1876 1858/1121/1876 -f 1853/1123/1872 1857/1124/1872 1851/1125/1872 -f 1855/1127/1872 1851/1125/1872 1857/1124/1872 -f 1854/1123/1873 1852/1125/1873 1858/1124/1873 -f 1856/1127/1873 1858/1124/1873 1852/1125/1873 -f 1859/1119/1877 1860/1119/1877 1861/1119/1877 -f 1862/1119/1877 1861/1119/1877 1860/1119/1877 -f 1863/1199/1875 1864/1200/1875 1859/1201/1875 -f 1860/1202/1875 1859/1201/1875 1864/1200/1875 -f 1865/1121/1876 1866/1121/1876 1863/1122/1876 -f 1864/1122/1876 1863/1122/1876 1866/1121/1876 -f 1861/1123/1872 1865/1124/1872 1859/1125/1872 -f 1863/1127/1872 1859/1125/1872 1865/1124/1872 -f 1862/1123/1873 1860/1125/1873 1866/1124/1873 -f 1864/1127/1873 1866/1124/1873 1860/1125/1873 -f 1837/1200/1878 1839/1203/1878 1797/1204/1878 -f 1690/1033/1879 1689/1033/1879 1839/1203/1879 -f 1842/1205/1880 1816/1200/1880 1689/1033/1880 -f 1689/1033/1881 1816/1200/1881 1839/1203/1881 -f 1839/1203/1882 1816/1200/1882 1797/1204/1882 -f 1816/1200/1883 1798/1204/1883 1797/1204/1883 -f 1718/1206/1884 1717/1143/1884 1714/1145/1884 -f 1716/1139/1885 1689/1207/1885 1717/1143/1885 -f 1717/1143/1886 1689/1207/1886 1714/1145/1886 -f 1690/1208/1887 1727/1130/1887 1689/1207/1887 -f 1689/1207/1888 1727/1130/1888 1714/1145/1888 -f 1728/1209/1889 1737/1210/1889 1727/1130/1889 -f 1727/1130/1890 1737/1210/1890 1714/1145/1890 -f 1737/1210/1891 1736/1211/1891 1714/1145/1891 -f 1714/1145/1892 1736/1211/1892 1715/1138/1892 -f 1844/1119/1874 1848/1119/1874 1846/1119/1874 -f 1847/1119/1874 1846/1119/1874 1848/1119/1874 -f 1843/1199/1875 1850/1200/1875 1844/1201/1875 -f 1848/1202/1875 1844/1201/1875 1850/1200/1875 -f 1845/1121/1893 1849/1121/1893 1843/1122/1893 -f 1850/1122/1893 1843/1122/1893 1849/1121/1893 -f 1867/1212/1894 1868/1213/1894 1869/1214/1895 -f 1868/1213/1894 1867/1212/1894 1870/1215/1896 -f 1871/1214/1896 1870/1215/1896 1867/1212/1894 -f 1870/1215/1896 1871/1214/1896 1872/1216/1897 -f 1873/1217/1898 1872/1216/1897 1871/1214/1896 -f 1872/1216/1897 1873/1217/1898 1874/1218/1899 -f 1875/1219/1900 1874/1218/1899 1873/1217/1898 -f 1874/1218/1899 1875/1219/1900 1876/1220/1901 -f 1877/1221/1902 1876/1220/1901 1875/1219/1900 -f 1876/1220/1901 1877/1221/1902 1878/1222/1903 -f 1879/1223/1904 1878/1222/1903 1877/1221/1902 -f 1878/1222/1903 1879/1223/1904 1880/1224/1905 -f 1881/1225/1905 1880/1224/1905 1879/1223/1904 -f 1880/1224/1905 1881/1225/1905 1882/1222/1906 -f 1883/1223/1906 1882/1222/1906 1881/1225/1905 -f 1882/1222/1906 1883/1223/1906 1884/1220/1907 -f 1885/1221/1908 1884/1220/1907 1883/1223/1906 -f 1884/1220/1907 1885/1221/1908 1886/1218/1909 -f 1887/1219/1910 1886/1218/1909 1885/1221/1908 -f 1886/1218/1909 1887/1219/1910 1888/1216/1911 -f 1889/1217/1912 1888/1216/1911 1887/1219/1910 -f 1888/1216/1911 1889/1217/1912 1890/1215/1913 -f 1869/1214/1895 1890/1215/1913 1889/1217/1912 -f 1890/1215/1913 1869/1214/1895 1868/1213/1894 -f 1868/1213/1914 1891/1226/1915 1890/1215/1916 -f 1892/1227/1917 1890/1215/1916 1891/1226/1915 -f 1890/1215/1916 1892/1227/1917 1888/1216/1918 -f 1893/1228/1919 1888/1216/1918 1892/1227/1917 -f 1888/1216/1918 1893/1228/1919 1886/1218/1920 -f 1894/1229/1921 1886/1218/1920 1893/1228/1919 -f 1886/1218/1920 1894/1229/1921 1884/1220/1922 -f 1895/1230/1923 1884/1220/1922 1894/1229/1921 -f 1884/1220/1922 1895/1230/1923 1882/1222/1924 -f 1896/1231/1925 1882/1222/1924 1895/1230/1923 -f 1882/1222/1924 1896/1231/1925 1880/1224/1926 -f 1897/1231/1927 1880/1224/1926 1896/1231/1925 -f 1880/1224/1926 1897/1231/1927 1878/1222/1928 -f 1898/1231/1929 1878/1222/1928 1897/1231/1927 -f 1878/1222/1928 1898/1231/1929 1876/1220/1930 -f 1899/1230/1931 1876/1220/1930 1898/1231/1929 -f 1876/1220/1930 1899/1230/1931 1874/1218/1932 -f 1900/1229/1933 1874/1218/1932 1899/1230/1931 -f 1891/1226/1915 1901/1232/1934 1892/1227/1917 -f 1902/1232/1935 1892/1227/1917 1901/1232/1934 -f 1892/1227/1917 1902/1232/1935 1893/1228/1919 -f 1874/1218/1932 1900/1229/1933 1872/1216/1936 -f 1903/1228/1937 1872/1216/1936 1900/1229/1933 -f 1872/1216/1936 1903/1228/1937 1870/1215/1938 -f 1904/1227/1939 1870/1215/1938 1903/1228/1937 -f 1870/1215/1938 1904/1227/1939 1868/1213/1914 -f 1891/1226/1915 1868/1213/1914 1904/1227/1939 -f 1904/1227/1939 1905/1232/1940 1891/1226/1915 -f 1901/1232/1934 1891/1226/1915 1905/1232/1940 -f 1901/1232/1934 1905/1232/1940 1906/1233/1941 -f 1902/1232/1935 1901/1232/1934 1906/1233/1941 -f 1907/1233/1942 1902/1232/1935 1906/1233/1941 -f 1907/1233/1942 1893/1228/1919 1902/1232/1935 -f 1893/1228/1919 1907/1233/1942 1894/1229/1921 -f 1908/1233/1943 1894/1229/1921 1907/1233/1942 -f 1894/1229/1921 1908/1233/1943 1895/1230/1923 -f 1909/1234/1944 1895/1230/1923 1908/1233/1943 -f 1895/1230/1923 1909/1234/1944 1896/1231/1925 -f 1910/1234/1945 1896/1231/1925 1909/1234/1944 -f 1896/1231/1925 1910/1234/1945 1897/1231/1927 -f 1911/1234/1946 1897/1231/1927 1910/1234/1945 -f 1897/1231/1927 1911/1234/1946 1898/1231/1929 -f 1912/1234/1947 1898/1231/1929 1911/1234/1946 -f 1898/1231/1929 1912/1234/1947 1899/1230/1931 -f 1913/1234/1948 1899/1230/1931 1912/1234/1947 -f 1899/1230/1931 1913/1234/1948 1900/1229/1933 -f 1914/1233/1949 1900/1229/1933 1913/1234/1948 -f 1900/1229/1933 1914/1233/1949 1903/1228/1937 -f 1915/1233/1950 1903/1228/1937 1914/1233/1949 -f 1903/1228/1937 1915/1233/1950 1904/1227/1939 -f 1905/1232/1940 1904/1227/1939 1915/1233/1950 -f 1905/1232/1940 1915/1233/1950 1906/1233/1941 -f 1915/1233/1950 1914/1233/1949 1906/1233/1941 -f 1914/1233/1949 1913/1234/1948 1906/1233/1941 -f 1913/1234/1948 1912/1234/1947 1906/1233/1941 -f 1912/1234/1947 1911/1234/1946 1906/1233/1941 -f 1911/1234/1946 1910/1234/1945 1906/1233/1941 -f 1910/1234/1945 1909/1234/1944 1906/1233/1941 -f 1909/1234/1944 1908/1233/1943 1906/1233/1941 -f 1908/1233/1943 1907/1233/1942 1906/1233/1941 -f 1885/1221/1951 1916/1235/1952 1887/1219/1953 -f 1917/1236/1954 1887/1219/1953 1916/1235/1952 -f 1887/1219/1953 1917/1236/1954 1889/1217/1955 -f 1918/1237/1956 1889/1217/1955 1917/1236/1954 -f 1889/1217/1955 1918/1237/1956 1869/1214/1957 -f 1919/1238/1958 1869/1214/1957 1918/1237/1956 -f 1869/1214/1957 1919/1238/1958 1867/1212/1959 -f 1920/1239/1960 1867/1212/1959 1919/1238/1958 -f 1867/1212/1959 1920/1239/1960 1871/1214/1961 -f 1921/1238/1962 1871/1214/1961 1920/1239/1960 -f 1871/1214/1961 1921/1238/1962 1873/1217/1963 -f 1922/1237/1964 1873/1217/1963 1921/1238/1962 -f 1873/1217/1963 1922/1237/1964 1875/1219/1965 -f 1923/1236/1966 1875/1219/1965 1922/1237/1964 -f 1875/1219/1965 1923/1236/1966 1877/1221/1967 -f 1924/1235/1968 1877/1221/1967 1923/1236/1966 -f 1877/1221/1967 1924/1235/1968 1879/1223/1969 -f 1925/1240/1970 1879/1223/1969 1924/1235/1968 -f 1917/1236/1954 1926/1241/1971 1918/1237/1956 -f 1918/1237/1956 1927/1242/1972 1919/1238/1958 -f 1927/1242/1972 1918/1237/1956 1926/1241/1971 -f 1926/1241/1971 1928/1243/1973 1927/1242/1972 -f 1928/1243/1973 1926/1241/1971 1929/1244/1974 -f 1930/1245/1975 1929/1244/1974 1926/1241/1971 -f 1926/1241/1971 1917/1236/1954 1930/1245/1975 -f 1916/1235/1952 1930/1245/1975 1917/1236/1954 -f 1879/1223/1969 1925/1240/1970 1881/1225/1976 -f 1931/1246/1977 1881/1225/1976 1925/1240/1970 -f 1881/1225/1976 1931/1246/1977 1883/1223/1978 -f 1932/1240/1979 1883/1223/1978 1931/1246/1977 -f 1883/1223/1978 1932/1240/1979 1885/1221/1951 -f 1916/1235/1952 1885/1221/1951 1932/1240/1979 -f 1932/1240/1979 1933/1247/1980 1916/1235/1952 -f 1930/1245/1975 1916/1235/1952 1933/1247/1980 -f 1933/1247/1980 1934/1244/1981 1930/1245/1975 -f 1929/1244/1974 1930/1245/1975 1934/1244/1981 -f 1934/1244/1981 1935/1248/1982 1929/1244/1974 -f 1929/1244/1974 1935/1248/1982 1928/1243/1973 -f 1928/1243/1973 1935/1248/1982 1936/1249/1983 -f 1936/1249/1983 1927/1242/1972 1928/1243/1973 -f 1927/1242/1972 1936/1249/1983 1937/1250/1984 -f 1937/1250/1984 1919/1238/1958 1927/1242/1972 -f 1919/1238/1958 1937/1250/1984 1920/1239/1960 -f 1938/1251/1985 1920/1239/1960 1937/1250/1984 -f 1920/1239/1960 1938/1251/1985 1921/1238/1962 -f 1939/1250/1986 1921/1238/1962 1938/1251/1985 -f 1921/1238/1962 1939/1250/1986 1922/1237/1964 -f 1940/1242/1987 1922/1237/1964 1939/1250/1986 -f 1922/1237/1964 1940/1242/1987 1923/1236/1966 -f 1941/1241/1988 1923/1236/1966 1940/1242/1987 -f 1923/1236/1966 1941/1241/1988 1924/1235/1968 -f 1942/1245/1989 1924/1235/1968 1941/1241/1988 -f 1924/1235/1968 1942/1245/1989 1925/1240/1970 -f 1943/1247/1990 1925/1240/1970 1942/1245/1989 -f 1925/1240/1970 1943/1247/1990 1931/1246/1977 -f 1944/1247/1991 1931/1246/1977 1943/1247/1990 -f 1931/1246/1977 1944/1247/1991 1932/1240/1979 -f 1933/1247/1980 1932/1240/1979 1944/1247/1991 -f 1944/1247/1991 1945/1252/1992 1933/1247/1980 -f 1934/1244/1981 1933/1247/1980 1945/1252/1992 -f 1945/1252/1992 1935/1248/1982 1934/1244/1981 -f 1946/1244/1993 1935/1248/1982 1945/1252/1992 -f 1945/1252/1992 1944/1247/1991 1946/1244/1993 -f 1943/1247/1990 1946/1244/1993 1944/1247/1991 -f 1947/1244/1994 1935/1248/1982 1946/1244/1993 -f 1946/1244/1993 1943/1247/1990 1947/1244/1994 -f 1942/1245/1989 1947/1244/1994 1943/1247/1990 -f 1947/1244/1994 1942/1245/1989 1948/1243/1995 -f 1941/1241/1988 1948/1243/1995 1942/1245/1989 -f 1948/1243/1995 1941/1241/1988 1949/1249/1996 -f 1940/1242/1987 1949/1249/1996 1941/1241/1988 -f 1949/1249/1996 1940/1242/1987 1950/1253/1997 -f 1939/1250/1986 1950/1253/1997 1940/1242/1987 -f 1950/1253/1997 1939/1250/1986 1951/1253/1998 -f 1938/1251/1985 1951/1253/1998 1939/1250/1986 -f 1951/1253/1998 1938/1251/1985 1952/1253/1999 -f 1937/1250/1984 1952/1253/1999 1938/1251/1985 -f 1952/1253/1999 1937/1250/1984 1936/1249/1983 -f 1936/1249/1983 1935/1248/1982 1952/1253/1999 -f 1952/1253/1999 1935/1248/1982 1951/1253/1998 -f 1951/1253/1998 1935/1248/1982 1950/1253/1997 -f 1950/1253/1997 1935/1248/1982 1949/1249/1996 -f 1949/1249/1996 1935/1248/1982 1948/1243/1995 -f 1948/1243/1995 1935/1248/1982 1947/1244/1994 -f 1689/1106/2000 1953/1107/2000 1690/1254/2000 -f 1796/1169/1719 1953/1255/2001 1798/1256/1719 -f 1689/1060/2002 1798/1256/1719 1953/1255/2001 -f 1953/1257/1856 1796/1191/2003 1690/1072/1856 -f 1797/1189/2004 1690/1072/1856 1796/1191/2003 -f 1798/1258/2005 1797/1258/2005 1796/1254/2005 -f 1690/1204/2006 1797/1259/2006 1689/1260/2006 -f 1798/1259/2007 1689/1260/2007 1797/1259/2007 -# 500 faces - -# -# object P_51_Mustang_Left_Landing_Wheel -# - -v 19.25 -7.41 18.44 -v 19.26 -7.41 18.30 -v 20.79 -7.36 18.42 -v 20.79 -7.36 18.28 -v 20.30 -0.82 17.29 -v 19.89 -9.61 17.84 -v 20.06 -0.82 17.28 -v 20.05 -9.61 18.01 -v 20.47 -0.82 17.47 -v 20.04 -9.61 18.26 -v 20.45 -0.82 17.71 -v 19.86 -9.61 18.43 -v 20.27 -0.82 17.88 -v 19.61 -9.61 18.42 -v 20.03 -0.82 17.87 -v 19.45 -9.60 18.24 -v 19.87 -0.82 17.69 -v 19.46 -9.61 18.00 -v 19.88 -0.82 17.45 -v 19.64 -9.61 17.83 -v 18.91 -13.24 18.10 -v 18.69 -13.22 18.10 -v 19.03 -10.60 17.93 -v 18.70 -10.57 17.94 -v 19.21 -9.83 17.89 -v 19.03 -9.31 17.85 -v 19.56 -9.60 17.87 -v 19.59 -9.04 17.83 -v 19.58 -9.04 18.33 -v 19.02 -9.31 18.35 -v 19.56 -9.59 18.36 -v 19.20 -9.83 18.38 -v 18.70 -10.57 18.43 -v 19.03 -10.60 18.43 -v 18.59 -13.22 18.60 -v 18.90 -13.24 18.60 -v 23.32 -9.94 15.18 -v 21.57 -3.85 17.12 -v 23.08 -10.00 18.57 -v 20.86 -1.44 18.08 -v 20.94 -1.41 16.97 -v 20.73 -1.48 16.97 -v 21.36 -3.92 17.12 -v 20.65 -1.50 18.08 -v 22.86 -10.07 18.58 -v 23.11 -10.00 15.18 -v 20.80 -7.18 18.41 -v 20.80 -7.18 18.27 -v 19.27 -7.10 18.42 -v 19.27 -7.10 18.28 -v 20.80 -7.36 17.54 -v 19.27 -7.42 17.55 -v 20.81 -7.18 17.52 -v 19.28 -7.10 17.53 -v 19.28 -7.10 17.68 -v 19.26 -7.41 17.70 -v 20.81 -7.18 17.67 -v 20.80 -7.36 17.68 -v 18.93 -10.59 17.88 -v 18.90 -10.98 16.68 -v 18.93 -10.87 19.15 -v 18.91 -11.75 20.15 -v 18.87 -12.99 20.61 -v 18.74 -15.33 17.13 -v 18.80 -13.21 15.67 -v 18.76 -14.45 16.14 -v 18.85 -11.94 15.88 -v 19.50 -14.55 15.96 -v 19.55 -13.22 15.47 -v 19.60 -11.86 15.68 -v 19.65 -10.83 16.55 -v 19.68 -10.41 17.84 -v 19.68 -10.71 19.20 -v 19.66 -11.65 20.27 -v 19.62 -12.98 20.77 -v 18.82 -14.26 20.41 -v 19.57 -14.34 20.55 -v 18.78 -15.22 19.60 -v 19.52 -15.37 19.68 -v 20.42 -10.87 19.10 -v 20.40 -11.74 20.10 -v 20.36 -12.98 20.56 -v 20.31 -14.25 20.36 -v 20.27 -15.21 19.55 -v 19.49 -15.79 18.40 -v 20.24 -15.60 18.35 -v 19.48 -15.49 17.04 -v 20.23 -15.32 17.08 -v 18.75 -15.61 18.40 -v 20.25 -14.44 16.08 -v 20.29 -13.21 15.62 -v 20.34 -11.94 15.82 -v 20.39 -10.98 16.63 -v 20.42 -10.59 17.83 -# 94 vertices - -vn 0.04 -1.00 0.00 -vn 0.41 -0.08 -0.91 -vn -0.34 -0.04 -0.94 -vn 0.94 -0.07 -0.33 -vn 0.93 -0.07 -0.35 -vn 0.90 -0.02 0.44 -vn 0.91 -0.02 0.40 -vn 0.34 0.04 0.94 -vn 0.37 0.04 0.93 -vn -0.41 0.08 0.91 -vn -0.93 0.07 0.35 -vn -0.94 0.07 0.33 -vn -0.91 0.02 -0.40 -vn -0.90 0.02 -0.44 -vn -0.37 -0.04 -0.93 -vn -0.01 -0.06 -1.00 -vn 0.01 0.06 1.00 -vn -0.01 -1.00 0.00 -vn 0.01 1.00 -0.00 -vn 0.96 0.25 0.07 -vn -0.96 -0.25 -0.07 -vn 1.00 -0.05 0.01 -vn 0.05 1.00 -0.00 -vn -1.00 0.05 -0.01 -vn -0.43 0.90 -0.01 -vn -0.97 0.25 -0.01 -vn -1.00 0.04 -0.01 -vn -1.00 0.03 -0.04 -vn -0.98 -0.00 -0.18 -vn -0.98 -0.01 -0.20 -vn -0.06 -1.00 -0.01 -vn -0.08 -1.00 -0.00 -vn -0.07 -1.00 -0.01 -vn -0.09 -1.00 0.00 -vn 0.98 -0.22 0.01 -vn 0.55 -0.83 0.01 -vn -0.29 0.96 -0.00 -vn -0.01 0.05 1.00 -vn 0.29 -0.96 0.00 -vn -0.09 0.28 -0.96 -vn 0.02 -0.06 -1.00 -vn -1.00 0.04 0.01 -vn -0.26 -0.55 -0.79 -vn -0.27 -0.10 -0.96 -vn -0.03 -0.57 -0.82 -vn -0.03 -0.10 -0.99 -vn -0.27 0.40 -0.87 -vn -0.03 0.42 -0.91 -vn -0.26 0.80 -0.53 -vn -0.02 0.83 -0.56 -vn -0.24 0.97 -0.04 -vn -0.00 1.00 -0.05 -vn -0.22 0.87 0.45 -vn 0.01 0.89 0.45 -vn -0.20 0.55 0.81 -vn 0.03 0.57 0.82 -vn -0.20 0.10 0.97 -vn 0.03 0.10 0.99 -vn -0.21 -0.40 0.89 -vn 0.03 -0.42 0.91 -vn -0.22 -0.81 0.55 -vn 0.02 -0.83 0.56 -vn 0.25 0.87 0.44 -vn 0.26 0.55 0.79 -vn 0.27 0.10 0.96 -vn 0.27 -0.40 0.87 -vn 0.26 -0.80 0.53 -vn 0.00 -1.00 0.05 -vn 0.24 -0.97 0.04 -vn -0.01 -0.89 -0.45 -vn 0.22 -0.87 -0.45 -vn -0.24 -0.97 0.05 -vn -0.25 -0.87 -0.44 -vn 0.20 -0.55 -0.81 -vn 0.20 -0.10 -0.97 -vn 0.21 0.40 -0.89 -vn 0.22 0.81 -0.55 -vn 0.24 0.97 -0.05 -vn 1.00 -0.04 -0.01 -# 79 vertex normals - -vt 0.07 0.76 0.00 -vt 0.09 0.92 0.00 -vt 0.30 0.92 0.00 -vt 0.30 0.93 0.00 -vt 0.09 0.93 0.00 -vt 0.30 0.94 0.00 -vt 0.09 0.94 0.00 -vt 0.44 0.70 0.00 -vt 0.44 0.73 0.00 -vt 0.44 0.74 0.00 -vt 0.43 0.74 0.00 -vt 0.43 0.75 0.00 -vt 0.31 0.99 0.00 -vt 0.31 0.98 0.00 -vt 0.32 1.00 0.00 -vt 0.33 0.99 0.00 -vt 0.33 0.98 0.00 -vt 0.33 1.00 0.00 -vt 0.32 0.98 0.00 -vt 0.66 0.03 0.00 -vt 0.53 0.08 0.00 -vt 0.67 0.11 0.00 -vt 0.47 0.11 0.00 -vt 0.47 0.08 0.00 -vt 0.61 0.03 0.00 -vt 0.66 0.00 0.00 -vt 0.47 0.00 0.00 -vt 0.08 0.75 0.00 -vt 0.09 0.75 0.00 -vt 0.07 0.75 0.00 -vt 0.03 0.85 0.00 -vt 0.04 0.85 0.00 -vt 0.03 0.84 0.00 -vt 0.04 0.84 0.00 -vt 0.08 0.76 0.00 -vt 0.09 0.74 0.00 -vt 0.42 0.74 0.00 -vt 0.42 0.73 0.00 -vt 0.43 0.73 0.00 -vt 0.42 0.72 0.00 -vt 0.43 0.72 0.00 -vt 0.46 0.73 0.00 -vt 0.46 0.72 0.00 -vt 0.45 0.73 0.00 -vt 0.05 0.68 0.00 -vt 0.03 0.68 0.00 -vt 0.03 0.67 0.00 -vt 0.16 0.67 0.00 -vt 0.08 0.68 0.00 -vt 0.08 0.67 0.00 -vt 0.16 0.66 0.00 -vt 0.07 0.66 0.00 -vt 0.07 0.67 0.00 -vt 0.03 0.66 0.00 -vt 0.82 0.92 0.00 -vt 0.80 0.92 0.00 -vt 0.84 0.93 0.00 -vt 0.85 0.94 0.00 -vt 0.85 0.96 0.00 -vt 0.78 0.98 0.00 -vt 0.77 0.94 0.00 -vt 0.77 0.96 0.00 -vt 0.78 0.93 0.00 -vt 0.31 0.77 0.00 -vt 0.29 0.77 0.00 -vt 0.31 0.76 0.00 -vt 0.29 0.76 0.00 -vt 0.32 0.77 0.00 -vt 0.33 0.76 0.00 -vt 0.34 0.77 0.00 -vt 0.34 0.76 0.00 -vt 0.36 0.77 0.00 -vt 0.36 0.76 0.00 -vt 0.38 0.77 0.00 -vt 0.38 0.76 0.00 -vt 0.39 0.77 0.00 -vt 0.39 0.76 0.00 -vt 0.36 0.75 0.00 -vt 0.38 0.75 0.00 -vt 0.39 0.75 0.00 -vt 0.34 0.75 0.00 -vt 0.32 0.75 0.00 -vt 0.31 0.75 0.00 -vt 0.29 0.75 0.00 -vt 0.84 0.98 0.00 -vt 0.82 0.99 0.00 -vt 0.80 0.99 0.00 -# 87 texture coords - -g P_51_Mustang_Left_Landing_Wheel -f 1954/1261/2008 1955/1261/2008 1956/1261/2008 -f 1957/1261/2008 1956/1261/2008 1955/1261/2008 -f 1958/1262/2009 1959/1263/2009 1960/1262/2010 -f 1959/1263/2009 1958/1262/2009 1961/1264/2011 -f 1962/1265/2012 1961/1264/2011 1958/1262/2009 -f 1961/1264/2011 1962/1265/2012 1963/1266/2013 -f 1964/1267/2014 1963/1266/2013 1962/1265/2012 -f 1963/1266/2013 1964/1267/2014 1965/1266/2015 -f 1966/1267/2016 1965/1266/2015 1964/1267/2014 -f 1965/1266/2015 1966/1267/2016 1967/1266/2017 -f 1968/1267/2017 1967/1266/2017 1966/1267/2016 -f 1967/1266/2017 1968/1267/2017 1969/1266/2018 -f 1970/1267/2019 1969/1266/2018 1968/1267/2017 -f 1969/1266/2018 1970/1267/2019 1971/1264/2020 -f 1972/1265/2021 1971/1264/2020 1970/1267/2019 -f 1971/1264/2020 1972/1265/2021 1973/1263/2022 -f 1960/1262/2010 1973/1263/2022 1972/1265/2021 -f 1973/1263/2022 1960/1262/2010 1959/1263/2009 -f 1974/1268/2023 1975/1268/2023 1976/1269/2023 -f 1975/1268/2023 1977/1269/2023 1976/1269/2023 -f 1976/1269/2023 1977/1269/2023 1978/1270/2023 -f 1977/1269/2023 1979/1270/2023 1978/1270/2023 -f 1978/1270/2023 1979/1270/2023 1980/1271/2023 -f 1979/1270/2023 1981/1272/2023 1980/1271/2023 -f 1982/1272/2024 1983/1270/2024 1984/1271/2024 -f 1983/1270/2024 1985/1270/2024 1984/1271/2024 -f 1986/1269/2024 1985/1270/2024 1983/1270/2024 -f 1987/1269/2024 1985/1270/2024 1986/1269/2024 -f 1988/1268/2024 1987/1269/2024 1986/1269/2024 -f 1989/1268/2024 1987/1269/2024 1988/1268/2024 -f 1967/1273/2025 1969/1274/2025 1965/1275/2025 -f 1969/1274/2025 1961/1276/2025 1965/1275/2025 -f 1973/1277/2025 1961/1276/2025 1969/1274/2025 -f 1959/1277/2025 1961/1276/2025 1973/1277/2025 -f 1965/1275/2025 1961/1276/2025 1963/1278/2025 -f 1958/1279/2026 1960/1277/2026 1962/1274/2026 -f 1960/1277/2026 1966/1275/2026 1962/1274/2026 -f 1970/1276/2026 1966/1275/2026 1960/1277/2026 -f 1968/1278/2026 1966/1275/2026 1970/1276/2026 -f 1972/1277/2026 1970/1276/2026 1960/1277/2026 -f 1990/1280/2027 1991/1281/2027 1992/1282/2027 -f 1992/1282/2027 1991/1281/2027 1993/1283/2027 -f 1991/1281/2027 1994/1284/2027 1993/1283/2027 -f 1995/1280/2028 1996/1285/2028 1997/1286/2028 -f 1996/1285/2028 1998/1287/2028 1997/1286/2028 -f 1999/1284/2028 1998/1287/2028 1996/1285/2028 -f 1956/1288/2029 1957/1288/2029 2000/1288/2029 -f 2001/1288/2029 2000/1288/2029 1957/1288/2029 -f 2000/1288/2030 2001/1288/2030 2002/1289/2030 -f 2003/1289/2030 2002/1289/2030 2001/1288/2030 -f 2002/1290/2031 2003/1290/2031 1954/1290/2031 -f 1955/1290/2031 1954/1290/2031 2003/1290/2031 -f 2004/1291/2023 2005/1292/2023 2006/1293/2023 -f 2007/1294/2023 2006/1293/2023 2005/1292/2023 -f 2008/1293/2024 2009/1291/2024 2010/1294/2024 -f 2011/1292/2024 2010/1294/2024 2009/1291/2024 -f 2009/1290/2008 2005/1261/2008 2011/1288/2008 -f 2004/1295/2008 2011/1288/2008 2005/1261/2008 -f 2011/1289/2029 2004/1289/2029 2010/1289/2029 -f 2006/1289/2029 2010/1289/2029 2004/1289/2029 -f 2010/1288/2030 2006/1288/2030 2008/1288/2030 -f 2007/1288/2030 2008/1288/2030 2006/1288/2030 -f 2008/1296/2031 2007/1296/2031 2009/1296/2031 -f 2005/1296/2031 2009/1296/2031 2007/1296/2031 -f 1982/1297/2032 1981/1298/2032 1983/1271/2032 -f 1979/1299/2032 1983/1271/2032 1981/1298/2032 -f 1983/1298/2033 1979/1300/2033 1986/1299/2033 -f 1977/1301/2033 1986/1299/2033 1979/1300/2033 -f 1986/1299/2034 1977/1301/2035 1988/1302/2036 -f 1975/1303/2037 1988/1302/2036 1977/1301/2035 -f 1988/1299/2038 1975/1299/2039 1989/1271/2040 -f 1974/1271/2041 1989/1271/2040 1975/1299/2039 -f 1989/1298/2029 1974/1298/2029 1987/1304/2029 -f 1976/1304/2029 1987/1304/2029 1974/1298/2029 -f 1987/1304/2042 1976/1304/2042 1985/1302/2042 -f 1978/1302/2042 1985/1302/2042 1976/1304/2042 -f 1985/1297/2043 1978/1271/2043 1984/1297/2043 -f 1980/1271/2043 1984/1297/2043 1978/1271/2043 -f 1994/1305/2044 1995/1305/2044 1993/1306/2044 -f 1997/1306/2044 1993/1306/2044 1995/1305/2044 -f 1998/1307/2045 1992/1307/2045 1997/1308/2045 -f 1993/1308/2045 1997/1308/2045 1992/1307/2045 -f 1999/1306/2046 1990/1307/2046 1998/1309/2046 -f 1992/1310/2046 1998/1309/2046 1990/1307/2046 -f 1990/1311/2047 1999/1308/2047 1991/1312/2047 -f 1996/1313/2047 1991/1312/2047 1999/1308/2047 -f 1995/1307/2048 1994/1314/2048 1996/1313/2048 -f 1991/1312/2048 1996/1313/2048 1994/1314/2048 -f 1962/1274/2026 1966/1275/2026 1964/1273/2026 -f 1957/1291/2023 1955/1292/2023 2001/1293/2023 -f 2003/1294/2023 2001/1293/2023 1955/1292/2023 -f 2002/1293/2024 1954/1291/2024 2000/1294/2024 -f 1956/1292/2024 2000/1294/2024 1954/1291/2024 -f 1971/1279/2025 1973/1277/2025 1969/1274/2025 -f 2012/1315/2049 2013/1316/2049 2014/1317/2049 -f 2015/1318/2049 2014/1317/2049 2016/1319/2049 -f 2014/1317/2049 2013/1316/2049 2016/1319/2049 -f 2013/1316/2049 2017/1320/2049 2016/1319/2049 -f 2018/1321/2049 2017/1320/2049 2013/1316/2049 -f 2019/1322/2049 2017/1320/2049 2018/1321/2049 -f 2020/1323/2049 2018/1321/2049 2013/1316/2049 -f 2019/1324/2050 2018/1325/2051 2021/1326/2052 -f 2022/1327/2053 2021/1326/2052 2018/1325/2051 -f 2018/1325/2051 2020/1324/2054 2022/1327/2053 -f 2023/1326/2055 2022/1327/2053 2020/1324/2054 -f 2020/1324/2054 2013/1328/2056 2023/1326/2055 -f 2024/1329/2057 2023/1326/2055 2013/1328/2056 -f 2013/1328/2056 2012/1330/2058 2024/1329/2057 -f 2025/1331/2059 2024/1329/2057 2012/1330/2058 -f 2012/1330/2058 2014/1332/2060 2025/1331/2059 -f 2026/1333/2061 2025/1331/2059 2014/1332/2060 -f 2014/1332/2060 2015/1334/2062 2026/1333/2061 -f 2027/1335/2063 2026/1333/2061 2015/1334/2062 -f 2015/1334/2062 2016/1336/2064 2027/1335/2063 -f 2028/1337/2065 2027/1335/2063 2016/1336/2064 -f 2016/1336/2064 2029/1334/2066 2028/1337/2065 -f 2030/1335/2067 2028/1337/2065 2029/1334/2066 -f 2029/1334/2066 2031/1332/2068 2030/1335/2067 -f 2032/1333/2069 2030/1335/2067 2031/1332/2068 -f 2026/1333/2061 2027/1335/2063 2033/1338/2070 -f 2034/1339/2071 2033/1338/2070 2027/1335/2063 -f 2027/1335/2063 2028/1337/2065 2034/1339/2071 -f 2035/1340/2072 2034/1339/2071 2028/1337/2065 -f 2028/1337/2065 2030/1335/2067 2035/1340/2072 -f 2036/1339/2073 2035/1340/2072 2030/1335/2067 -f 2030/1335/2067 2032/1333/2069 2036/1339/2073 -f 2037/1338/2074 2036/1339/2073 2032/1333/2069 -f 2032/1333/2069 2038/1331/2075 2037/1338/2074 -f 2039/1341/2076 2037/1338/2074 2038/1331/2075 -f 2038/1331/2075 2040/1329/2077 2039/1341/2076 -f 2041/1342/2078 2039/1341/2076 2040/1329/2077 -f 2031/1332/2068 2042/1330/2079 2032/1333/2069 -f 2038/1331/2075 2032/1333/2069 2042/1330/2079 -f 2042/1330/2079 2017/1328/2080 2038/1331/2075 -f 2040/1329/2077 2038/1331/2075 2017/1328/2080 -f 2017/1328/2080 2019/1324/2050 2040/1329/2077 -f 2021/1326/2052 2040/1329/2077 2019/1324/2050 -f 2040/1329/2077 2021/1326/2052 2041/1342/2078 -f 2043/1343/2081 2041/1342/2078 2021/1326/2052 -f 2021/1326/2052 2022/1327/2053 2043/1343/2081 -f 2044/1344/2082 2043/1343/2081 2022/1327/2053 -f 2022/1327/2053 2023/1326/2055 2044/1344/2082 -f 2045/1343/2083 2044/1344/2082 2023/1326/2055 -f 2023/1326/2055 2024/1329/2057 2045/1343/2083 -f 2046/1342/2084 2045/1343/2083 2024/1329/2057 -f 2024/1329/2057 2025/1331/2059 2046/1342/2084 -f 2047/1341/2085 2046/1342/2084 2025/1331/2059 -f 2025/1331/2059 2026/1333/2061 2047/1341/2085 -f 2033/1338/2070 2047/1341/2085 2026/1333/2061 -f 2044/1319/2086 2045/1318/2086 2043/1345/2086 -f 2045/1318/2086 2047/1315/2086 2043/1345/2086 -f 2043/1345/2086 2047/1315/2086 2036/1322/2086 -f 2047/1315/2086 2034/1323/2086 2036/1322/2086 -f 2036/1322/2086 2034/1323/2086 2035/1321/2086 -f 2033/1316/2086 2034/1323/2086 2047/1315/2086 -f 2046/1317/2086 2047/1315/2086 2045/1318/2086 -f 2041/1346/2086 2043/1345/2086 2039/1347/2086 -f 2039/1347/2086 2043/1345/2086 2036/1322/2086 -f 2037/1320/2086 2039/1347/2086 2036/1322/2086 -f 2042/1347/2049 2031/1346/2049 2017/1320/2049 -f 2017/1320/2049 2031/1346/2049 2016/1319/2049 -f 2016/1319/2049 2031/1346/2049 2029/1345/2049 -# 162 faces - -# -# object P_51_Mustang_Left_Rockets -# - -v 28.30 -4.77 8.29 -v 28.33 -4.86 5.62 -v 28.36 -4.84 8.30 -v 28.39 -4.93 5.63 -v 30.30 -3.78 17.72 -v 30.11 -3.64 18.78 -v 29.93 -4.14 17.76 -v 29.98 -4.36 6.27 -v 29.58 -4.47 6.28 -v 29.44 -4.27 17.78 -v 29.18 -4.36 6.28 -v 28.96 -4.13 17.77 -v 28.90 -4.06 6.25 -v 28.63 -3.77 17.74 -v 28.82 -3.65 6.22 -v 28.52 -3.28 17.70 -v 28.94 -3.25 6.18 -v 28.67 -2.78 17.65 -v 29.25 -2.95 6.15 -v 29.04 -2.43 17.61 -v 29.65 -2.85 6.14 -v 29.53 -2.30 17.60 -v 30.05 -2.96 6.14 -v 30.01 -2.44 17.60 -v 28.80 -3.63 18.79 -v 29.07 -3.91 18.82 -v 29.44 -4.02 18.82 -v 29.82 -3.92 18.81 -v 29.46 -3.20 20.36 -v 30.23 -3.25 18.75 -v 30.46 -3.29 17.68 -v 30.29 -4.07 6.24 -v 30.41 -3.66 6.20 -v 29.13 -2.58 18.69 -v 28.84 -2.86 18.72 -v 28.72 -3.24 18.76 -v 29.51 -2.48 18.68 -v 30.32 -3.26 6.17 -v 30.35 -2.80 17.63 -v 30.15 -2.87 18.71 -v 29.89 -2.58 18.69 -v 29.57 -3.63 6.19 -v 29.64 -3.70 6.20 -v 30.92 -2.50 5.38 -v 30.85 -2.43 5.38 -v 29.61 -3.61 8.86 -v 29.55 -3.54 8.86 -v 30.89 -2.41 8.05 -v 30.82 -2.34 8.04 -v 30.77 -4.79 8.27 -v 29.63 -3.54 8.86 -v 30.70 -4.86 8.27 -v 29.56 -3.61 8.86 -v 28.48 -2.33 8.06 -v 28.41 -2.40 8.07 -v 30.73 -4.94 5.61 -v 29.59 -3.70 6.20 -v 28.44 -2.48 5.41 -v 28.51 -2.41 5.40 -v 29.66 -3.63 6.19 -v 30.80 -4.88 5.60 -v 30.94 -4.79 8.27 -v 30.97 -4.88 5.60 -v 31.00 -4.86 8.27 -v 31.03 -4.95 5.60 -v 32.94 -3.80 17.70 -v 32.75 -3.66 18.76 -v 32.57 -4.16 17.74 -v 32.62 -4.38 6.25 -v 32.21 -4.49 6.26 -v 32.08 -4.29 17.75 -v 31.82 -4.38 6.25 -v 31.60 -4.15 17.74 -v 31.54 -4.08 6.23 -v 31.26 -3.79 17.71 -v 31.45 -3.67 6.19 -v 31.16 -3.30 17.67 -v 31.58 -3.27 6.15 -v 31.31 -2.81 17.62 -v 31.89 -2.97 6.12 -v 31.68 -2.45 17.59 -v 32.29 -2.87 6.11 -v 32.17 -2.32 17.57 -v 32.68 -2.98 6.12 -v 32.65 -2.46 17.58 -v 31.44 -3.65 18.77 -v 31.70 -3.93 18.79 -v 32.08 -4.04 18.80 -v 32.46 -3.94 18.79 -v 32.09 -3.22 20.34 -v 32.87 -3.27 18.72 -v 33.09 -3.31 17.65 -v 32.92 -4.09 6.22 -v 33.05 -3.68 6.18 -v 31.77 -2.60 18.67 -v 31.48 -2.88 18.70 -v 31.36 -3.26 18.73 -v 32.15 -2.50 18.66 -v 32.96 -3.28 6.14 -v 32.99 -2.82 17.61 -v 32.79 -2.89 18.69 -v 32.52 -2.61 18.66 -v 32.21 -3.65 6.17 -v 32.28 -3.72 6.17 -v 33.55 -2.52 5.36 -v 33.49 -2.45 5.35 -v 32.25 -3.63 8.84 -v 32.18 -3.56 8.83 -v 33.52 -2.43 8.02 -v 33.46 -2.36 8.02 -v 33.41 -4.81 8.24 -v 32.27 -3.56 8.83 -v 33.34 -4.88 8.25 -v 32.19 -3.63 8.84 -v 31.12 -2.35 8.04 -v 31.05 -2.42 8.05 -v 33.37 -4.96 5.58 -v 32.22 -3.72 6.17 -v 31.08 -2.50 5.38 -v 31.15 -2.43 5.37 -v 32.29 -3.65 6.16 -v 33.44 -4.90 5.58 -v 33.69 -4.81 8.24 -v 33.72 -4.90 5.57 -v 33.75 -4.88 8.25 -v 33.78 -4.97 5.58 -v 35.69 -3.82 17.67 -v 35.50 -3.68 18.73 -v 35.32 -4.18 17.71 -v 35.37 -4.40 6.22 -v 34.96 -4.51 6.23 -v 34.83 -4.31 17.73 -v 34.57 -4.40 6.23 -v 34.35 -4.17 17.72 -v 34.29 -4.10 6.20 -v 34.01 -3.81 17.69 -v 34.21 -3.69 6.17 -v 33.91 -3.32 17.64 -v 34.33 -3.29 6.13 -v 34.06 -2.83 17.60 -v 34.64 -2.99 6.10 -v 34.43 -2.47 17.56 -v 35.04 -2.89 6.08 -v 34.92 -2.34 17.54 -v 35.44 -3.00 6.09 -v 35.40 -2.48 17.55 -v 34.19 -3.67 18.74 -v 34.45 -3.95 18.77 -v 34.83 -4.06 18.77 -v 35.21 -3.96 18.76 -v 34.85 -3.24 20.31 -v 35.62 -3.30 18.69 -v 35.84 -3.33 17.63 -v 35.67 -4.11 6.19 -v 35.80 -3.71 6.15 -v 34.52 -2.62 18.64 -v 34.23 -2.90 18.67 -v 34.11 -3.28 18.71 -v 34.90 -2.52 18.63 -v 35.71 -3.30 6.12 -v 35.74 -2.84 17.58 -v 35.54 -2.91 18.66 -v 35.27 -2.63 18.64 -v 34.96 -3.67 6.14 -v 35.03 -3.74 6.15 -v 36.31 -2.54 5.33 -v 36.24 -2.47 5.32 -v 35.00 -3.65 8.81 -v 34.93 -3.58 8.81 -v 36.28 -2.46 8.00 -v 36.21 -2.39 7.99 -v 36.16 -4.83 8.22 -v 35.02 -3.58 8.81 -v 36.09 -4.90 8.22 -v 34.94 -3.65 8.81 -v 33.87 -2.37 8.01 -v 33.80 -2.44 8.02 -v 36.12 -4.99 5.56 -v 34.97 -3.74 6.15 -v 33.83 -2.52 5.35 -v 33.90 -2.45 5.35 -v 35.05 -3.67 6.14 -v 36.19 -4.92 5.55 -# 183 vertices - -vn -0.73 -0.68 0.01 -vn 0.85 -0.51 0.11 -vn 0.82 -0.47 0.33 -vn 0.49 -0.86 0.12 -vn 0.50 -0.87 0.02 -vn -0.01 -1.00 0.02 -vn -0.01 -0.99 0.12 -vn -0.52 -0.85 0.01 -vn -0.52 -0.85 0.12 -vn -0.89 -0.46 -0.01 -vn -0.89 -0.45 0.10 -vn -1.00 0.05 -0.03 -vn -1.00 0.05 0.08 -vn -0.85 0.53 -0.04 -vn -0.85 0.53 0.06 -vn -0.48 0.87 -0.05 -vn -0.49 0.87 0.05 -vn 0.01 1.00 -0.05 -vn 0.01 1.00 0.06 -vn 0.52 0.85 -0.04 -vn 0.52 0.85 0.07 -vn -0.85 -0.42 0.32 -vn -0.50 -0.79 0.34 -vn -0.01 -0.94 0.35 -vn 0.47 -0.81 0.34 -vn -0.35 -0.53 0.78 -vn 0.92 -0.26 0.31 -vn 0.95 -0.29 0.10 -vn 0.86 -0.52 0.01 -vn 0.95 -0.30 0.01 -vn -0.46 0.85 0.27 -vn -0.81 0.52 0.28 -vn -0.95 0.07 0.30 -vn 0.01 0.96 0.27 -vn 0.45 0.77 0.46 -vn 0.88 0.47 -0.02 -vn 0.88 0.47 0.08 -vn 0.98 0.21 -0.01 -vn 0.97 0.22 0.09 -vn 0.84 0.46 0.30 -vn 0.93 0.23 0.30 -vn 0.49 0.82 0.29 -vn -0.01 -0.09 -1.00 -vn 0.27 0.17 -0.95 -vn 0.00 -0.08 -1.00 -vn -0.27 -0.33 -0.91 -vn -0.27 -0.17 0.95 -vn -0.00 0.08 1.00 -vn 0.01 0.09 1.00 -vn 0.27 0.33 0.91 -vn -0.69 0.72 -0.03 -vn 0.28 -0.19 0.94 -vn 0.02 0.08 1.00 -vn -0.25 0.35 0.90 -vn 0.25 -0.35 -0.90 -vn -0.02 -0.08 -1.00 -vn -0.28 0.19 -0.94 -vn 0.73 0.68 -0.01 -vn 0.69 -0.72 0.03 -# 59 vertex normals - -vt 0.81 0.65 0.00 -vt 0.71 0.65 0.00 -vt 0.83 0.57 0.00 -vt 0.85 0.57 0.00 -vt 0.64 0.57 0.00 -vt 0.64 0.58 0.00 -vt 0.83 0.58 0.00 -vt 0.64 0.59 0.00 -vt 0.83 0.59 0.00 -vt 0.64 0.60 0.00 -vt 0.83 0.60 0.00 -vt 0.85 0.58 0.00 -vt 0.89 0.58 0.00 -vt 0.85 0.59 0.00 -vt 0.85 0.60 0.00 -vt 0.89 0.60 0.00 -vt 0.64 0.61 0.00 -vt 0.83 0.61 0.00 -vt 0.85 0.61 0.00 -vt 0.37 0.73 0.00 -vt 0.37 0.74 0.00 -vt 0.39 0.74 0.00 -vt 0.39 0.72 0.00 -vt 0.39 0.73 0.00 -vt 0.38 0.74 0.00 -vt 0.69 0.65 0.00 -vt 0.75 0.65 0.00 -vt 0.91 0.70 0.00 -vt 0.91 0.66 0.00 -vt 0.98 0.70 0.00 -vt 0.98 0.66 0.00 -vt 0.91 0.63 0.00 -vt 0.98 0.63 0.00 -vt 0.37 0.72 0.00 -vt 0.38 0.71 0.00 -# 35 texture coords - -g P_51_Mustang_Left_Rockets -f 2048/1348/2087 2049/1349/2087 2050/1348/2087 -f 2051/1349/2087 2050/1348/2087 2049/1349/2087 -f 2052/1350/2088 2053/1351/2089 2054/1350/2090 -f 2054/1350/2090 2055/1352/2091 2052/1350/2088 -f 2055/1352/2091 2054/1350/2090 2056/1353/2092 -f 2057/1354/2093 2056/1353/2092 2054/1350/2090 -f 2056/1353/2092 2057/1354/2093 2058/1353/2094 -f 2059/1354/2095 2058/1353/2094 2057/1354/2093 -f 2058/1353/2094 2059/1354/2095 2060/1353/2096 -f 2061/1354/2097 2060/1353/2096 2059/1354/2095 -f 2060/1353/2096 2061/1354/2097 2062/1355/2098 -f 2063/1356/2099 2062/1355/2098 2061/1354/2097 -f 2062/1355/2098 2063/1356/2099 2064/1355/2100 -f 2065/1356/2101 2064/1355/2100 2063/1356/2099 -f 2064/1355/2100 2065/1356/2101 2066/1355/2102 -f 2067/1356/2103 2066/1355/2102 2065/1356/2101 -f 2066/1355/2102 2067/1356/2103 2068/1357/2104 -f 2069/1358/2105 2068/1357/2104 2067/1356/2103 -f 2068/1357/2104 2069/1358/2105 2070/1357/2106 -f 2071/1358/2107 2070/1357/2106 2069/1358/2105 -f 2061/1354/2097 2072/1359/2108 2063/1356/2099 -f 2072/1359/2108 2061/1354/2097 2073/1359/2109 -f 2059/1354/2095 2073/1359/2109 2061/1354/2097 -f 2073/1359/2109 2059/1354/2095 2074/1359/2110 -f 2057/1354/2093 2074/1359/2110 2059/1354/2095 -f 2074/1359/2110 2057/1354/2093 2075/1351/2111 -f 2054/1350/2090 2075/1351/2111 2057/1354/2093 -f 2075/1351/2111 2054/1350/2090 2053/1351/2089 -f 2075/1351/2111 2053/1351/2089 2076/1360/2112 -f 2053/1351/2089 2077/1351/2113 2076/1360/2112 -f 2053/1351/2089 2052/1350/2088 2077/1351/2113 -f 2078/1350/2114 2077/1351/2113 2052/1350/2088 -f 2052/1350/2088 2079/1352/2115 2078/1350/2114 -f 2080/1352/2116 2078/1350/2114 2079/1352/2115 -f 2081/1361/2117 2082/1361/2118 2076/1360/2112 -f 2082/1361/2118 2083/1361/2119 2076/1360/2112 -f 2083/1361/2119 2072/1359/2108 2076/1360/2112 -f 2072/1359/2108 2073/1359/2109 2076/1360/2112 -f 2073/1359/2109 2074/1359/2110 2076/1360/2112 -f 2074/1359/2110 2075/1351/2111 2076/1360/2112 -f 2084/1362/2120 2081/1361/2117 2076/1363/2121 -f 2070/1357/2106 2071/1358/2107 2085/1357/2122 -f 2086/1358/2123 2085/1357/2122 2071/1358/2107 -f 2085/1357/2122 2086/1358/2123 2080/1364/2124 -f 2078/1365/2125 2080/1364/2124 2086/1358/2123 -f 2086/1358/2123 2087/1362/2126 2078/1365/2125 -f 2077/1366/2127 2078/1365/2125 2087/1362/2126 -f 2077/1366/2127 2087/1362/2126 2076/1363/2121 -f 2087/1362/2126 2088/1362/2128 2076/1363/2121 -f 2088/1362/2128 2084/1362/2120 2076/1363/2121 -f 2088/1362/2128 2071/1358/2107 2084/1362/2120 -f 2069/1358/2105 2084/1362/2120 2071/1358/2107 -f 2084/1362/2120 2069/1358/2105 2081/1361/2117 -f 2067/1356/2103 2081/1361/2117 2069/1358/2105 -f 2081/1361/2117 2067/1356/2103 2082/1361/2118 -f 2065/1356/2101 2082/1361/2118 2067/1356/2103 -f 2082/1361/2118 2065/1356/2101 2083/1361/2119 -f 2063/1356/2099 2083/1361/2119 2065/1356/2101 -f 2083/1361/2119 2063/1356/2099 2072/1359/2108 -f 2087/1362/2126 2086/1358/2123 2088/1362/2128 -f 2071/1358/2107 2088/1362/2128 2086/1358/2123 -f 2085/1367/2129 2080/1367/2129 2070/1368/2129 -f 2080/1367/2129 2066/1369/2129 2070/1368/2129 -f 2058/1370/2129 2066/1369/2129 2080/1367/2129 -f 2062/1371/2129 2066/1369/2129 2058/1370/2129 -f 2060/1370/2129 2062/1371/2129 2058/1370/2129 -f 2070/1368/2129 2066/1369/2129 2068/1372/2129 -f 2064/1371/2129 2066/1369/2129 2062/1371/2129 -f 2049/1373/2130 2089/1374/2129 2051/1373/2130 -f 2090/1374/2131 2051/1373/2130 2089/1374/2129 -f 2090/1374/2131 2089/1374/2129 2091/1348/2132 -f 2092/1348/2132 2091/1348/2132 2089/1374/2129 -f 2050/1373/2133 2093/1374/2134 2048/1373/2133 -f 2094/1374/2135 2048/1373/2133 2093/1374/2134 -f 2093/1374/2134 2095/1348/2136 2094/1374/2135 -f 2096/1348/2136 2094/1374/2135 2095/1348/2136 -f 2048/1375/2137 2094/1376/2137 2049/1377/2137 -f 2089/1378/2137 2049/1377/2137 2094/1376/2137 -f 2094/1376/2137 2096/1379/2137 2089/1378/2137 -f 2092/1380/2137 2089/1378/2137 2096/1379/2137 -f 2097/1373/2138 2098/1374/2135 2099/1373/2138 -f 2100/1374/2139 2099/1373/2138 2098/1374/2135 -f 2098/1374/2135 2101/1348/2140 2100/1374/2139 -f 2102/1348/2140 2100/1374/2139 2101/1348/2140 -f 2099/1375/2087 2100/1376/2087 2103/1377/2087 -f 2104/1378/2087 2103/1377/2087 2100/1376/2087 -f 2100/1376/2087 2102/1379/2087 2104/1378/2087 -f 2105/1380/2087 2104/1378/2087 2102/1379/2087 -f 2105/1348/2141 2106/1348/2141 2104/1374/2142 -f 2107/1374/2129 2104/1374/2142 2106/1348/2141 -f 2107/1374/2129 2108/1373/2143 2104/1374/2142 -f 2103/1373/2143 2104/1374/2142 2108/1373/2143 -f 2101/1375/2144 2098/1376/2144 2106/1377/2144 -f 2107/1378/2144 2106/1377/2144 2098/1376/2144 -f 2098/1376/2144 2097/1379/2144 2107/1378/2144 -f 2108/1380/2144 2107/1378/2144 2097/1379/2144 -f 2079/1381/2129 2055/1381/2129 2080/1367/2129 -f 2055/1381/2129 2058/1370/2129 2080/1367/2129 -f 2056/1382/2129 2058/1370/2129 2055/1381/2129 -f 2095/1375/2145 2093/1376/2145 2091/1377/2145 -f 2090/1378/2145 2091/1377/2145 2093/1376/2145 -f 2093/1376/2145 2050/1379/2145 2090/1378/2145 -f 2051/1380/2145 2090/1378/2145 2050/1379/2145 -f 2095/1348/2144 2091/1349/2144 2096/1348/2144 -f 2092/1349/2144 2096/1348/2144 2091/1349/2144 -f 2099/1348/2145 2103/1349/2145 2097/1348/2145 -f 2108/1349/2145 2097/1348/2145 2103/1349/2145 -f 2101/1348/2137 2106/1349/2137 2102/1348/2137 -f 2105/1349/2137 2102/1348/2137 2106/1349/2137 -f 2079/1352/2115 2052/1350/2088 2055/1352/2091 -f 2109/1348/2087 2110/1349/2087 2111/1348/2087 -f 2112/1349/2087 2111/1348/2087 2110/1349/2087 -f 2113/1350/2088 2114/1351/2089 2115/1350/2090 -f 2115/1350/2090 2116/1352/2091 2113/1350/2088 -f 2116/1352/2091 2115/1350/2090 2117/1353/2092 -f 2118/1354/2093 2117/1353/2092 2115/1350/2090 -f 2117/1353/2092 2118/1354/2093 2119/1353/2094 -f 2120/1354/2095 2119/1353/2094 2118/1354/2093 -f 2119/1353/2094 2120/1354/2095 2121/1353/2096 -f 2122/1354/2097 2121/1353/2096 2120/1354/2095 -f 2121/1353/2096 2122/1354/2097 2123/1355/2098 -f 2124/1356/2099 2123/1355/2098 2122/1354/2097 -f 2123/1355/2098 2124/1356/2099 2125/1355/2100 -f 2126/1356/2101 2125/1355/2100 2124/1356/2099 -f 2125/1355/2100 2126/1356/2101 2127/1355/2102 -f 2128/1356/2103 2127/1355/2102 2126/1356/2101 -f 2127/1355/2102 2128/1356/2103 2129/1357/2104 -f 2130/1358/2105 2129/1357/2104 2128/1356/2103 -f 2129/1357/2104 2130/1358/2105 2131/1357/2106 -f 2132/1358/2107 2131/1357/2106 2130/1358/2105 -f 2122/1354/2097 2133/1359/2108 2124/1356/2099 -f 2133/1359/2108 2122/1354/2097 2134/1359/2109 -f 2120/1354/2095 2134/1359/2109 2122/1354/2097 -f 2134/1359/2109 2120/1354/2095 2135/1359/2110 -f 2118/1354/2093 2135/1359/2110 2120/1354/2095 -f 2135/1359/2110 2118/1354/2093 2136/1351/2111 -f 2115/1350/2090 2136/1351/2111 2118/1354/2093 -f 2136/1351/2111 2115/1350/2090 2114/1351/2089 -f 2136/1351/2111 2114/1351/2089 2137/1360/2112 -f 2114/1351/2089 2138/1351/2113 2137/1360/2112 -f 2114/1351/2089 2113/1350/2088 2138/1351/2113 -f 2139/1350/2114 2138/1351/2113 2113/1350/2088 -f 2113/1350/2088 2140/1352/2115 2139/1350/2114 -f 2141/1352/2116 2139/1350/2114 2140/1352/2115 -f 2142/1361/2117 2143/1361/2118 2137/1360/2112 -f 2143/1361/2118 2144/1361/2119 2137/1360/2112 -f 2144/1361/2119 2133/1359/2108 2137/1360/2112 -f 2133/1359/2108 2134/1359/2109 2137/1360/2112 -f 2134/1359/2109 2135/1359/2110 2137/1360/2112 -f 2135/1359/2110 2136/1351/2111 2137/1360/2112 -f 2145/1362/2120 2142/1361/2117 2137/1363/2121 -f 2131/1357/2106 2132/1358/2107 2146/1357/2122 -f 2147/1358/2123 2146/1357/2122 2132/1358/2107 -f 2146/1357/2122 2147/1358/2123 2141/1364/2124 -f 2139/1365/2125 2141/1364/2124 2147/1358/2123 -f 2147/1358/2123 2148/1362/2126 2139/1365/2125 -f 2138/1366/2127 2139/1365/2125 2148/1362/2126 -f 2138/1366/2127 2148/1362/2126 2137/1363/2121 -f 2148/1362/2126 2149/1362/2128 2137/1363/2121 -f 2149/1362/2128 2145/1362/2120 2137/1363/2121 -f 2149/1362/2128 2132/1358/2107 2145/1362/2120 -f 2130/1358/2105 2145/1362/2120 2132/1358/2107 -f 2145/1362/2120 2130/1358/2105 2142/1361/2117 -f 2128/1356/2103 2142/1361/2117 2130/1358/2105 -f 2142/1361/2117 2128/1356/2103 2143/1361/2118 -f 2126/1356/2101 2143/1361/2118 2128/1356/2103 -f 2143/1361/2118 2126/1356/2101 2144/1361/2119 -f 2124/1356/2099 2144/1361/2119 2126/1356/2101 -f 2144/1361/2119 2124/1356/2099 2133/1359/2108 -f 2148/1362/2126 2147/1358/2123 2149/1362/2128 -f 2132/1358/2107 2149/1362/2128 2147/1358/2123 -f 2146/1367/2129 2141/1367/2129 2131/1368/2129 -f 2141/1367/2129 2127/1369/2129 2131/1368/2129 -f 2119/1370/2129 2127/1369/2129 2141/1367/2129 -f 2123/1371/2129 2127/1369/2129 2119/1370/2129 -f 2121/1370/2129 2123/1371/2129 2119/1370/2129 -f 2131/1368/2129 2127/1369/2129 2129/1372/2129 -f 2125/1371/2129 2127/1369/2129 2123/1371/2129 -f 2110/1373/2130 2150/1374/2129 2112/1373/2130 -f 2151/1374/2131 2112/1373/2130 2150/1374/2129 -f 2151/1374/2131 2150/1374/2129 2152/1348/2132 -f 2153/1348/2132 2152/1348/2132 2150/1374/2129 -f 2111/1373/2133 2154/1374/2134 2109/1373/2133 -f 2155/1374/2135 2109/1373/2133 2154/1374/2134 -f 2154/1374/2134 2156/1348/2136 2155/1374/2135 -f 2157/1348/2136 2155/1374/2135 2156/1348/2136 -f 2109/1375/2137 2155/1376/2137 2110/1377/2137 -f 2150/1378/2137 2110/1377/2137 2155/1376/2137 -f 2155/1376/2137 2157/1379/2137 2150/1378/2137 -f 2153/1380/2137 2150/1378/2137 2157/1379/2137 -f 2158/1373/2138 2159/1374/2135 2160/1373/2138 -f 2161/1374/2139 2160/1373/2138 2159/1374/2135 -f 2159/1374/2135 2162/1348/2140 2161/1374/2139 -f 2163/1348/2140 2161/1374/2139 2162/1348/2140 -f 2160/1375/2087 2161/1376/2087 2164/1377/2087 -f 2165/1378/2087 2164/1377/2087 2161/1376/2087 -f 2161/1376/2087 2163/1379/2087 2165/1378/2087 -f 2166/1380/2087 2165/1378/2087 2163/1379/2087 -f 2166/1348/2141 2167/1348/2141 2165/1374/2142 -f 2168/1374/2129 2165/1374/2142 2167/1348/2141 -f 2168/1374/2129 2169/1373/2143 2165/1374/2142 -f 2164/1373/2143 2165/1374/2142 2169/1373/2143 -f 2162/1375/2144 2159/1376/2144 2167/1377/2144 -f 2168/1378/2144 2167/1377/2144 2159/1376/2144 -f 2159/1376/2144 2158/1379/2144 2168/1378/2144 -f 2169/1380/2144 2168/1378/2144 2158/1379/2144 -f 2140/1381/2129 2116/1381/2129 2141/1367/2129 -f 2116/1381/2129 2119/1370/2129 2141/1367/2129 -f 2117/1382/2129 2119/1370/2129 2116/1381/2129 -f 2156/1375/2145 2154/1376/2145 2152/1377/2145 -f 2151/1378/2145 2152/1377/2145 2154/1376/2145 -f 2154/1376/2145 2111/1379/2145 2151/1378/2145 -f 2112/1380/2145 2151/1378/2145 2111/1379/2145 -f 2156/1348/2144 2152/1349/2144 2157/1348/2144 -f 2153/1349/2144 2157/1348/2144 2152/1349/2144 -f 2160/1348/2145 2164/1349/2145 2158/1348/2145 -f 2169/1349/2145 2158/1348/2145 2164/1349/2145 -f 2162/1348/2137 2167/1349/2137 2163/1348/2137 -f 2166/1349/2137 2163/1348/2137 2167/1349/2137 -f 2140/1352/2115 2113/1350/2088 2116/1352/2091 -f 2170/1348/2087 2171/1349/2087 2172/1348/2087 -f 2173/1349/2087 2172/1348/2087 2171/1349/2087 -f 2174/1350/2088 2175/1351/2089 2176/1350/2090 -f 2176/1350/2090 2177/1352/2091 2174/1350/2088 -f 2177/1352/2091 2176/1350/2090 2178/1353/2092 -f 2179/1354/2093 2178/1353/2092 2176/1350/2090 -f 2178/1353/2092 2179/1354/2093 2180/1353/2094 -f 2181/1354/2095 2180/1353/2094 2179/1354/2093 -f 2180/1353/2094 2181/1354/2095 2182/1353/2096 -f 2183/1354/2097 2182/1353/2096 2181/1354/2095 -f 2182/1353/2096 2183/1354/2097 2184/1355/2098 -f 2185/1356/2099 2184/1355/2098 2183/1354/2097 -f 2184/1355/2098 2185/1356/2099 2186/1355/2100 -f 2187/1356/2101 2186/1355/2100 2185/1356/2099 -f 2186/1355/2100 2187/1356/2101 2188/1355/2102 -f 2189/1356/2103 2188/1355/2102 2187/1356/2101 -f 2188/1355/2102 2189/1356/2103 2190/1357/2104 -f 2191/1358/2105 2190/1357/2104 2189/1356/2103 -f 2190/1357/2104 2191/1358/2105 2192/1357/2106 -f 2193/1358/2107 2192/1357/2106 2191/1358/2105 -f 2183/1354/2097 2194/1359/2108 2185/1356/2099 -f 2194/1359/2108 2183/1354/2097 2195/1359/2109 -f 2181/1354/2095 2195/1359/2109 2183/1354/2097 -f 2195/1359/2109 2181/1354/2095 2196/1359/2110 -f 2179/1354/2093 2196/1359/2110 2181/1354/2095 -f 2196/1359/2110 2179/1354/2093 2197/1351/2111 -f 2176/1350/2090 2197/1351/2111 2179/1354/2093 -f 2197/1351/2111 2176/1350/2090 2175/1351/2089 -f 2197/1351/2111 2175/1351/2089 2198/1360/2112 -f 2175/1351/2089 2199/1351/2113 2198/1360/2112 -f 2175/1351/2089 2174/1350/2088 2199/1351/2113 -f 2200/1350/2114 2199/1351/2113 2174/1350/2088 -f 2174/1350/2088 2201/1352/2115 2200/1350/2114 -f 2202/1352/2116 2200/1350/2114 2201/1352/2115 -f 2203/1361/2117 2204/1361/2118 2198/1360/2112 -f 2204/1361/2118 2205/1361/2119 2198/1360/2112 -f 2205/1361/2119 2194/1359/2108 2198/1360/2112 -f 2194/1359/2108 2195/1359/2109 2198/1360/2112 -f 2195/1359/2109 2196/1359/2110 2198/1360/2112 -f 2196/1359/2110 2197/1351/2111 2198/1360/2112 -f 2206/1362/2120 2203/1361/2117 2198/1363/2121 -f 2192/1357/2106 2193/1358/2107 2207/1357/2122 -f 2208/1358/2123 2207/1357/2122 2193/1358/2107 -f 2207/1357/2122 2208/1358/2123 2202/1364/2124 -f 2200/1365/2125 2202/1364/2124 2208/1358/2123 -f 2208/1358/2123 2209/1362/2126 2200/1365/2125 -f 2199/1366/2127 2200/1365/2125 2209/1362/2126 -f 2199/1366/2127 2209/1362/2126 2198/1363/2121 -f 2209/1362/2126 2210/1362/2128 2198/1363/2121 -f 2210/1362/2128 2206/1362/2120 2198/1363/2121 -f 2210/1362/2128 2193/1358/2107 2206/1362/2120 -f 2191/1358/2105 2206/1362/2120 2193/1358/2107 -f 2206/1362/2120 2191/1358/2105 2203/1361/2117 -f 2189/1356/2103 2203/1361/2117 2191/1358/2105 -f 2203/1361/2117 2189/1356/2103 2204/1361/2118 -f 2187/1356/2101 2204/1361/2118 2189/1356/2103 -f 2204/1361/2118 2187/1356/2101 2205/1361/2119 -f 2185/1356/2099 2205/1361/2119 2187/1356/2101 -f 2205/1361/2119 2185/1356/2099 2194/1359/2108 -f 2209/1362/2126 2208/1358/2123 2210/1362/2128 -f 2193/1358/2107 2210/1362/2128 2208/1358/2123 -f 2207/1367/2129 2202/1367/2129 2192/1368/2129 -f 2202/1367/2129 2188/1369/2129 2192/1368/2129 -f 2180/1370/2129 2188/1369/2129 2202/1367/2129 -f 2184/1371/2129 2188/1369/2129 2180/1370/2129 -f 2182/1370/2129 2184/1371/2129 2180/1370/2129 -f 2192/1368/2129 2188/1369/2129 2190/1372/2129 -f 2186/1371/2129 2188/1369/2129 2184/1371/2129 -f 2171/1373/2130 2211/1374/2129 2173/1373/2130 -f 2212/1374/2131 2173/1373/2130 2211/1374/2129 -f 2212/1374/2131 2211/1374/2129 2213/1348/2132 -f 2214/1348/2132 2213/1348/2132 2211/1374/2129 -f 2172/1373/2133 2215/1374/2134 2170/1373/2133 -f 2216/1374/2135 2170/1373/2133 2215/1374/2134 -f 2215/1374/2134 2217/1348/2136 2216/1374/2135 -f 2218/1348/2136 2216/1374/2135 2217/1348/2136 -f 2170/1375/2137 2216/1376/2137 2171/1377/2137 -f 2211/1378/2137 2171/1377/2137 2216/1376/2137 -f 2216/1376/2137 2218/1379/2137 2211/1378/2137 -f 2214/1380/2137 2211/1378/2137 2218/1379/2137 -f 2219/1373/2138 2220/1374/2135 2221/1373/2138 -f 2222/1374/2139 2221/1373/2138 2220/1374/2135 -f 2220/1374/2135 2223/1348/2140 2222/1374/2139 -f 2224/1348/2140 2222/1374/2139 2223/1348/2140 -f 2221/1375/2087 2222/1376/2087 2225/1377/2087 -f 2226/1378/2087 2225/1377/2087 2222/1376/2087 -f 2222/1376/2087 2224/1379/2087 2226/1378/2087 -f 2227/1380/2087 2226/1378/2087 2224/1379/2087 -f 2227/1348/2141 2228/1348/2141 2226/1374/2142 -f 2229/1374/2129 2226/1374/2142 2228/1348/2141 -f 2229/1374/2129 2230/1373/2143 2226/1374/2142 -f 2225/1373/2143 2226/1374/2142 2230/1373/2143 -f 2223/1375/2144 2220/1376/2144 2228/1377/2144 -f 2229/1378/2144 2228/1377/2144 2220/1376/2144 -f 2220/1376/2144 2219/1379/2144 2229/1378/2144 -f 2230/1380/2144 2229/1378/2144 2219/1379/2144 -f 2201/1381/2129 2177/1381/2129 2202/1367/2129 -f 2177/1381/2129 2180/1370/2129 2202/1367/2129 -f 2178/1382/2129 2180/1370/2129 2177/1381/2129 -f 2217/1375/2145 2215/1376/2145 2213/1377/2145 -f 2212/1378/2145 2213/1377/2145 2215/1376/2145 -f 2215/1376/2145 2172/1379/2145 2212/1378/2145 -f 2173/1380/2145 2212/1378/2145 2172/1379/2145 -f 2217/1348/2144 2213/1349/2144 2218/1348/2144 -f 2214/1349/2144 2218/1348/2144 2213/1349/2144 -f 2221/1348/2145 2225/1349/2145 2219/1348/2145 -f 2230/1349/2145 2219/1348/2145 2225/1349/2145 -f 2223/1348/2137 2228/1349/2137 2224/1348/2137 -f 2227/1349/2137 2224/1348/2137 2228/1349/2137 -f 2201/1352/2115 2174/1350/2088 2177/1352/2091 -# 330 faces - -# -# object P_51_Mustang_Left_Wing_Flap -# - -v 4.70 -0.34 3.26 -v 5.20 -0.60 -0.73 -v 4.68 -0.83 3.28 -v 29.00 -0.53 5.74 -v 29.38 -0.84 2.43 -v 28.97 -1.13 5.77 -# 6 vertices - -vn -0.99 0.04 -0.13 -vn 0.01 1.00 -0.06 -vn 0.02 1.00 -0.09 -vn 0.01 1.00 -0.07 -vn -0.10 0.04 0.99 -vn -0.10 0.06 0.99 -vn -0.00 -1.00 -0.06 -vn -0.00 -1.00 -0.08 -vn -0.00 -1.00 -0.09 -vn 0.99 -0.04 0.12 -# 10 vertex normals - -vt 0.23 0.01 0.00 -vt 0.29 0.02 0.00 -vt 0.23 0.02 0.00 -vt 0.98 0.45 0.00 -vt 0.65 0.50 0.00 -vt 0.97 0.38 0.00 -vt 0.65 0.44 0.00 -vt 0.46 0.01 0.00 -vt 0.46 0.00 0.00 -vt 0.23 0.00 0.00 -vt 0.01 0.04 0.00 -vt 0.01 0.31 0.00 -vt 0.06 0.05 0.00 -vt 0.05 0.32 0.00 -vt 0.28 0.01 0.00 -vt 0.33 0.02 0.00 -vt 0.33 0.01 0.00 -# 17 texture coords - -g P_51_Mustang_Left_Wing_Flap -f 2231/1383/2146 2232/1384/2146 2233/1385/2146 -f 2231/1386/2147 2234/1387/2148 2232/1388/2149 -f 2235/1389/2148 2232/1388/2149 2234/1387/2148 -f 2233/1390/2150 2236/1383/2151 2231/1391/2150 -f 2234/1392/2151 2231/1391/2150 2236/1383/2151 -f 2232/1393/2152 2235/1394/2153 2233/1395/2152 -f 2236/1396/2154 2233/1395/2152 2235/1394/2153 -f 2235/1397/2155 2234/1398/2155 2236/1399/2155 -# 8 faces - -# -# object P_51_Mustang_Right_Elevator -# - -v -1.73 4.93 -32.15 -v -1.43 4.98 -35.87 -v -1.80 5.11 -32.31 -v -4.44 4.96 -31.91 -v -4.06 5.00 -35.35 -v -7.81 5.09 -34.62 -v -7.82 5.05 -31.65 -v -11.23 5.16 -33.95 -v -11.33 5.14 -31.30 -v -14.07 5.22 -33.39 -v -14.38 5.21 -32.45 -v -13.95 5.24 -30.69 -v -13.81 5.66 -30.77 -v -11.12 5.68 -31.09 -v -7.79 5.68 -31.43 -v -4.42 5.63 -31.75 -v -1.74 5.55 -32.08 -# 17 vertices - -vn 0.91 0.41 0.08 -vn -0.01 -1.00 -0.01 -vn -0.02 -1.00 -0.01 -vn -0.03 -1.00 -0.01 -vn -0.03 -1.00 -0.00 -vn -0.02 -1.00 -0.02 -vn -0.02 -1.00 -0.00 -vn -0.03 -1.00 0.03 -vn -0.03 0.99 -0.16 -vn -0.02 0.98 -0.17 -vn -0.02 0.99 -0.17 -vn -0.02 0.98 -0.18 -vn -0.01 0.98 -0.18 -vn -0.01 0.98 -0.17 -vn -0.03 0.98 -0.18 -vn -0.00 0.99 -0.16 -vn -0.01 0.99 -0.16 -vn 0.01 0.99 -0.15 -vn 0.98 -0.18 0.11 -# 19 vertex normals - -vt 0.96 0.79 0.00 -vt 0.96 0.78 0.00 -vt 0.02 0.62 0.00 -vt 0.06 0.63 0.00 -vt 0.01 0.57 0.00 -vt 0.05 0.58 0.00 -vt 0.11 0.59 0.00 -vt 0.11 0.63 0.00 -vt 0.16 0.60 0.00 -vt 0.16 0.63 0.00 -vt 0.20 0.60 0.00 -vt 0.20 0.62 0.00 -vt 0.20 0.64 0.00 -vt 0.29 0.23 0.00 -vt 0.29 0.27 0.00 -vt 0.25 0.22 0.00 -vt 0.25 0.27 0.00 -vt 0.29 0.32 0.00 -vt 0.24 0.32 0.00 -vt 0.28 0.37 0.00 -vt 0.23 0.37 0.00 -vt 0.22 0.41 0.00 -vt 0.28 0.41 0.00 -# 23 texture coords - -g P_51_Mustang_Right_Elevator -f 2237/1400/2156 2238/1401/2156 2239/1400/2156 -f 2237/1402/2157 2240/1403/2158 2238/1404/2157 -f 2241/1405/2158 2238/1404/2157 2240/1403/2158 -f 2241/1405/2158 2240/1403/2158 2242/1406/2159 -f 2243/1407/2159 2242/1406/2159 2240/1403/2158 -f 2242/1406/2159 2243/1407/2159 2244/1408/2158 -f 2245/1409/2160 2244/1408/2158 2243/1407/2159 -f 2246/1410/2161 2244/1408/2158 2245/1409/2160 -f 2247/1411/2162 2246/1410/2161 2245/1409/2160 -f 2248/1412/2163 2247/1411/2162 2245/1409/2160 -f 2249/1413/2164 2250/1414/2165 2246/1415/2166 -f 2244/1416/2167 2246/1415/2166 2250/1414/2165 -f 2250/1414/2165 2251/1417/2168 2244/1416/2167 -f 2242/1418/2168 2244/1416/2167 2251/1417/2168 -f 2251/1417/2168 2252/1419/2168 2242/1418/2168 -f 2241/1420/2169 2242/1418/2168 2252/1419/2168 -f 2241/1420/2170 2252/1419/2171 2238/1421/2172 -f 2253/1422/2173 2238/1421/2172 2252/1419/2171 -f 2253/1400/2174 2239/1400/2174 2238/1401/2174 -# 19 faces - -# -# object P_51_Mustang_Back_Wheel -# - -v 0.75 -3.90 -21.82 -v 0.72 -4.53 -21.59 -v 0.78 -3.45 -22.32 -v 0.67 -5.83 -22.72 -v 0.69 -5.68 -23.36 -v 0.67 -5.64 -22.12 -v 0.79 -3.49 -23.56 -v 0.79 -3.30 -22.96 -v 0.69 -5.17 -21.70 -v 0.29 -3.41 -23.61 -v 0.29 -3.21 -22.96 -v 0.27 -3.37 -22.27 -v 0.24 -3.85 -21.74 -v 0.21 -4.52 -21.50 -v 0.18 -5.20 -21.61 -v 0.16 -5.72 -22.06 -v 0.16 -5.92 -22.71 -v 0.17 -5.76 -23.40 -v 0.72 -5.24 -23.86 -v 0.20 -5.28 -23.93 -v 0.75 -4.61 -24.09 -v 0.24 -4.61 -24.17 -v 0.78 -3.97 -23.98 -v 0.27 -3.92 -24.06 -v -0.25 -3.96 -23.97 -v -0.23 -3.49 -23.55 -v -0.23 -3.30 -22.95 -v -0.24 -3.45 -22.31 -v -0.27 -3.89 -21.81 -v -0.30 -4.52 -21.58 -v -0.33 -5.16 -21.69 -v -0.35 -5.63 -22.11 -v -0.35 -5.82 -22.71 -v -0.33 -5.68 -23.35 -v -0.31 -5.23 -23.85 -v -0.28 -4.60 -24.08 -# 36 vertices - -vn 1.00 -0.05 0.01 -vn 0.18 0.82 -0.54 -vn 0.00 0.84 -0.55 -vn 0.19 0.98 -0.04 -vn 0.01 1.00 -0.04 -vn 0.18 0.87 0.46 -vn 0.01 0.89 0.46 -vn 0.18 0.55 0.82 -vn 0.01 0.56 0.83 -vn 0.18 0.09 0.98 -vn 0.01 0.09 1.00 -vn 0.18 -0.42 0.89 -vn 0.00 -0.43 0.90 -vn 0.18 -0.82 0.54 -vn -0.00 -0.84 0.55 -vn 0.17 -0.99 0.03 -vn -0.01 -1.00 0.04 -vn 0.16 -0.87 -0.46 -vn -0.01 -0.89 -0.46 -vn 0.16 -0.55 -0.82 -vn -0.01 -0.56 -0.83 -vn 0.17 -0.09 -0.98 -vn -0.01 -0.09 -1.00 -vn 0.18 0.42 -0.89 -vn -0.00 0.43 -0.90 -vn -0.18 0.42 -0.89 -vn -0.18 0.82 -0.54 -vn -0.17 0.99 -0.03 -vn -0.16 0.87 0.46 -vn -0.16 0.55 0.82 -vn -0.17 0.09 0.98 -vn -0.18 -0.42 0.89 -vn -0.18 -0.82 0.54 -vn -0.19 -0.98 0.04 -vn -0.18 -0.87 -0.46 -vn -0.18 -0.55 -0.82 -vn -0.18 -0.09 -0.98 -vn -1.00 0.05 -0.01 -# 38 vertex normals - -vt 0.79 0.99 0.00 -vt 0.81 0.99 0.00 -vt 0.78 0.97 0.00 -vt 0.85 0.95 0.00 -vt 0.85 0.93 0.00 -vt 0.85 0.97 0.00 -vt 0.78 0.93 0.00 -vt 0.77 0.95 0.00 -vt 0.83 0.99 0.00 -vt 0.31 0.75 0.00 -vt 0.31 0.76 0.00 -vt 0.30 0.75 0.00 -vt 0.30 0.76 0.00 -vt 0.33 0.75 0.00 -vt 0.32 0.76 0.00 -vt 0.34 0.75 0.00 -vt 0.34 0.76 0.00 -vt 0.36 0.75 0.00 -vt 0.36 0.76 0.00 -vt 0.37 0.75 0.00 -vt 0.37 0.76 0.00 -vt 0.38 0.75 0.00 -vt 0.39 0.76 0.00 -vt 0.33 0.77 0.00 -vt 0.31 0.77 0.00 -vt 0.30 0.77 0.00 -vt 0.34 0.77 0.00 -vt 0.36 0.77 0.00 -vt 0.37 0.77 0.00 -vt 0.38 0.77 0.00 -vt 0.83 0.92 0.00 -vt 0.79 0.92 0.00 -vt 0.81 0.91 0.00 -# 33 texture coords - -g P_51_Mustang_Back_Wheel -f 2254/1423/2175 2255/1424/2175 2256/1425/2175 -f 2257/1426/2175 2258/1427/2175 2259/1428/2175 -f 2258/1427/2175 2255/1424/2175 2259/1428/2175 -f 2260/1429/2175 2255/1424/2175 2258/1427/2175 -f 2256/1425/2175 2255/1424/2175 2260/1429/2175 -f 2261/1430/2175 2256/1425/2175 2260/1429/2175 -f 2259/1428/2175 2255/1424/2175 2262/1431/2175 -f 2260/1432/2176 2263/1433/2177 2261/1434/2178 -f 2264/1435/2179 2261/1434/2178 2263/1433/2177 -f 2261/1434/2178 2264/1435/2179 2256/1432/2180 -f 2265/1433/2181 2256/1432/2180 2264/1435/2179 -f 2256/1432/2180 2265/1433/2181 2254/1436/2182 -f 2266/1437/2183 2254/1436/2182 2265/1433/2181 -f 2254/1436/2182 2266/1437/2183 2255/1438/2184 -f 2267/1439/2185 2255/1438/2184 2266/1437/2183 -f 2255/1438/2184 2267/1439/2185 2262/1440/2186 -f 2268/1441/2187 2262/1440/2186 2267/1439/2185 -f 2262/1440/2186 2268/1441/2187 2259/1442/2188 -f 2269/1443/2189 2259/1442/2188 2268/1441/2187 -f 2259/1442/2188 2269/1443/2189 2257/1444/2190 -f 2270/1445/2191 2257/1444/2190 2269/1443/2189 -f 2257/1444/2190 2270/1445/2191 2258/1442/2192 -f 2271/1443/2193 2258/1442/2192 2270/1445/2191 -f 2258/1442/2192 2271/1443/2193 2272/1440/2194 -f 2273/1441/2195 2272/1440/2194 2271/1443/2193 -f 2272/1440/2194 2273/1441/2195 2274/1438/2196 -f 2275/1439/2197 2274/1438/2196 2273/1441/2195 -f 2274/1438/2196 2275/1439/2197 2276/1436/2198 -f 2277/1437/2199 2276/1436/2198 2275/1439/2197 -f 2276/1436/2198 2277/1437/2199 2260/1432/2176 -f 2263/1433/2177 2260/1432/2176 2277/1437/2199 -f 2277/1437/2199 2278/1446/2200 2263/1433/2177 -f 2279/1447/2201 2263/1433/2177 2278/1446/2200 -f 2263/1433/2177 2279/1447/2201 2264/1435/2179 -f 2280/1448/2202 2264/1435/2179 2279/1447/2201 -f 2264/1435/2179 2280/1448/2202 2265/1433/2181 -f 2281/1447/2203 2265/1433/2181 2280/1448/2202 -f 2265/1433/2181 2281/1447/2203 2266/1437/2183 -f 2282/1446/2204 2266/1437/2183 2281/1447/2203 -f 2266/1437/2183 2282/1446/2204 2267/1439/2185 -f 2283/1449/2205 2267/1439/2185 2282/1446/2204 -f 2267/1439/2185 2283/1449/2205 2268/1441/2187 -f 2284/1450/2206 2268/1441/2187 2283/1449/2205 -f 2268/1441/2187 2284/1450/2206 2269/1443/2189 -f 2285/1451/2207 2269/1443/2189 2284/1450/2206 -f 2269/1443/2189 2285/1451/2207 2270/1445/2191 -f 2286/1452/2208 2270/1445/2191 2285/1451/2207 -f 2270/1445/2191 2286/1452/2208 2271/1443/2193 -f 2287/1451/2209 2271/1443/2193 2286/1452/2208 -f 2271/1443/2193 2287/1451/2209 2273/1441/2195 -f 2288/1450/2210 2273/1441/2195 2287/1451/2209 -f 2273/1441/2195 2288/1450/2210 2275/1439/2197 -f 2289/1449/2211 2275/1439/2197 2288/1450/2210 -f 2275/1439/2197 2289/1449/2211 2277/1437/2199 -f 2278/1446/2200 2277/1437/2199 2289/1449/2211 -f 2285/1428/2212 2284/1431/2212 2286/1426/2212 -f 2286/1426/2212 2284/1431/2212 2288/1453/2212 -f 2288/1453/2212 2284/1431/2212 2280/1430/2212 -f 2278/1454/2212 2288/1453/2212 2280/1430/2212 -f 2279/1429/2212 2278/1454/2212 2280/1430/2212 -f 2289/1455/2212 2288/1453/2212 2278/1454/2212 -f 2287/1427/2212 2286/1426/2212 2288/1453/2212 -f 2272/1453/2175 2274/1455/2175 2258/1427/2175 -f 2274/1455/2175 2260/1429/2175 2258/1427/2175 -f 2276/1454/2175 2260/1429/2175 2274/1455/2175 -f 2281/1425/2212 2280/1430/2212 2282/1423/2212 -f 2280/1430/2212 2284/1431/2212 2282/1423/2212 -f 2282/1423/2212 2284/1431/2212 2283/1424/2212 -# 68 faces - -# -# object P_51_Mustang_Left_Elevator -# - -v 3.14 4.95 -35.92 -v 3.33 4.89 -32.33 -v 3.39 5.51 -32.16 -v 5.75 4.92 -35.46 -v 6.03 4.88 -32.03 -v 9.49 4.95 -34.81 -v 9.40 4.92 -31.81 -v 12.89 4.98 -34.22 -v 12.73 4.96 -31.49 -v 15.72 4.99 -33.73 -v 15.64 4.97 -32.81 -v 15.50 5.01 -31.28 -v 15.57 5.42 -31.45 -v 12.75 5.49 -31.56 -v 9.43 5.54 -31.80 -v 6.06 5.54 -32.00 -v 3.41 5.07 -32.37 -# 17 vertices - -vn -1.00 0.08 0.05 -vn -0.01 -1.00 -0.01 -vn 0.00 -1.00 -0.01 -vn -0.00 -1.00 -0.01 -vn 0.01 -1.00 -0.01 -vn 0.01 -1.00 -0.00 -vn 0.02 -1.00 0.02 -vn 0.03 0.98 -0.18 -vn 0.03 0.98 -0.19 -vn 0.02 0.98 -0.19 -vn 0.02 0.98 -0.18 -vn -0.00 0.98 -0.18 -vn 0.02 0.99 -0.16 -vn 0.01 0.99 -0.17 -vn 0.04 0.99 -0.15 -vn 0.78 -0.24 0.58 -# 16 vertex normals - -vt 0.94 0.79 0.00 -vt 0.93 0.78 0.00 -vt 0.01 0.57 0.00 -vt 0.05 0.58 0.00 -vt 0.02 0.62 0.00 -vt 0.06 0.63 0.00 -vt 0.11 0.59 0.00 -vt 0.11 0.63 0.00 -vt 0.16 0.59 0.00 -vt 0.16 0.64 0.00 -vt 0.20 0.60 0.00 -vt 0.20 0.62 0.00 -vt 0.20 0.64 0.00 -vt 0.29 0.61 0.00 -vt 0.26 0.62 0.00 -vt 0.29 0.57 0.00 -vt 0.25 0.57 0.00 -vt 0.29 0.52 0.00 -vt 0.24 0.52 0.00 -vt 0.28 0.47 0.00 -vt 0.23 0.47 0.00 -vt 0.28 0.43 0.00 -vt 0.22 0.43 0.00 -# 23 texture coords - -g P_51_Mustang_Left_Elevator -f 2290/1456/2213 2291/1457/2213 2292/1457/2213 -f 2290/1458/2214 2293/1459/2215 2291/1460/2216 -f 2294/1461/2217 2291/1460/2216 2293/1459/2215 -f 2293/1459/2215 2295/1462/2217 2294/1461/2217 -f 2296/1463/2217 2294/1461/2217 2295/1462/2217 -f 2295/1462/2217 2297/1464/2217 2296/1463/2217 -f 2298/1465/2218 2296/1463/2217 2297/1464/2217 -f 2299/1466/2215 2298/1465/2218 2297/1464/2217 -f 2300/1467/2215 2298/1465/2218 2299/1466/2215 -f 2301/1468/2219 2298/1465/2218 2300/1467/2215 -f 2302/1469/2220 2299/1470/2220 2303/1471/2221 -f 2297/1472/2221 2303/1471/2221 2299/1470/2220 -f 2303/1471/2221 2297/1472/2221 2304/1473/2222 -f 2295/1474/2222 2304/1473/2222 2297/1472/2221 -f 2304/1473/2222 2295/1474/2222 2305/1475/2223 -f 2293/1476/2223 2305/1475/2223 2295/1474/2222 -f 2305/1475/2224 2293/1476/2225 2292/1477/2226 -f 2290/1478/2227 2292/1477/2226 2293/1476/2225 -f 2306/1457/2228 2292/1457/2228 2291/1457/2228 -# 19 faces - -# -# object P_51_Mustang_Rudder -# - -v 1.94 16.37 -39.44 -v 1.85 16.90 -39.49 -v 1.94 16.37 -39.43 -v -0.40 3.34 -38.12 -v -0.34 5.20 -38.31 -v 0.05 2.94 -41.04 -v 0.27 4.65 -42.12 -v 0.29 7.13 -38.50 -v 0.58 6.72 -42.03 -v 0.67 6.59 -43.07 -v 0.75 7.71 -43.00 -v 1.10 7.67 -43.30 -v 1.43 15.17 -42.50 -v 1.44 7.70 -43.02 -v 1.76 15.18 -42.35 -v 1.50 7.81 -42.12 -v 1.78 15.24 -41.86 -v 1.75 8.22 -38.63 -v 1.92 15.54 -39.35 -v 1.82 16.10 -41.76 -v 1.82 16.67 -41.61 -v 0.34 8.23 -38.61 -v 0.87 15.54 -39.34 -v 0.67 7.82 -42.09 -v 0.92 16.38 -39.42 -v 1.07 15.25 -41.84 -v 1.10 15.19 -42.33 -v 1.49 17.19 -40.75 -v 1.48 17.32 -39.52 -v 1.06 16.91 -39.48 -v 1.15 16.68 -41.59 -v 1.10 16.10 -41.74 -v 1.14 16.05 -42.19 -v 1.47 16.03 -42.34 -v 1.80 16.05 -42.20 -v 1.81 16.63 -42.01 -v 1.82 16.83 -41.81 -v 1.17 16.83 -41.79 -v 1.50 16.81 -41.93 -v 1.17 16.63 -41.99 -v 1.49 16.61 -42.13 -v 0.94 4.41 -43.65 -v 0.48 4.74 -43.09 -v 1.05 6.55 -43.43 -v 1.41 4.73 -43.10 -v 1.44 3.03 -42.87 -v 1.58 4.64 -42.14 -v 1.61 2.93 -41.06 -v 2.02 3.32 -38.14 -v 1.63 1.73 -40.70 -v 1.99 1.54 -37.97 -v 1.44 1.15 -40.85 -v 1.75 0.67 -37.88 -v 0.74 0.99 -40.75 -v 0.67 0.46 -37.85 -v 0.05 1.17 -40.84 -v -0.39 0.69 -37.86 -v -0.54 1.56 -37.94 -v -0.09 1.74 -40.68 -v 0.78 1.47 -42.17 -v 0.24 1.84 -42.10 -v 1.35 1.83 -42.11 -v 0.84 2.58 -43.11 -v 0.29 3.04 -42.85 -v 2.09 4.08 -38.22 -v 2.14 5.18 -38.33 -v 1.49 6.71 -42.05 -v 1.69 7.13 -38.52 -v 1.41 6.58 -43.09 -# 69 vertices - -vn 1.00 0.09 -0.04 -vn 0.91 0.42 -0.05 -vn 0.99 0.16 -0.05 -vn -0.99 0.04 -0.16 -vn -0.97 0.15 -0.18 -vn -0.99 0.03 -0.16 -vn -0.98 0.10 -0.16 -vn -0.98 0.14 -0.13 -vn -0.99 0.11 -0.10 -vn -0.89 0.11 -0.45 -vn -0.88 0.09 -0.47 -vn -0.01 0.10 -1.00 -vn -0.01 0.13 -0.99 -vn 0.89 0.01 -0.46 -vn 0.83 0.04 -0.56 -vn 1.00 -0.03 -0.06 -vn 1.00 -0.04 -0.05 -vn 1.00 -0.04 -0.06 -vn 1.00 -0.03 -0.05 -vn 1.00 -0.02 -0.05 -vn 0.99 0.15 0.03 -vn -0.99 0.05 -0.10 -vn -0.99 0.06 -0.09 -vn -0.99 0.07 -0.10 -vn -0.99 0.14 -0.08 -vn -1.00 0.05 -0.08 -vn -0.82 0.12 -0.56 -vn 0.03 0.99 -0.13 -vn 0.02 0.99 -0.10 -vn -0.87 0.48 -0.08 -vn -0.97 0.24 -0.01 -vn -0.99 0.07 -0.08 -vn -0.79 0.19 -0.58 -vn -0.01 0.25 -0.97 -vn 0.80 0.12 -0.59 -vn 0.75 0.35 -0.55 -vn 0.71 0.64 -0.29 -vn -0.68 0.67 -0.30 -vn -0.00 0.83 -0.56 -vn -0.74 0.40 -0.55 -vn -0.01 0.51 -0.86 -vn 0.00 -0.04 -1.00 -vn -0.89 0.08 -0.45 -vn 0.00 0.09 -1.00 -vn 0.90 -0.01 -0.44 -vn 0.84 -0.22 -0.49 -vn 0.99 -0.01 -0.14 -vn 0.99 -0.06 -0.13 -vn 0.99 -0.05 -0.14 -vn 0.97 -0.15 -0.17 -vn 0.98 -0.17 -0.14 -vn 0.65 -0.71 -0.26 -vn 0.64 -0.75 -0.19 -vn -0.01 -0.97 -0.24 -vn -0.02 -0.98 -0.18 -vn -0.68 -0.67 -0.28 -vn -0.68 -0.70 -0.21 -vn -0.98 -0.08 -0.17 -vn -0.98 -0.06 -0.19 -vn -0.02 -0.80 -0.60 -vn -0.80 -0.39 -0.45 -vn 0.78 -0.46 -0.43 -vn -0.01 -0.46 -0.89 -vn -0.85 -0.14 -0.51 -vn -0.01 -0.10 -1.00 -vn 0.99 0.04 -0.13 -vn 1.00 0.03 -0.09 -vn 0.99 0.08 -0.07 -vn 0.90 0.02 -0.44 -vn 0.01 0.10 1.00 -# 70 vertex normals - -vt 0.93 0.98 0.00 -vt 0.93 0.99 0.00 -vt 0.93 0.83 0.00 -vt 0.93 0.85 0.00 -vt 0.96 0.83 0.00 -vt 0.98 0.85 0.00 -vt 0.93 0.87 0.00 -vt 0.97 0.87 0.00 -vt 0.98 0.87 0.00 -vt 0.98 0.88 0.00 -vt 0.99 0.88 0.00 -vt 0.97 0.97 0.00 -vt 0.97 0.88 0.00 -vt 0.96 0.97 0.00 -vt 0.93 0.89 0.00 -vt 0.93 0.97 0.00 -vt 0.96 0.98 0.00 -vt 0.96 0.99 0.00 -vt 0.95 0.99 0.00 -vt 0.93 1.00 0.00 -vt 0.97 0.98 0.00 -vt 0.97 0.99 0.00 -vt 1.00 0.84 0.00 -vt 0.99 0.85 0.00 -vt 0.99 0.87 0.00 -vt 0.99 0.83 0.00 -vt 0.96 0.81 0.00 -vt 0.93 0.81 0.00 -vt 0.96 0.80 0.00 -vt 0.93 0.80 0.00 -vt 0.96 0.79 0.00 -vt 0.93 0.79 0.00 -vt 0.98 0.80 0.00 -vt 0.98 0.81 0.00 -vt 0.99 0.82 0.00 -vt 0.93 0.84 0.00 -vt 0.65 0.02 0.00 -vt 0.65 0.03 0.00 -vt 0.66 0.02 0.00 -vt 0.64 0.03 0.00 -vt 0.56 0.01 0.00 -vt 0.55 0.03 0.00 -vt 0.55 0.01 0.00 -vt 0.53 0.03 0.00 -vt 0.52 0.01 0.00 -vt 0.48 0.03 0.00 -vt 0.48 0.01 0.00 -vt 0.48 0.02 0.00 -vt 0.56 0.03 0.00 -vt 0.49 0.03 0.00 -vt 0.51 0.03 0.00 -vt 0.49 0.01 0.00 -vt 0.53 0.01 0.00 -vt 0.64 0.01 0.00 -vt 0.65 0.01 0.00 -# 55 texture coords - -g P_51_Mustang_Rudder -f 2307/1479/2229 2308/1480/2230 2309/1479/2231 -f 2310/1481/2232 2311/1482/2233 2312/1483/2234 -f 2313/1484/2235 2312/1483/2234 2311/1482/2233 -f 2311/1482/2233 2314/1485/2236 2313/1484/2235 -f 2315/1486/2237 2313/1484/2235 2314/1485/2236 -f 2315/1486/2237 2316/1487/2238 2313/1484/2235 -f 2316/1487/2238 2315/1486/2237 2317/1488/2239 -f 2317/1488/2239 2318/1489/2240 2316/1487/2238 -f 2318/1489/2240 2317/1488/2239 2319/1490/2241 -f 2318/1489/2240 2319/1490/2241 2320/1488/2242 -f 2321/1490/2243 2320/1488/2242 2319/1490/2241 -f 2320/1488/2242 2321/1490/2243 2322/1491/2244 -f 2323/1492/2245 2322/1491/2244 2321/1490/2243 -f 2322/1491/2244 2323/1492/2245 2324/1493/2246 -f 2325/1494/2247 2324/1493/2246 2323/1492/2245 -f 2323/1492/2245 2326/1495/2248 2325/1494/2247 -f 2307/1479/2229 2325/1494/2247 2326/1495/2248 -f 2326/1495/2248 2327/1496/2249 2307/1479/2229 -f 2327/1496/2249 2308/1480/2230 2307/1479/2229 -f 2314/1485/2236 2328/1493/2250 2315/1486/2237 -f 2328/1493/2250 2329/1494/2251 2330/1491/2252 -f 2330/1491/2252 2315/1486/2237 2328/1493/2250 -f 2330/1491/2252 2317/1488/2239 2315/1486/2237 -f 2329/1494/2251 2331/1479/2253 2332/1492/2254 -f 2332/1492/2254 2330/1491/2252 2329/1494/2251 -f 2332/1492/2254 2333/1490/2255 2330/1491/2252 -f 2317/1488/2239 2330/1491/2252 2333/1490/2255 -f 2333/1490/2255 2319/1490/2241 2317/1488/2239 -f 2327/1496/2249 2334/1497/2256 2308/1480/2230 -f 2335/1498/2257 2308/1480/2230 2334/1497/2256 -f 2335/1498/2257 2334/1497/2256 2336/1480/2258 -f 2337/1496/2259 2336/1480/2258 2334/1497/2256 -f 2336/1480/2258 2337/1496/2259 2331/1479/2253 -f 2338/1495/2260 2331/1479/2253 2337/1496/2259 -f 2338/1495/2260 2332/1492/2254 2331/1479/2253 -f 2338/1495/2260 2339/1495/2261 2332/1492/2254 -f 2333/1490/2255 2332/1492/2254 2339/1495/2261 -f 2339/1495/2261 2340/1499/2262 2333/1490/2255 -f 2319/1490/2241 2333/1490/2255 2340/1499/2262 -f 2319/1490/2241 2340/1499/2262 2321/1490/2243 -f 2341/1495/2263 2321/1490/2243 2340/1499/2262 -f 2321/1490/2243 2341/1495/2263 2323/1492/2245 -f 2326/1495/2248 2323/1492/2245 2341/1495/2263 -f 2341/1495/2263 2342/1496/2264 2326/1495/2248 -f 2327/1496/2249 2326/1495/2248 2342/1496/2264 -f 2342/1496/2264 2343/1496/2265 2327/1496/2249 -f 2337/1496/2259 2334/1497/2256 2344/1496/2266 -f 2327/1496/2249 2343/1496/2265 2334/1497/2256 -f 2345/1496/2267 2334/1497/2256 2343/1496/2265 -f 2345/1496/2267 2344/1496/2266 2334/1497/2256 -f 2344/1496/2266 2345/1496/2267 2346/1496/2268 -f 2344/1496/2266 2346/1496/2268 2337/1496/2259 -f 2337/1496/2259 2346/1496/2268 2338/1495/2260 -f 2339/1495/2261 2338/1495/2260 2346/1496/2268 -f 2346/1496/2268 2347/1500/2269 2339/1495/2261 -f 2340/1499/2262 2339/1495/2261 2347/1500/2269 -f 2340/1499/2262 2347/1500/2269 2341/1495/2263 -f 2342/1496/2264 2341/1495/2263 2347/1500/2269 -f 2347/1500/2269 2345/1496/2267 2342/1496/2264 -f 2343/1496/2265 2342/1496/2264 2345/1496/2267 -f 2347/1500/2269 2346/1496/2268 2345/1496/2267 -f 2348/1501/2270 2349/1502/2271 2350/1503/2272 -f 2348/1501/2270 2350/1503/2272 2351/1502/2273 -f 2351/1502/2273 2352/1504/2274 2348/1501/2270 -f 2351/1502/2273 2353/1484/2275 2352/1504/2274 -f 2354/1483/2276 2352/1504/2274 2353/1484/2275 -f 2355/1481/2277 2354/1483/2276 2353/1484/2275 -f 2354/1483/2276 2355/1481/2277 2356/1505/2278 -f 2357/1506/2279 2356/1505/2278 2355/1481/2277 -f 2356/1505/2278 2357/1506/2279 2358/1507/2280 -f 2359/1508/2281 2358/1507/2280 2357/1506/2279 -f 2358/1507/2280 2359/1508/2281 2360/1509/2282 -f 2361/1510/2283 2360/1509/2282 2359/1508/2281 -f 2360/1509/2282 2361/1510/2283 2362/1507/2284 -f 2363/1508/2285 2362/1507/2284 2361/1510/2283 -f 2363/1508/2285 2364/1506/2286 2362/1507/2284 -f 2365/1505/2287 2362/1507/2284 2364/1506/2286 -f 2364/1506/2286 2310/1481/2232 2365/1505/2287 -f 2312/1483/2234 2365/1505/2287 2310/1481/2232 -f 2366/1511/2288 2362/1507/2284 2367/1512/2289 -f 2362/1507/2284 2366/1511/2288 2360/1509/2282 -f 2366/1511/2288 2358/1507/2280 2360/1509/2282 -f 2366/1511/2288 2368/1512/2290 2358/1507/2280 -f 2356/1505/2278 2358/1507/2280 2368/1512/2290 -f 2356/1505/2278 2368/1512/2290 2354/1483/2276 -f 2352/1504/2274 2354/1483/2276 2368/1512/2290 -f 2352/1504/2274 2368/1512/2290 2369/1513/2291 -f 2369/1513/2291 2348/1501/2270 2352/1504/2274 -f 2369/1513/2291 2370/1504/2292 2348/1501/2270 -f 2349/1502/2271 2348/1501/2270 2370/1504/2292 -f 2366/1511/2288 2369/1513/2291 2368/1512/2290 -f 2366/1511/2288 2367/1512/2289 2369/1513/2291 -f 2370/1504/2292 2369/1513/2291 2367/1512/2289 -f 2371/1514/2293 2355/1481/2277 2372/1482/2294 -f 2372/1482/2294 2355/1481/2277 2353/1484/2275 -f 2353/1484/2275 2373/1486/2295 2372/1482/2294 -f 2374/1485/2296 2372/1482/2294 2373/1486/2295 -f 2374/1485/2296 2373/1486/2295 2324/1493/2246 -f 2322/1491/2244 2324/1493/2246 2373/1486/2295 -f 2322/1491/2244 2373/1486/2295 2320/1488/2242 -f 2375/1487/2297 2320/1488/2242 2373/1486/2295 -f 2320/1488/2242 2375/1487/2297 2318/1489/2240 -f 2350/1503/2272 2318/1489/2240 2375/1487/2297 -f 2350/1503/2272 2316/1487/2238 2318/1489/2240 -f 2316/1487/2238 2350/1503/2272 2349/1502/2271 -f 2349/1502/2271 2313/1484/2235 2316/1487/2238 -f 2349/1502/2271 2370/1504/2292 2313/1484/2235 -f 2312/1483/2234 2313/1484/2235 2370/1504/2292 -f 2370/1504/2292 2367/1512/2289 2312/1483/2234 -f 2365/1505/2287 2312/1483/2234 2367/1512/2289 -f 2365/1505/2287 2367/1512/2289 2362/1507/2284 -f 2373/1486/2295 2353/1484/2275 2375/1487/2297 -f 2351/1502/2273 2375/1487/2297 2353/1484/2275 -f 2375/1487/2297 2351/1502/2273 2350/1503/2272 -f 2336/1515/2298 2331/1516/2298 2335/1517/2298 -f 2331/1516/2298 2329/1518/2298 2335/1517/2298 -f 2329/1518/2298 2324/1519/2298 2335/1517/2298 -f 2314/1520/2298 2324/1519/2298 2329/1518/2298 -f 2374/1521/2298 2324/1519/2298 2314/1520/2298 -f 2314/1520/2298 2311/1522/2298 2374/1521/2298 -f 2311/1522/2298 2371/1523/2298 2374/1521/2298 -f 2363/1524/2298 2371/1523/2298 2311/1522/2298 -f 2359/1525/2298 2371/1523/2298 2363/1524/2298 -f 2361/1526/2298 2359/1525/2298 2363/1524/2298 -f 2328/1527/2298 2314/1520/2298 2329/1518/2298 -f 2364/1528/2298 2363/1524/2298 2310/1529/2298 -f 2310/1529/2298 2363/1524/2298 2311/1522/2298 -f 2357/1530/2298 2371/1523/2298 2359/1525/2298 -f 2371/1523/2298 2372/1531/2298 2374/1521/2298 -f 2324/1519/2298 2325/1532/2298 2335/1517/2298 -f 2325/1532/2298 2309/1533/2298 2335/1517/2298 -f 2309/1533/2298 2308/1515/2298 2335/1517/2298 -# 132 faces - diff --git a/examples/models/resources/plane.png b/examples/models/resources/plane.png deleted file mode 100644 index b41513843..000000000 Binary files a/examples/models/resources/plane.png and /dev/null differ diff --git a/examples/models/resources/plane/LICENSE b/examples/models/resources/plane/LICENSE new file mode 100644 index 000000000..57333b2dc --- /dev/null +++ b/examples/models/resources/plane/LICENSE @@ -0,0 +1,9 @@ +WWI Plane Model created by GiaHanLam (https://sketchfab.com/GiaHanLam) +This model is free to use, licensed as Creative Commons Attribution (CC-BY 4.0) + +License details: https://creativecommons.org/licenses/by/4.0/ + +As per the license, author must be credited and commercial use is allowed. + +This model was donwload from author Sketchfab account: https://sketchfab.com/3d-models/wwi-plane-model-f0d39a6daacd4925a8922db193886715 + diff --git a/examples/models/resources/plane/plane.bin b/examples/models/resources/plane/plane.bin new file mode 100644 index 000000000..4e5ee53b4 Binary files /dev/null and b/examples/models/resources/plane/plane.bin differ diff --git a/examples/models/resources/plane/plane.gltf b/examples/models/resources/plane/plane.gltf new file mode 100644 index 000000000..928b172bb --- /dev/null +++ b/examples/models/resources/plane/plane.gltf @@ -0,0 +1,327 @@ +{ + "accessors": [ + { + "bufferView": 2, + "componentType": 5126, + "count": 3446, + "max": [ + 143.99604797363281, + 168.74668884277344, + 75.31597900390625 + ], + "min": [ + -143.99604797363281, + -43.94732666015625, + -49.556678771972656 + ], + "type": "VEC3" + }, + { + "bufferView": 2, + "byteOffset": 41352, + "componentType": 5126, + "count": 3446, + "max": [ + 1, + 0.99916732311248779, + 0.99978786706924438 + ], + "min": [ + -1, + -0.99928808212280273, + -0.99977350234985352 + ], + "type": "VEC3" + }, + { + "bufferView": 3, + "componentType": 5126, + "count": 3446, + "max": [ + 1, + 1, + 1, + 1 + ], + "min": [ + 0, + 0, + 0, + 0 + ], + "type": "VEC4" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 3446, + "max": [ + 4.8965663909912109, + 0.99786919355392456 + ], + "min": [ + 0.0036561768501996994, + 0.0083234198391437531 + ], + "type": "VEC2" + }, + { + "bufferView": 0, + "componentType": 5125, + "count": 7692, + "max": [ + 3445 + ], + "min": [ + 0 + ], + "type": "SCALAR" + } + ], + "asset": { + "extras": { + "author": "GiaHanLam (https://sketchfab.com/GiaHanLam)", + "license": "CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)", + "source": "https://sketchfab.com/3d-models/wwi-plane-model-f0d39a6daacd4925a8922db193886715", + "title": "WWI Plane Model" + }, + "generator": "Sketchfab-8.25.0", + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 30768, + "byteOffset": 0, + "name": "floatBufferViews", + "target": 34963 + }, + { + "buffer": 0, + "byteLength": 27568, + "byteOffset": 30768, + "byteStride": 8, + "name": "floatBufferViews", + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 82704, + "byteOffset": 58336, + "byteStride": 12, + "name": "floatBufferViews", + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 55136, + "byteOffset": 141040, + "byteStride": 16, + "name": "floatBufferViews", + "target": 34962 + } + ], + "buffers": [ + { + "byteLength": 196176, + "uri": "plane.bin" + } + ], + "images": [ + { + "uri": "plane_diffuse.png" + } + ], + "materials": [ + { + "doubleSided": true, + "name": "Material_24", + "pbrMetallicRoughness": { + "baseColorFactor": [ + 1, + 1, + 1, + 1 + ], + "baseColorTexture": { + "index": 0, + "texCoord": 0 + }, + "metallicFactor": 0, + "roughnessFactor": 0.59999999999999998 + } + } + ], + "meshes": [ + { + "name": "BODY_Material #24_0", + "primitives": [ + { + "attributes": { + "COLOR_0": 2, + "NORMAL": 1, + "POSITION": 0, + "TEXCOORD_0": 3 + }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1 + ], + "name": "RootNode (gltf orientation matrix)", + "rotation": [ + -0.70710678118654746, + -0, + -0, + 0.70710678118654757 + ] + }, + { + "children": [ + 2 + ], + "name": "RootNode (model correction matrix)" + }, + { + "children": [ + 3 + ], + "matrix": [ + 1, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + -1, + 0, + 0, + 0, + 0, + 0, + 1 + ], + "name": "base" + }, + { + "children": [ + 4, + 6 + ], + "name": "RootNode" + }, + { + "children": [ + 5 + ], + "matrix": [ + 1, + 0, + 0, + 0, + 0, + 2.2204460492503131e-16, + -1, + 0, + 0, + 1, + 2.2204460492503131e-16, + 0, + 0, + 0, + 0, + 1 + ], + "name": "BODY" + }, + { + "mesh": 0, + "name": "BODY_Material #24_0" + }, + { + "children": [ + 7 + ], + "matrix": [ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + -680, + 0, + 90, + 1 + ], + "name": "Sky001" + }, + { + "children": [ + 8 + ], + "matrix": [ + 1, + 0, + 0, + 0, + 0, + 2.2204460492503131e-16, + 1, + 0, + 0, + -1, + 2.2204460492503131e-16, + 0, + 0, + 0, + 0, + 1 + ], + "name": "" + }, + { + "name": "" + } + ], + "samplers": [ + { + "magFilter": 9729, + "minFilter": 9987, + "wrapS": 10497, + "wrapT": 10497 + } + ], + "scene": 0, + "scenes": [ + { + "name": "OSG_Scene", + "nodes": [ + 0 + ] + } + ], + "textures": [ + { + "sampler": 0, + "source": 0 + } + ] +} + diff --git a/examples/models/resources/plane/plane_diffuse.png b/examples/models/resources/plane/plane_diffuse.png new file mode 100644 index 000000000..07371c01f Binary files /dev/null and b/examples/models/resources/plane/plane_diffuse.png differ diff --git a/examples/models/resources/plane_diffuse.png b/examples/models/resources/plane_diffuse.png deleted file mode 100644 index c02a9e2f7..000000000 Binary files a/examples/models/resources/plane_diffuse.png and /dev/null differ diff --git a/examples/models/resources/shaders/glsl100/skybox.fs b/examples/models/resources/shaders/glsl100/skybox.fs index 1269a96d9..4aa4ec9c0 100644 --- a/examples/models/resources/shaders/glsl100/skybox.fs +++ b/examples/models/resources/shaders/glsl100/skybox.fs @@ -8,6 +8,7 @@ varying vec3 fragPosition; // Input uniform values uniform samplerCube environmentMap; uniform bool vflipped; +uniform bool doGamma; void main() { @@ -19,9 +20,11 @@ void main() vec3 color = vec3(texelColor.x, texelColor.y, texelColor.z); - // Apply gamma correction - color = color/(color + vec3(1.0)); - color = pow(color, vec3(1.0/2.2)); + if (doGamma)// Apply gamma correction + { + color = color/(color + vec3(1.0)); + color = pow(color, vec3(1.0/2.2)); + } // Calculate final fragment color gl_FragColor = vec4(color, 1.0); diff --git a/examples/models/resources/shaders/glsl330/brdf.fs b/examples/models/resources/shaders/glsl330/brdf.fs index d04bc6618..5f44bfe5f 100644 --- a/examples/models/resources/shaders/glsl330/brdf.fs +++ b/examples/models/resources/shaders/glsl330/brdf.fs @@ -1,16 +1,5 @@ -/******************************************************************************************* -* -* BRDF LUT Generation - Bidirectional reflectance distribution function fragment shader -* -* REF: https://github.com/HectorMF/BRDFGenerator -* -* Copyright (c) 2017 Victor Fisac -* -**********************************************************************************************/ - #version 330 - // Input vertex attributes (from vertex shader) in vec2 fragTexCoord; @@ -41,27 +30,27 @@ float RadicalInverseVdC(uint bits) // Compute Hammersley coordinates vec2 Hammersley(uint i, uint N) { - return vec2(float(i)/float(N), RadicalInverseVdC(i)); + return vec2(float(i)/float(N), RadicalInverseVdC(i)); } // Integrate number of importance samples for (roughness and NoV) vec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness) { - float a = roughness*roughness; - float phi = 2.0 * PI * Xi.x; - float cosTheta = sqrt((1.0 - Xi.y)/(1.0 + (a*a - 1.0)*Xi.y)); - float sinTheta = sqrt(1.0 - cosTheta*cosTheta); + float a = roughness*roughness; + float phi = 2.0 * PI * Xi.x; + float cosTheta = sqrt((1.0 - Xi.y)/(1.0 + (a*a - 1.0)*Xi.y)); + float sinTheta = sqrt(1.0 - cosTheta*cosTheta); - // Transform from spherical coordinates to cartesian coordinates (halfway vector) - vec3 H = vec3(cos(phi)*sinTheta, sin(phi)*sinTheta, cosTheta); + // Transform from spherical coordinates to cartesian coordinates (halfway vector) + vec3 H = vec3(cos(phi)*sinTheta, sin(phi)*sinTheta, cosTheta); - // Transform from tangent space H vector to world space sample vector - vec3 up = ((abs(N.z) < 0.999) ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0)); - vec3 tangent = normalize(cross(up, N)); - vec3 bitangent = cross(N, tangent); - vec3 sampleVec = tangent*H.x + bitangent*H.y + N*H.z; + // Transform from tangent space H vector to world space sample vector + vec3 up = ((abs(N.z) < 0.999) ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0)); + vec3 tangent = normalize(cross(up, N)); + vec3 bitangent = cross(N, tangent); + vec3 sampleVec = tangent*H.x + bitangent*H.y + N*H.z; - return normalize(sampleVec); + return normalize(sampleVec); } float GeometrySchlickGGX(float NdotV, float roughness) @@ -86,6 +75,8 @@ float GeometrySmith(vec3 N, vec3 V, vec3 L, float roughness) return ggx1*ggx2; } +// Bidirectional reflectance distribution function +// Ref: https://github.com/HectorMF/BRDFGenerator vec2 IntegrateBRDF(float NdotV, float roughness) { float A = 0.0; diff --git a/examples/models/resources/shaders/glsl330/brdf.vs b/examples/models/resources/shaders/glsl330/brdf.vs index 06384673b..c93cfd0ea 100644 --- a/examples/models/resources/shaders/glsl330/brdf.vs +++ b/examples/models/resources/shaders/glsl330/brdf.vs @@ -1,11 +1,3 @@ -/******************************************************************************************* -* -* rPBR [shader] - Bidirectional reflectance distribution function vertex shader -* -* Copyright (c) 2017 Victor Fisac -* -**********************************************************************************************/ - #version 330 // Input vertex attributes diff --git a/examples/models/resources/shaders/glsl330/cubemap.vs b/examples/models/resources/shaders/glsl330/cubemap.vs index 5721eaa2c..d3565dfdc 100644 --- a/examples/models/resources/shaders/glsl330/cubemap.vs +++ b/examples/models/resources/shaders/glsl330/cubemap.vs @@ -1,11 +1,3 @@ -/******************************************************************************************* -* -* rPBR [shader] - Equirectangular to cubemap vertex shader -* -* Copyright (c) 2017 Victor Fisac -* -**********************************************************************************************/ - #version 330 // Input vertex attributes diff --git a/examples/models/resources/shaders/glsl330/irradiance.fs b/examples/models/resources/shaders/glsl330/irradiance.fs index 4ef03e052..4b74916d9 100644 --- a/examples/models/resources/shaders/glsl330/irradiance.fs +++ b/examples/models/resources/shaders/glsl330/irradiance.fs @@ -1,11 +1,3 @@ -/******************************************************************************************* -* -* rPBR [shader] - Irradiance cubemap fragment shader -* -* Copyright (c) 2017 Victor Fisac -* -**********************************************************************************************/ - #version 330 // Input vertex attributes (from vertex shader) diff --git a/examples/models/resources/shaders/glsl330/pbr.fs b/examples/models/resources/shaders/glsl330/pbr.fs index 68bf203a2..72779a185 100644 --- a/examples/models/resources/shaders/glsl330/pbr.fs +++ b/examples/models/resources/shaders/glsl330/pbr.fs @@ -1,11 +1,3 @@ -/******************************************************************************************* -* -* rPBR [shader] - Physically based rendering fragment shader -* -* Copyright (c) 2017 Victor Fisac -* -**********************************************************************************************/ - #version 330 #define MAX_REFLECTION_LOD 4.0 diff --git a/examples/models/resources/shaders/glsl330/pbr.vs b/examples/models/resources/shaders/glsl330/pbr.vs index 045428c68..4729b0141 100644 --- a/examples/models/resources/shaders/glsl330/pbr.vs +++ b/examples/models/resources/shaders/glsl330/pbr.vs @@ -1,11 +1,3 @@ -/******************************************************************************************* -* -* rPBR [shader] - Physically based rendering vertex shader -* -* Copyright (c) 2017 Victor Fisac -* -**********************************************************************************************/ - #version 330 // Input vertex attributes diff --git a/examples/models/resources/shaders/glsl330/prefilter.fs b/examples/models/resources/shaders/glsl330/prefilter.fs index 941ea86c0..3ea694f95 100644 --- a/examples/models/resources/shaders/glsl330/prefilter.fs +++ b/examples/models/resources/shaders/glsl330/prefilter.fs @@ -1,14 +1,7 @@ -/******************************************************************************************* -* -* rPBR [shader] - Prefiltered environment for reflections fragment shader -* -* Copyright (c) 2017 Victor Fisac -* -**********************************************************************************************/ - #version 330 -#define MAX_SAMPLES 1024u -#define CUBEMAP_RESOLUTION 1024.0 + +#define MAX_SAMPLES 1024u +#define CUBEMAP_RESOLUTION 1024.0 // Input vertex attributes (from vertex shader) in vec3 fragPosition; @@ -54,26 +47,26 @@ float RadicalInverse_VdC(uint bits) vec2 Hammersley(uint i, uint N) { - return vec2(float(i)/float(N), RadicalInverse_VdC(i)); + return vec2(float(i)/float(N), RadicalInverse_VdC(i)); } vec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness) { - float a = roughness*roughness; - float phi = 2.0*PI*Xi.x; - float cosTheta = sqrt((1.0 - Xi.y)/(1.0 + (a*a - 1.0)*Xi.y)); - float sinTheta = sqrt(1.0 - cosTheta*cosTheta); + float a = roughness*roughness; + float phi = 2.0*PI*Xi.x; + float cosTheta = sqrt((1.0 - Xi.y)/(1.0 + (a*a - 1.0)*Xi.y)); + float sinTheta = sqrt(1.0 - cosTheta*cosTheta); - // Transform from spherical coordinates to cartesian coordinates (halfway vector) - vec3 H = vec3(cos(phi)*sinTheta, sin(phi)*sinTheta, cosTheta); + // Transform from spherical coordinates to cartesian coordinates (halfway vector) + vec3 H = vec3(cos(phi)*sinTheta, sin(phi)*sinTheta, cosTheta); - // Transform from tangent space H vector to world space sample vector - vec3 up = ((abs(N.z) < 0.999) ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0)); - vec3 tangent = normalize(cross(up, N)); - vec3 bitangent = cross(N, tangent); - vec3 sampleVec = tangent*H.x + bitangent*H.y + N*H.z; + // Transform from tangent space H vector to world space sample vector + vec3 up = ((abs(N.z) < 0.999) ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0)); + vec3 tangent = normalize(cross(up, N)); + vec3 bitangent = cross(N, tangent); + vec3 sampleVec = tangent*H.x + bitangent*H.y + N*H.z; - return normalize(sampleVec); + return normalize(sampleVec); } void main() diff --git a/examples/models/resources/shaders/glsl330/skybox.fs b/examples/models/resources/shaders/glsl330/skybox.fs index c7a17883e..bb96fc3c3 100644 --- a/examples/models/resources/shaders/glsl330/skybox.fs +++ b/examples/models/resources/shaders/glsl330/skybox.fs @@ -1,13 +1,3 @@ -/******************************************************************************************* -* -* rPBR [shader] - Background skybox fragment shader -* -* Copyright (c) 2017 Victor Fisac -* -* 19-Jun-2020 - modified by Giuseppe Mastrangelo (@peppemas) - VFlip Support -* -**********************************************************************************************/ - #version 330 // Input vertex attributes (from vertex shader) @@ -16,6 +6,7 @@ in vec3 fragPosition; // Input uniform values uniform samplerCube environmentMap; uniform bool vflipped; +uniform bool doGamma; // Output fragment color out vec4 finalColor; @@ -28,9 +19,11 @@ void main() if (vflipped) color = texture(environmentMap, vec3(fragPosition.x, -fragPosition.y, fragPosition.z)).rgb; else color = texture(environmentMap, fragPosition).rgb; - // Apply gamma correction - color = color/(color + vec3(1.0)); - color = pow(color, vec3(1.0/2.2)); + if (doGamma)// Apply gamma correction + { + color = color/(color + vec3(1.0)); + color = pow(color, vec3(1.0/2.2)); + } // Calculate final fragment color finalColor = vec4(color, 1.0); diff --git a/examples/models/resources/shaders/glsl330/skybox.vs b/examples/models/resources/shaders/glsl330/skybox.vs index 4fe9a2c30..6279bc497 100644 --- a/examples/models/resources/shaders/glsl330/skybox.vs +++ b/examples/models/resources/shaders/glsl330/skybox.vs @@ -1,11 +1,3 @@ -/******************************************************************************************* -* -* rPBR [shader] - Background skybox vertex shader -* -* Copyright (c) 2017 Victor Fisac -* -**********************************************************************************************/ - #version 330 // Input vertex attributes diff --git a/examples/models/resources/skybox.png b/examples/models/resources/skybox.png new file mode 100644 index 000000000..36a79b2de Binary files /dev/null and b/examples/models/resources/skybox.png differ diff --git a/examples/models/rlights.h b/examples/models/rlights.h index 66185bb43..a1b298881 100644 --- a/examples/models/rlights.h +++ b/examples/models/rlights.h @@ -163,21 +163,21 @@ Light CreateLight(int type, Vector3 position, Vector3 target, Color color, Shade void UpdateLightValues(Shader shader, Light light) { // Send to shader light enabled state and type - SetShaderValue(shader, light.enabledLoc, &light.enabled, UNIFORM_INT); - SetShaderValue(shader, light.typeLoc, &light.type, UNIFORM_INT); + SetShaderValue(shader, light.enabledLoc, &light.enabled, SHADER_UNIFORM_INT); + SetShaderValue(shader, light.typeLoc, &light.type, SHADER_UNIFORM_INT); // Send to shader light position values float position[3] = { light.position.x, light.position.y, light.position.z }; - SetShaderValue(shader, light.posLoc, position, UNIFORM_VEC3); + SetShaderValue(shader, light.posLoc, position, SHADER_UNIFORM_VEC3); // Send to shader light target position values float target[3] = { light.target.x, light.target.y, light.target.z }; - SetShaderValue(shader, light.targetLoc, target, UNIFORM_VEC3); + SetShaderValue(shader, light.targetLoc, target, SHADER_UNIFORM_VEC3); // Send to shader light color values float color[4] = { (float)light.color.r/(float)255, (float)light.color.g/(float)255, (float)light.color.b/(float)255, (float)light.color.a/(float)255 }; - SetShaderValue(shader, light.colorLoc, color, UNIFORM_VEC4); + SetShaderValue(shader, light.colorLoc, color, SHADER_UNIFORM_VEC4); } #endif // RLIGHTS_IMPLEMENTATION \ No newline at end of file diff --git a/examples/network/network_ping_pong.c b/examples/network/network_ping_pong.c index 22aaa69e8..ec45f6445 100644 --- a/examples/network/network_ping_pong.c +++ b/examples/network/network_ping_pong.c @@ -40,16 +40,16 @@ static void NetworkConnect(void) { ping = true; connected = true; - } - else + } + else { // If the client is connected, run the server code to check for a connection - if (clientConnected) + if (clientConnected) { int active = CheckSockets(socketSet, 0); if (active != 0) TraceLog(LOG_INFO, "There are currently %d socket(s) with data to be processed.", active); - if (active > 0) + if (active > 0) { if ((connection = SocketAccept(serverResult->socket, &connectionConfig)) != NULL) { @@ -58,7 +58,7 @@ static void NetworkConnect(void) ping = true; } } - } + } else { // Check if we're connected every _delay_ seconds @@ -66,7 +66,7 @@ static void NetworkConnect(void) if (elapsed > delay) { if (IsSocketConnected(clientResult->socket)) clientConnected = true; - + elapsed = 0.0f; } } @@ -88,7 +88,7 @@ static void UpdateNetwork(void) { if (IsSocketReady(clientResult->socket)) bytesRecv = SocketReceive(clientResult->socket, receiveBuffer, msglen); if (IsSocketReady(serverResult->socket)) bytesRecv = SocketReceive(serverResult->socket, receiveBuffer, msglen); - } + } else if (IsSocketReady(connection)) bytesRecv = SocketReceive(connection, receiveBuffer, msglen); // If we received data, was that data a "Ping!" or a "Pong!" @@ -107,14 +107,14 @@ static void UpdateNetwork(void) ping = false; if (serverConfig.type == SOCKET_UDP && clientConfig.type == SOCKET_UDP) SocketSend(clientResult->socket, pingmsg, msglen); else SocketSend(clientResult->socket, pingmsg, msglen); - } + } else if (pong) { pong = false; if (serverConfig.type == SOCKET_UDP && clientConfig.type == SOCKET_UDP) SocketSend(clientResult->socket, pongmsg, msglen); else SocketSend(clientResult->socket, pongmsg, msglen); } - + elapsed = 0.0f; } } @@ -132,7 +132,7 @@ int main(void) // Create the server: getaddrinfo + socket + setsockopt + bind + listen serverResult = LoadSocketResult(); - if (!SocketCreate(&serverConfig, serverResult)) + if (!SocketCreate(&serverConfig, serverResult)) { TraceLog(LOG_WARNING, "Failed to open server: status %d, errno %d", serverResult->status, serverResult->socket->status); } @@ -141,7 +141,7 @@ int main(void) if (!SocketBind(&serverConfig, serverResult)) { TraceLog(LOG_WARNING, "Failed to bind server: status %d, errno %d", serverResult->status, serverResult->socket->status); - } + } else { if (!(serverConfig.type == SOCKET_UDP)) @@ -156,7 +156,7 @@ int main(void) // Create the client: getaddrinfo + socket + setsockopt + connect (TCP only) clientResult = LoadSocketResult(); - if (!SocketCreate(&clientConfig, clientResult)) + if (!SocketCreate(&clientConfig, clientResult)) { TraceLog(LOG_WARNING, "Failed to open client: status %d, errno %d", clientResult->status, clientResult->socket->status); } @@ -194,7 +194,7 @@ int main(void) BeginDrawing(); ClearBackground(RAYWHITE); - + // TODO: Draw relevant connection info EndDrawing(); @@ -204,7 +204,7 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- CloseNetworkDevice(); // Close network communication - + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/network/network_resolve_host.c b/examples/network/network_resolve_host.c index e2e3f7218..a6e9ecdf4 100644 --- a/examples/network/network_resolve_host.c +++ b/examples/network/network_resolve_host.c @@ -22,17 +22,17 @@ int main(void) const int screenHeight = 450; InitWindow(screenWidth, screenHeight, "raylib [network] example - resolve host"); - + InitNetworkDevice(); // Init network communications - + char buffer[ADDRESS_IPV6_ADDRSTRLEN]; unsigned short port = 0; AddressInformation *address = LoadAddressList(1); - + // Address info flags // ADDRESS_INFO_NUMERICHOST // or try them in conjunction to - // ADDRESS_INFO_NUMERICSERV // specify custom behaviour from + // ADDRESS_INFO_NUMERICSERV // specify custom behaviour from // ADDRESS_INFO_DNS_ONLY // the function getaddrinfo() // ADDRESS_INFO_ALL // // ADDRESS_INFO_FQDN // e.g. ADDRESS_INFO_CANONNAME | ADDRESS_INFO_NUMERICSERV @@ -70,7 +70,7 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- CloseNetworkDevice(); // Close network communication - + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/network/network_tcp_client.c b/examples/network/network_tcp_client.c index 4259e25d7..1779a3a4a 100644 --- a/examples/network/network_tcp_client.c +++ b/examples/network/network_tcp_client.c @@ -24,10 +24,10 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [network] example - tcp client"); InitNetworkDevice(); // Init network communications - + const char *pingmsg = "Ping!"; const char *pongmsg = "Pong!"; - + bool ping = false; bool pong = false; float elapsed = 0.0f; @@ -35,12 +35,12 @@ int main(void) bool connected = false; SocketConfig clientConfig = { - .host = "127.0.0.1", - .port = "4950", - .type = SOCKET_TCP, + .host = "127.0.0.1", + .port = "4950", + .type = SOCKET_TCP, .nonblocking = true }; - + SocketSet *socketSet = NULL; SocketResult *clientResult = NULL; char receiveBuffer[512] = { 0 }; @@ -48,9 +48,9 @@ int main(void) // Create the client: getaddrinfo + socket + setsockopt + connect (TCP only) clientResult = LoadSocketResult(); if (!SocketCreate(&clientConfig, clientResult)) TraceLog(LOG_WARNING, "Failed to open client: status %d, errno %d", clientResult->status, clientResult->socket->status); - else + else { - if (!(clientConfig.type == SOCKET_UDP)) + if (!(clientConfig.type == SOCKET_UDP)) { if (!SocketConnect(&clientConfig, clientResult)) TraceLog(LOG_WARNING, "Failed to connect to server: status %d, errno %d", clientResult->status, clientResult->socket->status); } @@ -80,10 +80,10 @@ int main(void) // IsSocketReady, if the socket is ready, attempt to receive data from the socket int bytesRecv = 0; - if (IsSocketReady(clientResult->socket)) bytesRecv = SocketReceive(clientResult->socket, receiveBuffer, strlen(pingmsg) + 1); + if (IsSocketReady(clientResult->socket)) bytesRecv = SocketReceive(clientResult->socket, receiveBuffer, (int)strlen(pingmsg) + 1); // If we received data, was that data a "Ping!" or a "Pong!" - if (bytesRecv > 0) + if (bytesRecv > 0) { if (strcmp(receiveBuffer, pingmsg) == 0) { pong = true; } if (strcmp(receiveBuffer, pongmsg) == 0) { ping = true; } @@ -91,19 +91,19 @@ int main(void) // After each delay has expired, send a response "Ping!" for a "Pong!" and vice versa elapsed += GetFrameTime(); - if (elapsed > delay) + if (elapsed > delay) { - if (ping) + if (ping) { ping = false; - SocketSend(clientResult->socket, pingmsg, strlen(pingmsg) + 1); + SocketSend(clientResult->socket, pingmsg, (int)strlen(pingmsg) + 1); } - else if (pong) + else if (pong) { pong = false; - SocketSend(clientResult->socket, pongmsg, strlen(pingmsg) + 1); + SocketSend(clientResult->socket, pongmsg, (int)strlen(pingmsg) + 1); } - + elapsed = 0.0f; } } @@ -124,7 +124,7 @@ int main(void) BeginDrawing(); ClearBackground(RAYWHITE); - + // TODO: Draw relevant connection info EndDrawing(); @@ -134,7 +134,7 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- CloseNetworkDevice(); // Close network communication - + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/network/network_tcp_server.c b/examples/network/network_tcp_server.c index ee64acfc0..5cbbe54bd 100644 --- a/examples/network/network_tcp_server.c +++ b/examples/network/network_tcp_server.c @@ -24,10 +24,10 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [network] example - tcp server"); InitNetworkDevice(); // Init network communications - + const char *pingmsg = "Ping!"; const char *pongmsg = "Pong!"; - + bool ping = false; bool pong = false; float elapsed = 0.0f; @@ -35,32 +35,32 @@ int main(void) bool connected = false; SocketConfig serverConfig = { - .host = "127.0.0.1", - .port = "4950", + .host = "127.0.0.1", + .port = "4950", .type = SOCKET_TCP, .server = true, .nonblocking = true }; - + SocketConfig connectionConfig = { .nonblocking = true }; - + Socket *connection = NULL; SocketSet *socketSet = NULL; SocketResult *serverResult = NULL; char receiveBuffer[512] = { 0 }; - + // Create the server: getaddrinfo + socket + setsockopt + bind + listen serverResult = LoadSocketResult(); - if (!SocketCreate(&serverConfig, serverResult)) + if (!SocketCreate(&serverConfig, serverResult)) { TraceLog(LOG_WARNING, "Failed to open server: status %d, errno %d", serverResult->status, serverResult->socket->status); - } + } else { if (!SocketBind(&serverConfig, serverResult)) { TraceLog(LOG_WARNING, "Failed to bind server: status %d, errno %d", serverResult->status, serverResult->socket->status); - } + } else { if (!(serverConfig.type == SOCKET_UDP)) @@ -94,7 +94,7 @@ int main(void) // IsSocketReady, if the socket is ready, attempt to receive data from the socket int bytesRecv = 0; - if (IsSocketReady(connection)) bytesRecv = SocketReceive(connection, receiveBuffer, strlen(pingmsg) + 1); + if (IsSocketReady(connection)) bytesRecv = SocketReceive(connection, receiveBuffer, (int)strlen(pingmsg) + 1); // If we received data, was that data a "Ping!" or a "Pong!" if (bytesRecv > 0) @@ -107,17 +107,17 @@ int main(void) elapsed += GetFrameTime(); if (elapsed > delay) { - if (ping) + if (ping) { ping = false; - SocketSend(connection, pingmsg, strlen(pingmsg) + 1); - } + SocketSend(connection, pingmsg, (int)strlen(pingmsg) + 1); + } else if (pong) { pong = false; - SocketSend(connection, pongmsg, strlen(pingmsg) + 1); + SocketSend(connection, pongmsg, (int)strlen(pingmsg) + 1); } - + elapsed = 0.0f; } } @@ -127,9 +127,9 @@ int main(void) int active = CheckSockets(socketSet, 0); if (active != 0) TraceLog(LOG_DEBUG, "There are currently %d socket(s) with data to be processed.", active); - if (active > 0) + if (active > 0) { - if ((connection = SocketAccept(serverResult->socket, &connectionConfig)) != NULL) + if ((connection = SocketAccept(serverResult->socket, &connectionConfig)) != NULL) { AddSocket(socketSet, connection); connected = true; @@ -144,7 +144,7 @@ int main(void) BeginDrawing(); ClearBackground(RAYWHITE); - + // TODO: Draw relevant connection info EndDrawing(); @@ -154,7 +154,7 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- CloseNetworkDevice(); // Close network communication - + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/network/network_test.c b/examples/network/network_test.c index b756c2cdf..957ed8ba0 100644 --- a/examples/network/network_test.c +++ b/examples/network/network_test.c @@ -85,7 +85,7 @@ void test_resolve_host() const char *address = "localhost"; const char *port = "80"; AddressInformation *addr = LoadAddressList(3); - int count = ResolveHost(address, port, ADDRESS_TYPE_ANY, 0, addr); + int count = ResolveHost(address, port, ADDRESS_TYPE_ANY, 0, addr); assert(GetAddressFamily(addr[0]) == ADDRESS_TYPE_IPV6); assert(GetAddressFamily(addr[1]) == ADDRESS_TYPE_IPV4); @@ -122,9 +122,9 @@ int main(void) const int screenHeight = 450; InitWindow(screenWidth, screenHeight, "raylib [network] example - network test"); - + InitNetworkDevice(); // Init network communications - + // Run some tests test_resolve_host(); //test_socket_create(); @@ -146,7 +146,7 @@ int main(void) BeginDrawing(); ClearBackground(RAYWHITE); - + // TODO: Draw relevant connection info EndDrawing(); @@ -156,7 +156,7 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- CloseNetworkDevice(); // Close network communication - + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/network/network_udp_client.c b/examples/network/network_udp_client.c index 74a241b67..d351372b5 100644 --- a/examples/network/network_udp_client.c +++ b/examples/network/network_udp_client.c @@ -24,22 +24,22 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [network] example - udp client"); InitNetworkDevice(); // Init network communications - + const char *pingmsg = "Ping!"; const char *pongmsg = "Pong!"; - + bool ping = true; bool pong = false; float elapsed = 0.0f; float delay = 1.0f; SocketConfig clientConfig = { - .host = "127.0.0.1", - .port = "4950", - .type = SOCKET_UDP, + .host = "127.0.0.1", + .port = "4950", + .type = SOCKET_UDP, .nonblocking = true }; - + SocketResult *clientResult = NULL; SocketSet *socketSet = NULL; char receiveBuffer[512] = { 0 }; @@ -73,10 +73,10 @@ int main(void) // IsSocketReady, if the socket is ready, attempt to receive data from the socket int bytesRecv = 0; - if (IsSocketReady(clientResult->socket)) bytesRecv = SocketReceive(clientResult->socket, receiveBuffer, strlen(pingmsg) + 1); + if (IsSocketReady(clientResult->socket)) bytesRecv = SocketReceive(clientResult->socket, receiveBuffer, (int)strlen(pingmsg) + 1); // If we received data, was that data a "Ping!" or a "Pong!" - if (bytesRecv > 0) + if (bytesRecv > 0) { if (strcmp(receiveBuffer, pingmsg) == 0) { pong = true; } if (strcmp(receiveBuffer, pongmsg) == 0) { ping = true; } @@ -86,17 +86,17 @@ int main(void) elapsed += GetFrameTime(); if (elapsed > delay) { - if (ping) + if (ping) { ping = false; - SocketSend(clientResult->socket, pingmsg, strlen(pingmsg) + 1); - } + SocketSend(clientResult->socket, pingmsg, (int)strlen(pingmsg) + 1); + } else if (pong) { pong = false; - SocketSend(clientResult->socket, pongmsg, strlen(pongmsg) + 1); + SocketSend(clientResult->socket, pongmsg, (int)strlen(pongmsg) + 1); } - + elapsed = 0.0f; } //---------------------------------------------------------------------------------- @@ -106,7 +106,7 @@ int main(void) BeginDrawing(); ClearBackground(RAYWHITE); - + // TODO: Draw relevant connection info EndDrawing(); @@ -116,7 +116,7 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- CloseNetworkDevice(); // Close network communication - + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/network/network_udp_server.c b/examples/network/network_udp_server.c index 5d5c425e8..29fffbe7b 100644 --- a/examples/network/network_udp_server.c +++ b/examples/network/network_udp_server.c @@ -24,30 +24,30 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [network] example - udp server"); InitNetworkDevice(); // Init network communications - + const char *pingmsg = "Ping!"; const char *pongmsg = "Pong!"; - + bool ping = false; bool pong = false; float elapsed = 0.0f; float delay = 1.0f; SocketConfig serverConfig = { - .host = "127.0.0.1", - .port = "4950", - .server = true, - .type = SOCKET_UDP, + .host = "127.0.0.1", + .port = "4950", + .server = true, + .type = SOCKET_UDP, .nonblocking = true }; - + SocketResult *serverResult = NULL; SocketSet *socketSet = NULL; char receiveBuffer[512] = { 0 }; // Create the server: getaddrinfo + socket + setsockopt + bind + listen serverResult = LoadSocketResult(); - + if (!SocketCreate(&serverConfig, serverResult)) TraceLog(LOG_WARNING, "Failed to open server: status %d, errno %d", serverResult->status, serverResult->socket->status); else if (!SocketBind(&serverConfig, serverResult)) TraceLog(LOG_WARNING, "Failed to bind server: status %d, errno %d", serverResult->status, serverResult->socket->status); @@ -65,7 +65,7 @@ int main(void) //---------------------------------------------------------------------------------- // Once connected to the network, check the sockets for pending information // and when information is ready, send either a Ping or a Pong. - + // CheckSockets, if any of the sockets in the set are pending (received data, or requests) // then mark the socket as being ready. You can check this with IsSocketReady(client_res->socket) int active = CheckSockets(socketSet, 0); @@ -76,10 +76,10 @@ int main(void) // if (IsSocketReady(serverResult->socket)) { // bytesRecv = SocketReceive(serverResult->socket, receiveBuffer, msglen); // } - int bytesRecv = SocketReceive(serverResult->socket, receiveBuffer, strlen(pingmsg) + 1); + int bytesRecv = SocketReceive(serverResult->socket, receiveBuffer, (int)strlen(pingmsg) + 1); // If we received data, is that data a "Ping!" or a "Pong!"? - if (bytesRecv > 0) + if (bytesRecv > 0) { if (strcmp(receiveBuffer, pingmsg) == 0) { pong = true; } if (strcmp(receiveBuffer, pongmsg) == 0) { ping = true; } @@ -87,20 +87,20 @@ int main(void) // After each delay has expired, send a response "Ping!" for a "Pong!" and vice-versa elapsed += GetFrameTime(); - + if (elapsed > delay) { - if (ping) + if (ping) { ping = false; - SocketSend(serverResult->socket, pingmsg, strlen(pingmsg) + 1); - } - else if (pong) + SocketSend(serverResult->socket, pingmsg, (int)strlen(pingmsg) + 1); + } + else if (pong) { pong = false; - SocketSend(serverResult->socket, pongmsg, strlen(pongmsg) + 1); + SocketSend(serverResult->socket, pongmsg, (int)strlen(pongmsg) + 1); } - + elapsed = 0.0f; } //---------------------------------------------------------------------------------- @@ -120,7 +120,7 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- CloseNetworkDevice(); // Close network communication - + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/others/easings.h b/examples/others/easings.h index f6c384b00..216178260 100644 --- a/examples/others/easings.h +++ b/examples/others/easings.h @@ -112,12 +112,12 @@ EASEDEF float EaseSineOut(float t, float b, float c, float d) { return (c*sinf(t EASEDEF float EaseSineInOut(float t, float b, float c, float d) { return (-c/2.0f*(cosf(PI*t/d) - 1.0f) + b); } // Circular Easing functions -EASEDEF float EaseCircIn(float t, float b, float c, float d) { t /= d; return (-c*(sqrt(1.0f - t*t) - 1.0f) + b); } -EASEDEF float EaseCircOut(float t, float b, float c, float d) { t = t/d - 1.0f; return (c*sqrt(1.0f - t*t) + b); } +EASEDEF float EaseCircIn(float t, float b, float c, float d) { t /= d; return (-c*(sqrtf(1.0f - t*t) - 1.0f) + b); } +EASEDEF float EaseCircOut(float t, float b, float c, float d) { t = t/d - 1.0f; return (c*sqrtf(1.0f - t*t) + b); } EASEDEF float EaseCircInOut(float t, float b, float c, float d) { - if ((t/=d/2.0f) < 1.0f) return (-c/2.0f*(sqrt(1.0f - t*t) - 1.0f) + b); - t -= 2.0f; return (c/2.0f*(sqrt(1.0f - t*t) + 1.0f) + b); + if ((t/=d/2.0f) < 1.0f) return (-c/2.0f*(sqrtf(1.0f - t*t) - 1.0f) + b); + t -= 2.0f; return (c/2.0f*(sqrtf(1.0f - t*t) + 1.0f) + b); } // Cubic Easing functions @@ -139,15 +139,15 @@ EASEDEF float EaseQuadInOut(float t, float b, float c, float d) } // Exponential Easing functions -EASEDEF float EaseExpoIn(float t, float b, float c, float d) { return (t == 0.0f) ? b : (c*pow(2.0f, 10.0f*(t/d - 1.0f)) + b); } -EASEDEF float EaseExpoOut(float t, float b, float c, float d) { return (t == d) ? (b + c) : (c*(-pow(2.0f, -10.0f*t/d) + 1.0f) + b); } +EASEDEF float EaseExpoIn(float t, float b, float c, float d) { return (t == 0.0f) ? b : (c * powf(2.0f, 10.0f*(t/d - 1.0f)) + b); } +EASEDEF float EaseExpoOut(float t, float b, float c, float d) { return (t == d) ? (b + c) : (c * (-powf(2.0f, -10.0f*t/d) + 1.0f) + b); } EASEDEF float EaseExpoInOut(float t, float b, float c, float d) { if (t == 0.0f) return b; if (t == d) return (b + c); - if ((t/=d/2.0f) < 1.0f) return (c/2.0f*pow(2.0f, 10.0f*(t - 1.0f)) + b); + if ((t/=d/2.0f) < 1.0f) return (c/2.0f* powf(2.0f, 10.0f*(t - 1.0f)) + b); - return (c/2.0f*(-pow(2.0f, -10.0f*(t - 1.0f)) + 2.0f) + b); + return (c/2.0f*(-powf(2.0f, -10.0f*(t - 1.0f)) + 2.0f) + b); } // Back Easing functions @@ -219,7 +219,7 @@ EASEDEF float EaseElasticIn(float t, float b, float c, float d) float p = d*0.3f; float a = c; float s = p/4.0f; - float postFix = a*pow(2.0f, 10.0f*(t-=1.0f)); + float postFix = a*powf(2.0f, 10.0f*(t-=1.0f)); return (-(postFix*sinf((t*d-s)*(2.0f*PI)/p )) + b); } @@ -233,7 +233,7 @@ EASEDEF float EaseElasticOut(float t, float b, float c, float d) float a = c; float s = p/4.0f; - return (a*pow(2.0f,-10.0f*t)*sinf((t*d-s)*(2.0f*PI)/p) + c + b); + return (a*powf(2.0f,-10.0f*t)*sinf((t*d-s)*(2.0f*PI)/p) + c + b); } EASEDEF float EaseElasticInOut(float t, float b, float c, float d) @@ -247,11 +247,11 @@ EASEDEF float EaseElasticInOut(float t, float b, float c, float d) if (t < 1.0f) { - float postFix = a*pow(2.0f, 10.0f*(t-=1.0f)); + float postFix = a*powf(2.0f, 10.0f*(t-=1.0f)); return -0.5f*(postFix*sinf((t*d-s)*(2.0f*PI)/p)) + b; } - float postFix = a*pow(2.0f, -10.0f*(t-=1.0f)); + float postFix = a*powf(2.0f, -10.0f*(t-=1.0f)); return (postFix*sinf((t*d-s)*(2.0f*PI)/p)*0.5f + c + b); } diff --git a/examples/others/easings_testbed.c b/examples/others/easings_testbed.c index 9c94cfc3e..19c3b4578 100644 --- a/examples/others/easings_testbed.c +++ b/examples/others/easings_testbed.c @@ -107,7 +107,7 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [easings] example - easings testbed"); Vector2 ballPosition = { 100.0f, 200.0f }; - + float t = 0.0f; // Current time (in any unit measure, but same unit as duration) float d = 300.0f; // Total time it should take to complete (duration) bool paused = true; diff --git a/examples/others/embedded_files_loading.c b/examples/others/embedded_files_loading.c index 7064ebc69..60a2a6f0f 100644 --- a/examples/others/embedded_files_loading.c +++ b/examples/others/embedded_files_loading.c @@ -28,7 +28,7 @@ int main(void) InitAudioDevice(); // Initialize audio device // Loaded in CPU memory (RAM) from header file (audio_data.h) - // Same as: Wave wave = LoadWave("sound.wav"); + // Same as: Wave wave = LoadWave("sound.wav"); Wave wave = { .data = AUDIO_DATA, .sampleCount = AUDIO_SAMPLE_COUNT, @@ -39,14 +39,14 @@ int main(void) // Wave converted to Sound to be played Sound sound = LoadSoundFromWave(wave); - + // With a Wave loaded from file, after Sound is loaded, we can unload Wave // but in our case, Wave is embedded in executable, in program .data segment // we can not (and should not) try to free that private memory region //UnloadWave(wave); // Do not unload wave data! // Loaded in CPU memory (RAM) from header file (image_data.h) - // Same as: Image image = LoadImage("raylib_logo.png"); + // Same as: Image image = LoadImage("raylib_logo.png"); Image image = { .data = IMAGE_DATA, .width = IMAGE_WIDTH, @@ -54,15 +54,15 @@ int main(void) .format = IMAGE_FORMAT, .mipmaps = 1 }; - + // Image converted to Texture (VRAM) to be drawn - Texture2D texture = LoadTextureFromImage(image); - + Texture2D texture = LoadTextureFromImage(image); + // With an Image loaded from file, after Texture is loaded, we can unload Image // but in our case, Image is embedded in executable, in program .data segment // we can not (and should not) try to free that private memory region //UnloadImage(image); // Do not unload image data! - + SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- diff --git a/examples/others/opengl_interop.c b/examples/others/opengl_interop.c new file mode 100644 index 000000000..5d435f2a8 --- /dev/null +++ b/examples/others/opengl_interop.c @@ -0,0 +1,132 @@ +/******************************************************************************************* +* +* raylib [shaders] example - OpenGL point particle system +* +* This example has been created using raylib 2ad3eb1 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) +* +* Example contributed by Stephan Soller (@arkanis - http://arkanis.de/) +* and reviewed by Ramon Santamaria (@raysan5) +* +* Copyright (c) 2021 Stephan Soller (@arkanis) and Ramon Santamaria (@raysan5) +* +******************************************************************************************** +* +* Mixes raylib and plain OpenGL code to draw a GL_POINTS based particle system. The +* primary point is to demonstrate raylib and OpenGL interop. +* +* rlgl batched draw operations internally so we have to flush the current batch before +* doing our own OpenGL work (rlDrawRenderBatchActive()). +* +* The example also demonstrates how to get the current model view projection matrix of +* raylib. That way raylib cameras and so on work as expected. +* +********************************************************************************************/ + +#include "raylib.h" +#include "rlgl.h" +#include "glad.h" + +#if defined(PLATFORM_DESKTOP) + #define GLSL_VERSION 330 +#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB + #define GLSL_VERSION 100 +#endif + +int main() +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib - point particles"); + + Shader shader = LoadShader( + TextFormat("resources/shaders/glsl%i/point_particle.vs", GLSL_VERSION), + TextFormat("resources/shaders/glsl%i/point_particle.fs", GLSL_VERSION)); + int currentTimeLoc = GetShaderLocation(shader, "currentTime"); + int colorLoc = GetShaderLocation(shader, "color"); + + // Initialize the vertex buffer for the particles and assign each particle random values + struct { float x, y, period; } particles[10000]; + const size_t particleCount = sizeof(particles) / sizeof(particles[0]); + for (size_t i = 0; i < particleCount; i++) + { + particles[i].x = GetRandomValue(20, screenWidth - 20); + particles[i].y = GetRandomValue(50, screenHeight - 20); + // Give each particle a slightly different period. But don't spread it to much. This way the particles line up + // every so often and you get a glimps of what is going on. + particles[i].period = GetRandomValue(10, 30) / 10.0f; + } + + // Create a plain OpenGL vertex buffer with the data and an vertex array object that feeds the data from the buffer + // into the vertexPosition shader attribute. + GLuint vao = 0, vbo = 0; + glGenVertexArrays(1, &vao); + glBindVertexArray(vao); + glGenBuffers(1, &vbo); + glBindBuffer(GL_ARRAY_BUFFER, vbo); + glBufferData(GL_ARRAY_BUFFER, sizeof(particles), particles, GL_STATIC_DRAW); + // Note: LoadShader() automatically fetches the attribute index of "vertexPosition" and saves it in shader.locs[SHADER_LOC_VERTEX_POSITION] + glVertexAttribPointer(shader.locs[SHADER_LOC_VERTEX_POSITION], 3, GL_FLOAT, GL_FALSE, 0, 0); + glEnableVertexAttribArray(0); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindVertexArray(0); + + // Allows the vertex shader to set the point size of each particle individually + glEnable(GL_PROGRAM_POINT_SIZE); + + SetTargetFPS(60); + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key + { + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + ClearBackground(WHITE); + + DrawRectangle(10, 10, 210, 30, MAROON); + DrawText(TextFormat("%zu particles in one vertex buffer", particleCount), 20, 20, 10, RAYWHITE); + + // Switch to plain OpenGL + //------------------------------------------------------------------------------ + // rlglDraw() in raylib 3.5 + rlDrawRenderBatchActive(); + glUseProgram(shader.id); + glUniform1f(currentTimeLoc, GetTime()); + + Vector4 color = ColorNormalize((Color){ 255, 0, 0, 128 }); + glUniform4fv(colorLoc, 1, (float*)&color); + + // The the current model view projection matrix so the particle system is displayed and transformed + // (e.g. by cameras) just like everything else. + // GetMatrixModelview() and GetMatrixProjection() in raylib 3.5 + Matrix modelViewProjection = MatrixMultiply(rlGetMatrixModelview(), rlGetMatrixProjection()); + glUniformMatrix4fv(shader.locs[SHADER_LOC_MATRIX_MVP], 1, false, MatrixToFloat(modelViewProjection)); + + glBindVertexArray(vao); + glDrawArrays(GL_POINTS, 0, particleCount); + glBindVertexArray(0); + glUseProgram(0); + + // And back to raylib again + //------------------------------------------------------------------------------ + DrawFPS(screenWidth - 100, 10); + EndDrawing(); + //---------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + glDeleteBuffers(1, &vbo); + glDeleteVertexArrays(1, &vao); + + UnloadShader(shader); + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} \ No newline at end of file diff --git a/examples/others/opengl_interop.png b/examples/others/opengl_interop.png new file mode 100644 index 000000000..74d7acaea Binary files /dev/null and b/examples/others/opengl_interop.png differ diff --git a/examples/others/raudio_standalone.c b/examples/others/raudio_standalone.c index 224286d36..db543aca0 100644 --- a/examples/others/raudio_standalone.c +++ b/examples/others/raudio_standalone.c @@ -15,7 +15,7 @@ * * COMPILATION: * gcc -o raudio_standalone.exe raudio_standalone.c ..\..\src\raudio.c / -* -I..\..\src -I..\..\src\external -L. -Wall -std=c99 -DRAUDIO_STANDALONE / +* -I..\..\src -I..\..\src\external -L. -Wall -std=c99 -DRAUDIO_STANDALONE / * -DSUPPORT_FILEFORMAT_WAV -DSUPPORT_FILEFORMAT_OGG -DSUPPORT_FILEFORMAT_MP3 * * LICENSE: zlib/libpng @@ -64,6 +64,9 @@ #if !defined(_WIN32) static int kbhit(void); // Check if a key has been pressed static char getch(); // Get pressed character +#else +#define kbhit _kbhit +#define getch _getch #endif //------------------------------------------------------------------------------------ @@ -93,7 +96,7 @@ int main(int argc, char *argv[]) if ((key == 's') || (key == 'S')) PlaySound(fxWav); if ((key == 'd') || (key == 'D')) PlaySound(fxOgg); - + key = 0; UpdateMusicStream(music); diff --git a/examples/others/resources/shaders/glsl100/point_particle.fs b/examples/others/resources/shaders/glsl100/point_particle.fs new file mode 100644 index 000000000..cf0fd72c2 --- /dev/null +++ b/examples/others/resources/shaders/glsl100/point_particle.fs @@ -0,0 +1,16 @@ +#version 100 + +precision mediump float; + +// Input uniform values +uniform vec4 color; + +// NOTE: Add here your custom variables + +void main() +{ + // Each point is drawn as a screen space square of gl_PointSize size. gl_PointCoord contains where we are inside of + // it. (0, 0) is the top left, (1, 1) the bottom right corner. + // Draw each point as a colored circle with alpha 1.0 in the center and 0.0 at the outer edges. + gl_FragColor = vec4(color.rgb, color.a * (1.0 - length(gl_PointCoord.xy - vec2(0.5))*2.0)); +} \ No newline at end of file diff --git a/examples/others/resources/shaders/glsl100/point_particle.vs b/examples/others/resources/shaders/glsl100/point_particle.vs new file mode 100644 index 000000000..890834c49 --- /dev/null +++ b/examples/others/resources/shaders/glsl100/point_particle.vs @@ -0,0 +1,24 @@ +#version 100 + +// Input vertex attributes +attribute vec3 vertexPosition; + +// Input uniform values +uniform mat4 mvp; +uniform float currentTime; + +// NOTE: Add here your custom variables + +void main() +{ + // Unpack data from vertexPosition + vec2 pos = vertexPosition.xy; + float period = vertexPosition.z; + + // Calculate final vertex position (jiggle it around a bit horizontally) + pos += vec2(100.0, 0.0) * sin(period * currentTime); + gl_Position = mvp * vec4(pos.x, pos.y, 0.0, 1.0); + + // Calculate the screen space size of this particle (also vary it over time) + gl_PointSize = 10.0 - 5.0 * abs(sin(period * currentTime)); +} \ No newline at end of file diff --git a/examples/others/resources/shaders/glsl330/point_particle.fs b/examples/others/resources/shaders/glsl330/point_particle.fs new file mode 100644 index 000000000..f08462105 --- /dev/null +++ b/examples/others/resources/shaders/glsl330/point_particle.fs @@ -0,0 +1,17 @@ +#version 330 + +// Input uniform values +uniform vec4 color; + +// Output fragment color +out vec4 finalColor; + +// NOTE: Add here your custom variables + +void main() +{ + // Each point is drawn as a screen space square of gl_PointSize size. gl_PointCoord contains where we are inside of + // it. (0, 0) is the top left, (1, 1) the bottom right corner. + // Draw each point as a colored circle with alpha 1.0 in the center and 0.0 at the outer edges. + finalColor = vec4(color.rgb, color.a * (1 - length(gl_PointCoord.xy - vec2(0.5))*2)); +} \ No newline at end of file diff --git a/examples/others/resources/shaders/glsl330/point_particle.vs b/examples/others/resources/shaders/glsl330/point_particle.vs new file mode 100644 index 000000000..e43b91de3 --- /dev/null +++ b/examples/others/resources/shaders/glsl330/point_particle.vs @@ -0,0 +1,24 @@ +#version 330 + +// Input vertex attributes +in vec3 vertexPosition; + +// Input uniform values +uniform mat4 mvp; +uniform float currentTime; + +// NOTE: Add here your custom variables + +void main() +{ + // Unpack data from vertexPosition + vec2 pos = vertexPosition.xy; + float period = vertexPosition.z; + + // Calculate final vertex position (jiggle it around a bit horizontally) + pos += vec2(100, 0) * sin(period * currentTime); + gl_Position = mvp * vec4(pos, 0.0, 1.0); + + // Calculate the screen space size of this particle (also vary it over time) + gl_PointSize = 10 - 5 * abs(sin(period * currentTime)); +} \ No newline at end of file diff --git a/examples/others/rlgl_standalone.c b/examples/others/rlgl_standalone.c index 9aea2b478..47233afd8 100644 --- a/examples/others/rlgl_standalone.c +++ b/examples/others/rlgl_standalone.c @@ -9,7 +9,7 @@ * rlgl.h - OpenGL 1.1 immediate-mode style coding translation layer * glad.h - OpenGL extensions initialization library (required by rlgl) * raymath.h - 3D math library (required by rlgl) -* glfw3 - Windows and context initialization library +* glfw3 - Windows and context initialization library * * rlgl library is provided as a single-file header-only library, this library * allows coding in a pseudo-OpenGL 1.1 style while translating calls to multiple @@ -57,7 +57,7 @@ #define GLFW_INCLUDE_ES2 #endif -#include // Windows/Context and inputs management +#include "GLFW/glfw3.h" // Windows/Context and inputs management #include // Required for: printf() @@ -65,6 +65,15 @@ #define RAYWHITE (Color){ 245, 245, 245, 255 } // My own White (raylib logo) #define DARKGRAY (Color){ 80, 80, 80, 255 } // Dark Gray +// Camera type, defines a camera position/orientation in 3d space +typedef struct Camera { + Vector3 position; // Camera position + Vector3 target; // Camera target it looks-at + Vector3 up; // Camera up vector (rotation over its axis) + float fovy; // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic + int projection; // Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC +} Camera; + //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- @@ -86,18 +95,18 @@ int main(void) //-------------------------------------------------------------------------------------- const int screenWidth = 800; const int screenHeight = 450; - + // GLFW3 Initialization + OpenGL 3.3 Context + Extensions //-------------------------------------------------------- glfwSetErrorCallback(ErrorCallback); - + if (!glfwInit()) { printf("GLFW3: Can not initialize GLFW\n"); return 1; } else printf("GLFW3: GLFW initialized successfully\n"); - + glfwWindowHint(GLFW_SAMPLES, 4); glfwWindowHint(GLFW_DEPTH_BITS, 16); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); @@ -108,27 +117,27 @@ int main(void) glfwWindowHint( GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE ); #endif - + GLFWwindow *window = glfwCreateWindow(screenWidth, screenHeight, "rlgl standalone", NULL, NULL); - + if (!window) { glfwTerminate(); return 2; } else printf("GLFW3: Window created successfully\n"); - + glfwSetWindowPos(window, 200, 200); - + glfwSetKeyCallback(window, KeyCallback); - + glfwMakeContextCurrent(window); glfwSwapInterval(0); - + // Load OpenGL 3.3 supported extensions rlLoadExtensions(glfwGetProcAddress); //-------------------------------------------------------- - + // Initialize OpenGL context (states and resources) rlglInit(screenWidth, screenHeight); @@ -142,18 +151,18 @@ int main(void) rlClearColor(245, 245, 245, 255); // Define clear color rlEnableDepthTest(); // Enable DEPTH_TEST for 3D - + Camera camera = { 0 }; camera.position = (Vector3){ 5.0f, 5.0f, 5.0f }; // Camera position camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) camera.fovy = 45.0f; // Camera field-of-view Y - - Vector3 cubePosition = { 0.0f, 0.0f, 0.0f }; // Cube default position (center) - //-------------------------------------------------------------------------------------- - // Main game loop - while (!glfwWindowShouldClose(window)) + Vector3 cubePosition = { 0.0f, 0.0f, 0.0f }; // Cube default position (center) + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!glfwWindowShouldClose(window)) { // Update //---------------------------------------------------------------------------------- @@ -167,29 +176,29 @@ int main(void) // Draw '3D' elements in the scene //----------------------------------------------- // Calculate projection matrix (from perspective) and view matrix from camera look at - Matrix matProj = MatrixPerspective(camera.fovy*DEG2RAD, (double)screenWidth/(double)screenHeight, 0.01, 1000.0); + Matrix matProj = MatrixPerspective((double)(camera.fovy*DEG2RAD), (double)screenWidth/(double)screenHeight, 0.01, 1000.0); Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); - SetMatrixModelview(matView); // Set internal modelview matrix (default shader) - SetMatrixProjection(matProj); // Set internal projection matrix (default shader) + rlSetMatrixModelview(matView); // Set internal modelview matrix (default shader) + rlSetMatrixProjection(matProj); // Set internal projection matrix (default shader) DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, RAYWHITE); DrawGrid(10, 1.0f); - // NOTE: Internal buffers drawing (3D data) - rlglDraw(); + // Draw internal render batch buffers (3D data) + rlDrawRenderBatchActive(); //----------------------------------------------- - + // Draw '2D' elements in the scene (GUI) //----------------------------------------------- #define RLGL_CREATE_MATRIX_MANUALLY #if defined(RLGL_CREATE_MATRIX_MANUALLY) matProj = MatrixOrtho(0.0, screenWidth, screenHeight, 0.0, 0.0, 1.0); matView = MatrixIdentity(); - - SetMatrixModelview(matView); // Set internal modelview matrix (default shader) - SetMatrixProjection(matProj); // Set internal projection matrix (default shader) + + rlSetMatrixModelview(matView); // Set internal modelview matrix (default shader) + rlSetMatrixProjection(matProj); // Set internal projection matrix (default shader) #else // Let rlgl generate and multiply matrix internally @@ -201,10 +210,10 @@ int main(void) #endif DrawRectangleV((Vector2){ 10.0f, 10.0f }, (Vector2){ 780.0f, 20.0f }, DARKGRAY); - // NOTE: Internal buffers drawing (2D data) - rlglDraw(); + // Draw internal render batch buffers (3D data) + rlDrawRenderBatchActive(); //----------------------------------------------- - + glfwSwapBuffers(window); glfwPollEvents(); //---------------------------------------------------------------------------------- @@ -213,11 +222,11 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- rlglClose(); // Unload rlgl internal buffers and default shader/texture - + glfwDestroyWindow(window); // Close window glfwTerminate(); // Free GLFW3 resources //-------------------------------------------------------------------------------------- - + return 0; } @@ -246,13 +255,13 @@ static void DrawRectangleV(Vector2 position, Vector2 size, Color color) rlBegin(RL_TRIANGLES); rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2i(position.x, position.y); - rlVertex2i(position.x, position.y + size.y); - rlVertex2i(position.x + size.x, position.y + size.y); + rlVertex2f(position.x, position.y); + rlVertex2f(position.x, position.y + size.y); + rlVertex2f(position.x + size.x, position.y + size.y); - rlVertex2i(position.x, position.y); - rlVertex2i(position.x + size.x, position.y + size.y); - rlVertex2i(position.x + size.x, position.y); + rlVertex2f(position.x, position.y); + rlVertex2f(position.x + size.x, position.y + size.y); + rlVertex2f(position.x + size.x, position.y); rlEnd(); } diff --git a/examples/physics/physics_demo.c b/examples/physics/physics_demo.c index 421c82a90..fd4c1d25c 100644 --- a/examples/physics/physics_demo.c +++ b/examples/physics/physics_demo.c @@ -1,24 +1,19 @@ /******************************************************************************************* * -* Physac - Physics demo +* raylib [physac] example - physics demo * -* NOTE 1: Physac requires multi-threading, when InitPhysics() a second thread is created to manage physics calculations. -* NOTE 2: Physac requires static C library linkage to avoid dependency on MinGW DLL (-static -lpthread) +* This example has been created using raylib 1.5 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Use the following line to compile: +* This example uses physac 1.1 (https://github.com/raysan5/raylib/blob/master/src/physac.h) * -* gcc -o $(NAME_PART).exe $(FILE_NAME) -s -static / -* -lraylib -lpthread -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm / -* -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition -* -* Copyright (c) 2016-2018 Victor Fisac +* Copyright (c) 2016-2021 Victor Fisac (@victorfisac) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ #include "raylib.h" #define PHYSAC_IMPLEMENTATION -#define PHYSAC_NO_THREADS #include "physac.h" int main(void) @@ -29,12 +24,11 @@ int main(void) const int screenHeight = 450; SetConfigFlags(FLAG_MSAA_4X_HINT); - InitWindow(screenWidth, screenHeight, "Physac [raylib] - Physics demo"); + InitWindow(screenWidth, screenHeight, "raylib [physac] example - physics demo"); // Physac logo drawing position int logoX = screenWidth - MeasureText("Physac", 30) - 10; int logoY = 15; - bool needsReset = false; // Initialize physics and default physics bodies InitPhysics(); @@ -55,30 +49,22 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - // Delay initialization of variables due to physics reset async - RunPhysicsStep(); + UpdatePhysics(); // Update physics system - if (needsReset) + if (IsKeyPressed(KEY_R)) // Reset physics system { + ResetPhysics(); + floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2, screenHeight }, 500, 100, 10); floor->enabled = false; circle = CreatePhysicsBodyCircle((Vector2){ screenWidth/2, screenHeight/2 }, 45, 10); circle->enabled = false; - - needsReset = false; - } - - // Reset physics input - if (IsKeyPressed('R')) - { - ResetPhysics(); - needsReset = true; } // Physics body creation inputs - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) CreatePhysicsBodyPolygon(GetMousePosition(), GetRandomValue(20, 80), GetRandomValue(3, 8), 10); - else if (IsMouseButtonPressed(MOUSE_RIGHT_BUTTON)) CreatePhysicsBodyCircle(GetMousePosition(), GetRandomValue(10, 45), 10); + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) CreatePhysicsBodyPolygon(GetMousePosition(), GetRandomValue(20, 80), GetRandomValue(3, 8), 10); + else if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT)) CreatePhysicsBodyCircle(GetMousePosition(), GetRandomValue(10, 45), 10); // Destroy falling physics bodies int bodiesCount = GetPhysicsBodiesCount(); diff --git a/examples/physics/physics_friction.c b/examples/physics/physics_friction.c index 0acf88aea..d1ade9796 100644 --- a/examples/physics/physics_friction.c +++ b/examples/physics/physics_friction.c @@ -1,24 +1,19 @@ /******************************************************************************************* * -* Physac - Physics friction +* raylib [physac] example - physics friction * -* NOTE 1: Physac requires multi-threading, when InitPhysics() a second thread is created to manage physics calculations. -* NOTE 2: Physac requires static C library linkage to avoid dependency on MinGW DLL (-static -lpthread) +* This example has been created using raylib 1.5 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Use the following line to compile: +* This example uses physac 1.1 (https://github.com/raysan5/raylib/blob/master/src/physac.h) * -* gcc -o $(NAME_PART).exe $(FILE_NAME) -s -static / -* -lraylib -lpthread -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm / -* -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition -* -* Copyright (c) 2016-2018 Victor Fisac +* Copyright (c) 2016-2021 Victor Fisac (@victorfisac) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ #include "raylib.h" #define PHYSAC_IMPLEMENTATION -#define PHYSAC_NO_THREADS #include "physac.h" int main(void) @@ -29,7 +24,7 @@ int main(void) const int screenHeight = 450; SetConfigFlags(FLAG_MSAA_4X_HINT); - InitWindow(screenWidth, screenHeight, "Physac [raylib] - Physics friction"); + InitWindow(screenWidth, screenHeight, "raylib [physac] example - physics friction"); // Physac logo drawing position int logoX = screenWidth - MeasureText("Physac", 30) - 10; @@ -73,9 +68,9 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - RunPhysicsStep(); + UpdatePhysics(); // Update physics system - if (IsKeyPressed('R')) // Reset physics input + if (IsKeyPressed(KEY_R)) // Reset physics system { // Reset dynamic physics bodies position, velocity and rotation bodyA->position = (Vector2){ 35, screenHeight*0.6f }; diff --git a/examples/physics/physics_movement.c b/examples/physics/physics_movement.c index d946811d1..d6155da15 100644 --- a/examples/physics/physics_movement.c +++ b/examples/physics/physics_movement.c @@ -1,24 +1,19 @@ /******************************************************************************************* * -* Physac - Physics movement +* raylib [physac] example - physics movement * -* NOTE 1: Physac requires multi-threading, when InitPhysics() a second thread is created to manage physics calculations. -* NOTE 2: Physac requires static C library linkage to avoid dependency on MinGW DLL (-static -lpthread) +* This example has been created using raylib 1.5 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Use the following line to compile: +* This example uses physac 1.1 (https://github.com/raysan5/raylib/blob/master/src/physac.h) * -* gcc -o $(NAME_PART).exe $(FILE_NAME) -s -static / -* -lraylib -lpthread -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm / -* -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition -* -* Copyright (c) 2016-2018 Victor Fisac +* Copyright (c) 2016-2021 Victor Fisac (@victorfisac) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ #include "raylib.h" #define PHYSAC_IMPLEMENTATION -#define PHYSAC_NO_THREADS #include "physac.h" #define VELOCITY 0.5f @@ -31,7 +26,7 @@ int main(void) const int screenHeight = 450; SetConfigFlags(FLAG_MSAA_4X_HINT); - InitWindow(screenWidth, screenHeight, "Physac [raylib] - Physics movement"); + InitWindow(screenWidth, screenHeight, "raylib [physac] example - physics movement"); // Physac logo drawing position int logoX = screenWidth - MeasureText("Physac", 30) - 10; @@ -66,9 +61,9 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - RunPhysicsStep(); + UpdatePhysics(); // Update physics system - if (IsKeyPressed('R')) // Reset physics input + if (IsKeyPressed(KEY_R)) // Reset physics input { // Reset movement physics body position, velocity and rotation body->position = (Vector2){ screenWidth/2, screenHeight/2 }; diff --git a/examples/physics/physics_restitution.c b/examples/physics/physics_restitution.c index 12a2a9220..917ab8d09 100644 --- a/examples/physics/physics_restitution.c +++ b/examples/physics/physics_restitution.c @@ -1,24 +1,19 @@ /******************************************************************************************* * -* Physac - Physics restitution +* raylib [physac] example - physics restitution * -* NOTE 1: Physac requires multi-threading, when InitPhysics() a second thread is created to manage physics calculations. -* NOTE 2: Physac requires static C library linkage to avoid dependency on MinGW DLL (-static -lpthread) +* This example has been created using raylib 1.5 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Use the following line to compile: +* This example uses physac 1.1 (https://github.com/raysan5/raylib/blob/master/src/physac.h) * -* gcc -o $(NAME_PART).exe $(FILE_NAME) -s -static / -* -lraylib -lpthread -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm / -* -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition -* -* Copyright (c) 2016-2018 Victor Fisac +* Copyright (c) 2016-2021 Victor Fisac (@victorfisac) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ #include "raylib.h" #define PHYSAC_IMPLEMENTATION -#define PHYSAC_NO_THREADS #include "physac.h" int main(void) @@ -29,7 +24,7 @@ int main(void) const int screenHeight = 450; SetConfigFlags(FLAG_MSAA_4X_HINT); - InitWindow(screenWidth, screenHeight, "Physac [raylib] - Physics restitution"); + InitWindow(screenWidth, screenHeight, "raylib [physac] example - physics restitution"); // Physac logo drawing position int logoX = screenWidth - MeasureText("Physac", 30) - 10; @@ -53,7 +48,7 @@ int main(void) // Restitution demo needs a very tiny physics time step for a proper simulation SetPhysicsTimeStep(1.0/60.0/100*1000); - + SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -62,9 +57,9 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - RunPhysicsStep(); + UpdatePhysics(); // Update physics system - if (IsKeyPressed('R')) // Reset physics input + if (IsKeyPressed(KEY_R)) // Reset physics input { // Reset circles physics bodies position and velocity circleA->position = (Vector2){ screenWidth*0.25f, screenHeight/2 }; @@ -124,6 +119,7 @@ int main(void) DestroyPhysicsBody(circleB); DestroyPhysicsBody(circleC); DestroyPhysicsBody(floor); + ClosePhysics(); // Unitialize physics CloseWindow(); // Close window and OpenGL context diff --git a/examples/physics/physics_shatter.c b/examples/physics/physics_shatter.c index cbc65221d..6c5bebfda 100644 --- a/examples/physics/physics_shatter.c +++ b/examples/physics/physics_shatter.c @@ -1,24 +1,19 @@ /******************************************************************************************* * -* Physac - Body shatter +* raylib [physac] example - physics shatter * -* NOTE 1: Physac requires multi-threading, when InitPhysics() a second thread is created to manage physics calculations. -* NOTE 2: Physac requires static C library linkage to avoid dependency on MinGW DLL (-static -lpthread) +* This example has been created using raylib 1.5 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Use the following line to compile: +* This example uses physac 1.1 (https://github.com/raysan5/raylib/blob/master/src/physac.h) * -* gcc -o $(NAME_PART).exe $(FILE_NAME) -s -static / -* -lraylib -lpthread -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm / -* -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition -* -* Copyright (c) 2016-2018 Victor Fisac +* Copyright (c) 2016-2021 Victor Fisac (@victorfisac) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ #include "raylib.h" #define PHYSAC_IMPLEMENTATION -#define PHYSAC_NO_THREADS #include "physac.h" int main(void) @@ -29,19 +24,18 @@ int main(void) const int screenHeight = 450; SetConfigFlags(FLAG_MSAA_4X_HINT); - InitWindow(screenWidth, screenHeight, "Physac [raylib] - Body shatter"); + InitWindow(screenWidth, screenHeight, "raylib [physac] example - physics shatter"); // Physac logo drawing position int logoX = screenWidth - MeasureText("Physac", 30) - 10; int logoY = 15; - bool needsReset = false; // Initialize physics and default physics bodies InitPhysics(); SetPhysicsGravity(0, 0); // Create random polygon physics body to shatter - CreatePhysicsBodyPolygon((Vector2){ screenWidth/2, screenHeight/2 }, GetRandomValue(80, 200), GetRandomValue(3, 8), 10); + CreatePhysicsBodyPolygon((Vector2){ screenWidth/2.0f, screenHeight/2.0f }, GetRandomValue(80, 200), GetRandomValue(3, 8), 10); SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -49,31 +43,23 @@ int main(void) // Main game loop while (!WindowShouldClose()) // Detect window close button or ESC key { - // Update - RunPhysicsStep(); - //---------------------------------------------------------------------------------- - // Delay initialization of variables due to physics reset asynchronous - if (needsReset) - { - // Create random polygon physics body to shatter - CreatePhysicsBodyPolygon((Vector2){ screenWidth/2, screenHeight/2 }, GetRandomValue(80, 200), GetRandomValue(3, 8), 10); - needsReset = false; - } + UpdatePhysics(); // Update physics system - if (IsKeyPressed('R')) // Reset physics input + if (IsKeyPressed(KEY_R)) // Reset physics input { ResetPhysics(); - needsReset = true; + + CreatePhysicsBodyPolygon((Vector2){ screenWidth/2.0f, screenHeight/2.0f }, GetRandomValue(80, 200), GetRandomValue(3, 8), 10); } - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) // Physics shatter input + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) // Physics shatter input { - // Note: some values need to be stored in variables due to asynchronous changes during main thread int count = GetPhysicsBodiesCount(); for (int i = count - 1; i >= 0; i--) { PhysicsBody currentBody = GetPhysicsBody(i); + if (currentBody != NULL) PhysicsShatter(currentBody, GetMousePosition(), 10/currentBody->inverseMass); } } diff --git a/examples/shaders/resources/shaders/glsl100/base_lighting_instanced.vs b/examples/shaders/resources/shaders/glsl100/base_lighting_instanced.vs new file mode 100644 index 000000000..c8e25607c --- /dev/null +++ b/examples/shaders/resources/shaders/glsl100/base_lighting_instanced.vs @@ -0,0 +1,62 @@ +#version 100 + +// Input vertex attributes +attribute vec3 vertexPosition; +attribute vec2 vertexTexCoord; +attribute vec3 vertexNormal; +attribute vec4 vertexColor; + +attribute mat4 instance; + +// Input uniform values +uniform mat4 mvp; + +// Output vertex attributes (to fragment shader) +varying vec3 fragPosition; +varying vec2 fragTexCoord; +varying vec4 fragColor; +varying vec3 fragNormal; + +// NOTE: Add here your custom variables + +// https://github.com/glslify/glsl-inverse +mat3 inverse(mat3 m) +{ + float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2]; + float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2]; + float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2]; + + float b01 = a22*a11 - a12*a21; + float b11 = -a22*a10 + a12*a20; + float b21 = a21*a10 - a11*a20; + + float det = a00*b01 + a01*b11 + a02*b21; + + return mat3(b01, (-a22*a01 + a02*a21), (a12*a01 - a02*a11), + b11, (a22*a00 - a02*a20), (-a12*a00 + a02*a10), + b21, (-a21*a00 + a01*a20), (a11*a00 - a01*a10))/det; +} + +// https://github.com/glslify/glsl-transpose +mat3 transpose(mat3 m) +{ + return mat3(m[0][0], m[1][0], m[2][0], + m[0][1], m[1][1], m[2][1], + m[0][2], m[1][2], m[2][2]); +} + +void main() +{ + // Send vertex attributes to fragment shader + fragPosition = vec3(instance*vec4(vertexPosition, 1.0)); + fragTexCoord = vertexTexCoord; + fragColor = vertexColor; + + mat3 normalMatrix = transpose(inverse(mat3(instance))); + fragNormal = normalize(normalMatrix*vertexNormal); + + mat4 mvpi = mvp*instance; + + // Calculate final vertex position + gl_Position = mvpi*vec4(vertexPosition, 1.0); +} diff --git a/examples/shaders/resources/shaders/glsl100/bloom.fs b/examples/shaders/resources/shaders/glsl100/bloom.fs index a8e1d20f7..673e0116a 100644 --- a/examples/shaders/resources/shaders/glsl100/bloom.fs +++ b/examples/shaders/resources/shaders/glsl100/bloom.fs @@ -14,7 +14,7 @@ uniform vec4 colDiffuse; const vec2 size = vec2(800, 450); // render size const float samples = 5.0; // pixels per axis; higher = bigger glow, worse performance -const float quality = 2.5; // lower = smaller glow, better quality +const float quality = 2.5; // lower = smaller glow, better quality void main() { diff --git a/examples/shaders/resources/shaders/glsl100/color_mix.fs b/examples/shaders/resources/shaders/glsl100/color_mix.fs index 0074e6af1..c5c0cb70c 100644 --- a/examples/shaders/resources/shaders/glsl100/color_mix.fs +++ b/examples/shaders/resources/shaders/glsl100/color_mix.fs @@ -11,6 +11,8 @@ uniform sampler2D texture0; uniform sampler2D texture1; uniform vec4 colDiffuse; +uniform float divider; + void main() { // Texel color fetching from texture sampler @@ -18,7 +20,7 @@ void main() vec4 texelColor1 = texture2D(texture1, fragTexCoord); float x = fract(fragTexCoord.s); - float out = smoothstep(0.4, 0.6, x); + float final = smoothstep(divider - 0.1, divider + 0.1, x); - gl_FragColor = mix(texelColor0, texelColor1, out); -} \ No newline at end of file + gl_FragColor = mix(texelColor0, texelColor1, final); +} diff --git a/examples/shaders/resources/shaders/glsl100/dream_vision.fs b/examples/shaders/resources/shaders/glsl100/dream_vision.fs index fa9c5b771..7014b5920 100644 --- a/examples/shaders/resources/shaders/glsl100/dream_vision.fs +++ b/examples/shaders/resources/shaders/glsl100/dream_vision.fs @@ -34,4 +34,4 @@ void main() color = color/9.5; gl_FragColor = color; -} \ No newline at end of file +} \ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl100/raymarching.fs b/examples/shaders/resources/shaders/glsl100/raymarching.fs index c823e01eb..7535086b5 100644 --- a/examples/shaders/resources/shaders/glsl100/raymarching.fs +++ b/examples/shaders/resources/shaders/glsl100/raymarching.fs @@ -42,7 +42,7 @@ uniform vec2 resolution; float sdPlane( vec3 p ) { - return p.y; + return p.y; } float sdSphere( vec3 p, float s ) @@ -85,9 +85,9 @@ float sdHexPrism( vec3 p, vec2 h ) float sdCapsule( vec3 p, vec3 a, vec3 b, float r ) { - vec3 pa = p-a, ba = b-a; - float h = clamp( dot(pa,ba)/dot(ba,ba), 0.0, 1.0 ); - return length( pa - ba*h ) - r; + vec3 pa = p-a, ba = b-a; + float h = clamp( dot(pa,ba)/dot(ba,ba), 0.0, 1.0 ); + return length( pa - ba*h ) - r; } float sdEquilateralTriangle( in vec2 p ) @@ -154,19 +154,19 @@ float sdPryamid4(vec3 p, vec3 h ) // h = { cos a, sin a, height } float length2( vec2 p ) { - return sqrt( p.x*p.x + p.y*p.y ); + return sqrt( p.x*p.x + p.y*p.y ); } float length6( vec2 p ) { - p = p*p*p; p = p*p; - return pow( p.x + p.y, 1.0/6.0 ); + p = p*p*p; p = p*p; + return pow( p.x + p.y, 1.0/6.0 ); } float length8( vec2 p ) { - p = p*p; p = p*p; p = p*p; - return pow( p.x + p.y, 1.0/8.0 ); + p = p*p; p = p*p; p = p*p; + return pow( p.x + p.y, 1.0/8.0 ); } float sdTorus82( vec3 p, vec2 t ) @@ -195,7 +195,7 @@ float opS( float d1, float d2 ) vec2 opU( vec2 d1, vec2 d2 ) { - return (d1.xtmax ) break; t += res.x; - m = res.y; + m = res.y; } if( t>tmax ) m=-1.0; @@ -271,11 +271,11 @@ vec2 castRay( in vec3 ro, in vec3 rd ) float calcSoftshadow( in vec3 ro, in vec3 rd, in float mint, in float tmax ) { - float res = 1.0; + float res = 1.0; float t = mint; for( int i=0; i<16; i++ ) { - float h = map( ro + rd*t ).x; + float h = map( ro + rd*t ).x; res = min( res, 8.0*h/t ); t += clamp( h, 0.02, 0.10 ); if( h<0.001 || t>tmax ) break; @@ -287,22 +287,22 @@ 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 + - e.xxx*map( pos + e.xxx ).x ); + e.yyx*map( pos + e.yyx ).x + + e.yxy*map( pos + e.yxy ).x + + e.xxx*map( pos + e.xxx ).x ); /* - vec3 eps = vec3( 0.0005, 0.0, 0.0 ); - vec3 nor = vec3( - map(pos+eps.xyy).x - map(pos-eps.xyy).x, - map(pos+eps.yxy).x - map(pos-eps.yxy).x, - map(pos+eps.yyx).x - map(pos-eps.yyx).x ); - return normalize(nor); - */ + vec3 eps = vec3( 0.0005, 0.0, 0.0 ); + vec3 nor = vec3( + map(pos+eps.xyy).x - map(pos-eps.xyy).x, + map(pos+eps.yxy).x - map(pos-eps.yxy).x, + map(pos+eps.yyx).x - map(pos-eps.yyx).x ); + return normalize(nor); + */ } float calcAO( in vec3 pos, in vec3 nor ) { - float occ = 0.0; + float occ = 0.0; float sca = 1.0; for( int i=0; i<5; i++ ) { @@ -331,7 +331,7 @@ vec3 render( in vec3 ro, in vec3 rd ) vec3 col = vec3(0.7, 0.9, 1.0) +rd.y*0.8; vec2 res = castRay(ro,rd); float t = res.x; - float m = res.y; + float m = res.y; if( m>-0.5 ) { vec3 pos = ro + t*rd; @@ -339,7 +339,7 @@ vec3 render( in vec3 ro, in vec3 rd ) vec3 ref = reflect( rd, nor ); // material - col = 0.45 + 0.35*sin( vec3(0.05,0.08,0.10)*(m-1.0) ); + col = 0.45 + 0.35*sin( vec3(0.05,0.08,0.10)*(m-1.0) ); if( m<1.5 ) { @@ -349,9 +349,9 @@ vec3 render( in vec3 ro, in vec3 rd ) // lighting float occ = calcAO( pos, nor ); - vec3 lig = normalize( vec3(cos(-0.4 * runTime), sin(0.7 * runTime), -0.6) ); + vec3 lig = normalize( vec3(cos(-0.4 * runTime), sin(0.7 * runTime), -0.6) ); vec3 hal = normalize( lig-rd ); - float amb = clamp( 0.5+0.5*nor.y, 0.0, 1.0 ); + float amb = clamp( 0.5+0.5*nor.y, 0.0, 1.0 ); float dif = clamp( dot( nor, lig ), 0.0, 1.0 ); float bac = clamp( dot( nor, normalize(vec3(-lig.x,0.0,-lig.z))), 0.0, 1.0 )*clamp( 1.0-pos.y,0.0,1.0); float dom = smoothstep( -0.1, 0.1, ref.y ); @@ -360,31 +360,31 @@ vec3 render( in vec3 ro, in vec3 rd ) dif *= calcSoftshadow( pos, lig, 0.02, 2.5 ); dom *= calcSoftshadow( pos, ref, 0.02, 2.5 ); - float spe = pow( clamp( dot( nor, hal ), 0.0, 1.0 ),16.0)* + float spe = pow( clamp( dot( nor, hal ), 0.0, 1.0 ),16.0)* dif * (0.04 + 0.96*pow( clamp(1.0+dot(hal,rd),0.0,1.0), 5.0 )); - vec3 lin = vec3(0.0); + vec3 lin = vec3(0.0); lin += 1.30*dif*vec3(1.00,0.80,0.55); lin += 0.40*amb*vec3(0.40,0.60,1.00)*occ; lin += 0.50*dom*vec3(0.40,0.60,1.00)*occ; lin += 0.50*bac*vec3(0.25,0.25,0.25)*occ; lin += 0.25*fre*vec3(1.00,1.00,1.00)*occ; - col = col*lin; - col += 10.00*spe*vec3(1.00,0.90,0.70); + col = col*lin; + col += 10.00*spe*vec3(1.00,0.90,0.70); - col = mix( col, vec3(0.8,0.9,1.0), 1.0-exp( -0.0002*t*t*t ) ); + col = mix( col, vec3(0.8,0.9,1.0), 1.0-exp( -0.0002*t*t*t ) ); } - return vec3( clamp(col,0.0,1.0) ); + return vec3( clamp(col,0.0,1.0) ); } mat3 setCamera( in vec3 ro, in vec3 ta, float cr ) { vec3 cw = normalize(ta-ro); - vec3 cp = vec3(sin(cr), cos(cr),0.0); - vec3 cu = normalize( cross(cw,cp) ); - vec3 cv = normalize( cross(cu,cw) ); + vec3 cp = vec3(sin(cr), cos(cr),0.0); + vec3 cu = normalize( cross(cw,cp) ); + vec3 cv = normalize( cross(cu,cw) ); return mat3( cu, cv, cw ); } @@ -402,7 +402,7 @@ void main() vec2 p = (-resolution.xy + 2.0*gl_FragCoord.xy)/resolution.y; #endif - // RAY: Camera is provided from raylib + // RAY: Camera is provided from raylib //vec3 ro = vec3( -0.5+3.5*cos(0.1*time + 6.0*mo.x), 1.0 + 2.0*mo.y, 0.5 + 4.0*sin(0.1*time + 6.0*mo.x) ); vec3 ro = viewEye; @@ -413,10 +413,10 @@ void main() // ray direction vec3 rd = ca * normalize( vec3(p.xy,2.0) ); - // render + // render vec3 col = render( ro, rd ); - // gamma + // gamma col = pow( col, vec3(0.4545) ); tot += col; diff --git a/examples/shaders/resources/shaders/glsl100/reload.fs b/examples/shaders/resources/shaders/glsl100/reload.fs new file mode 100644 index 000000000..eda00ae3a --- /dev/null +++ b/examples/shaders/resources/shaders/glsl100/reload.fs @@ -0,0 +1,39 @@ +#version 100 + +precision mediump float; + +// Input vertex attributes (from vertex shader) +varying vec2 fragTexCoord; // Texture coordinates (sampler2D) +varying vec4 fragColor; // Tint color + +// Uniform inputs +uniform vec2 resolution; // Viewport resolution (in pixels) +uniform vec2 mouse; // Mouse pixel xy coordinates +uniform float time; // Total run time (in secods) + +// Draw circle +vec4 DrawCircle(vec2 fragCoord, vec2 position, float radius, vec3 color) +{ + float d = length(position - fragCoord) - radius; + float t = clamp(d, 0.0, 1.0); + return vec4(color, 1.0 - t); +} + +void main() +{ + vec2 fragCoord = gl_FragCoord.xy; + vec2 position = vec2(mouse.x, resolution.y - mouse.y); + float radius = 40.0; + + // Draw background layer + vec4 colorA = vec4(0.2,0.2,0.8, 1.0); + vec4 colorB = vec4(1.0,0.7,0.2, 1.0); + vec4 layer1 = mix(colorA, colorB, abs(sin(time*0.1))); + + // Draw circle layer + vec3 color = vec3(0.9, 0.16, 0.21); + vec4 layer2 = DrawCircle(fragCoord, position, radius, color); + + // Blend the two layers + gl_FragColor = mix(layer1, layer2, layer2.a); +} diff --git a/examples/shaders/resources/shaders/glsl100/sobel.fs b/examples/shaders/resources/shaders/glsl100/sobel.fs index 745562ad0..3e5c22dda 100644 --- a/examples/shaders/resources/shaders/glsl100/sobel.fs +++ b/examples/shaders/resources/shaders/glsl100/sobel.fs @@ -15,26 +15,26 @@ vec2 resolution = vec2(800.0, 450.0); void main() { - float x = 1.0/resolution.x; - float y = 1.0/resolution.y; + float x = 1.0/resolution.x; + float y = 1.0/resolution.y; - vec4 horizEdge = vec4(0.0); - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0; - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; + vec4 horizEdge = vec4(0.0); + horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; + horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0; + horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; + horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; + horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0; + horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; - vec4 vertEdge = vec4(0.0); - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y - y))*2.0; - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y + y))*2.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; + vec4 vertEdge = vec4(0.0); + vertEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; + vertEdge -= texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y - y))*2.0; + vertEdge -= texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; + vertEdge += texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; + vertEdge += texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y + y))*2.0; + vertEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; - vec3 edge = sqrt((horizEdge.rgb*horizEdge.rgb) + (vertEdge.rgb*vertEdge.rgb)); - - gl_FragColor = vec4(edge, texture2D(texture0, fragTexCoord).a); + vec3 edge = sqrt((horizEdge.rgb*horizEdge.rgb) + (vertEdge.rgb*vertEdge.rgb)); + + gl_FragColor = vec4(edge, texture2D(texture0, fragTexCoord).a); } \ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl100/spotlight.fs b/examples/shaders/resources/shaders/glsl100/spotlight.fs index c1202610e..c8d830381 100644 --- a/examples/shaders/resources/shaders/glsl100/spotlight.fs +++ b/examples/shaders/resources/shaders/glsl100/spotlight.fs @@ -5,9 +5,9 @@ precision mediump float; #define MAX_SPOTS 3 struct Spot { - vec2 pos; // window coords of spot - float inner; // inner fully transparent centre radius - float radius; // alpha fades out to this radius + vec2 pos; // window coords of spot + float inner; // inner fully transparent centre radius + float radius; // alpha fades out to this radius }; uniform Spot spots[MAX_SPOTS]; // Spotlight positions array @@ -15,63 +15,63 @@ uniform float screenWidth; // Width of the screen void main() { - float alpha = 1.0; + float alpha = 1.0; - // Get the position of the current fragment (screen coordinates!) - vec2 pos = vec2(gl_FragCoord.x, gl_FragCoord.y); - - // Find out which spotlight is nearest - float d = 65000.0; // some high value - int fi = -1; // found index + // Get the position of the current fragment (screen coordinates!) + vec2 pos = vec2(gl_FragCoord.x, gl_FragCoord.y); + + // Find out which spotlight is nearest + float d = 65000.0; // some high value + int fi = -1; // found index for (int i = 0; i < MAX_SPOTS; i++) { - for (int j = 0; j < MAX_SPOTS; j++) - { - float dj = distance(pos, spots[j].pos) - spots[j].radius + spots[i].radius; + for (int j = 0; j < MAX_SPOTS; j++) + { + float dj = distance(pos, spots[j].pos) - spots[j].radius + spots[i].radius; - if (d > dj) - { - d = dj; - fi = i; - } - } + if (d > dj) + { + d = dj; + fi = i; + } + } } // d now equals distance to nearest spot... // allowing for the different radii of all spotlights if (fi == 0) { - if (d > spots[0].radius) alpha = 1.0; - else - { - if (d < spots[0].inner) alpha = 0.0; - else alpha = (d - spots[0].inner)/(spots[0].radius - spots[0].inner); - } - } + if (d > spots[0].radius) alpha = 1.0; + else + { + if (d < spots[0].inner) alpha = 0.0; + else alpha = (d - spots[0].inner)/(spots[0].radius - spots[0].inner); + } + } else if (fi == 1) { - if (d > spots[1].radius) alpha = 1.0; - else - { - if (d < spots[1].inner) alpha = 0.0; - else alpha = (d - spots[1].inner)/(spots[1].radius - spots[1].inner); - } - } + if (d > spots[1].radius) alpha = 1.0; + else + { + if (d < spots[1].inner) alpha = 0.0; + else alpha = (d - spots[1].inner)/(spots[1].radius - spots[1].inner); + } + } else if (fi == 2) { - if (d > spots[2].radius) alpha = 1.0; - else - { - if (d < spots[2].inner) alpha = 0.0; - else alpha = (d - spots[2].inner)/(spots[2].radius - spots[2].inner); - } - } - - // Right hand side of screen is dimly lit, + if (d > spots[2].radius) alpha = 1.0; + else + { + if (d < spots[2].inner) alpha = 0.0; + else alpha = (d - spots[2].inner)/(spots[2].radius - spots[2].inner); + } + } + + // Right hand side of screen is dimly lit, // could make the threshold value user definable - if ((pos.x > screenWidth/2.0) && (alpha > 0.9)) alpha = 0.9; + if ((pos.x > screenWidth/2.0) && (alpha > 0.9)) alpha = 0.9; - // could make the black out colour user definable... + // could make the black out colour user definable... gl_FragColor = vec4(0, 0, 0, alpha); } diff --git a/examples/shaders/resources/shaders/glsl100/wave.fs b/examples/shaders/resources/shaders/glsl100/wave.fs index bcc156cc6..50c4e02f3 100644 --- a/examples/shaders/resources/shaders/glsl100/wave.fs +++ b/examples/shaders/resources/shaders/glsl100/wave.fs @@ -22,15 +22,15 @@ uniform float speedX; uniform float speedY; void main() { - float pixelWidth = 1.0 / size.x; - float pixelHeight = 1.0 / size.y; - float aspect = pixelHeight / pixelWidth; - float boxLeft = 0.0; - float boxTop = 0.0; + float pixelWidth = 1.0 / size.x; + float pixelHeight = 1.0 / size.y; + float aspect = pixelHeight / pixelWidth; + float boxLeft = 0.0; + float boxTop = 0.0; - vec2 p = fragTexCoord; - p.x += cos((fragTexCoord.y - boxTop) * freqX / ( pixelWidth * 750.0) + (secondes * speedX)) * ampX * pixelWidth; - p.y += sin((fragTexCoord.x - boxLeft) * freqY * aspect / ( pixelHeight * 750.0) + (secondes * speedY)) * ampY * pixelHeight; + vec2 p = fragTexCoord; + p.x += cos((fragTexCoord.y - boxTop) * freqX / ( pixelWidth * 750.0) + (secondes * speedX)) * ampX * pixelWidth; + p.y += sin((fragTexCoord.x - boxLeft) * freqY * aspect / ( pixelHeight * 750.0) + (secondes * speedY)) * ampY * pixelHeight; - gl_FragColor = texture2D(texture0, p)*colDiffuse*fragColor; + gl_FragColor = texture2D(texture0, p)*colDiffuse*fragColor; } diff --git a/examples/shaders/resources/shaders/glsl120/bloom.fs b/examples/shaders/resources/shaders/glsl120/bloom.fs index c28836b0d..f97c18ed7 100644 --- a/examples/shaders/resources/shaders/glsl120/bloom.fs +++ b/examples/shaders/resources/shaders/glsl120/bloom.fs @@ -12,7 +12,7 @@ uniform vec4 colDiffuse; const vec2 size = vec2(800, 450); // render size const float samples = 5.0; // pixels per axis; higher = bigger glow, worse performance -const float quality = 2.5; // lower = smaller glow, better quality +const float quality = 2.5; // lower = smaller glow, better quality void main() { diff --git a/examples/shaders/resources/shaders/glsl120/dream_vision.fs b/examples/shaders/resources/shaders/glsl120/dream_vision.fs index 4ca2a8634..cb97b2bd0 100644 --- a/examples/shaders/resources/shaders/glsl120/dream_vision.fs +++ b/examples/shaders/resources/shaders/glsl120/dream_vision.fs @@ -32,4 +32,4 @@ void main() color = color/9.5; gl_FragColor = color; -} \ No newline at end of file +} \ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl120/sobel.fs b/examples/shaders/resources/shaders/glsl120/sobel.fs index a3f3f2bf7..73e72703a 100644 --- a/examples/shaders/resources/shaders/glsl120/sobel.fs +++ b/examples/shaders/resources/shaders/glsl120/sobel.fs @@ -13,26 +13,26 @@ vec2 resolution = vec2(800.0, 450.0); void main() { - float x = 1.0/resolution.x; - float y = 1.0/resolution.y; + float x = 1.0/resolution.x; + float y = 1.0/resolution.y; - vec4 horizEdge = vec4(0.0); - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0; - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; + vec4 horizEdge = vec4(0.0); + horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; + horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0; + horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; + horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; + horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0; + horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; - vec4 vertEdge = vec4(0.0); - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y - y))*2.0; - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y + y))*2.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; + vec4 vertEdge = vec4(0.0); + vertEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; + vertEdge -= texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y - y))*2.0; + vertEdge -= texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; + vertEdge += texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; + vertEdge += texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y + y))*2.0; + vertEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; - vec3 edge = sqrt((horizEdge.rgb*horizEdge.rgb) + (vertEdge.rgb*vertEdge.rgb)); - - gl_FragColor = vec4(edge, texture2D(texture0, fragTexCoord).a); + vec3 edge = sqrt((horizEdge.rgb*horizEdge.rgb) + (vertEdge.rgb*vertEdge.rgb)); + + gl_FragColor = vec4(edge, texture2D(texture0, fragTexCoord).a); } \ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl330/base_lighting.vs b/examples/shaders/resources/shaders/glsl330/base_lighting.vs index f1b75d79a..f8ec45f19 100644 --- a/examples/shaders/resources/shaders/glsl330/base_lighting.vs +++ b/examples/shaders/resources/shaders/glsl330/base_lighting.vs @@ -9,6 +9,7 @@ in vec4 vertexColor; // Input uniform values uniform mat4 mvp; uniform mat4 matModel; +uniform mat4 matNormal; // Output vertex attributes (to fragment shader) out vec3 fragPosition; @@ -24,9 +25,7 @@ void main() fragPosition = vec3(matModel*vec4(vertexPosition, 1.0)); fragTexCoord = vertexTexCoord; fragColor = vertexColor; - - mat3 normalMatrix = transpose(inverse(mat3(matModel))); - fragNormal = normalize(normalMatrix*vertexNormal); + fragNormal = normalize(vec3(matNormal*vec4(vertexNormal, 1.0))); // Calculate final vertex position gl_Position = mvp*vec4(vertexPosition, 1.0); diff --git a/examples/shaders/resources/shaders/glsl330/base_lighting_instanced.vs b/examples/shaders/resources/shaders/glsl330/base_lighting_instanced.vs index 5e5430b3f..d198efe1f 100644 --- a/examples/shaders/resources/shaders/glsl330/base_lighting_instanced.vs +++ b/examples/shaders/resources/shaders/glsl330/base_lighting_instanced.vs @@ -6,10 +6,11 @@ in vec2 vertexTexCoord; in vec3 vertexNormal; in vec4 vertexColor; -layout (location = 12) in mat4 instance; +in mat4 instanceTransform; // Input uniform values uniform mat4 mvp; +uniform mat4 matNormal; // Output vertex attributes (to fragment shader) out vec3 fragPosition; @@ -21,16 +22,15 @@ out vec3 fragNormal; void main() { + // Compute MVP for current instance + mat4 mvpi = mvp*instanceTransform; + // Send vertex attributes to fragment shader - fragPosition = vec3(instance * vec4(vertexPosition, 1.0)); + fragPosition = vec3(mvpi*vec4(vertexPosition, 1.0)); fragTexCoord = vertexTexCoord; fragColor = vertexColor; - - mat3 normalMatrix = transpose(inverse(mat3(instance))); - fragNormal = normalize(normalMatrix * vertexNormal); - - mat4 mvpi = mvp * instance; + fragNormal = normalize(vec3(matNormal*vec4(vertexNormal, 1.0))); // Calculate final vertex position - gl_Position = mvpi * vec4(vertexPosition, 1.0); + gl_Position = mvpi*vec4(vertexPosition, 1.0); } diff --git a/examples/shaders/resources/shaders/glsl330/bloom.fs b/examples/shaders/resources/shaders/glsl330/bloom.fs index 333d5b059..549cde8f8 100644 --- a/examples/shaders/resources/shaders/glsl330/bloom.fs +++ b/examples/shaders/resources/shaders/glsl330/bloom.fs @@ -15,7 +15,7 @@ out vec4 finalColor; const vec2 size = vec2(800, 450); // render size const float samples = 5.0; // pixels per axis; higher = bigger glow, worse performance -const float quality = 2.5; // lower = smaller glow, better quality +const float quality = 2.5; // lower = smaller glow, better quality void main() { diff --git a/examples/shaders/resources/shaders/glsl330/color_mix.fs b/examples/shaders/resources/shaders/glsl330/color_mix.fs index 11515b0cd..761b3464a 100644 --- a/examples/shaders/resources/shaders/glsl330/color_mix.fs +++ b/examples/shaders/resources/shaders/glsl330/color_mix.fs @@ -10,6 +10,8 @@ uniform sampler2D texture0; uniform sampler2D texture1; uniform vec4 colDiffuse; +uniform float divider = 0.5; + out vec4 finalColor; void main() @@ -19,7 +21,7 @@ void main() vec4 texelColor1 = texture(texture1, fragTexCoord); float x = fract(fragTexCoord.s); - float out = smoothstep(0.4, 0.6, x); + float final = smoothstep(divider - 0.1, divider + 0.1, x); - finalColor = mix(texelColor0, texelColor1, out); + finalColor = mix(texelColor0, texelColor1, final); } \ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl330/dream_vision.fs b/examples/shaders/resources/shaders/glsl330/dream_vision.fs index 031158628..31d3fd2f3 100644 --- a/examples/shaders/resources/shaders/glsl330/dream_vision.fs +++ b/examples/shaders/resources/shaders/glsl330/dream_vision.fs @@ -31,4 +31,4 @@ void main() color = color/9.5; fragColor = color; -} \ No newline at end of file +} \ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl330/eratosthenes.fs b/examples/shaders/resources/shaders/glsl330/eratosthenes.fs index 92d2d2571..14711222b 100644 --- a/examples/shaders/resources/shaders/glsl330/eratosthenes.fs +++ b/examples/shaders/resources/shaders/glsl330/eratosthenes.fs @@ -38,9 +38,9 @@ vec4 Colorizer(float counter, float maxSize) void main() { - vec4 color = vec4(1.0); - float scale = 1000.0; // Makes 100x100 square grid. Change this variable to make a smaller or larger grid. - int value = int(scale*floor(fragTexCoord.y*scale)+floor(fragTexCoord.x*scale)); // Group pixels into boxes representing integer values + vec4 color = vec4(1.0); + float scale = 1000.0; // Makes 100x100 square grid. Change this variable to make a smaller or larger grid. + int value = int(scale*floor(fragTexCoord.y*scale)+floor(fragTexCoord.x*scale)); // Group pixels into boxes representing integer values if ((value == 0) || (value == 1) || (value == 2)) finalColor = vec4(1.0); else diff --git a/examples/shaders/resources/shaders/glsl330/raymarching.fs b/examples/shaders/resources/shaders/glsl330/raymarching.fs index 3cec58a2b..5b0caa652 100644 --- a/examples/shaders/resources/shaders/glsl330/raymarching.fs +++ b/examples/shaders/resources/shaders/glsl330/raymarching.fs @@ -43,7 +43,7 @@ uniform vec2 resolution; float sdPlane( vec3 p ) { - return p.y; + return p.y; } float sdSphere( vec3 p, float s ) @@ -86,9 +86,9 @@ float sdHexPrism( vec3 p, vec2 h ) float sdCapsule( vec3 p, vec3 a, vec3 b, float r ) { - vec3 pa = p-a, ba = b-a; - float h = clamp( dot(pa,ba)/dot(ba,ba), 0.0, 1.0 ); - return length( pa - ba*h ) - r; + vec3 pa = p-a, ba = b-a; + float h = clamp( dot(pa,ba)/dot(ba,ba), 0.0, 1.0 ); + return length( pa - ba*h ) - r; } float sdEquilateralTriangle( in vec2 p ) @@ -155,19 +155,19 @@ float sdPryamid4(vec3 p, vec3 h ) // h = { cos a, sin a, height } float length2( vec2 p ) { - return sqrt( p.x*p.x + p.y*p.y ); + return sqrt( p.x*p.x + p.y*p.y ); } float length6( vec2 p ) { - p = p*p*p; p = p*p; - return pow( p.x + p.y, 1.0/6.0 ); + p = p*p*p; p = p*p; + return pow( p.x + p.y, 1.0/6.0 ); } float length8( vec2 p ) { - p = p*p; p = p*p; p = p*p; - return pow( p.x + p.y, 1.0/8.0 ); + p = p*p; p = p*p; p = p*p; + return pow( p.x + p.y, 1.0/8.0 ); } float sdTorus82( vec3 p, vec2 t ) @@ -196,7 +196,7 @@ float opS( float d1, float d2 ) vec2 opU( vec2 d1, vec2 d2 ) { - return (d1.xtmax ) break; t += res.x; - m = res.y; + m = res.y; } if( t>tmax ) m=-1.0; @@ -272,11 +272,11 @@ vec2 castRay( in vec3 ro, in vec3 rd ) float calcSoftshadow( in vec3 ro, in vec3 rd, in float mint, in float tmax ) { - float res = 1.0; + float res = 1.0; float t = mint; for( int i=0; i<16; i++ ) { - float h = map( ro + rd*t ).x; + float h = map( ro + rd*t ).x; res = min( res, 8.0*h/t ); t += clamp( h, 0.02, 0.10 ); if( h<0.001 || t>tmax ) break; @@ -288,22 +288,22 @@ 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 + - e.xxx*map( pos + e.xxx ).x ); + e.yyx*map( pos + e.yyx ).x + + e.yxy*map( pos + e.yxy ).x + + e.xxx*map( pos + e.xxx ).x ); /* - vec3 eps = vec3( 0.0005, 0.0, 0.0 ); - vec3 nor = vec3( - map(pos+eps.xyy).x - map(pos-eps.xyy).x, - map(pos+eps.yxy).x - map(pos-eps.yxy).x, - map(pos+eps.yyx).x - map(pos-eps.yyx).x ); - return normalize(nor); - */ + vec3 eps = vec3( 0.0005, 0.0, 0.0 ); + vec3 nor = vec3( + map(pos+eps.xyy).x - map(pos-eps.xyy).x, + map(pos+eps.yxy).x - map(pos-eps.yxy).x, + map(pos+eps.yyx).x - map(pos-eps.yyx).x ); + return normalize(nor); + */ } float calcAO( in vec3 pos, in vec3 nor ) { - float occ = 0.0; + float occ = 0.0; float sca = 1.0; for( int i=0; i<5; i++ ) { @@ -332,7 +332,7 @@ vec3 render( in vec3 ro, in vec3 rd ) vec3 col = vec3(0.7, 0.9, 1.0) +rd.y*0.8; vec2 res = castRay(ro,rd); float t = res.x; - float m = res.y; + float m = res.y; if( m>-0.5 ) { vec3 pos = ro + t*rd; @@ -340,7 +340,7 @@ vec3 render( in vec3 ro, in vec3 rd ) vec3 ref = reflect( rd, nor ); // material - col = 0.45 + 0.35*sin( vec3(0.05,0.08,0.10)*(m-1.0) ); + col = 0.45 + 0.35*sin( vec3(0.05,0.08,0.10)*(m-1.0) ); if( m<1.5 ) { @@ -350,9 +350,9 @@ vec3 render( in vec3 ro, in vec3 rd ) // lighting float occ = calcAO( pos, nor ); - vec3 lig = normalize( vec3(cos(-0.4 * runTime), sin(0.7 * runTime), -0.6) ); + vec3 lig = normalize( vec3(cos(-0.4 * runTime), sin(0.7 * runTime), -0.6) ); vec3 hal = normalize( lig-rd ); - float amb = clamp( 0.5+0.5*nor.y, 0.0, 1.0 ); + float amb = clamp( 0.5+0.5*nor.y, 0.0, 1.0 ); float dif = clamp( dot( nor, lig ), 0.0, 1.0 ); float bac = clamp( dot( nor, normalize(vec3(-lig.x,0.0,-lig.z))), 0.0, 1.0 )*clamp( 1.0-pos.y,0.0,1.0); float dom = smoothstep( -0.1, 0.1, ref.y ); @@ -361,31 +361,31 @@ vec3 render( in vec3 ro, in vec3 rd ) dif *= calcSoftshadow( pos, lig, 0.02, 2.5 ); dom *= calcSoftshadow( pos, ref, 0.02, 2.5 ); - float spe = pow( clamp( dot( nor, hal ), 0.0, 1.0 ),16.0)* + float spe = pow( clamp( dot( nor, hal ), 0.0, 1.0 ),16.0)* dif * (0.04 + 0.96*pow( clamp(1.0+dot(hal,rd),0.0,1.0), 5.0 )); - vec3 lin = vec3(0.0); + vec3 lin = vec3(0.0); lin += 1.30*dif*vec3(1.00,0.80,0.55); lin += 0.40*amb*vec3(0.40,0.60,1.00)*occ; lin += 0.50*dom*vec3(0.40,0.60,1.00)*occ; lin += 0.50*bac*vec3(0.25,0.25,0.25)*occ; lin += 0.25*fre*vec3(1.00,1.00,1.00)*occ; - col = col*lin; - col += 10.00*spe*vec3(1.00,0.90,0.70); + col = col*lin; + col += 10.00*spe*vec3(1.00,0.90,0.70); - col = mix( col, vec3(0.8,0.9,1.0), 1.0-exp( -0.0002*t*t*t ) ); + col = mix( col, vec3(0.8,0.9,1.0), 1.0-exp( -0.0002*t*t*t ) ); } - return vec3( clamp(col,0.0,1.0) ); + return vec3( clamp(col,0.0,1.0) ); } mat3 setCamera( in vec3 ro, in vec3 ta, float cr ) { vec3 cw = normalize(ta-ro); - vec3 cp = vec3(sin(cr), cos(cr),0.0); - vec3 cu = normalize( cross(cw,cp) ); - vec3 cv = normalize( cross(cu,cw) ); + vec3 cp = vec3(sin(cr), cos(cr),0.0); + vec3 cu = normalize( cross(cw,cp) ); + vec3 cv = normalize( cross(cu,cw) ); return mat3( cu, cv, cw ); } @@ -403,7 +403,7 @@ void main() vec2 p = (-resolution.xy + 2.0*gl_FragCoord.xy)/resolution.y; #endif - // RAY: Camera is provided from raylib + // RAY: Camera is provided from raylib //vec3 ro = vec3( -0.5+3.5*cos(0.1*time + 6.0*mo.x), 1.0 + 2.0*mo.y, 0.5 + 4.0*sin(0.1*time + 6.0*mo.x) ); vec3 ro = viewEye; @@ -414,10 +414,10 @@ void main() // ray direction vec3 rd = ca * normalize( vec3(p.xy,2.0) ); - // render + // render vec3 col = render( ro, rd ); - // gamma + // gamma col = pow( col, vec3(0.4545) ); tot += col; diff --git a/examples/shaders/resources/shaders/glsl330/reload.fs b/examples/shaders/resources/shaders/glsl330/reload.fs index 9891a4b5f..21ce18e02 100644 --- a/examples/shaders/resources/shaders/glsl330/reload.fs +++ b/examples/shaders/resources/shaders/glsl330/reload.fs @@ -15,26 +15,26 @@ uniform float time; // Total run time (in secods) // Draw circle vec4 DrawCircle(vec2 fragCoord, vec2 position, float radius, vec3 color) { - float d = length(position - fragCoord) - radius; - float t = clamp(d, 0.0, 1.0); - return vec4(color, 1.0 - t); + float d = length(position - fragCoord) - radius; + float t = clamp(d, 0.0, 1.0); + return vec4(color, 1.0 - t); } void main() { - vec2 fragCoord = gl_FragCoord.xy; - vec2 position = vec2(mouse.x, resolution.y - mouse.y); - float radius = 40.0; + vec2 fragCoord = gl_FragCoord.xy; + vec2 position = vec2(mouse.x, resolution.y - mouse.y); + float radius = 40.0; // Draw background layer vec4 colorA = vec4(0.2,0.2,0.8, 1.0); vec4 colorB = vec4(1.0,0.7,0.2, 1.0); - vec4 layer1 = mix(colorA, colorB, abs(sin(time*0.1))); + vec4 layer1 = mix(colorA, colorB, abs(sin(time*0.1))); - // Draw circle layer - vec3 color = vec3(0.9, 0.16, 0.21); - vec4 layer2 = DrawCircle(fragCoord, position, radius, color); - - // Blend the two layers - finalColor = mix(layer1, layer2, layer2.a); + // Draw circle layer + vec3 color = vec3(0.9, 0.16, 0.21); + vec4 layer2 = DrawCircle(fragCoord, position, radius, color); + + // Blend the two layers + finalColor = mix(layer1, layer2, layer2.a); } diff --git a/examples/shaders/resources/shaders/glsl330/sobel.fs b/examples/shaders/resources/shaders/glsl330/sobel.fs index a1430cdd0..f317ae328 100644 --- a/examples/shaders/resources/shaders/glsl330/sobel.fs +++ b/examples/shaders/resources/shaders/glsl330/sobel.fs @@ -16,26 +16,26 @@ uniform vec2 resolution = vec2(800, 450); void main() { - float x = 1.0/resolution.x; - float y = 1.0/resolution.y; + float x = 1.0/resolution.x; + float y = 1.0/resolution.y; - vec4 horizEdge = vec4(0.0); - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0; - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; + vec4 horizEdge = vec4(0.0); + horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; + horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0; + horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; + horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; + horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0; + horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; - vec4 vertEdge = vec4(0.0); - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y - y))*2.0; - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y + y))*2.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; + vec4 vertEdge = vec4(0.0); + vertEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; + vertEdge -= texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y - y))*2.0; + vertEdge -= texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; + vertEdge += texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; + vertEdge += texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y + y))*2.0; + vertEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; - vec3 edge = sqrt((horizEdge.rgb*horizEdge.rgb) + (vertEdge.rgb*vertEdge.rgb)); - - finalColor = vec4(edge, texture2D(texture0, fragTexCoord).a); + vec3 edge = sqrt((horizEdge.rgb*horizEdge.rgb) + (vertEdge.rgb*vertEdge.rgb)); + + finalColor = vec4(edge, texture2D(texture0, fragTexCoord).a); } \ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl330/spotlight.fs b/examples/shaders/resources/shaders/glsl330/spotlight.fs index 97a4377b4..c573be8f3 100644 --- a/examples/shaders/resources/shaders/glsl330/spotlight.fs +++ b/examples/shaders/resources/shaders/glsl330/spotlight.fs @@ -12,9 +12,9 @@ out vec4 finalColor; #define MAX_SPOTS 3 struct Spot { - vec2 pos; // window coords of spot - float inner; // inner fully transparent centre radius - float radius; // alpha fades out to this radius + vec2 pos; // window coords of spot + float inner; // inner fully transparent centre radius + float radius; // alpha fades out to this radius }; uniform Spot spots[MAX_SPOTS]; // Spotlight positions array @@ -22,44 +22,44 @@ uniform float screenWidth; // Width of the screen void main() { - float alpha = 1.0; + float alpha = 1.0; - // Get the position of the current fragment (screen coordinates!) - vec2 pos = vec2(gl_FragCoord.x, gl_FragCoord.y); - - // Find out which spotlight is nearest - float d = 65000; // some high value - int fi = -1; // found index + // Get the position of the current fragment (screen coordinates!) + vec2 pos = vec2(gl_FragCoord.x, gl_FragCoord.y); + + // Find out which spotlight is nearest + float d = 65000; // some high value + int fi = -1; // found index for (int i = 0; i < MAX_SPOTS; i++) { - for (int j = 0; j < MAX_SPOTS; j++) - { - float dj = distance(pos, spots[j].pos) - spots[j].radius + spots[i].radius; + for (int j = 0; j < MAX_SPOTS; j++) + { + float dj = distance(pos, spots[j].pos) - spots[j].radius + spots[i].radius; - if (d > dj) - { - d = dj; - fi = i; - } - } + if (d > dj) + { + d = dj; + fi = i; + } + } } // d now equals distance to nearest spot... // allowing for the different radii of all spotlights if (fi != -1) { - if (d > spots[fi].radius) alpha = 1.0; - else - { - if (d < spots[fi].inner) alpha = 0.0; - else alpha = (d - spots[fi].inner) / (spots[fi].radius - spots[fi].inner); - } - } - - // Right hand side of screen is dimly lit, + if (d > spots[fi].radius) alpha = 1.0; + else + { + if (d < spots[fi].inner) alpha = 0.0; + else alpha = (d - spots[fi].inner) / (spots[fi].radius - spots[fi].inner); + } + } + + // Right hand side of screen is dimly lit, // could make the threshold value user definable - if ((pos.x > screenWidth/2.0) && (alpha > 0.9)) alpha = 0.9; + if ((pos.x > screenWidth/2.0) && (alpha > 0.9)) alpha = 0.9; finalColor = vec4(0, 0, 0, alpha); } diff --git a/examples/shaders/resources/shaders/glsl330/wave.fs b/examples/shaders/resources/shaders/glsl330/wave.fs index f139f3957..43efee234 100644 --- a/examples/shaders/resources/shaders/glsl330/wave.fs +++ b/examples/shaders/resources/shaders/glsl330/wave.fs @@ -23,15 +23,15 @@ uniform float speedX; uniform float speedY; void main() { - float pixelWidth = 1.0 / size.x; - float pixelHeight = 1.0 / size.y; - float aspect = pixelHeight / pixelWidth; - float boxLeft = 0.0; - float boxTop = 0.0; + float pixelWidth = 1.0 / size.x; + float pixelHeight = 1.0 / size.y; + float aspect = pixelHeight / pixelWidth; + float boxLeft = 0.0; + float boxTop = 0.0; - vec2 p = fragTexCoord; - p.x += cos((fragTexCoord.y - boxTop) * freqX / ( pixelWidth * 750.0) + (secondes * speedX)) * ampX * pixelWidth; - p.y += sin((fragTexCoord.x - boxLeft) * freqY * aspect / ( pixelHeight * 750.0) + (secondes * speedY)) * ampY * pixelHeight; + vec2 p = fragTexCoord; + p.x += cos((fragTexCoord.y - boxTop) * freqX / ( pixelWidth * 750.0) + (secondes * speedX)) * ampX * pixelWidth; + p.y += sin((fragTexCoord.x - boxLeft) * freqY * aspect / ( pixelHeight * 750.0) + (secondes * speedY)) * ampY * pixelHeight; - finalColor = texture(texture0, p)*colDiffuse*fragColor; + finalColor = texture(texture0, p)*colDiffuse*fragColor; } diff --git a/examples/shaders/rlights.h b/examples/shaders/rlights.h index 66185bb43..a1b298881 100644 --- a/examples/shaders/rlights.h +++ b/examples/shaders/rlights.h @@ -163,21 +163,21 @@ Light CreateLight(int type, Vector3 position, Vector3 target, Color color, Shade void UpdateLightValues(Shader shader, Light light) { // Send to shader light enabled state and type - SetShaderValue(shader, light.enabledLoc, &light.enabled, UNIFORM_INT); - SetShaderValue(shader, light.typeLoc, &light.type, UNIFORM_INT); + SetShaderValue(shader, light.enabledLoc, &light.enabled, SHADER_UNIFORM_INT); + SetShaderValue(shader, light.typeLoc, &light.type, SHADER_UNIFORM_INT); // Send to shader light position values float position[3] = { light.position.x, light.position.y, light.position.z }; - SetShaderValue(shader, light.posLoc, position, UNIFORM_VEC3); + SetShaderValue(shader, light.posLoc, position, SHADER_UNIFORM_VEC3); // Send to shader light target position values float target[3] = { light.target.x, light.target.y, light.target.z }; - SetShaderValue(shader, light.targetLoc, target, UNIFORM_VEC3); + SetShaderValue(shader, light.targetLoc, target, SHADER_UNIFORM_VEC3); // Send to shader light color values float color[4] = { (float)light.color.r/(float)255, (float)light.color.g/(float)255, (float)light.color.b/(float)255, (float)light.color.a/(float)255 }; - SetShaderValue(shader, light.colorLoc, color, UNIFORM_VEC4); + SetShaderValue(shader, light.colorLoc, color, SHADER_UNIFORM_VEC4); } #endif // RLIGHTS_IMPLEMENTATION \ No newline at end of file diff --git a/examples/shaders/shaders_basic_lighting.c b/examples/shaders/shaders_basic_lighting.c index 95df69c22..6ef09e4aa 100644 --- a/examples/shaders/shaders_basic_lighting.c +++ b/examples/shaders/shaders_basic_lighting.c @@ -54,7 +54,7 @@ int main(void) camera.target = (Vector3){ 0.0f, 0.5f, 0.0f }; // Camera looking at point camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) camera.fovy = 45.0f; // Camera field-of-view Y - camera.type = CAMERA_PERSPECTIVE; // Camera mode type + camera.projection = CAMERA_PERSPECTIVE; // Camera mode type // Load models Model modelA = LoadModelFromMesh(GenMeshTorus(0.4f, 1.0f, 16, 32)); @@ -65,21 +65,21 @@ int main(void) Texture texture = LoadTexture("resources/texel_checker.png"); // Assign texture to default model material - modelA.materials[0].maps[MAP_DIFFUSE].texture = texture; - modelB.materials[0].maps[MAP_DIFFUSE].texture = texture; - modelC.materials[0].maps[MAP_DIFFUSE].texture = texture; + modelA.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; + modelB.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; + modelC.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; - Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/base_lighting.vs", GLSL_VERSION), + Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/base_lighting.vs", GLSL_VERSION), TextFormat("resources/shaders/glsl%i/lighting.fs", GLSL_VERSION)); - + // Get some shader loactions - shader.locs[LOC_MATRIX_MODEL] = GetShaderLocation(shader, "matModel"); - shader.locs[LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos"); + shader.locs[SHADER_LOC_MATRIX_MODEL] = GetShaderLocation(shader, "matModel"); + shader.locs[SHADER_LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos"); // ambient light level int ambientLoc = GetShaderLocation(shader, "ambient"); - SetShaderValue(shader, ambientLoc, (float[4]){ 0.2f, 0.2f, 0.2f, 1.0f }, UNIFORM_VEC4); - + SetShaderValue(shader, ambientLoc, (float[4]){ 0.2f, 0.2f, 0.2f, 1.0f }, SHADER_UNIFORM_VEC4); + float angle = 6.282f; // All models use the same shader @@ -121,7 +121,7 @@ int main(void) lights[2].position.z = sinf(angle*0.2f)*4.0f; lights[3].position.y = cosf(-angle*0.35f)*4.0f; lights[3].position.z = sinf(-angle*0.35f)*4.0f; - + UpdateLightValues(shader, lights[0]); UpdateLightValues(shader, lights[1]); UpdateLightValues(shader, lights[2]); @@ -133,7 +133,7 @@ int main(void) // Update the light shader with the camera view position float cameraPos[3] = { camera.position.x, camera.position.y, camera.position.z }; - SetShaderValue(shader, shader.locs[LOC_VECTOR_VIEW], cameraPos, UNIFORM_VEC3); + SetShaderValue(shader, shader.locs[SHADER_LOC_VECTOR_VIEW], cameraPos, SHADER_UNIFORM_VEC3); //---------------------------------------------------------------------------------- // Draw @@ -146,8 +146,8 @@ int main(void) // Draw the three models DrawModel(modelA, Vector3Zero(), 1.0f, WHITE); - DrawModel(modelB, (Vector3){-1.6,0,0}, 1.0f, WHITE); - DrawModel(modelC, (Vector3){ 1.6,0,0}, 1.0f, WHITE); + DrawModel(modelB, (Vector3){-1.6f,0.0f,0.0f}, 1.0f, WHITE); + DrawModel(modelC, (Vector3){ 1.6f,0.0f,0.0f}, 1.0f, WHITE); // Draw markers to show where the lights are if (lights[0].enabled) { DrawSphereEx(lights[0].position, 0.2f, 8, 8, WHITE); } @@ -160,7 +160,7 @@ int main(void) EndMode3D(); DrawFPS(10, 10); - + DrawText("Use keys RGBW to toggle lights", 10, 30, 20, DARKGRAY); EndDrawing(); @@ -172,7 +172,7 @@ int main(void) UnloadModel(modelA); // Unload the modelA UnloadModel(modelB); // Unload the modelB UnloadModel(modelC); // Unload the modelC - + UnloadTexture(texture); // Unload the texture UnloadShader(shader); // Unload shader diff --git a/examples/shaders/shaders_custom_uniform.c b/examples/shaders/shaders_custom_uniform.c index 2e46bc13f..6efda727b 100644 --- a/examples/shaders/shaders_custom_uniform.c +++ b/examples/shaders/shaders_custom_uniform.c @@ -41,11 +41,11 @@ int main(void) camera.target = (Vector3){ 0.0f, 1.5f, 0.0f }; camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; camera.fovy = 45.0f; - camera.type = CAMERA_PERSPECTIVE; + camera.projection = CAMERA_PERSPECTIVE; Model model = LoadModel("resources/models/barracks.obj"); // Load OBJ model Texture2D texture = LoadTexture("resources/models/barracks_diffuse.png"); // Load model texture (diffuse map) - model.materials[0].maps[MAP_DIFFUSE].texture = texture; // Set model diffuse texture + model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set model diffuse texture Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position @@ -79,7 +79,7 @@ int main(void) swirlCenter[1] = screenHeight - mousePosition.y; // Send new value to the shader to be used on drawing - SetShaderValue(shader, swirlCenterLoc, swirlCenter, UNIFORM_VEC2); + SetShaderValue(shader, swirlCenterLoc, swirlCenter, SHADER_UNIFORM_VEC2); UpdateCamera(&camera); // Update camera //---------------------------------------------------------------------------------- @@ -109,7 +109,7 @@ int main(void) BeginShaderMode(shader); // NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom) - DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, WHITE); + DrawTextureRec(target.texture, (Rectangle){ 0, 0, (float)target.texture.width, (float)-target.texture.height }, (Vector2){ 0, 0 }, WHITE); EndShaderMode(); diff --git a/examples/shaders/shaders_eratosthenes.c b/examples/shaders/shaders_eratosthenes.c index 3bd83d0fe..d5163a7f6 100644 --- a/examples/shaders/shaders_eratosthenes.c +++ b/examples/shaders/shaders_eratosthenes.c @@ -41,7 +41,7 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [shaders] example - Sieve of Eratosthenes"); RenderTexture2D target = LoadRenderTexture(screenWidth, screenHeight); - + // Load Eratosthenes shader // NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/eratosthenes.fs", GLSL_VERSION)); @@ -75,7 +75,7 @@ int main(void) BeginShaderMode(shader); // NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom) - DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0.0f, 0.0f }, WHITE); + DrawTextureRec(target.texture, (Rectangle){ 0, 0, (float)target.texture.width, (float)-target.texture.height }, (Vector2){ 0.0f, 0.0f }, WHITE); EndShaderMode(); EndDrawing(); diff --git a/examples/shaders/shaders_fog.c b/examples/shaders/shaders_fog.c index 78f8c9cab..fef311c41 100644 --- a/examples/shaders/shaders_fog.c +++ b/examples/shaders/shaders_fog.c @@ -49,7 +49,7 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [shaders] example - fog"); // Define the camera to look into our 3d world - Camera camera = { + Camera camera = { (Vector3){ 2.0f, 2.0f, 6.0f }, // position (Vector3){ 0.0f, 0.5f, 0.0f }, // target (Vector3){ 0.0f, 1.0f, 0.0f }, // up @@ -62,23 +62,23 @@ int main(void) Texture texture = LoadTexture("resources/texel_checker.png"); // Assign texture to default model material - modelA.materials[0].maps[MAP_DIFFUSE].texture = texture; - modelB.materials[0].maps[MAP_DIFFUSE].texture = texture; - modelC.materials[0].maps[MAP_DIFFUSE].texture = texture; + modelA.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; + modelB.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; + modelC.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Load shader and set up some uniforms - Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/base_lighting.vs", GLSL_VERSION), + Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/base_lighting.vs", GLSL_VERSION), TextFormat("resources/shaders/glsl%i/fog.fs", GLSL_VERSION)); - shader.locs[LOC_MATRIX_MODEL] = GetShaderLocation(shader, "matModel"); - shader.locs[LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos"); + shader.locs[SHADER_LOC_MATRIX_MODEL] = GetShaderLocation(shader, "matModel"); + shader.locs[SHADER_LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos"); // Ambient light level int ambientLoc = GetShaderLocation(shader, "ambient"); - SetShaderValue(shader, ambientLoc, (float[4]){ 0.2f, 0.2f, 0.2f, 1.0f }, UNIFORM_VEC4); - + SetShaderValue(shader, ambientLoc, (float[4]){ 0.2f, 0.2f, 0.2f, 1.0f }, SHADER_UNIFORM_VEC4); + float fogDensity = 0.15f; int fogDensityLoc = GetShaderLocation(shader, "fogDensity"); - SetShaderValue(shader, fogDensityLoc, &fogDensity, UNIFORM_FLOAT); + SetShaderValue(shader, fogDensityLoc, &fogDensity, SHADER_UNIFORM_FLOAT); // NOTE: All models share the same shader modelA.materials[0].shader = shader; @@ -100,26 +100,26 @@ int main(void) //---------------------------------------------------------------------------------- UpdateCamera(&camera); // Update camera - if (IsKeyDown(KEY_UP)) + if (IsKeyDown(KEY_UP)) { - fogDensity += 0.001; - if (fogDensity > 1.0) fogDensity = 1.0; + fogDensity += 0.001f; + if (fogDensity > 1.0f) fogDensity = 1.0f; } - + if (IsKeyDown(KEY_DOWN)) { - fogDensity -= 0.001; - if (fogDensity < 0.0) fogDensity = 0.0; + fogDensity -= 0.001f; + if (fogDensity < 0.0f) fogDensity = 0.0f; } - - SetShaderValue(shader, fogDensityLoc, &fogDensity, UNIFORM_FLOAT); + + SetShaderValue(shader, fogDensityLoc, &fogDensity, SHADER_UNIFORM_FLOAT); // Rotate the torus - modelA.transform = MatrixMultiply(modelA.transform, MatrixRotateX(-0.025)); - modelA.transform = MatrixMultiply(modelA.transform, MatrixRotateZ(0.012)); + modelA.transform = MatrixMultiply(modelA.transform, MatrixRotateX(-0.025f)); + modelA.transform = MatrixMultiply(modelA.transform, MatrixRotateZ(0.012f)); // Update the light shader with the camera view position - SetShaderValue(shader, shader.locs[LOC_VECTOR_VIEW], &camera.position.x, UNIFORM_VEC3); + SetShaderValue(shader, shader.locs[SHADER_LOC_VECTOR_VIEW], &camera.position.x, SHADER_UNIFORM_VEC3); //---------------------------------------------------------------------------------- // Draw @@ -132,10 +132,10 @@ int main(void) // Draw the three models DrawModel(modelA, Vector3Zero(), 1.0f, WHITE); - DrawModel(modelB, (Vector3){ -2.6, 0, 0 }, 1.0f, WHITE); - DrawModel(modelC, (Vector3){ 2.6, 0, 0 }, 1.0f, WHITE); + DrawModel(modelB, (Vector3){ -2.6f, 0, 0 }, 1.0f, WHITE); + DrawModel(modelC, (Vector3){ 2.6f, 0, 0 }, 1.0f, WHITE); - for (int i = -20; i < 20; i += 2) DrawModel(modelA,(Vector3){ i, 0, 2 }, 1.0f, WHITE); + for (int i = -20; i < 20; i += 2) DrawModel(modelA,(Vector3){ (float)i, 0, 2 }, 1.0f, WHITE); EndMode3D(); diff --git a/examples/shaders/shaders_hot_reloading.c b/examples/shaders/shaders_hot_reloading.c index fb645c860..05da7b7ab 100644 --- a/examples/shaders/shaders_hot_reloading.c +++ b/examples/shaders/shaders_hot_reloading.c @@ -13,6 +13,7 @@ ********************************************************************************************/ #include "raylib.h" +#include "rlgl.h" #include // Required for: localtime(), asctime() @@ -44,7 +45,7 @@ int main(void) int timeLoc = GetShaderLocation(shader, "time"); float resolution[2] = { (float)screenWidth, (float)screenHeight }; - SetShaderValue(shader, resolutionLoc, resolution, UNIFORM_VEC2); + SetShaderValue(shader, resolutionLoc, resolution, SHADER_UNIFORM_VEC2); float totalTime = 0.0f; bool shaderAutoReloading = false; @@ -62,38 +63,38 @@ int main(void) float mousePos[2] = { mouse.x, mouse.y }; // Set shader required uniform values - SetShaderValue(shader, timeLoc, &totalTime, UNIFORM_FLOAT); - SetShaderValue(shader, mouseLoc, mousePos, UNIFORM_VEC2); - + SetShaderValue(shader, timeLoc, &totalTime, SHADER_UNIFORM_FLOAT); + SetShaderValue(shader, mouseLoc, mousePos, SHADER_UNIFORM_VEC2); + // Hot shader reloading - if (shaderAutoReloading || (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) + if (shaderAutoReloading || (IsMouseButtonPressed(MOUSE_BUTTON_LEFT))) { long currentFragShaderModTime = GetFileModTime(TextFormat(fragShaderFileName, GLSL_VERSION)); - + // Check if shader file has been modified if (currentFragShaderModTime != fragShaderFileModTime) { // Try reloading updated shader Shader updatedShader = LoadShader(0, TextFormat(fragShaderFileName, GLSL_VERSION)); - - if (updatedShader.id != GetShaderDefault().id) // It was correctly loaded + + if (updatedShader.id != rlGetShaderDefault().id) // It was correctly loaded { UnloadShader(shader); shader = updatedShader; - + // Get shader locations for required uniforms resolutionLoc = GetShaderLocation(shader, "resolution"); mouseLoc = GetShaderLocation(shader, "mouse"); timeLoc = GetShaderLocation(shader, "time"); - + // Reset required uniforms - SetShaderValue(shader, resolutionLoc, resolution, UNIFORM_VEC2); + SetShaderValue(shader, resolutionLoc, resolution, SHADER_UNIFORM_VEC2); } - + fragShaderFileModTime = currentFragShaderModTime; } } - + if (IsKeyPressed(KEY_A)) shaderAutoReloading = !shaderAutoReloading; //---------------------------------------------------------------------------------- @@ -108,10 +109,10 @@ int main(void) DrawRectangle(0, 0, screenWidth, screenHeight, WHITE); EndShaderMode(); - DrawText(TextFormat("PRESS [A] to TOGGLE SHADER AUTOLOADING: %s", + DrawText(TextFormat("PRESS [A] to TOGGLE SHADER AUTOLOADING: %s", shaderAutoReloading? "AUTO" : "MANUAL"), 10, 10, 10, shaderAutoReloading? RED : BLACK); if (!shaderAutoReloading) DrawText("MOUSE CLICK to SHADER RE-LOADING", 10, 30, 10, BLACK); - + DrawText(TextFormat("Shader last modification: %s", asctime(localtime(&fragShaderFileModTime))), 10, 430, 10, BLACK); EndDrawing(); diff --git a/examples/shaders/shaders_julia_set.c b/examples/shaders/shaders_julia_set.c index 91067a104..4a12ba02e 100644 --- a/examples/shaders/shaders_julia_set.c +++ b/examples/shaders/shaders_julia_set.c @@ -25,14 +25,14 @@ #endif // A few good julia sets -const float POINTS_OF_INTEREST[6][2] = +const float pointsOfInterest[6][2] = { - { -0.348827, 0.607167 }, - { -0.786268, 0.169728 }, - { -0.8, 0.156 }, - { 0.285, 0.0 }, - { -0.835, -0.2321 }, - { -0.70176, -0.3842 }, + { -0.348827f, 0.607167f }, + { -0.786268f, 0.169728f }, + { -0.8f, 0.156f }, + { 0.285f, 0.0f }, + { -0.835f, -0.2321f }, + { -0.70176f, -0.3842f }, }; int main(void) @@ -42,17 +42,21 @@ int main(void) const int screenWidth = 800; const int screenHeight = 450; + //SetConfigFlags(FLAG_WINDOW_HIGHDPI); InitWindow(screenWidth, screenHeight, "raylib [shaders] example - julia sets"); // Load julia set shader // NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/julia_set.fs", GLSL_VERSION)); + // Create a RenderTexture2D to be used for render to texture + RenderTexture2D target = LoadRenderTexture(GetScreenWidth(), GetScreenHeight()); + // c constant to use in z^2 + c - float c[2] = { POINTS_OF_INTEREST[0][0], POINTS_OF_INTEREST[0][1] }; + float c[2] = { pointsOfInterest[0][0], pointsOfInterest[0][1] }; // Offset and zoom to draw the julia set at. (centered on screen and default size) - float offset[2] = { -(float)screenWidth/2, -(float)screenHeight/2 }; + float offset[2] = { -(float)GetScreenWidth()/2, -(float)GetScreenHeight()/2 }; float zoom = 1.0f; Vector2 offsetSpeed = { 0.0f, 0.0f }; @@ -64,15 +68,12 @@ int main(void) int offsetLoc = GetShaderLocation(shader, "offset"); // Tell the shader what the screen dimensions, zoom, offset and c are - float screenDims[2] = { (float)screenWidth, (float)screenHeight }; - SetShaderValue(shader, GetShaderLocation(shader, "screenDims"), screenDims, UNIFORM_VEC2); + float screenDims[2] = { (float)GetScreenWidth(), (float)GetScreenHeight() }; + SetShaderValue(shader, GetShaderLocation(shader, "screenDims"), screenDims, SHADER_UNIFORM_VEC2); - SetShaderValue(shader, cLoc, c, UNIFORM_VEC2); - SetShaderValue(shader, zoomLoc, &zoom, UNIFORM_FLOAT); - SetShaderValue(shader, offsetLoc, offset, UNIFORM_VEC2); - - // Create a RenderTexture2D to be used for render to texture - RenderTexture2D target = LoadRenderTexture(screenWidth, screenHeight); + SetShaderValue(shader, cLoc, c, SHADER_UNIFORM_VEC2); + SetShaderValue(shader, zoomLoc, &zoom, SHADER_UNIFORM_FLOAT); + SetShaderValue(shader, offsetLoc, offset, SHADER_UNIFORM_VEC2); int incrementSpeed = 0; // Multiplier of speed to change c value bool showControls = true; // Show controls @@ -94,14 +95,14 @@ int main(void) IsKeyPressed(KEY_FIVE) || IsKeyPressed(KEY_SIX)) { - if (IsKeyPressed(KEY_ONE)) c[0] = POINTS_OF_INTEREST[0][0], c[1] = POINTS_OF_INTEREST[0][1]; - else if (IsKeyPressed(KEY_TWO)) c[0] = POINTS_OF_INTEREST[1][0], c[1] = POINTS_OF_INTEREST[1][1]; - else if (IsKeyPressed(KEY_THREE)) c[0] = POINTS_OF_INTEREST[2][0], c[1] = POINTS_OF_INTEREST[2][1]; - else if (IsKeyPressed(KEY_FOUR)) c[0] = POINTS_OF_INTEREST[3][0], c[1] = POINTS_OF_INTEREST[3][1]; - else if (IsKeyPressed(KEY_FIVE)) c[0] = POINTS_OF_INTEREST[4][0], c[1] = POINTS_OF_INTEREST[4][1]; - else if (IsKeyPressed(KEY_SIX)) c[0] = POINTS_OF_INTEREST[5][0], c[1] = POINTS_OF_INTEREST[5][1]; + if (IsKeyPressed(KEY_ONE)) c[0] = pointsOfInterest[0][0], c[1] = pointsOfInterest[0][1]; + else if (IsKeyPressed(KEY_TWO)) c[0] = pointsOfInterest[1][0], c[1] = pointsOfInterest[1][1]; + else if (IsKeyPressed(KEY_THREE)) c[0] = pointsOfInterest[2][0], c[1] = pointsOfInterest[2][1]; + else if (IsKeyPressed(KEY_FOUR)) c[0] = pointsOfInterest[3][0], c[1] = pointsOfInterest[3][1]; + else if (IsKeyPressed(KEY_FIVE)) c[0] = pointsOfInterest[4][0], c[1] = pointsOfInterest[4][1]; + else if (IsKeyPressed(KEY_SIX)) c[0] = pointsOfInterest[5][0], c[1] = pointsOfInterest[5][1]; - SetShaderValue(shader, cLoc, c, UNIFORM_VEC2); + SetShaderValue(shader, cLoc, c, SHADER_UNIFORM_VEC2); } if (IsKeyPressed(KEY_SPACE)) pause = !pause; // Pause animation (c change) @@ -114,10 +115,10 @@ int main(void) // TODO: The idea is to zoom and move around with mouse // Probably offset movement should be proportional to zoom level - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON) || IsMouseButtonDown(MOUSE_RIGHT_BUTTON)) + if (IsMouseButtonDown(MOUSE_BUTTON_LEFT) || IsMouseButtonDown(MOUSE_BUTTON_RIGHT)) { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) zoom += zoom*0.003f; - if (IsMouseButtonDown(MOUSE_RIGHT_BUTTON)) zoom -= zoom*0.003f; + if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) zoom += zoom*0.003f; + if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT)) zoom -= zoom*0.003f; Vector2 mousePos = GetMousePosition(); @@ -130,15 +131,15 @@ int main(void) } else offsetSpeed = (Vector2){ 0.0f, 0.0f }; - SetShaderValue(shader, zoomLoc, &zoom, UNIFORM_FLOAT); - SetShaderValue(shader, offsetLoc, offset, UNIFORM_VEC2); + SetShaderValue(shader, zoomLoc, &zoom, SHADER_UNIFORM_FLOAT); + SetShaderValue(shader, offsetLoc, offset, SHADER_UNIFORM_VEC2); // Increment c value with time float amount = GetFrameTime()*incrementSpeed*0.0005f; c[0] += amount; c[1] += amount; - SetShaderValue(shader, cLoc, c, UNIFORM_VEC2); + SetShaderValue(shader, cLoc, c, SHADER_UNIFORM_VEC2); } //---------------------------------------------------------------------------------- @@ -162,7 +163,9 @@ int main(void) // Draw the saved texture and rendered julia set with shader // NOTE: We do not invert texture on Y, already considered inside shader BeginShaderMode(shader); - DrawTexture(target.texture, 0, 0, WHITE); + // WARNING: If FLAG_WINDOW_HIGHDPI is enabled, HighDPI monitor scaling should be considered + // when rendering the RenderTexture2D to fit in the HighDPI scaled Window + DrawTextureEx(target.texture, (Vector2){ 0.0f, 0.0f }, 0.0f, 1.0f, WHITE); EndShaderMode(); if (showControls) diff --git a/examples/shaders/shaders_mesh_instancing.c b/examples/shaders/shaders_mesh_instancing.c new file mode 100644 index 000000000..11662f738 --- /dev/null +++ b/examples/shaders/shaders_mesh_instancing.c @@ -0,0 +1,224 @@ +/******************************************************************************************* +* +* raylib [shaders] example - mesh instancing +* +* This example has been created using raylib 3.7 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) +* +* Example contributed by @seanpringle and reviewed by Max (@moliad) and Ramon Santamaria (@raysan5) +* +* Copyright (c) 2020-2021 @seanpringle, Max (@moliad) and Ramon Santamaria (@raysan5) +* +********************************************************************************************/ + + +#include "raylib.h" +#include "raymath.h" + +#define RLIGHTS_IMPLEMENTATION +#include "rlights.h" + +#include +#include + +#if defined(PLATFORM_DESKTOP) + #define GLSL_VERSION 330 +#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB + #define GLSL_VERSION 100 +#endif + +#define MAX_INSTANCES 10000 + +//------------------------------------------------------------------------------------ +// Program main entry point +//------------------------------------------------------------------------------------ +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + const int fps = 60; + + SetConfigFlags(FLAG_MSAA_4X_HINT); // Enable Multi Sampling Anti Aliasing 4x (if available) + InitWindow(screenWidth, screenHeight, "raylib [shaders] example - mesh instancing"); + + int speed = 30; // Speed of jump animation + int groups = 2; // Count of separate groups jumping around + float amp = 10; // Maximum amplitude of jump + float variance = 0.8f; // Global variance in jump height + float loop = 0.0f; // Individual cube's computed loop timer + float x = 0.0f, y = 0.0f, z = 0.0f; // Used for various 3D coordinate & vector ops + + // Define the camera to look into our 3d world + Camera camera = { 0 }; + camera.position = (Vector3){ -125.0f, 125.0f, -125.0f }; + camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; + camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; + camera.fovy = 45.0f; + camera.projection = CAMERA_PERSPECTIVE; + + Mesh cube = GenMeshCube(1.0f, 1.0f, 1.0f); + + Matrix *rotations = RL_MALLOC(MAX_INSTANCES*sizeof(Matrix)); // Rotation state of instances + Matrix *rotationsInc = RL_MALLOC(MAX_INSTANCES*sizeof(Matrix)); // Per-frame rotation animation of instances + Matrix *translations = RL_MALLOC(MAX_INSTANCES*sizeof(Matrix)); // Locations of instances + + // Scatter random cubes around + for (int i = 0; i < MAX_INSTANCES; i++) + { + x = GetRandomValue(-50, 50); + y = GetRandomValue(-50, 50); + z = GetRandomValue(-50, 50); + translations[i] = MatrixTranslate(x, y, z); + + x = GetRandomValue(0, 360); + y = GetRandomValue(0, 360); + z = GetRandomValue(0, 360); + Vector3 axis = Vector3Normalize((Vector3){ x, y, z }); + float angle = (float)GetRandomValue(0, 10)*DEG2RAD; + + rotationsInc[i] = MatrixRotate(axis, angle); + rotations[i] = MatrixIdentity(); + } + + Matrix *transforms = RL_MALLOC(MAX_INSTANCES*sizeof(Matrix)); // Pre-multiplied transformations passed to rlgl + + Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/base_lighting_instanced.vs", GLSL_VERSION), + TextFormat("resources/shaders/glsl%i/lighting.fs", GLSL_VERSION)); + + // Get some shader loactions + shader.locs[SHADER_LOC_MATRIX_MVP] = GetShaderLocation(shader, "mvp"); + shader.locs[SHADER_LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos"); + shader.locs[SHADER_LOC_MATRIX_MODEL] = GetShaderLocationAttrib(shader, "instanceTransform"); + + // Ambient light level + int ambientLoc = GetShaderLocation(shader, "ambient"); + SetShaderValue(shader, ambientLoc, (float[4]){ 0.2f, 0.2f, 0.2f, 1.0f }, SHADER_UNIFORM_VEC4); + + CreateLight(LIGHT_DIRECTIONAL, (Vector3){ 50.0f, 50.0f, 0.0f }, Vector3Zero(), WHITE, shader); + + // NOTE: We are assigning the intancing shader to material.shader + // to be used on mesh drawing with DrawMeshInstanced() + Material material = LoadMaterialDefault(); + material.shader = shader; + material.maps[MATERIAL_MAP_DIFFUSE].color = RED; + + SetCameraMode(camera, CAMERA_ORBITAL); // Set an orbital camera mode + + int textPositionY = 300; + int framesCounter = 0; // Simple frames counter to manage animation + + SetTargetFPS(fps); // Set our game to run at 60 frames-per-second + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key + { + + // Update + //---------------------------------------------------------------------------------- + textPositionY = 300; + framesCounter++; + + if (IsKeyDown(KEY_UP)) amp += 0.5f; + if (IsKeyDown(KEY_DOWN)) amp = (amp <= 1)? 1.0f : (amp - 1.0f); + if (IsKeyDown(KEY_LEFT)) variance = (variance <= 0.0f)? 0.0f : (variance - 0.01f); + if (IsKeyDown(KEY_RIGHT)) variance = (variance >= 1.0f)? 1.0f : (variance + 0.01f); + if (IsKeyDown(KEY_ONE)) groups = 1; + if (IsKeyDown(KEY_TWO)) groups = 2; + if (IsKeyDown(KEY_THREE)) groups = 3; + if (IsKeyDown(KEY_FOUR)) groups = 4; + if (IsKeyDown(KEY_FIVE)) groups = 5; + if (IsKeyDown(KEY_SIX)) groups = 6; + if (IsKeyDown(KEY_SEVEN)) groups = 7; + if (IsKeyDown(KEY_EIGHT)) groups = 8; + if (IsKeyDown(KEY_NINE)) groups = 9; + if (IsKeyDown(KEY_W)) { groups = 7; amp = 25; speed = 18; variance = 0.70f; } + + if (IsKeyDown(KEY_EQUAL)) speed = (speed <= (fps*0.25f))? (fps*0.25f) : (speed*0.95f); + if (IsKeyDown(KEY_KP_ADD)) speed = (speed <= (fps*0.25f))? (fps*0.25f) : (speed*0.95f); + + if (IsKeyDown(KEY_MINUS)) speed = fmaxf(speed*1.02f, speed + 1); + if (IsKeyDown(KEY_KP_SUBTRACT)) speed = fmaxf(speed*1.02f, speed + 1); + + // Update the light shader with the camera view position + float cameraPos[3] = { camera.position.x, camera.position.y, camera.position.z }; + SetShaderValue(shader, shader.locs[SHADER_LOC_VECTOR_VIEW], cameraPos, SHADER_UNIFORM_VEC3); + + // Apply per-instance transformations + for (int i = 0; i < MAX_INSTANCES; i++) + { + rotations[i] = MatrixMultiply(rotations[i], rotationsInc[i]); + transforms[i] = MatrixMultiply(rotations[i], translations[i]); + + // Get the animation cycle's framesCounter for this instance + loop = (float)((framesCounter + (int)(((float)(i%groups)/groups)*speed))%speed)/speed; + + // Calculate the y according to loop cycle + y = (sinf(loop*PI*2))*amp*((1 - variance) + (variance*(float)(i%(groups*10))/(groups*10))); + + // Clamp to floor + y = (y < 0)? 0.0f : y; + + transforms[i] = MatrixMultiply(transforms[i], MatrixTranslate(0.0f, y, 0.0f)); + } + + UpdateCamera(&camera); + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + + ClearBackground(RAYWHITE); + + BeginMode3D(camera); + //DrawMesh(cube, material, MatrixIdentity()); + DrawMeshInstanced(cube, material, transforms, MAX_INSTANCES); + EndMode3D(); + + DrawText("A CUBE OF DANCING CUBES!", 490, 10, 20, MAROON); + DrawText("PRESS KEYS:", 10, textPositionY, 20, BLACK); + + DrawText("1 - 9", 10, textPositionY += 25, 10, BLACK); + DrawText(": Number of groups", 50, textPositionY , 10, BLACK); + DrawText(TextFormat(": %d", groups), 160, textPositionY , 10, BLACK); + + DrawText("UP", 10, textPositionY += 15, 10, BLACK); + DrawText(": increase amplitude", 50, textPositionY, 10, BLACK); + DrawText(TextFormat(": %.2f", amp), 160, textPositionY , 10, BLACK); + + DrawText("DOWN", 10, textPositionY += 15, 10, BLACK); + DrawText(": decrease amplitude", 50, textPositionY, 10, BLACK); + + DrawText("LEFT", 10, textPositionY += 15, 10, BLACK); + DrawText(": decrease variance", 50, textPositionY, 10, BLACK); + DrawText(TextFormat(": %.2f", variance), 160, textPositionY , 10, BLACK); + + DrawText("RIGHT", 10, textPositionY += 15, 10, BLACK); + DrawText(": increase variance", 50, textPositionY, 10, BLACK); + + DrawText("+/=", 10, textPositionY += 15, 10, BLACK); + DrawText(": increase speed", 50, textPositionY, 10, BLACK); + DrawText(TextFormat(": %d = %f loops/sec", speed, ((float)fps / speed)), 160, textPositionY , 10, BLACK); + + DrawText("-", 10, textPositionY += 15, 10, BLACK); + DrawText(": decrease speed", 50, textPositionY, 10, BLACK); + + DrawText("W", 10, textPositionY += 15, 10, BLACK); + DrawText(": Wild setup!", 50, textPositionY, 10, BLACK); + + DrawFPS(10, 10); + + EndDrawing(); + //---------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} diff --git a/examples/shaders/shaders_rlgl_mesh_instanced.png b/examples/shaders/shaders_mesh_instancing.png similarity index 100% rename from examples/shaders/shaders_rlgl_mesh_instanced.png rename to examples/shaders/shaders_mesh_instancing.png diff --git a/examples/shaders/shaders_model_shader.c b/examples/shaders/shaders_model_shader.c index 4a2d6912f..5c53b43e6 100644 --- a/examples/shaders/shaders_model_shader.c +++ b/examples/shaders/shaders_model_shader.c @@ -41,7 +41,7 @@ int main(void) camera.target = (Vector3){ 0.0f, 1.0f, -1.0f }; camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; camera.fovy = 45.0f; - camera.type = CAMERA_PERSPECTIVE; + camera.projection = CAMERA_PERSPECTIVE; Model model = LoadModel("resources/models/watermill.obj"); // Load OBJ model Texture2D texture = LoadTexture("resources/models/watermill_diffuse.png"); // Load model texture @@ -51,7 +51,7 @@ int main(void) Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/grayscale.fs", GLSL_VERSION)); model.materials[0].shader = shader; // Set shader effect to 3d model - model.materials[0].maps[MAP_DIFFUSE].texture = texture; // Bind texture to model + model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Bind texture to model Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position diff --git a/examples/shaders/shaders_multi_sample2d.c b/examples/shaders/shaders_multi_sample2d.c index 2e545981c..fbe75085c 100644 --- a/examples/shaders/shaders_multi_sample2d.c +++ b/examples/shaders/shaders_multi_sample2d.c @@ -42,10 +42,14 @@ int main(void) UnloadImage(imBlue); Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/color_mix.fs", GLSL_VERSION)); - + // Get an additional sampler2D location to be enabled on drawing int texBlueLoc = GetShaderLocation(shader, "texture1"); + // Get shader uniform for divider + int dividerLoc = GetShaderLocation(shader, "divider"); + float dividerValue = 0.5f; + SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -54,28 +58,36 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - // ... + if (IsKeyDown(KEY_RIGHT)) dividerValue += 0.01f; + else if (IsKeyDown(KEY_LEFT)) dividerValue -= 0.01f; + + if (dividerValue < 0.0f) dividerValue = 0.0f; + else if (dividerValue > 1.0f) dividerValue = 1.0f; + + SetShaderValue(shader, dividerLoc, ÷rValue, SHADER_UNIFORM_FLOAT); //---------------------------------------------------------------------------------- - + // Draw //---------------------------------------------------------------------------------- BeginDrawing(); - + ClearBackground(RAYWHITE); BeginShaderMode(shader); - + // WARNING: Additional samplers are enabled for all draw calls in the batch, // EndShaderMode() forces batch drawing and consequently resets active textures // to let other sampler2D to be activated on consequent drawings (if required) SetShaderValueTexture(shader, texBlueLoc, texBlue); - + // We are drawing texRed using default sampler2D texture0 but // an additional texture units is enabled for texBlue (sampler2D texture1) DrawTexture(texRed, 0, 0, WHITE); - + EndShaderMode(); - + + DrawText("Use KEY_LEFT/KEY_RIGHT to move texture mixing in shader!", 80, GetScreenHeight() - 40, 20, RAYWHITE); + EndDrawing(); //---------------------------------------------------------------------------------- } diff --git a/examples/shaders/shaders_palette_switch.c b/examples/shaders/shaders_palette_switch.c index 0f6055bc9..43578fceb 100644 --- a/examples/shaders/shaders_palette_switch.c +++ b/examples/shaders/shaders_palette_switch.c @@ -106,7 +106,7 @@ int main(void) // Send new value to the shader to be used on drawing. // NOTE: We are sending RGB triplets w/o the alpha channel - SetShaderValueV(shader, paletteLoc, palettes[currentPalette], UNIFORM_IVEC3, COLORS_PER_PALETTE); + SetShaderValueV(shader, paletteLoc, palettes[currentPalette], SHADER_UNIFORM_IVEC3, COLORS_PER_PALETTE); //---------------------------------------------------------------------------------- // Draw diff --git a/examples/shaders/shaders_postprocessing.c b/examples/shaders/shaders_postprocessing.c index 931c3a872..ef815391b 100644 --- a/examples/shaders/shaders_postprocessing.c +++ b/examples/shaders/shaders_postprocessing.c @@ -74,7 +74,7 @@ int main(void) Model model = LoadModel("resources/models/church.obj"); // Load OBJ model Texture2D texture = LoadTexture("resources/models/church_diffuse.png"); // Load model texture (diffuse map) - model.materials[0].maps[MAP_DIFFUSE].texture = texture; // Set model diffuse texture + model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set model diffuse texture Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position @@ -146,7 +146,7 @@ int main(void) BeginShaderMode(shaders[currentShader]); // NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom) - DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, WHITE); + DrawTextureRec(target.texture, (Rectangle){ 0, 0, (float)target.texture.width, (float)-target.texture.height }, (Vector2){ 0, 0 }, WHITE); EndShaderMode(); diff --git a/examples/shaders/shaders_raymarching.c b/examples/shaders/shaders_raymarching.c index e9ab3f14f..5ffe134b0 100644 --- a/examples/shaders/shaders_raymarching.c +++ b/examples/shaders/shaders_raymarching.c @@ -49,7 +49,7 @@ int main(void) int resolutionLoc = GetShaderLocation(shader, "resolution"); float resolution[2] = { (float)screenWidth, (float)screenHeight }; - SetShaderValue(shader, resolutionLoc, resolution, UNIFORM_VEC2); + SetShaderValue(shader, resolutionLoc, resolution, SHADER_UNIFORM_VEC2); float runTime = 0.0f; @@ -70,17 +70,17 @@ int main(void) runTime += deltaTime; // Set shader required uniform values - SetShaderValue(shader, viewEyeLoc, cameraPos, UNIFORM_VEC3); - SetShaderValue(shader, viewCenterLoc, cameraTarget, UNIFORM_VEC3); - SetShaderValue(shader, runTimeLoc, &runTime, UNIFORM_FLOAT); - + SetShaderValue(shader, viewEyeLoc, cameraPos, SHADER_UNIFORM_VEC3); + SetShaderValue(shader, viewCenterLoc, cameraTarget, SHADER_UNIFORM_VEC3); + SetShaderValue(shader, runTimeLoc, &runTime, SHADER_UNIFORM_FLOAT); + // Check if screen is resized if (IsWindowResized()) { screenWidth = GetScreenWidth(); screenHeight = GetScreenHeight(); float resolution[2] = { (float)screenWidth, (float)screenHeight }; - SetShaderValue(shader, resolutionLoc, resolution, UNIFORM_VEC2); + SetShaderValue(shader, resolutionLoc, resolution, SHADER_UNIFORM_VEC2); } //---------------------------------------------------------------------------------- diff --git a/examples/shaders/shaders_rlgl_mesh_instanced.c b/examples/shaders/shaders_rlgl_mesh_instanced.c deleted file mode 100644 index 4cf780aaa..000000000 --- a/examples/shaders/shaders_rlgl_mesh_instanced.c +++ /dev/null @@ -1,142 +0,0 @@ -/******************************************************************************************* -* -* raylib [shaders] example - rlgl module usage for instanced meshes -* -* This example uses [rlgl] module funtionality (pseudo-OpenGL 1.1 style coding) -* -* This example has been created using raylib 3.5 (www.raylib.com) -* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) -* -* Example contributed by @seanpringle and reviewed by Ramon Santamaria (@raysan5) -* -* Copyright (c) 2020 @seanpringle -* -********************************************************************************************/ - - -#include "raylib.h" -#include "raymath.h" -#include "rlgl.h" - -#define RLIGHTS_IMPLEMENTATION -#include "rlights.h" - -#include - -#define GLSL_VERSION 330 - -//------------------------------------------------------------------------------------ -// Program main entry point -//------------------------------------------------------------------------------------ -int main(void) -{ - // Initialization - //-------------------------------------------------------------------------------------- - const int screenWidth = 800; - const int screenHeight = 450; - - SetConfigFlags(FLAG_MSAA_4X_HINT); // Enable Multi Sampling Anti Aliasing 4x (if available) - InitWindow(screenWidth, screenHeight, "raylib [shaders] example - rlgl mesh instanced"); - - // Define the camera to look into our 3d world - Camera camera = { 0 }; - camera.position = (Vector3){ 125.0f, 125.0f, 125.0f }; - camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; - camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; - camera.fovy = 45.0f; - camera.type = CAMERA_PERSPECTIVE; - - const int count = 10000; // Number of instances to display - Mesh cube = GenMeshCube(1.0f, 1.0f, 1.0f); - - Matrix *rotations = RL_MALLOC(count*sizeof(Matrix)); // Rotation state of instances - Matrix *rotationsInc = RL_MALLOC(count*sizeof(Matrix)); // Per-frame rotation animation of instances - Matrix *translations = RL_MALLOC(count*sizeof(Matrix)); // Locations of instances - - // Scatter random cubes around - for (int i = 0; i < count; i++) - { - float x = GetRandomValue(-50, 50); - float y = GetRandomValue(-50, 50); - float z = GetRandomValue(-50, 50); - translations[i] = MatrixTranslate(x, y, z); - - x = GetRandomValue(0, 360); - y = GetRandomValue(0, 360); - z = GetRandomValue(0, 360); - Vector3 axis = Vector3Normalize((Vector3){x, y, z}); - float angle = (float)GetRandomValue(0, 10) * DEG2RAD; - - rotationsInc[i] = MatrixRotate(axis, angle); - rotations[i] = MatrixIdentity(); - } - - Matrix *transforms = RL_MALLOC(count*sizeof(Matrix)); // Pre-multiplied transformations passed to rlgl - - Shader shader = LoadShader(FormatText("resources/shaders/glsl%i/base_lighting_instanced.vs", GLSL_VERSION), - FormatText("resources/shaders/glsl%i/lighting.fs", GLSL_VERSION)); - - // Get some shader loactions - shader.locs[LOC_MATRIX_MVP] = GetShaderLocation(shader, "mvp"); - shader.locs[LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos"); - shader.locs[LOC_MATRIX_MODEL] = GetShaderLocationAttrib(shader, "instance"); - - // Ambient light level - int ambientLoc = GetShaderLocation(shader, "ambient"); - SetShaderValue(shader, ambientLoc, (float[4]){ 0.2f, 0.2f, 0.2f, 1.0f }, UNIFORM_VEC4); - - CreateLight(LIGHT_DIRECTIONAL, (Vector3){ 50, 50, 0 }, Vector3Zero(), WHITE, shader); - - Material material = LoadMaterialDefault(); - material.shader = shader; - material.maps[MAP_DIFFUSE].color = RED; - - SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode - - SetTargetFPS(60); // Set our game to run at 60 frames-per-second - //-------------------------------------------------------------------------------------- - - // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key - { - // Update - //---------------------------------------------------------------------------------- - UpdateCamera(&camera); - - // Update the light shader with the camera view position - float cameraPos[3] = { camera.position.x, camera.position.y, camera.position.z }; - SetShaderValue(shader, shader.locs[LOC_VECTOR_VIEW], cameraPos, UNIFORM_VEC3); - - // Apply per-instance rotations - for (int i = 0; i < count; i++) - { - rotations[i] = MatrixMultiply(rotations[i], rotationsInc[i]); - transforms[i] = MatrixMultiply(rotations[i], translations[i]); - } - //---------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - BeginDrawing(); - - ClearBackground(RAYWHITE); - - BeginMode3D(camera); - rlDrawMeshInstanced(cube, material, transforms, count); - EndMode3D(); - - DrawText("A CUBE OF DANCING CUBES!", 490, 10, 20, MAROON); - - DrawFPS(10, 10); - - EndDrawing(); - //---------------------------------------------------------------------------------- - } - - // De-Initialization - //-------------------------------------------------------------------------------------- - CloseWindow(); // Close window and OpenGL context - //-------------------------------------------------------------------------------------- - - return 0; -} diff --git a/examples/shaders/shaders_simple_mask.c b/examples/shaders/shaders_simple_mask.c index df0d2b6eb..981e64863 100644 --- a/examples/shaders/shaders_simple_mask.c +++ b/examples/shaders/shaders_simple_mask.c @@ -42,13 +42,13 @@ int main(void) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; camera.fovy = 45.0f; - camera.type = CAMERA_PERSPECTIVE; + camera.projection = CAMERA_PERSPECTIVE; // Define our three models to show the shader on - Mesh torus = GenMeshTorus(.3, 1, 16, 32); + Mesh torus = GenMeshTorus(0.3f, 1, 16, 32); Model model1 = LoadModelFromMesh(torus); - Mesh cube = GenMeshCube(.8,.8,.8); + Mesh cube = GenMeshCube(0.8f,0.8f,0.8f); Model model2 = LoadModelFromMesh(cube); // Generate model to be shaded just to see the gaps in the other two @@ -57,18 +57,18 @@ int main(void) // Load the shader Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/mask.fs", GLSL_VERSION)); - + // Load and apply the diffuse texture (colour map) Texture texDiffuse = LoadTexture("resources/plasma.png"); - model1.materials[0].maps[MAP_DIFFUSE].texture = texDiffuse; - model2.materials[0].maps[MAP_DIFFUSE].texture = texDiffuse; + model1.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texDiffuse; + model2.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texDiffuse; - // Using MAP_EMISSION as a spare slot to use for 2nd texture - // NOTE: Don't use MAP_IRRADIANCE, MAP_PREFILTER or MAP_CUBEMAP as they are bound as cube maps + // Using MATERIAL_MAP_EMISSION as a spare slot to use for 2nd texture + // NOTE: Don't use MATERIAL_MAP_IRRADIANCE, MATERIAL_MAP_PREFILTER or MATERIAL_MAP_CUBEMAP as they are bound as cube maps Texture texMask = LoadTexture("resources/mask.png"); - model1.materials[0].maps[MAP_EMISSION].texture = texMask; - model2.materials[0].maps[MAP_EMISSION].texture = texMask; - shader.locs[LOC_MAP_EMISSION] = GetShaderLocation(shader, "mask"); + model1.materials[0].maps[MATERIAL_MAP_EMISSION].texture = texMask; + model2.materials[0].maps[MATERIAL_MAP_EMISSION].texture = texMask; + shader.locs[SHADER_LOC_MAP_EMISSION] = GetShaderLocation(shader, "mask"); // Frame is incremented each frame to animate the shader int shaderFrame = GetShaderLocation(shader, "frame"); @@ -94,7 +94,7 @@ int main(void) rotation.z -= 0.0025f; // Send frames counter to shader for animation - SetShaderValue(shader, shaderFrame, &framesCounter, UNIFORM_INT); + SetShaderValue(shader, shaderFrame, &framesCounter, SHADER_UNIFORM_INT); // Rotate one of the models model1.transform = MatrixRotateXYZ(rotation); @@ -131,10 +131,10 @@ int main(void) UnloadModel(model1); UnloadModel(model2); UnloadModel(model3); - + UnloadTexture(texDiffuse); // Unload default diffuse texture UnloadTexture(texMask); // Unload texture mask - + UnloadShader(shader); // Unload shader CloseWindow(); // Close window and OpenGL context diff --git a/examples/shaders/shaders_spotlight.c b/examples/shaders/shaders_spotlight.c index 51e5f6f4d..892093d75 100644 --- a/examples/shaders/shaders_spotlight.c +++ b/examples/shaders/shaders_spotlight.c @@ -5,7 +5,7 @@ * This example has been created using raylib 2.5 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Example contributed by Chris Camacho (@chriscamacho - http://bedroomcoders.co.uk/) +* Example contributed by Chris Camacho (@chriscamacho - http://bedroomcoders.co.uk/) * and reviewed by Ramon Santamaria (@raysan5) * * Copyright (c) 2019 Chris Camacho (@chriscamacho) and Ramon Santamaria (@raysan5) @@ -14,13 +14,13 @@ * * The shader makes alpha holes in the forground to give the apearance of a top * down look at a spotlight casting a pool of light... -* +* * The right hand side of the screen there is just enough light to see whats * going on without the spot light, great for a stealth type game where you * have to avoid the spotlights. -* +* * The left hand side of the screen is in pitch dark except for where the spotlights are. -* +* * Although this example doesn't scale like the letterbox example, you could integrate * the two techniques, but by scaling the actual colour of the render texture rather * than using alpha as a mask. @@ -43,12 +43,12 @@ #define MAX_STARS 400 // Spot data -typedef struct { +typedef struct { Vector2 pos; Vector2 vel; float inner; float radius; - + // Shader locations unsigned int posLoc; unsigned int innerLoc; @@ -75,26 +75,26 @@ int main(void) HideCursor(); Texture texRay = LoadTexture("resources/raysan.png"); - + Star stars[MAX_STARS] = { 0 }; for (int n = 0; n < MAX_STARS; n++) ResetStar(&stars[n]); // Progress all the stars on, so they don't all start in the centre - for (int m = 0; m < screenWidth/2.0; m++) + for (int m = 0; m < screenWidth/2.0; m++) { for (int n = 0; n < MAX_STARS; n++) UpdateStar(&stars[n]); } int frameCounter = 0; - + // Use default vert shader Shader shdrSpot = LoadShader(0, TextFormat("resources/shaders/glsl%i/spotlight.fs", GLSL_VERSION)); - + // Get the locations of spots in the shader Spot spots[MAX_SPOTS]; - for (int i = 0; i < MAX_SPOTS; i++) + for (int i = 0; i < MAX_SPOTS; i++) { char posName[32] = "spots[x].pos\0"; char innerName[32] = "spots[x].inner\0"; @@ -103,44 +103,44 @@ int main(void) posName[6] = '0' + i; innerName[6] = '0' + i; radiusName[6] = '0' + i; - + spots[i].posLoc = GetShaderLocation(shdrSpot, posName); spots[i].innerLoc = GetShaderLocation(shdrSpot, innerName); spots[i].radiusLoc = GetShaderLocation(shdrSpot, radiusName); - + } - + // Tell the shader how wide the screen is so we can have // a pitch black half and a dimly lit half. unsigned int wLoc = GetShaderLocation(shdrSpot, "screenWidth"); float sw = (float)GetScreenWidth(); - SetShaderValue(shdrSpot, wLoc, &sw, UNIFORM_FLOAT); + SetShaderValue(shdrSpot, wLoc, &sw, SHADER_UNIFORM_FLOAT); - // Randomise the locations and velocities of the spotlights - // and initialise the shader locations + // Randomize the locations and velocities of the spotlights + // and initialize the shader locations for (int i = 0; i < MAX_SPOTS; i++) { - spots[i].pos.x = GetRandomValue(64, screenWidth - 64); - spots[i].pos.y = GetRandomValue(64, screenHeight - 64); + spots[i].pos.x = GetRandomValue(64.0f, screenWidth - 64.0f); + spots[i].pos.y = GetRandomValue(64.0f, screenHeight - 64.0f); spots[i].vel = (Vector2){ 0, 0 }; - + while ((fabs(spots[i].vel.x) + fabs(spots[i].vel.y)) < 2) { - spots[i].vel.x = GetRandomValue(-40, 40)/10.0; - spots[i].vel.y = GetRandomValue(-40, 40)/10.0; + spots[i].vel.x = GetRandomValue(-400.f, 40.0f) / 10.0f; + spots[i].vel.y = GetRandomValue(-400.f, 40.0f) / 10.0f; } - - spots[i].inner = 28 * (i + 1); - spots[i].radius = 48 * (i + 1); - - SetShaderValue(shdrSpot, spots[i].posLoc, &spots[i].pos.x, UNIFORM_VEC2); - SetShaderValue(shdrSpot, spots[i].innerLoc, &spots[i].inner, UNIFORM_FLOAT); - SetShaderValue(shdrSpot, spots[i].radiusLoc, &spots[i].radius, UNIFORM_FLOAT); + + spots[i].inner = 28.0f * (i + 1); + spots[i].radius = 48.0f * (i + 1); + + SetShaderValue(shdrSpot, spots[i].posLoc, &spots[i].pos.x, SHADER_UNIFORM_VEC2); + SetShaderValue(shdrSpot, spots[i].innerLoc, &spots[i].inner, SHADER_UNIFORM_FLOAT); + SetShaderValue(shdrSpot, spots[i].radiusLoc, &spots[i].radius, SHADER_UNIFORM_FLOAT); } SetTargetFPS(60); // Set to run at 60 frames-per-second //-------------------------------------------------------------------------------------- - + // Main game loop while (!WindowShouldClose()) // Detect window close button or ESC key { @@ -157,23 +157,23 @@ int main(void) if (i == 0) { Vector2 mp = GetMousePosition(); - spots[i].pos.x = mp.x; + spots[i].pos.x = mp.x; spots[i].pos.y = screenHeight - mp.y; } else { - spots[i].pos.x += spots[i].vel.x; + spots[i].pos.x += spots[i].vel.x; spots[i].pos.y += spots[i].vel.y; - - if (spots[i].pos.x < 64) spots[i].vel.x = -spots[i].vel.x; - if (spots[i].pos.x > (screenWidth - 64)) spots[i].vel.x = -spots[i].vel.x; - if (spots[i].pos.y < 64) spots[i].vel.y = -spots[i].vel.y; + + if (spots[i].pos.x < 64) spots[i].vel.x = -spots[i].vel.x; + if (spots[i].pos.x > (screenWidth - 64)) spots[i].vel.x = -spots[i].vel.x; + if (spots[i].pos.y < 64) spots[i].vel.y = -spots[i].vel.y; if (spots[i].pos.y > (screenHeight - 64)) spots[i].vel.y = -spots[i].vel.y; } - - SetShaderValue(shdrSpot, spots[i].posLoc, &spots[i].pos.x, UNIFORM_VEC2); + + SetShaderValue(shdrSpot, spots[i].posLoc, &spots[i].pos.x, SHADER_UNIFORM_VEC2); } - + // Draw //---------------------------------------------------------------------------------- BeginDrawing(); @@ -184,14 +184,14 @@ int main(void) for (int n = 0; n < MAX_STARS; n++) { // Single pixel is just too small these days! - DrawRectangle(stars[n].pos.x, stars[n].pos.y, 2, 2, WHITE); + DrawRectangle((int)stars[n].pos.x, (int)stars[n].pos.y, 2, 2, WHITE); } for (int i = 0; i < 16; i++) { DrawTexture(texRay, - (screenWidth/2.0) + cos((frameCounter + i*8)/51.45f)*(screenWidth/2.2) - 32, - (screenHeight/2.0) + sin((frameCounter + i*8)/17.87f)*(screenHeight/4.2), WHITE); + (screenWidth/2.0f) + cos((frameCounter + i*8)/51.45f)*(screenWidth/2.2f) - 32, + (screenHeight/2.0f) + sin((frameCounter + i*8)/17.87f)*(screenHeight/4.2f), WHITE); } // Draw spot lights @@ -204,11 +204,11 @@ int main(void) EndShaderMode(); DrawFPS(10, 10); - + DrawText("Move the mouse!", 10, 30, 20, GREEN); DrawText("Pitch Black", screenWidth*0.2f, screenHeight/2, 20, GREEN); DrawText("Dark", screenWidth*.66f, screenHeight/2, 20, GREEN); - + EndDrawing(); //---------------------------------------------------------------------------------- @@ -229,21 +229,21 @@ int main(void) void ResetStar(Star *s) { s->pos = (Vector2){ GetScreenWidth()/2.0f, GetScreenHeight()/2.0f }; - + do { s->vel.x = (float)GetRandomValue(-1000, 1000)/100.0f; s->vel.y = (float)GetRandomValue(-1000, 1000)/100.0f; - + } while (!(fabs(s->vel.x) + (fabs(s->vel.y) > 1))); - + s->pos = Vector2Add(s->pos, Vector2Multiply(s->vel, (Vector2){ 8.0f, 8.0f })); } void UpdateStar(Star *s) { s->pos = Vector2Add(s->pos, s->vel); - + if ((s->pos.x < 0) || (s->pos.x > GetScreenWidth()) || (s->pos.y < 0) || (s->pos.y > GetScreenHeight())) { diff --git a/examples/shaders/shaders_texture_drawing.c b/examples/shaders/shaders_texture_drawing.c index c5a332637..a8cd5abfb 100644 --- a/examples/shaders/shaders_texture_drawing.c +++ b/examples/shaders/shaders_texture_drawing.c @@ -39,7 +39,7 @@ int main(void) float time = 0.0f; int timeLoc = GetShaderLocation(shader, "uTime"); - SetShaderValue(shader, timeLoc, &time, UNIFORM_FLOAT); + SetShaderValue(shader, timeLoc, &time, SHADER_UNIFORM_FLOAT); SetTargetFPS(60); // Set our game to run at 60 frames-per-second // ------------------------------------------------------------------------------------------------------------- @@ -49,8 +49,8 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - time = GetTime(); - SetShaderValue(shader, timeLoc, &time, UNIFORM_FLOAT); + time = (float)GetTime(); + SetShaderValue(shader, timeLoc, &time, SHADER_UNIFORM_FLOAT); //---------------------------------------------------------------------------------- // Draw diff --git a/examples/shaders/shaders_texture_waves.c b/examples/shaders/shaders_texture_waves.c index ca41620e1..7d396fd12 100644 --- a/examples/shaders/shaders_texture_waves.c +++ b/examples/shaders/shaders_texture_waves.c @@ -34,10 +34,10 @@ int main(void) const int screenHeight = 450; InitWindow(screenWidth, screenHeight, "raylib [shaders] example - texture waves"); - + // Load texture texture to apply shaders Texture2D texture = LoadTexture("resources/space.png"); - + // Load shader and setup location points and values Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/wave.fs", GLSL_VERSION)); @@ -58,13 +58,13 @@ int main(void) float speedY = 8.0f; float screenSize[2] = { (float)GetScreenWidth(), (float)GetScreenHeight() }; - SetShaderValue(shader, GetShaderLocation(shader, "size"), &screenSize, UNIFORM_VEC2); - SetShaderValue(shader, freqXLoc, &freqX, UNIFORM_FLOAT); - SetShaderValue(shader, freqYLoc, &freqY, UNIFORM_FLOAT); - SetShaderValue(shader, ampXLoc, &X, UNIFORM_FLOAT); - SetShaderValue(shader, ampYLoc, &Y, UNIFORM_FLOAT); - SetShaderValue(shader, speedXLoc, &speedX, UNIFORM_FLOAT); - SetShaderValue(shader, speedYLoc, &speedY, UNIFORM_FLOAT); + SetShaderValue(shader, GetShaderLocation(shader, "size"), &screenSize, SHADER_UNIFORM_VEC2); + SetShaderValue(shader, freqXLoc, &freqX, SHADER_UNIFORM_FLOAT); + SetShaderValue(shader, freqYLoc, &freqY, SHADER_UNIFORM_FLOAT); + SetShaderValue(shader, ampXLoc, &X, SHADER_UNIFORM_FLOAT); + SetShaderValue(shader, ampYLoc, &Y, SHADER_UNIFORM_FLOAT); + SetShaderValue(shader, speedXLoc, &speedX, SHADER_UNIFORM_FLOAT); + SetShaderValue(shader, speedYLoc, &speedY, SHADER_UNIFORM_FLOAT); float seconds = 0.0f; @@ -77,8 +77,8 @@ int main(void) // Update //---------------------------------------------------------------------------------- seconds += GetFrameTime(); - - SetShaderValue(shader, secondsLoc, &seconds, UNIFORM_FLOAT); + + SetShaderValue(shader, secondsLoc, &seconds, SHADER_UNIFORM_FLOAT); //---------------------------------------------------------------------------------- // Draw @@ -88,10 +88,10 @@ int main(void) ClearBackground(RAYWHITE); BeginShaderMode(shader); - + DrawTexture(texture, 0, 0, WHITE); DrawTexture(texture, texture.width, 0, WHITE); - + EndShaderMode(); EndDrawing(); @@ -102,7 +102,7 @@ int main(void) //-------------------------------------------------------------------------------------- UnloadShader(shader); // Unload shader UnloadTexture(texture); // Unload texture - + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/shapes/shapes_basic_shapes.c b/examples/shapes/shapes_basic_shapes.c index f7a8d02fd..086de774a 100644 --- a/examples/shapes/shapes_basic_shapes.c +++ b/examples/shapes/shapes_basic_shapes.c @@ -39,27 +39,32 @@ int main(void) DrawText("some basic shapes available on raylib", 20, 20, 20, DARKGRAY); - DrawCircle(screenWidth/4, 120, 35, DARKBLUE); + // Circle shapes and lines + DrawCircle(screenWidth/5, 120, 35, DARKBLUE); + DrawCircleGradient(screenWidth/5, 220, 60, GREEN, SKYBLUE); + DrawCircleLines(screenWidth/5, 340, 80, DARKBLUE); + // Rectangle shapes and ines DrawRectangle(screenWidth/4*2 - 60, 100, 120, 60, RED); - DrawRectangleLines(screenWidth/4*2 - 40, 320, 80, 60, ORANGE); // NOTE: Uses QUADS internally, not lines DrawRectangleGradientH(screenWidth/4*2 - 90, 170, 180, 130, MAROON, GOLD); + DrawRectangleLines(screenWidth/4*2 - 40, 320, 80, 60, ORANGE); // NOTE: Uses QUADS internally, not lines - DrawTriangle((Vector2){screenWidth/4*3, 80}, - (Vector2){screenWidth/4*3 - 60, 150}, - (Vector2){screenWidth/4*3 + 60, 150}, VIOLET); + // Triangle shapes and lines + DrawTriangle((Vector2){screenWidth/4.0f *3.0f, 80.0f}, + (Vector2){screenWidth/4.0f *3.0f - 60.0f, 150.0f}, + (Vector2){screenWidth/4.0f *3.0f + 60.0f, 150.0f}, VIOLET); + DrawTriangleLines((Vector2){screenWidth/4.0f*3.0f, 160.0f}, + (Vector2){screenWidth/4.0f*3.0f - 20.0f, 230.0f}, + (Vector2){screenWidth/4.0f*3.0f + 20.0f, 230.0f}, DARKBLUE); + + // Polygon shapes and lines DrawPoly((Vector2){screenWidth/4*3, 320}, 6, 80, 0, BROWN); - - DrawCircleGradient(screenWidth/4, 220, 60, GREEN, SKYBLUE); + DrawPolyLinesEx((Vector2){screenWidth/4*3, 320}, 6, 80, 0, 6, BEIGE); // NOTE: We draw all LINES based shapes together to optimize internal drawing, // this way, all LINES are rendered in a single draw pass DrawLine(18, 42, screenWidth - 18, 42, BLACK); - DrawCircleLines(screenWidth/4, 340, 80, DARKBLUE); - DrawTriangleLines((Vector2){screenWidth/4*3, 160}, - (Vector2){screenWidth/4*3 - 20, 230}, - (Vector2){screenWidth/4*3 + 20, 230}, DARKBLUE); EndDrawing(); //---------------------------------------------------------------------------------- } diff --git a/examples/shapes/shapes_colors_palette.c b/examples/shapes/shapes_colors_palette.c index a0bba002a..0865d5814 100644 --- a/examples/shapes/shapes_colors_palette.c +++ b/examples/shapes/shapes_colors_palette.c @@ -37,10 +37,10 @@ int main(void) // Fills colorsRecs data (for every rectangle) for (int i = 0; i < MAX_COLORS_COUNT; i++) { - colorsRecs[i].x = 20 + 100*(i%7) + 10*(i%7); - colorsRecs[i].y = 80 + 100*(i/7) + 10*(i/7); - colorsRecs[i].width = 100; - colorsRecs[i].height = 100; + colorsRecs[i].x = 20.0f + 100.0f *(i%7) + 10.0f *(i%7); + colorsRecs[i].y = 80.0f + 100.0f *(i/7) + 10.0f *(i/7); + colorsRecs[i].width = 100.0f; + colorsRecs[i].height = 100.0f; } int colorState[MAX_COLORS_COUNT] = { 0 }; // Color state: 0-DEFAULT, 1-MOUSE_HOVER diff --git a/examples/shapes/shapes_draw_circle_sector.c b/examples/shapes/shapes_draw_circle_sector.c index 92ce1f4aa..009288df6 100644 --- a/examples/shapes/shapes_draw_circle_sector.c +++ b/examples/shapes/shapes_draw_circle_sector.c @@ -28,9 +28,10 @@ int main(void) Vector2 center = {(GetScreenWidth() - 300)/2, GetScreenHeight()/2 }; float outerRadius = 180.0f; - int startAngle = 0; - int endAngle = 180; + float startAngle = 0.0f; + float endAngle = 180.0f; int segments = 0; + int minSegments = 4; SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -42,38 +43,39 @@ int main(void) //---------------------------------------------------------------------------------- // NOTE: All variables update happens inside GUI control functions //---------------------------------------------------------------------------------- - + // Draw //---------------------------------------------------------------------------------- BeginDrawing(); - + ClearBackground(RAYWHITE); - + DrawLine(500, 0, 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.6f)); DrawRectangle(500, 0, GetScreenWidth() - 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.3f)); DrawCircleSector(center, outerRadius, startAngle, endAngle, segments, Fade(MAROON, 0.3)); DrawCircleSectorLines(center, outerRadius, startAngle, endAngle, segments, Fade(MAROON, 0.6)); - + // Draw GUI controls //------------------------------------------------------------------------------ startAngle = GuiSliderBar((Rectangle){ 600, 40, 120, 20}, "StartAngle", NULL, startAngle, 0, 720); endAngle = GuiSliderBar((Rectangle){ 600, 70, 120, 20}, "EndAngle", NULL, endAngle, 0, 720); - + outerRadius = GuiSliderBar((Rectangle){ 600, 140, 120, 20}, "Radius", NULL, outerRadius, 0, 200); segments = GuiSliderBar((Rectangle){ 600, 170, 120, 20}, "Segments", NULL, segments, 0, 100); //------------------------------------------------------------------------------ - - DrawText(TextFormat("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 600, 200, 10, (segments >= 4)? MAROON : DARKGRAY); - + + minSegments = (int)ceilf((endAngle - startAngle) / 90); + DrawText(TextFormat("MODE: %s", (segments >= minSegments)? "MANUAL" : "AUTO"), 600, 200, 10, (segments >= minSegments)? MAROON : DARKGRAY); + DrawFPS(10, 10); - + EndDrawing(); //---------------------------------------------------------------------------------- } // De-Initialization - //-------------------------------------------------------------------------------------- + //-------------------------------------------------------------------------------------- CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/shapes/shapes_draw_ring.c b/examples/shapes/shapes_draw_ring.c index bc8287ef4..b60ed2b7e 100644 --- a/examples/shapes/shapes_draw_ring.c +++ b/examples/shapes/shapes_draw_ring.c @@ -30,9 +30,10 @@ int main(void) float innerRadius = 80.0f; float outerRadius = 190.0f; - int startAngle = 0; - int endAngle = 360; + float startAngle = 0.0f; + float endAngle = 360.0f; int segments = 0; + int minSegments = 4; bool drawRing = true; bool drawRingLines = false; @@ -77,7 +78,8 @@ int main(void) drawCircleLines = GuiCheckBox((Rectangle){ 600, 380, 20, 20 }, "Draw CircleLines", drawCircleLines); //------------------------------------------------------------------------------ - DrawText(TextFormat("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 600, 270, 10, (segments >= 4)? MAROON : DARKGRAY); + int minSegments = (int)ceilf((endAngle - startAngle) / 90); + DrawText(TextFormat("MODE: %s", (segments >= minSegments)? "MANUAL" : "AUTO"), 600, 270, 10, (segments >= minSegments)? MAROON : DARKGRAY); DrawFPS(10, 10); diff --git a/examples/shapes/shapes_following_eyes.c b/examples/shapes/shapes_following_eyes.c index a36a8d67b..9ded4feb5 100644 --- a/examples/shapes/shapes_following_eyes.c +++ b/examples/shapes/shapes_following_eyes.c @@ -22,12 +22,12 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [shapes] example - following eyes"); - Vector2 scleraLeftPosition = { GetScreenWidth()/2 - 100, GetScreenHeight()/2 }; - Vector2 scleraRightPosition = { GetScreenWidth()/2 + 100, GetScreenHeight()/2 }; + Vector2 scleraLeftPosition = { GetScreenWidth()/2.0f - 100.0f, GetScreenHeight()/2.0f }; + Vector2 scleraRightPosition = { GetScreenWidth()/2.0f + 100.0f, GetScreenHeight()/2.0f }; float scleraRadius = 80; - Vector2 irisLeftPosition = { GetScreenWidth()/2 - 100, GetScreenHeight()/2 }; - Vector2 irisRightPosition = { GetScreenWidth()/2 + 100, GetScreenHeight()/2}; + Vector2 irisLeftPosition = { GetScreenWidth()/2.0f - 100.0f, GetScreenHeight()/2.0f }; + Vector2 irisRightPosition = { GetScreenWidth()/2.0f + 100.0f, GetScreenHeight()/2.0f }; float irisRadius = 24; float angle = 0.0f; diff --git a/examples/shapes/shapes_lines_bezier.c b/examples/shapes/shapes_lines_bezier.c index 3d4edcded..634eb2847 100644 --- a/examples/shapes/shapes_lines_bezier.c +++ b/examples/shapes/shapes_lines_bezier.c @@ -22,7 +22,7 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [shapes] example - cubic-bezier lines"); Vector2 start = { 0, 0 }; - Vector2 end = { screenWidth, screenHeight }; + Vector2 end = { (float)screenWidth, (float)screenHeight }; SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -32,8 +32,8 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) start = GetMousePosition(); - else if (IsMouseButtonDown(MOUSE_RIGHT_BUTTON)) end = GetMousePosition(); + if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) start = GetMousePosition(); + else if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT)) end = GetMousePosition(); //---------------------------------------------------------------------------------- // Draw diff --git a/examples/shapes/shapes_logo_raylib_anim.c b/examples/shapes/shapes_logo_raylib_anim.c index b8558393e..fe5eeffb4 100644 --- a/examples/shapes/shapes_logo_raylib_anim.c +++ b/examples/shapes/shapes_logo_raylib_anim.c @@ -90,7 +90,7 @@ int main(void) } else if (state == 4) // State 4: Reset and Replay { - if (IsKeyPressed('R')) + if (IsKeyPressed(KEY_R)) { framesCounter = 0; lettersCount = 0; @@ -157,4 +157,4 @@ int main(void) //-------------------------------------------------------------------------------------- return 0; -} \ No newline at end of file +} diff --git a/examples/shapes/shapes_rectangle_scaling.c b/examples/shapes/shapes_rectangle_scaling.c index 6940cbcd0..bd1f0648a 100644 --- a/examples/shapes/shapes_rectangle_scaling.c +++ b/examples/shapes/shapes_rectangle_scaling.c @@ -45,7 +45,7 @@ int main(void) CheckCollisionPointRec(mousePosition, (Rectangle){ rec.x + rec.width - MOUSE_SCALE_MARK_SIZE, rec.y + rec.height - MOUSE_SCALE_MARK_SIZE, MOUSE_SCALE_MARK_SIZE, MOUSE_SCALE_MARK_SIZE })) { mouseScaleReady = true; - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) mouseScaleMode = true; + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) mouseScaleMode = true; } else mouseScaleReady = false; @@ -59,7 +59,7 @@ int main(void) if (rec.width < MOUSE_SCALE_MARK_SIZE) rec.width = MOUSE_SCALE_MARK_SIZE; if (rec.height < MOUSE_SCALE_MARK_SIZE) rec.height = MOUSE_SCALE_MARK_SIZE; - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) mouseScaleMode = false; + if (IsMouseButtonReleased(MOUSE_BUTTON_LEFT)) mouseScaleMode = false; } //---------------------------------------------------------------------------------- diff --git a/examples/text/resources/shaders/glsl330/alpha_discard.fs b/examples/text/resources/shaders/glsl330/alpha_discard.fs new file mode 100644 index 000000000..d2134a688 --- /dev/null +++ b/examples/text/resources/shaders/glsl330/alpha_discard.fs @@ -0,0 +1,19 @@ +#version 330 + +// Input vertex attributes (from vertex shader) +in vec2 fragTexCoord; +in vec4 fragColor; + +// Input uniform values +uniform sampler2D texture0; +uniform vec4 colDiffuse; + +// Output fragment color +out vec4 finalColor; + +void main() +{ + vec4 texelColor = texture(texture0, fragTexCoord); + if (texelColor.a == 0.0) discard; + finalColor = texelColor * fragColor * colDiffuse; +} diff --git a/examples/text/resources/shaders/glsl330/sdf.fs b/examples/text/resources/shaders/glsl330/sdf.fs index 44d33e9b1..45e1cabea 100644 --- a/examples/text/resources/shaders/glsl330/sdf.fs +++ b/examples/text/resources/shaders/glsl330/sdf.fs @@ -12,14 +12,14 @@ uniform vec4 colDiffuse; out vec4 finalColor; // NOTE: Add here your custom variables -const float smoothing = 1.0/16.0; void main() { // Texel color fetching from texture sampler // NOTE: Calculate alpha using signed distance field (SDF) - float distance = texture(texture0, fragTexCoord).a; - float alpha = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance); + float distanceFromOutline = texture(texture0, fragTexCoord).a - 0.5; + float distanceChangePerFragment = length(vec2(dFdx(distanceFromOutline), dFdy(distanceFromOutline))); + float alpha = smoothstep(-distanceChangePerFragment, distanceChangePerFragment, distanceFromOutline); // Calculate final fragment color finalColor = vec4(fragColor.rgb, fragColor.a*alpha); diff --git a/examples/text/text_draw_3d.c b/examples/text/text_draw_3d.c new file mode 100644 index 000000000..a579a528b --- /dev/null +++ b/examples/text/text_draw_3d.c @@ -0,0 +1,748 @@ +/******************************************************************************************* +* +* raylib [text] example - Draw 2D text in 3D +* +* Draw a 2D text in 3D space, each letter is drawn in a quad (or 2 quads if backface is set) +* where the texture coodinates of each quad map to the texture coordinates of the glyphs +* inside the font texture. +* A more efficient approach, i believe, would be to render the text in a render texture and +* map that texture to a plane and render that, or maybe a shader but my method allows more +* flexibility...for example to change position of each letter individually to make somethink +* like a wavy text effect. +* +* Special thanks to: +* @Nighten for the DrawTextStyle() code https://github.com/NightenDushi/Raylib_DrawTextStyle +* Chris Camacho (codifies - http://bedroomcoders.co.uk/) for the alpha discard shader +* +* This example has been created using raylib 3.5 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) +* +* Example contributed by Vlad Adrian (@Demizdor) and reviewed by Ramon Santamaria (@raysan5) +* +* Copyright (C) 2021 Vlad Adrian (@Demizdor - https://github.com/Demizdor) +* +********************************************************************************************/ + +#include "raylib.h" +#include "rlgl.h" + +#include // Required for: NULL +#include // Required for: sinf() + +// To make it work with the older RLGL module just comment the line below +#define RAYLIB_NEW_RLGL + +//-------------------------------------------------------------------------------------- +// Globals +//-------------------------------------------------------------------------------------- +#define LETTER_BOUNDRY_SIZE 0.25f +#define TEXT_MAX_LAYERS 32 +#define LETTER_BOUNDRY_COLOR VIOLET + +bool SHOW_LETTER_BOUNDRY = false; +bool SHOW_TEXT_BOUNDRY = false; + +//-------------------------------------------------------------------------------------- +// Data Types definition +//-------------------------------------------------------------------------------------- + +// Configuration structure for waving the text +typedef struct { + Vector3 waveRange; + Vector3 waveSpeed; + Vector3 waveOffset; +} WaveTextConfig; + +//-------------------------------------------------------------------------------------- +// Module Functions Declaration +//-------------------------------------------------------------------------------------- +// Draw a codepoint in 3D space +void DrawTextCodepoint3D(Font font, int codepoint, Vector3 position, float fontSize, bool backface, Color tint); +// Draw a 2D text in 3D space +void DrawText3D(Font font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, Color tint); +// Measure a text in 3D. For some reason `MeasureTextEx()` just doesn't seem to work so i had to use this instead. +Vector3 MeasureText3D(Font font, const char* text, float fontSize, float fontSpacing, float lineSpacing); + +// Draw a 2D text in 3D space and wave the parts that start with `~~` and end with `~~`. +// This is a modified version of the original code by @Nighten found here https://github.com/NightenDushi/Raylib_DrawTextStyle +void DrawTextWave3D(Font font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, WaveTextConfig* config, float time, Color tint); +// Measure a text in 3D ignoring the `~~` chars. +Vector3 MeasureTextWave3D(Font font, const char* text, float fontSize, float fontSpacing, float lineSpacing); +// Generates a nice color with a random hue +Color GenerateRandomColor(float s, float v); + +//------------------------------------------------------------------------------------ +// Program main entry point +//------------------------------------------------------------------------------------ +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + SetConfigFlags(FLAG_MSAA_4X_HINT|FLAG_VSYNC_HINT); + InitWindow(screenWidth, screenHeight, "raylib [text] example - draw 2D text in 3D"); + + bool spin = true; // Spin the camera? + bool multicolor = false; // Multicolor mode + + // Define the camera to look into our 3d world + Camera3D camera = { 0 }; + camera.position = (Vector3){ -10.0f, 15.0f, -10.0f }; // Camera position + camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point + camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) + camera.fovy = 45.0f; // Camera field-of-view Y + camera.projection = CAMERA_PERSPECTIVE; // Camera mode type + + SetCameraMode(camera, CAMERA_ORBITAL); + + Vector3 cubePosition = { 0.0f, 1.0f, 0.0f }; + Vector3 cubeSize = { 2.0f, 2.0f, 2.0f }; + + SetTargetFPS(60); // Set our game to run at 60 frames-per-second + + // Use the default font + Font font = GetFontDefault(); + float fontSize = 8.0f; + float fontSpacing = 0.5f; + float lineSpacing = -1.0f; + + // Set the text (using markdown!) + char text[64] = "Hello ~~World~~ in 3D!"; + Vector3 tbox = {0}; + int layers = 1; + int quads = 0; + float layerDistance = 0.01f; + + WaveTextConfig wcfg; + wcfg.waveSpeed.x = wcfg.waveSpeed.y = 3.0f; wcfg.waveSpeed.z = 0.5f; + wcfg.waveOffset.x = wcfg.waveOffset.y = wcfg.waveOffset.z = 0.35f; + wcfg.waveRange.x = wcfg.waveRange.y = wcfg.waveRange.z = 0.45f; + + float time = 0.0f; + + // Setup a light and dark color + Color light = MAROON; + Color dark = RED; + + // Load the alpha discard shader + Shader alphaDiscard = LoadShader(NULL, "resources/shaders/glsl330/alpha_discard.fs"); + + // Array filled with multiple random colors (when multicolor mode is set) + Color multi[TEXT_MAX_LAYERS] = {0}; + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key + { + // Update + //---------------------------------------------------------------------------------- + // Handle font files dropped + if (IsFileDropped()) + { + int count = 0; + char **droppedFiles = GetDroppedFiles(&count); + + // NOTE: We only support first ttf file dropped + if (IsFileExtension(droppedFiles[0], ".ttf")) + { + UnloadFont(font); + font = LoadFontEx(droppedFiles[0], fontSize, 0, 0); + } + else if (IsFileExtension(droppedFiles[0], ".fnt")) + { + UnloadFont(font); + font = LoadFont(droppedFiles[0]); + fontSize = font.baseSize; + } + ClearDroppedFiles(); + } + + // Handle Events + if (IsKeyPressed(KEY_F1)) SHOW_LETTER_BOUNDRY = !SHOW_LETTER_BOUNDRY; + if (IsKeyPressed(KEY_F2)) SHOW_TEXT_BOUNDRY = !SHOW_TEXT_BOUNDRY; + if (IsKeyPressed(KEY_F3)) + { + // Handle camera change + spin = !spin; + // we need to reset the camera when changing modes + camera = (Camera3D){ 0 }; + camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point + camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) + camera.fovy = 45.0f; // Camera field-of-view Y + camera.projection = CAMERA_PERSPECTIVE; // Camera mode type + + if (spin) + { + camera.position = (Vector3){ -10.0f, 15.0f, -10.0f }; // Camera position + SetCameraMode(camera, CAMERA_ORBITAL); + } + else + { + camera.position = (Vector3){ 10.0f, 10.0f, -10.0f }; // Camera position + SetCameraMode(camera, CAMERA_FREE); + } + } + + // Handle clicking the cube + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) + { + Ray ray = GetMouseRay(GetMousePosition(), camera); + + // Check collision between ray and box + RayCollision collision = GetRayCollisionBox(ray, + (BoundingBox){(Vector3){ cubePosition.x - cubeSize.x/2, cubePosition.y - cubeSize.y/2, cubePosition.z - cubeSize.z/2 }, + (Vector3){ cubePosition.x + cubeSize.x/2, cubePosition.y + cubeSize.y/2, cubePosition.z + cubeSize.z/2 }}); + if (collision.hit) + { + // Generate new random colors + light = GenerateRandomColor(0.5f, 0.78f); + dark = GenerateRandomColor(0.4f, 0.58f); + } + } + + // Handle text layers changes + if (IsKeyPressed(KEY_HOME)) { if (layers > 1) --layers; } + else if (IsKeyPressed(KEY_END)) { if (layers < TEXT_MAX_LAYERS) ++layers; } + + // Handle text changes + if (IsKeyPressed(KEY_LEFT)) fontSize -= 0.5f; + else if (IsKeyPressed(KEY_RIGHT)) fontSize += 0.5f; + else if (IsKeyPressed(KEY_UP)) fontSpacing -= 0.1f; + else if (IsKeyPressed(KEY_DOWN)) fontSpacing += 0.1f; + else if (IsKeyPressed(KEY_PAGE_UP)) lineSpacing -= 0.1f; + else if (IsKeyPressed(KEY_PAGE_DOWN)) lineSpacing += 0.1f; + else if (IsKeyDown(KEY_INSERT)) layerDistance -= 0.001f; + else if (IsKeyDown(KEY_DELETE)) layerDistance += 0.001f; + else if (IsKeyPressed(KEY_TAB)) + { + multicolor = !multicolor; // Enable /disable multicolor mode + + if (multicolor) + { + // Fill color array with random colors + for (int i = 0; i < TEXT_MAX_LAYERS; ++i) + { + multi[i] = GenerateRandomColor(0.5f, 0.8f); + multi[i].a = GetRandomValue(0, 255); + } + } + } + + // Handle text input + int ch = GetCharPressed(); + if (IsKeyPressed(KEY_BACKSPACE)) + { + // Remove last char + int len = TextLength(text); + if (len > 0) text[len - 1] = '\0'; + } + else if (IsKeyPressed(KEY_ENTER)) + { + // handle newline + int len = TextLength(text); + if (len < sizeof(text) - 1) + { + text[len] = '\n'; + text[len+1] ='\0'; + } + } + else + { + // append only printable chars + int len = TextLength(text); + if (len < sizeof(text) - 1) + { + text[len] = ch; + text[len+1] ='\0'; + } + } + + // Measure 3D text so we can center it + tbox = MeasureTextWave3D(font, text, fontSize, fontSpacing, lineSpacing); + + UpdateCamera(&camera); // Update camera + quads = 0; // Reset quad counter + time += GetFrameTime(); // Update timer needed by `DrawTextWave3D()` + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + + ClearBackground(RAYWHITE); + + BeginMode3D(camera); + DrawCubeV(cubePosition, cubeSize, dark); + DrawCubeWires(cubePosition, 2.1f, 2.1f, 2.1f, light); + + DrawGrid(10, 2.0f); + + // Use a shader to handle the depth buffer issue with transparent textures + // NOTE: more info at https://bedroomcoders.co.uk/raylib-billboards-advanced-use/ + BeginShaderMode(alphaDiscard); + + // Draw the 3D text above the red cube + rlPushMatrix(); + rlRotatef(90.0f, 1.0f, 0.0f, 0.0f); + rlRotatef(90.0f, 0.0f, 0.0f, -1.0f); + + for (int i = 0; i < layers; ++i) + { + Color clr = light; + if(multicolor) clr = multi[i]; + DrawTextWave3D(font, text, (Vector3){ -tbox.x/2.0f, layerDistance*i, -4.5f }, fontSize, fontSpacing, lineSpacing, true, &wcfg, time, clr); + } + + // Draw the text boundry if set + if (SHOW_TEXT_BOUNDRY) DrawCubeWiresV((Vector3){ 0.0f, 0.0f, -4.5f + tbox.z/2 }, tbox, dark); + rlPopMatrix(); + + // Don't draw the letter boundries for the 3D text below + bool slb = SHOW_LETTER_BOUNDRY; + SHOW_LETTER_BOUNDRY = false; + + // Draw 3D options (use default font) + //------------------------------------------------------------------------- + rlPushMatrix(); + rlRotatef(180.0f, 0.0f, 1.0f, 0.0f); + char *opt = (char *)TextFormat("< SIZE: %2.1f >", fontSize); + quads += TextLength(opt); + Vector3 m = MeasureText3D(GetFontDefault(), opt, 8.0f, 1.0f, 0.0f); + Vector3 pos = { -m.x/2.0f, 0.01f, 2.0f}; + DrawText3D(GetFontDefault(), opt, pos, 8.0f, 1.0f, 0.0f, false, BLUE); + pos.z += 0.5f + m.z; + + opt = (char *)TextFormat("< SPACING: %2.1f >", fontSpacing); + quads += TextLength(opt); + m = MeasureText3D(GetFontDefault(), opt, 8.0f, 1.0f, 0.0f); + pos.x = -m.x/2.0f; + DrawText3D(GetFontDefault(), opt, pos, 8.0f, 1.0f, 0.0f, false, BLUE); + pos.z += 0.5f + m.z; + + opt = (char *)TextFormat("< LINE: %2.1f >", lineSpacing); + quads += TextLength(opt); + m = MeasureText3D(GetFontDefault(), opt, 8.0f, 1.0f, 0.0f); + pos.x = -m.x/2.0f; + DrawText3D(GetFontDefault(), opt, pos, 8.0f, 1.0f, 0.0f, false, BLUE); + pos.z += 1.0f + m.z; + + opt = (char *)TextFormat("< LBOX: %3s >", slb? "ON" : "OFF"); + quads += TextLength(opt); + m = MeasureText3D(GetFontDefault(), opt, 8.0f, 1.0f, 0.0f); + pos.x = -m.x/2.0f; + DrawText3D(GetFontDefault(), opt, pos, 8.0f, 1.0f, 0.0f, false, RED); + pos.z += 0.5f + m.z; + + opt = (char *)TextFormat("< TBOX: %3s >", SHOW_TEXT_BOUNDRY? "ON" : "OFF"); + quads += TextLength(opt); + m = MeasureText3D(GetFontDefault(), opt, 8.0f, 1.0f, 0.0f); + pos.x = -m.x/2.0f; + DrawText3D(GetFontDefault(), opt, pos, 8.0f, 1.0f, 0.0f, false, RED); + pos.z += 0.5f + m.z; + + opt = (char *)TextFormat("< LAYER DISTANCE: %.3f >", layerDistance); + quads += TextLength(opt); + m = MeasureText3D(GetFontDefault(), opt, 8.0f, 1.0f, 0.0f); + pos.x = -m.x/2.0f; + DrawText3D(GetFontDefault(), opt, pos, 8.0f, 1.0f, 0.0f, false, DARKPURPLE); + rlPopMatrix(); + //------------------------------------------------------------------------- + + // Draw 3D info text (use default font) + //------------------------------------------------------------------------- + opt = "All the text displayed here is in 3D"; + quads += 36; + m = MeasureText3D(GetFontDefault(), opt, 10.0f, 0.5f, 0.0f); + pos = (Vector3){-m.x/2.0f, 0.01f, 2.0f}; + DrawText3D(GetFontDefault(), opt, pos, 10.0f, 0.5f, 0.0f, false, DARKBLUE); + pos.z += 1.5f + m.z; + + opt = "press [Left]/[Right] to change the font size"; + quads += 44; + m = MeasureText3D(GetFontDefault(), opt, 6.0f, 0.5f, 0.0f); + pos.x = -m.x/2.0f; + DrawText3D(GetFontDefault(), opt, pos, 6.0f, 0.5f, 0.0f, false, DARKBLUE); + pos.z += 0.5f + m.z; + + opt = "press [Up]/[Down] to change the font spacing"; + quads += 44; + m = MeasureText3D(GetFontDefault(), opt, 6.0f, 0.5f, 0.0f); + pos.x = -m.x/2.0f; + DrawText3D(GetFontDefault(), opt, pos, 6.0f, 0.5f, 0.0f, false, DARKBLUE); + pos.z += 0.5f + m.z; + + opt = "press [PgUp]/[PgDown] to change the line spacing"; + quads += 48; + m = MeasureText3D(GetFontDefault(), opt, 6.0f, 0.5f, 0.0f); + pos.x = -m.x/2.0f; + DrawText3D(GetFontDefault(), opt, pos, 6.0f, 0.5f, 0.0f, false, DARKBLUE); + pos.z += 0.5f + m.z; + + opt = "press [F1] to toggle the letter boundry"; + quads += 39; + m = MeasureText3D(GetFontDefault(), opt, 6.0f, 0.5f, 0.0f); + pos.x = -m.x/2.0f; + DrawText3D(GetFontDefault(), opt, pos, 6.0f, 0.5f, 0.0f, false, DARKBLUE); + pos.z += 0.5f + m.z; + + opt = "press [F2] to toggle the text boundry"; + quads += 37; + m = MeasureText3D(GetFontDefault(), opt, 6.0f, 0.5f, 0.0f); + pos.x = -m.x/2.0f; + DrawText3D(GetFontDefault(), opt, pos, 6.0f, 0.5f, 0.0f, false, DARKBLUE); + //------------------------------------------------------------------------- + + SHOW_LETTER_BOUNDRY = slb; + EndShaderMode(); + + EndMode3D(); + + // Draw 2D info text & stats + //------------------------------------------------------------------------- + DrawText("Drag & drop a font file to change the font!\nType something, see what happens!\n\n" + "Press [F3] to toggle the camera", 10, 35, 10, BLACK); + + quads += TextLength(text)*2*layers; + char *tmp = (char *)TextFormat("%2i layer(s) | %s camera | %4i quads (%4i verts)", layers, spin? "ORBITAL" : "FREE", quads, quads*4); + int width = MeasureText(tmp, 10); + DrawText(tmp, screenWidth - 20 - width, 10, 10, DARKGREEN); + + tmp = "[Home]/[End] to add/remove 3D text layers"; + width = MeasureText(tmp, 10); + DrawText(tmp, screenWidth - 20 - width, 25, 10, DARKGRAY); + + tmp = "[Insert]/[Delete] to increase/decrease distance between layers"; + width = MeasureText(tmp, 10); + DrawText(tmp, screenWidth - 20 - width, 40, 10, DARKGRAY); + + tmp = "click the [CUBE] for a random color"; + width = MeasureText(tmp, 10); + DrawText(tmp, screenWidth - 20 - width, 55, 10, DARKGRAY); + + tmp = "[Tab] to toggle multicolor mode"; + width = MeasureText(tmp, 10); + DrawText(tmp, screenWidth - 20 - width, 70, 10, DARKGRAY); + //------------------------------------------------------------------------- + + DrawFPS(10, 10); + + EndDrawing(); + //---------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + UnloadFont(font); + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} + +//-------------------------------------------------------------------------------------- +// Module Functions Definitions +//-------------------------------------------------------------------------------------- +// Draw codepoint at specified position in 3D space +void DrawTextCodepoint3D(Font font, int codepoint, Vector3 position, float fontSize, bool backface, Color tint) +{ + // Character index position in sprite font + // NOTE: In case a codepoint is not available in the font, index returned points to '?' + int index = GetGlyphIndex(font, codepoint); + float scale = fontSize/(float)font.baseSize; + + // Character destination rectangle on screen + // NOTE: We consider charsPadding on drawing + position.x += (float)(font.chars[index].offsetX - font.charsPadding)/(float)font.baseSize*scale; + position.z += (float)(font.chars[index].offsetY - font.charsPadding)/(float)font.baseSize*scale; + + // Character source rectangle from font texture atlas + // NOTE: We consider chars padding when drawing, it could be required for outline/glow shader effects + Rectangle srcRec = { font.recs[index].x - (float)font.charsPadding, font.recs[index].y - (float)font.charsPadding, + font.recs[index].width + 2.0f*font.charsPadding, font.recs[index].height + 2.0f*font.charsPadding }; + + float width = (float)(font.recs[index].width + 2.0f*font.charsPadding)/(float)font.baseSize*scale; + float height = (float)(font.recs[index].height + 2.0f*font.charsPadding)/(float)font.baseSize*scale; + + if(font.texture.id > 0) + { + const float x = 0.0f; + const float y = 0.0f; + const float z = 0.0f; + + // normalized texture coordinates of the glyph inside the font texture (0.0f -> 1.0f) + const float tx = srcRec.x/font.texture.width; + const float ty = srcRec.y/font.texture.height; + const float tw = (srcRec.x+srcRec.width)/font.texture.width; + const float th = (srcRec.y+srcRec.height)/font.texture.height; + + if(SHOW_LETTER_BOUNDRY) + DrawCubeWiresV((Vector3){ position.x + width/2, position.y, position.z + height/2}, (Vector3){ width, LETTER_BOUNDRY_SIZE, height }, LETTER_BOUNDRY_COLOR); + +#if defined(RAYLIB_NEW_RLGL) + rlCheckRenderBatchLimit(4 + 4*backface); + rlSetTexture(font.texture.id); +#else + if (rlCheckBufferLimit(4 + 4*backface)) rlglDraw(); + rlEnableTexture(font.texture.id); +#endif + rlPushMatrix(); + rlTranslatef(position.x, position.y, position.z); + + rlBegin(RL_QUADS); + rlColor4ub(tint.r, tint.g, tint.b, tint.a); + + // Front Face + rlNormal3f(0.0f, 1.0f, 0.0f); // Normal Pointing Up + rlTexCoord2f(tx, ty); rlVertex3f(x, y, z); // Top Left Of The Texture and Quad + rlTexCoord2f(tx, th); rlVertex3f(x, y, z + height); // Bottom Left Of The Texture and Quad + rlTexCoord2f(tw, th); rlVertex3f(x + width, y, z + height); // Bottom Right Of The Texture and Quad + rlTexCoord2f(tw, ty); rlVertex3f(x + width, y, z); // Top Right Of The Texture and Quad + + if (backface) + { + // Back Face + rlNormal3f(0.0f, -1.0f, 0.0f); // Normal Pointing Down + rlTexCoord2f(tx, ty); rlVertex3f(x, y, z); // Top Right Of The Texture and Quad + rlTexCoord2f(tw, ty); rlVertex3f(x + width, y, z); // Top Left Of The Texture and Quad + rlTexCoord2f(tw, th); rlVertex3f(x + width, y, z + height); // Bottom Left Of The Texture and Quad + rlTexCoord2f(tx, th); rlVertex3f(x, y, z + height); // Bottom Right Of The Texture and Quad + } + rlEnd(); + rlPopMatrix(); + +#if defined(RAYLIB_NEW_RLGL) + rlSetTexture(0); +#else + rlDisableTexture(); +#endif + } +} + +void DrawText3D(Font font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, Color tint) +{ + int length = TextLength(text); // Total length in bytes of the text, scanned by codepoints in loop + + float textOffsetY = 0.0f; // Offset between lines (on line break '\n') + float textOffsetX = 0.0f; // Offset X to next character to draw + + float scale = fontSize/(float)font.baseSize; + + for (int i = 0; i < length;) + { + // Get next codepoint from byte string and glyph index in font + int codepointByteCount = 0; + int codepoint = GetNextCodepoint(&text[i], &codepointByteCount); + int index = GetGlyphIndex(font, codepoint); + + // NOTE: Normally we exit the decoding sequence as soon as a bad byte is found (and return 0x3f) + // but we need to draw all of the bad bytes using the '?' symbol moving one byte + if (codepoint == 0x3f) codepointByteCount = 1; + + if (codepoint == '\n') + { + // NOTE: Fixed line spacing of 1.5 line-height + // TODO: Support custom line spacing defined by user + textOffsetY += scale + lineSpacing/(float)font.baseSize*scale; + textOffsetX = 0.0f; + } + else + { + if ((codepoint != ' ') && (codepoint != '\t')) + { + DrawTextCodepoint3D(font, codepoint, (Vector3){ position.x + textOffsetX, position.y, position.z + textOffsetY }, fontSize, backface, tint); + } + + if (font.chars[index].advanceX == 0) textOffsetX += (float)(font.recs[index].width + fontSpacing)/(float)font.baseSize*scale; + else textOffsetX += (float)(font.chars[index].advanceX + fontSpacing)/(float)font.baseSize*scale; + } + + i += codepointByteCount; // Move text bytes counter to next codepoint + } +} + +Vector3 MeasureText3D(Font font, const char* text, float fontSize, float fontSpacing, float lineSpacing) +{ + int len = TextLength(text); + int tempLen = 0; // Used to count longer text line num chars + int lenCounter = 0; + + float tempTextWidth = 0.0f; // Used to count longer text line width + + float scale = fontSize/(float)font.baseSize; + float textHeight = scale; + float textWidth = 0.0f; + + int letter = 0; // Current character + int index = 0; // Index position in sprite font + + for (int i = 0; i < len; i++) + { + lenCounter++; + + int next = 0; + letter = GetNextCodepoint(&text[i], &next); + index = GetGlyphIndex(font, letter); + + // NOTE: normally we exit the decoding sequence as soon as a bad byte is found (and return 0x3f) + // but we need to draw all of the bad bytes using the '?' symbol so to not skip any we set next = 1 + if (letter == 0x3f) next = 1; + i += next - 1; + + if (letter != '\n') + { + if (font.chars[index].advanceX != 0) textWidth += (font.chars[index].advanceX+fontSpacing)/(float)font.baseSize*scale; + else textWidth += (font.recs[index].width + font.chars[index].offsetX)/(float)font.baseSize*scale; + } + else + { + if (tempTextWidth < textWidth) tempTextWidth = textWidth; + lenCounter = 0; + textWidth = 0.0f; + textHeight += scale + lineSpacing/(float)font.baseSize*scale; + } + + if (tempLen < lenCounter) tempLen = lenCounter; + } + + if (tempTextWidth < textWidth) tempTextWidth = textWidth; + + Vector3 vec = { 0 }; + vec.x = tempTextWidth + (float)((tempLen - 1)*fontSpacing/(float)font.baseSize*scale); // Adds chars spacing to measure + vec.y = 0.25f; + vec.z = textHeight; + + return vec; +} + + +void DrawTextWave3D(Font font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, WaveTextConfig* config, float time, Color tint) +{ + int length = TextLength(text); // Total length in bytes of the text, scanned by codepoints in loop + + float textOffsetY = 0.0f; // Offset between lines (on line break '\n') + float textOffsetX = 0.0f; // Offset X to next character to draw + + float scale = fontSize/(float)font.baseSize; + + bool wave = false; + + for (int i = 0, k = 0; i < length; ++k) + { + // Get next codepoint from byte string and glyph index in font + int codepointByteCount = 0; + int codepoint = GetNextCodepoint(&text[i], &codepointByteCount); + int index = GetGlyphIndex(font, codepoint); + + // NOTE: Normally we exit the decoding sequence as soon as a bad byte is found (and return 0x3f) + // but we need to draw all of the bad bytes using the '?' symbol moving one byte + if (codepoint == 0x3f) codepointByteCount = 1; + + if (codepoint == '\n') + { + // NOTE: Fixed line spacing of 1.5 line-height + // TODO: Support custom line spacing defined by user + textOffsetY += scale + lineSpacing/(float)font.baseSize*scale; + textOffsetX = 0.0f; + k = 0; + } + else if (codepoint == '~') + { + if (GetNextCodepoint(&text[i+1], &codepointByteCount) == '~') + { + codepointByteCount += 1; + wave = !wave; + } + } + else + { + if ((codepoint != ' ') && (codepoint != '\t')) + { + Vector3 pos = position; + if (wave) // Apply the wave effect + { + pos.x += sinf(time*config->waveSpeed.x-k*config->waveOffset.x)*config->waveRange.x; + pos.y += sinf(time*config->waveSpeed.y-k*config->waveOffset.y)*config->waveRange.y; + pos.z += sinf(time*config->waveSpeed.z-k*config->waveOffset.z)*config->waveRange.z; + } + + DrawTextCodepoint3D(font, codepoint, (Vector3){ pos.x + textOffsetX, pos.y, pos.z + textOffsetY }, fontSize, backface, tint); + } + + if (font.chars[index].advanceX == 0) textOffsetX += (float)(font.recs[index].width + fontSpacing)/(float)font.baseSize*scale; + else textOffsetX += (float)(font.chars[index].advanceX + fontSpacing)/(float)font.baseSize*scale; + } + + i += codepointByteCount; // Move text bytes counter to next codepoint + } +} + +Vector3 MeasureTextWave3D(Font font, const char* text, float fontSize, float fontSpacing, float lineSpacing) +{ + int len = TextLength(text); + int tempLen = 0; // Used to count longer text line num chars + int lenCounter = 0; + + float tempTextWidth = 0.0f; // Used to count longer text line width + + float scale = fontSize/(float)font.baseSize; + float textHeight = scale; + float textWidth = 0.0f; + + int letter = 0; // Current character + int index = 0; // Index position in sprite font + + for (int i = 0; i < len; i++) + { + lenCounter++; + + int next = 0; + letter = GetNextCodepoint(&text[i], &next); + index = GetGlyphIndex(font, letter); + + // NOTE: normally we exit the decoding sequence as soon as a bad byte is found (and return 0x3f) + // but we need to draw all of the bad bytes using the '?' symbol so to not skip any we set next = 1 + if (letter == 0x3f) next = 1; + i += next - 1; + + if (letter != '\n') + { + if(letter == '~' && GetNextCodepoint(&text[i+1], &next) == '~') + { + i++; + } + else + { + if (font.chars[index].advanceX != 0) textWidth += (font.chars[index].advanceX+fontSpacing)/(float)font.baseSize*scale; + else textWidth += (font.recs[index].width + font.chars[index].offsetX)/(float)font.baseSize*scale; + } + } + else + { + if (tempTextWidth < textWidth) tempTextWidth = textWidth; + lenCounter = 0; + textWidth = 0.0f; + textHeight += scale + lineSpacing/(float)font.baseSize*scale; + } + + if (tempLen < lenCounter) tempLen = lenCounter; + } + + if (tempTextWidth < textWidth) tempTextWidth = textWidth; + + Vector3 vec = { 0 }; + vec.x = tempTextWidth + (float)((tempLen - 1)*fontSpacing/(float)font.baseSize*scale); // Adds chars spacing to measure + vec.y = 0.25f; + vec.z = textHeight; + + return vec; +} + +Color GenerateRandomColor(float s, float v) +{ + const float Phi = 0.618033988749895f; // Golden ratio conjugate + float h = GetRandomValue(0, 360); + h = fmodf((h + h*Phi), 360.0f); + return ColorFromHSV(h, s, v); +} diff --git a/examples/text/text_draw_3d.png b/examples/text/text_draw_3d.png new file mode 100644 index 000000000..ce9295980 Binary files /dev/null and b/examples/text/text_draw_3d.png differ diff --git a/examples/text/text_font_filters.c b/examples/text/text_font_filters.c index d90c4277c..71213ced9 100644 --- a/examples/text/text_font_filters.c +++ b/examples/text/text_font_filters.c @@ -35,13 +35,13 @@ int main(void) // NOTE: On 2D drawing it won't be noticeable, it looks like FILTER_BILINEAR GenTextureMipmaps(&font.texture); - float fontSize = font.baseSize; - Vector2 fontPosition = { 40, screenHeight/2 - 80 }; + float fontSize = (float)font.baseSize; + Vector2 fontPosition = { 40.0f, screenHeight/2.0f - 80.0f }; Vector2 textSize = { 0.0f, 0.0f }; // Setup texture scaling filter - SetTextureFilter(font.texture, FILTER_POINT); - int currentFontFilter = 0; // FILTER_POINT + SetTextureFilter(font.texture, TEXTURE_FILTER_POINT); + int currentFontFilter = 0; // TEXTURE_FILTER_POINT SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -56,18 +56,18 @@ int main(void) // Choose font texture filter method if (IsKeyPressed(KEY_ONE)) { - SetTextureFilter(font.texture, FILTER_POINT); + SetTextureFilter(font.texture, TEXTURE_FILTER_POINT); currentFontFilter = 0; } else if (IsKeyPressed(KEY_TWO)) { - SetTextureFilter(font.texture, FILTER_BILINEAR); + SetTextureFilter(font.texture, TEXTURE_FILTER_BILINEAR); currentFontFilter = 1; } else if (IsKeyPressed(KEY_THREE)) { // NOTE: Trilinear filter won't be noticed on 2D drawing - SetTextureFilter(font.texture, FILTER_TRILINEAR); + SetTextureFilter(font.texture, TEXTURE_FILTER_TRILINEAR); currentFontFilter = 2; } @@ -86,7 +86,7 @@ int main(void) if (IsFileExtension(droppedFiles[0], ".ttf")) { UnloadFont(font); - font = LoadFontEx(droppedFiles[0], fontSize, 0, 0); + font = LoadFontEx(droppedFiles[0], (int)fontSize, 0, 0); ClearDroppedFiles(); } } diff --git a/examples/text/text_font_loading.c b/examples/text/text_font_loading.c index 7eaaed8fe..2f8225db3 100644 --- a/examples/text/text_font_loading.c +++ b/examples/text/text_font_loading.c @@ -9,7 +9,7 @@ * - BMFonts > Angel code font fileformat, sprite font image must be provided * together with the .fnt file, font generation cna not be configured * - XNA Spritefont > Sprite font image, following XNA Spritefont conventions, -* Characters in image must follow some spacing and order rules +* Characters in image must follow some spacing and order rules * * This example has been created using raylib 2.6 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) @@ -66,12 +66,12 @@ int main(void) if (!useTtf) { - DrawTextEx(fontBm, msg, (Vector2){ 20.0f, 100.0f }, fontBm.baseSize, 2, MAROON); + DrawTextEx(fontBm, msg, (Vector2){ 20.0f, 100.0f }, (float)fontBm.baseSize, 2, MAROON); DrawText("Using BMFont (Angelcode) imported", 20, GetScreenHeight() - 30, 20, GRAY); } else { - DrawTextEx(fontTtf, msg, (Vector2){ 20.0f, 100.0f }, fontTtf.baseSize, 2, LIME); + DrawTextEx(fontTtf, msg, (Vector2){ 20.0f, 100.0f }, (float)fontTtf.baseSize, 2, LIME); DrawText("Using TTF font generated", 20, GetScreenHeight() - 30, 20, GRAY); } diff --git a/examples/text/text_font_sdf.c b/examples/text/text_font_sdf.c index b83b3d675..f9517bdc3 100644 --- a/examples/text/text_font_sdf.c +++ b/examples/text/text_font_sdf.c @@ -31,7 +31,7 @@ int main(void) // NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required) const char msg[50] = "Signed Distance Fields"; - + // Loading file to memory unsigned int fileSize = 0; unsigned char *fileData = LoadFileData("resources/anonymous_pro_bold.ttf", &fileSize); @@ -40,7 +40,7 @@ int main(void) Font fontDefault = { 0 }; fontDefault.baseSize = 16; fontDefault.charsCount = 95; - + // Loading font data from memory data // Parameters > font size: 16, no chars array provided (0), chars count: 95 (autogenerate chars array) fontDefault.chars = LoadFontData(fileData, fileSize, 16, 0, 95, FONT_DEFAULT); @@ -59,18 +59,18 @@ int main(void) atlas = GenImageFontAtlas(fontSDF.chars, &fontSDF.recs, 95, 16, 0, 1); fontSDF.texture = LoadTextureFromImage(atlas); UnloadImage(atlas); - + UnloadFileData(fileData); // Free memory from loaded file // Load SDF required shader (we use default vertex shader) Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/sdf.fs", GLSL_VERSION)); SetTextureFilter(fontSDF.texture, FILTER_BILINEAR); // Required for SDF font - Vector2 fontPosition = { 40, screenHeight/2 - 50 }; + Vector2 fontPosition = { 40, screenHeight/2.0f - 50 }; Vector2 textSize = { 0.0f, 0.0f }; float fontSize = 16.0f; int currentFont = 0; // 0 - fontDefault, 1 - fontSDF - + SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- diff --git a/examples/text/text_font_spritefont.c b/examples/text/text_font_spritefont.c index 4a62c7182..424e2719e 100644 --- a/examples/text/text_font_spritefont.c +++ b/examples/text/text_font_spritefont.c @@ -8,8 +8,8 @@ * - Every character and every line must be separated the same distance * - Rectangles must be defined by a MAGENTA color background * -* If following this constraints, a font can be provided just by an image, -* this is quite handy to avoid additional information files (like BMFonts use). +* If following this constraints, a font can be provided just by an image, +* this is quite handy to avoid additional information files (like BMFonts use). * * This example has been created using raylib 1.0 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) @@ -38,14 +38,14 @@ int main(void) Font font2 = LoadFont("resources/custom_alagard.png"); // Font loading Font font3 = LoadFont("resources/custom_jupiter_crash.png"); // Font loading - Vector2 fontPosition1 = { screenWidth/2 - MeasureTextEx(font1, msg1, font1.baseSize, -3).x/2, - screenHeight/2 - font1.baseSize/2 - 80 }; + Vector2 fontPosition1 = { screenWidth/2.0f - MeasureTextEx(font1, msg1, (float)font1.baseSize, -3).x/2, + screenHeight/2.0f - font1.baseSize/2.0f - 80.0f }; - Vector2 fontPosition2 = { screenWidth/2 - MeasureTextEx(font2, msg2, font2.baseSize, -2).x/2, - screenHeight/2 - font2.baseSize/2 - 10 }; + Vector2 fontPosition2 = { screenWidth/2.0f - MeasureTextEx(font2, msg2, (float)font2.baseSize, -2.0f).x/2.0f, + screenHeight/2.0f - font2.baseSize/2.0f - 10.0f }; - Vector2 fontPosition3 = { screenWidth/2 - MeasureTextEx(font3, msg3, font3.baseSize, 2).x/2, - screenHeight/2 - font3.baseSize/2 + 50 }; + Vector2 fontPosition3 = { screenWidth/2.0f - MeasureTextEx(font3, msg3, (float)font3.baseSize, 2.0f).x/2.0f, + screenHeight/2.0f - font3.baseSize/2.0f + 50.0f }; SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -64,9 +64,9 @@ int main(void) ClearBackground(RAYWHITE); - DrawTextEx(font1, msg1, fontPosition1, font1.baseSize, -3, WHITE); - DrawTextEx(font2, msg2, fontPosition2, font2.baseSize, -2, WHITE); - DrawTextEx(font3, msg3, fontPosition3, font3.baseSize, 2, WHITE); + DrawTextEx(font1, msg1, fontPosition1, (float)font1.baseSize, -3, WHITE); + DrawTextEx(font2, msg2, fontPosition2, (float)font2.baseSize, -2, WHITE); + DrawTextEx(font3, msg3, fontPosition3, (float)font3.baseSize, 2, WHITE); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/text/text_input_box.c b/examples/text/text_input_box.c index 1b35e21d6..aeea4e150 100644 --- a/examples/text/text_input_box.c +++ b/examples/text/text_input_box.c @@ -22,7 +22,7 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [text] example - input box"); - char name[MAX_INPUT_CHARS + 1] = "\0"; // NOTE: One extra space required for line ending char '\0' + char name[MAX_INPUT_CHARS + 1] = "\0"; // NOTE: One extra space required for null terminator char '\0' int letterCount = 0; Rectangle textBox = { screenWidth/2 - 100, 180, 225, 50 }; @@ -56,9 +56,10 @@ int main(void) if ((key >= 32) && (key <= 125) && (letterCount < MAX_INPUT_CHARS)) { name[letterCount] = (char)key; + name[letterCount+1] = '\0'; // Add null terminator at the end of the string. letterCount++; } - + key = GetCharPressed(); // Check next character in the queue } @@ -69,7 +70,7 @@ int main(void) name[letterCount] = '\0'; } } - else if (GetMouseCursor() != MOUSE_CURSOR_DEFAULT) SetMouseCursor(MOUSE_CURSOR_DEFAULT); + else SetMouseCursor(MOUSE_CURSOR_DEFAULT); if (mouseOnText) framesCounter++; else framesCounter = 0; diff --git a/examples/text/text_raylib_fonts.c b/examples/text/text_raylib_fonts.c index d7e41a78c..7bcfb7f69 100644 --- a/examples/text/text_raylib_fonts.c +++ b/examples/text/text_raylib_fonts.c @@ -52,8 +52,8 @@ int main(void) for (int i = 0; i < MAX_FONTS; i++) { - positions[i].x = screenWidth/2 - MeasureTextEx(fonts[i], messages[i], fonts[i].baseSize*2, spacings[i]).x/2; - positions[i].y = 60 + fonts[i].baseSize + 45*i; + positions[i].x = screenWidth/2.0f - MeasureTextEx(fonts[i], messages[i], fonts[i].baseSize*2.0f, (float)spacings[i]).x/2.0f; + positions[i].y = 60.0f + fonts[i].baseSize + 45.0f*i; } // Small Y position corrections @@ -62,7 +62,7 @@ int main(void) positions[7].y -= 8; Color colors[MAX_FONTS] = { MAROON, ORANGE, DARKGREEN, DARKBLUE, DARKPURPLE, LIME, GOLD, RED }; - + SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -85,7 +85,7 @@ int main(void) for (int i = 0; i < MAX_FONTS; i++) { - DrawTextEx(fonts[i], messages[i], positions[i], fonts[i].baseSize*2, spacings[i], colors[i]); + DrawTextEx(fonts[i], messages[i], positions[i], fonts[i].baseSize*2.0f, (float)spacings[i], colors[i]); } EndDrawing(); diff --git a/examples/text/text_rectangle_bounds.c b/examples/text/text_rectangle_bounds.c index 870561e1f..9754cd456 100644 --- a/examples/text/text_rectangle_bounds.c +++ b/examples/text/text_rectangle_bounds.c @@ -29,14 +29,14 @@ tempor incididunt ut labore et dolore magna aliqua. Nec ullamcorper sit amet ris bool resizing = false; bool wordWrap = true; - Rectangle container = { 25, 25, screenWidth - 50, screenHeight - 250}; + Rectangle container = { 25.0f, 25.0f, screenWidth - 50.0f, screenHeight - 250.0f }; Rectangle resizer = { container.x + container.width - 17, container.y + container.height - 17, 14, 14 }; // Minimum width and heigh for the container rectangle - const int minWidth = 60; - const int minHeight = 60; - const int maxWidth = screenWidth - 50; - const int maxHeight = screenHeight - 160; + const float minWidth = 60; + const float minHeight = 60; + const float maxWidth = screenWidth - 50.0f; + const float maxHeight = screenHeight - 160.0f; Vector2 lastMouse = { 0.0f, 0.0f }; // Stores last mouse coordinates Color borderColor = MAROON; // Container border color @@ -61,18 +61,18 @@ tempor incididunt ut labore et dolore magna aliqua. Nec ullamcorper sit amet ris // Container resizing logic if (resizing) { - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) resizing = false; + if (IsMouseButtonReleased(MOUSE_BUTTON_LEFT)) resizing = false; - int width = container.width + (mouse.x - lastMouse.x); + float width = container.width + (mouse.x - lastMouse.x); container.width = (width > minWidth)? ((width < maxWidth)? width : maxWidth) : minWidth; - int height = container.height + (mouse.y - lastMouse.y); + float height = container.height + (mouse.y - lastMouse.y); container.height = (height > minHeight)? ((height < maxHeight)? height : maxHeight) : minHeight; } else { // Check if we're resizing - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON) && CheckCollisionPointRec(mouse, resizer)) resizing = true; + if (IsMouseButtonDown(MOUSE_BUTTON_LEFT) && CheckCollisionPointRec(mouse, resizer)) resizing = true; } // Move resizer rectangle properly @@ -99,16 +99,16 @@ tempor incididunt ut labore et dolore magna aliqua. Nec ullamcorper sit amet ris // Draw bottom info DrawRectangle(0, screenHeight - 54, screenWidth, 54, GRAY); - DrawRectangleRec((Rectangle){ 382, screenHeight - 34, 12, 12 }, MAROON); - + DrawRectangleRec((Rectangle){ 382.0f, screenHeight - 34.0f, 12.0f, 12.0f }, MAROON); + DrawText("Word Wrap: ", 313, screenHeight-115, 20, BLACK); if (wordWrap) DrawText("ON", 447, screenHeight - 115, 20, RED); else DrawText("OFF", 447, screenHeight - 115, 20, BLACK); - + DrawText("Press [SPACE] to toggle word wrap", 218, screenHeight - 86, 20, GRAY); DrawText("Click hold & drag the to resize the container", 155, screenHeight - 38, 20, RAYWHITE); - + EndDrawing(); //---------------------------------------------------------------------------------- } diff --git a/examples/text/text_unicode.c b/examples/text/text_unicode.c index 161d46771..fa336de7f 100644 --- a/examples/text/text_unicode.c +++ b/examples/text/text_unicode.c @@ -180,7 +180,7 @@ int main(int argc, char **argv) if (IsKeyPressed(KEY_SPACE)) RandomizeEmoji(); // Set the selected emoji and copy its text to clipboard - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON) && (hovered != -1) && (hovered != selected)) + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT) && (hovered != -1) && (hovered != selected)) { selected = hovered; selectedPos = hoveredPos; @@ -203,15 +203,15 @@ int main(int argc, char **argv) for (int i = 0; i < SIZEOF(emoji); ++i) { const char *txt = &emojiCodepoints[emoji[i].index]; - Rectangle emojiRect = { pos.x, pos.y, fontEmoji.baseSize, fontEmoji.baseSize }; + Rectangle emojiRect = { pos.x, pos.y, (float)fontEmoji.baseSize, (float)fontEmoji.baseSize }; if (!CheckCollisionPointRec(mouse, emojiRect)) { - DrawTextEx(fontEmoji, txt, pos, fontEmoji.baseSize, 1.0, selected == i ? emoji[i].color : Fade(LIGHTGRAY, 0.4f)); + DrawTextEx(fontEmoji, txt, pos, (float)fontEmoji.baseSize, 1.0f, selected == i ? emoji[i].color : Fade(LIGHTGRAY, 0.4f)); } else { - DrawTextEx(fontEmoji, txt, pos, fontEmoji.baseSize, 1.0, emoji[i].color ); + DrawTextEx(fontEmoji, txt, pos, (float)fontEmoji.baseSize, 1.0f, emoji[i].color ); hovered = i; hoveredPos = pos; } @@ -235,7 +235,7 @@ int main(int argc, char **argv) TextIsEqual(messages[message].language, "Japanese")) font = &fontAsian; // Calculate size for the message box (approximate the height and width) - Vector2 sz = MeasureTextEx(*font, messages[message].text, font->baseSize, 1.0f); + Vector2 sz = MeasureTextEx(*font, messages[message].text, (float)font->baseSize, 1.0f); if (sz.x > 300) { sz.y *= sz.x/300; sz.x = 300; } else if (sz.x < 160) sz.x = 160; @@ -267,15 +267,15 @@ int main(int argc, char **argv) // Draw the main text message Rectangle textRect = { msgRect.x + horizontalPadding/2, msgRect.y + verticalPadding/2, msgRect.width - horizontalPadding, msgRect.height }; - DrawTextRec(*font, messages[message].text, textRect, font->baseSize, 1.0f, true, WHITE); + DrawTextRec(*font, messages[message].text, textRect, (float)font->baseSize, 1.0f, true, WHITE); // Draw the info text below the main message - int size = strlen(messages[message].text); + int size = (int)strlen(messages[message].text); int len = GetCodepointsCount(messages[message].text); const char *info = TextFormat("%s %u characters %i bytes", messages[message].language, len, size); sz = MeasureTextEx(GetFontDefault(), info, 10, 1.0f); Vector2 pos = { textRect.x + textRect.width - sz.x, msgRect.y + msgRect.height - sz.y - 2 }; - DrawText(info, pos.x, pos.y, 10, RAYWHITE); + DrawText(info, (int)pos.x, (int)pos.y, 10, RAYWHITE); } //------------------------------------------------------------------------------ diff --git a/examples/textures/textures_blend_modes.c b/examples/textures/textures_blend_modes.c index 2d9b0af9d..646bceaa4 100644 --- a/examples/textures/textures_blend_modes.c +++ b/examples/textures/textures_blend_modes.c @@ -32,12 +32,12 @@ int main(void) Texture2D fgTexture = LoadTextureFromImage(fgImage); // Image converted to texture, GPU memory (VRAM) // Once image has been converted to texture and uploaded to VRAM, it can be unloaded from RAM - UnloadImage(bgImage); + UnloadImage(bgImage); UnloadImage(fgImage); const int blendCountMax = 4; BlendMode blendMode = 0; - + // Main game loop while (!WindowShouldClose()) // Detect window close button or ESC key { @@ -49,7 +49,7 @@ int main(void) else blendMode++; } //---------------------------------------------------------------------------------- - + // Draw //---------------------------------------------------------------------------------- BeginDrawing(); @@ -65,7 +65,7 @@ int main(void) // Draw the texts DrawText("Press SPACE to change blend modes.", 310, 350, 10, GRAY); - + switch (blendMode) { case BLEND_ALPHA: DrawText("Current: BLEND_ALPHA", (screenWidth / 2) - 60, 370, 10, GRAY); break; @@ -74,7 +74,7 @@ int main(void) case BLEND_ADD_COLORS: DrawText("Current: BLEND_ADD_COLORS", (screenWidth / 2) - 60, 370, 10, GRAY); break; default: break; } - + DrawText("(c) Cyberpunk Street Environment by Luis Zuno (@ansimuz)", screenWidth - 330, screenHeight - 20, 10, GRAY); EndDrawing(); @@ -88,6 +88,6 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- - + return 0; } diff --git a/examples/textures/textures_bunnymark.c b/examples/textures/textures_bunnymark.c index 8182102c6..9be7c5964 100644 --- a/examples/textures/textures_bunnymark.c +++ b/examples/textures/textures_bunnymark.c @@ -49,7 +49,7 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) { // Create more bunnies for (int i = 0; i < 100; i++) @@ -94,7 +94,7 @@ int main(void) // Process of sending data is costly and it could happen that GPU data has not been completely // processed for drawing while new data is tried to be sent (updating current in-use buffers) // it could generates a stall and consequently a frame drop, limiting the number of drawn bunnies - DrawTexture(texBunny, bunnies[i].position.x, bunnies[i].position.y, bunnies[i].color); + DrawTexture(texBunny, (int)bunnies[i].position.x, (int)bunnies[i].position.y, bunnies[i].color); } DrawRectangle(0, 0, screenWidth, 40, BLACK); diff --git a/examples/textures/textures_draw_tiled.c b/examples/textures/textures_draw_tiled.c index faf2d1711..bc2b1724b 100644 --- a/examples/textures/textures_draw_tiled.c +++ b/examples/textures/textures_draw_tiled.c @@ -21,24 +21,24 @@ int main(int argc, char **argv) //-------------------------------------------------------------------------------------- int screenWidth = 800; int screenHeight = 450; - + SetConfigFlags(FLAG_WINDOW_RESIZABLE); // Make the window resizable InitWindow(screenWidth, screenHeight, "raylib [textures] example - Draw part of a texture tiled"); // NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required) Texture texPattern = LoadTexture("resources/patterns.png"); - SetTextureFilter(texPattern, FILTER_TRILINEAR); // Makes the texture smoother when upscaled - + SetTextureFilter(texPattern, TEXTURE_FILTER_TRILINEAR); // Makes the texture smoother when upscaled + // Coordinates for all patterns inside the texture - const Rectangle recPattern[] = { - (Rectangle){ 3, 3, 66, 66 }, - (Rectangle){ 75, 3, 100, 100 }, + const Rectangle recPattern[] = { + (Rectangle){ 3, 3, 66, 66 }, + (Rectangle){ 75, 3, 100, 100 }, (Rectangle){ 3, 75, 66, 66 }, (Rectangle){ 7, 156, 50, 50 }, (Rectangle){ 85, 106, 90, 45 }, (Rectangle){ 75, 154, 100, 60} }; - + // Setup colors const Color colors[] = { BLACK, MAROON, ORANGE, BLUE, PURPLE, BEIGE, LIME, RED, DARKGRAY, SKYBLUE }; enum { MAX_COLORS = SIZEOF(colors) }; @@ -47,25 +47,25 @@ int main(int argc, char **argv) // Calculate rectangle for each color for (int i = 0, x = 0, y = 0; i < MAX_COLORS; i++) { - colorRec[i].x = 2 + MARGIN_SIZE + x; - colorRec[i].y = 22 + 256 + MARGIN_SIZE + y; - colorRec[i].width = COLOR_SIZE*2; - colorRec[i].height = COLOR_SIZE; - + colorRec[i].x = 2.0f + MARGIN_SIZE + x; + colorRec[i].y = 22.0f + 256.0f + MARGIN_SIZE + y; + colorRec[i].width = COLOR_SIZE*2.0f; + colorRec[i].height = (float)COLOR_SIZE; + if (i == (MAX_COLORS/2 - 1)) { - x = 0; + x = 0; y += COLOR_SIZE + MARGIN_SIZE; - } + } else x += (COLOR_SIZE*2 + MARGIN_SIZE); } int activePattern = 0, activeCol = 0; float scale = 1.0f, rotation = 0.0f; - + SetTargetFPS(60); //--------------------------------------------------------------------------------------- - + // Main game loop while (!WindowShouldClose()) // Detect window close button or ESC key { @@ -73,22 +73,22 @@ int main(int argc, char **argv) //---------------------------------------------------------------------------------- screenWidth = GetScreenWidth(); screenHeight = GetScreenHeight(); - + // Handle mouse - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) { const Vector2 mouse = GetMousePosition(); - + // Check which pattern was clicked and set it as the active pattern for (int i = 0; i < SIZEOF(recPattern); i++) { if (CheckCollisionPointRec(mouse, (Rectangle){ 2 + MARGIN_SIZE + recPattern[i].x, 40 + MARGIN_SIZE + recPattern[i].y, recPattern[i].width, recPattern[i].height })) - { - activePattern = i; - break; + { + activePattern = i; + break; } } - + // Check to see which color was clicked and set it as the active color for (int i = 0; i < MAX_COLORS; ++i) { @@ -99,67 +99,67 @@ int main(int argc, char **argv) } } } - + // Handle keys - + // Change scale if (IsKeyPressed(KEY_UP)) scale += 0.25f; if (IsKeyPressed(KEY_DOWN)) scale -= 0.25f; if (scale > 10.0f) scale = 10.0f; else if ( scale <= 0.0f) scale = 0.25f; - + // Change rotation if (IsKeyPressed(KEY_LEFT)) rotation -= 25.0f; if (IsKeyPressed(KEY_RIGHT)) rotation += 25.0f; - + // Reset if (IsKeyPressed(KEY_SPACE)) { rotation = 0.0f; scale = 1.0f; } //---------------------------------------------------------------------------------- - + // Draw //---------------------------------------------------------------------------------- BeginDrawing(); ClearBackground(RAYWHITE); - + // Draw the tiled area - DrawTextureTiled(texPattern, recPattern[activePattern], (Rectangle){OPT_WIDTH+MARGIN_SIZE, MARGIN_SIZE, screenWidth - OPT_WIDTH - 2*MARGIN_SIZE, screenHeight - 2*MARGIN_SIZE}, + DrawTextureTiled(texPattern, recPattern[activePattern], (Rectangle){(float)OPT_WIDTH+MARGIN_SIZE, (float)MARGIN_SIZE, screenWidth - OPT_WIDTH - 2.0f*MARGIN_SIZE, screenHeight - 2.0f*MARGIN_SIZE}, (Vector2){0.0f, 0.0f}, rotation, scale, colors[activeCol]); - + // Draw options DrawRectangle(MARGIN_SIZE, MARGIN_SIZE, OPT_WIDTH - MARGIN_SIZE, screenHeight - 2*MARGIN_SIZE, ColorAlpha(LIGHTGRAY, 0.5f)); - + DrawText("Select Pattern", 2 + MARGIN_SIZE, 30 + MARGIN_SIZE, 10, BLACK); DrawTexture(texPattern, 2 + MARGIN_SIZE, 40 + MARGIN_SIZE, BLACK); - DrawRectangle(2 + MARGIN_SIZE + recPattern[activePattern].x, 40 + MARGIN_SIZE + recPattern[activePattern].y, recPattern[activePattern].width, recPattern[activePattern].height, ColorAlpha(DARKBLUE, 0.3f)); - + DrawRectangle(2 + MARGIN_SIZE + (int)recPattern[activePattern].x, 40 + MARGIN_SIZE + (int)recPattern[activePattern].y, (int)recPattern[activePattern].width, (int)recPattern[activePattern].height, ColorAlpha(DARKBLUE, 0.3f)); + DrawText("Select Color", 2+MARGIN_SIZE, 10+256+MARGIN_SIZE, 10, BLACK); for (int i = 0; i < MAX_COLORS; i++) { DrawRectangleRec(colorRec[i], colors[i]); - if (activeCol == i) DrawRectangleLinesEx(colorRec[i], 3.0f, ColorAlpha(WHITE, 0.5f)); + if (activeCol == i) DrawRectangleLinesEx(colorRec[i], 3, ColorAlpha(WHITE, 0.5f)); } - + DrawText("Scale (UP/DOWN to change)", 2 + MARGIN_SIZE, 80 + 256 + MARGIN_SIZE, 10, BLACK); DrawText(TextFormat("%.2fx", scale), 2 + MARGIN_SIZE, 92 + 256 + MARGIN_SIZE, 20, BLACK); - + DrawText("Rotation (LEFT/RIGHT to change)", 2 + MARGIN_SIZE, 122 + 256 + MARGIN_SIZE, 10, BLACK); DrawText(TextFormat("%.0f degrees", rotation), 2 + MARGIN_SIZE, 134 + 256 + MARGIN_SIZE, 20, BLACK); - + DrawText("Press [SPACE] to reset", 2 + MARGIN_SIZE, 164 + 256 + MARGIN_SIZE, 10, DARKBLUE); - + // Draw FPS DrawText(TextFormat("%i FPS", GetFPS()), 2 + MARGIN_SIZE, 2 + MARGIN_SIZE, 20, BLACK); EndDrawing(); //---------------------------------------------------------------------------------- } - + // De-Initialization //-------------------------------------------------------------------------------------- UnloadTexture(texPattern); // Unload texture - + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- - + return 0; } diff --git a/examples/textures/textures_image_drawing.c b/examples/textures/textures_image_drawing.c index 6e794582d..ea3cb319f 100644 --- a/examples/textures/textures_image_drawing.c +++ b/examples/textures/textures_image_drawing.c @@ -32,8 +32,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, cat.width, cat.height }, (Rectangle){ 30, 40, cat.width*1.5f, cat.height*1.5f }, WHITE); - ImageCrop(&parrots, (Rectangle){ 0, 50, parrots.width, parrots.height - 100 }); // Crop resulting image + ImageDraw(&parrots, cat, (Rectangle){ 0, 0, (float)cat.width, (float)cat.height }, (Rectangle){ 30, 40, cat.width*1.5f, cat.height*1.5f }, 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 ImageDrawPixel(&parrots, 10, 10, RAYWHITE); @@ -46,7 +46,7 @@ int main(void) Font font = LoadFont("resources/custom_jupiter_crash.png"); // Draw over image using custom font - ImageDrawTextEx(&parrots, font, "PARROTS & CAT", (Vector2){ 300, 230 }, font.baseSize, -2, WHITE); + ImageDrawTextEx(&parrots, font, "PARROTS & CAT", (Vector2){ 300, 230 }, (float)font.baseSize, -2, WHITE); UnloadFont(font); // Unload custom spritefont (already drawn used on image) diff --git a/examples/textures/textures_image_generation.c b/examples/textures/textures_image_generation.c index 0bb10583c..e2513a876 100644 --- a/examples/textures/textures_image_generation.c +++ b/examples/textures/textures_image_generation.c @@ -59,7 +59,7 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON) || IsKeyPressed(KEY_RIGHT)) + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT) || IsKeyPressed(KEY_RIGHT)) { currentTexture = (currentTexture + 1)%NUM_TEXTURES; // Cycle between the textures } diff --git a/examples/textures/textures_image_processing.c b/examples/textures/textures_image_processing.c index 46d8354de..bb47330b7 100644 --- a/examples/textures/textures_image_processing.c +++ b/examples/textures/textures_image_processing.c @@ -4,7 +4,7 @@ * * NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM) * -* This example has been created using raylib 1.4 (www.raylib.com) +* This example has been created using raylib 3.5 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * * Copyright (c) 2016 Ramon Santamaria (@raysan5) @@ -50,9 +50,11 @@ int main(void) // NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required) - Image image = LoadImage("resources/parrots.png"); // Loaded in CPU memory (RAM) - ImageFormat(&image, UNCOMPRESSED_R8G8B8A8); // Format image to RGBA 32bit (required for texture update) <-- ISSUE - Texture2D texture = LoadTextureFromImage(image); // Image converted to texture, GPU memory (VRAM) + Image imOrigin = LoadImage("resources/parrots.png"); // Loaded in CPU memory (RAM) + ImageFormat(&imOrigin, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8); // Format image to RGBA 32bit (required for texture update) <-- ISSUE + Texture2D texture = LoadTextureFromImage(imOrigin); // Image converted to texture, GPU memory (VRAM) + + Image imCopy = ImageCopy(imOrigin); int currentProcess = NONE; bool textureReload = false; @@ -70,7 +72,7 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - + // Mouse toggle group logic for (int i = 0; i < NUM_PROCESSES; i++) { @@ -78,7 +80,7 @@ int main(void) { mouseHoverRec = i; - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) + if (IsMouseButtonReleased(MOUSE_BUTTON_LEFT)) { currentProcess = i; textureReload = true; @@ -87,12 +89,12 @@ int main(void) } else mouseHoverRec = -1; } - + // Keyboard toggle group logic if (IsKeyPressed(KEY_DOWN)) { currentProcess++; - if (currentProcess > 7) currentProcess = 0; + if (currentProcess > (NUM_PROCESSES - 1)) currentProcess = 0; textureReload = true; } else if (IsKeyPressed(KEY_UP)) @@ -105,27 +107,27 @@ int main(void) // Reload texture when required if (textureReload) { - UnloadImage(image); // Unload current image data - image = LoadImage("resources/parrots.png"); // Re-load image data + UnloadImage(imCopy); // Unload image-copy data + imCopy = ImageCopy(imOrigin); // Restore image-copy from image-origin // NOTE: Image processing is a costly CPU process to be done every frame, // If image processing is required in a frame-basis, it should be done // with a texture and by shaders switch (currentProcess) { - case COLOR_GRAYSCALE: ImageColorGrayscale(&image); break; - case COLOR_TINT: ImageColorTint(&image, GREEN); break; - case COLOR_INVERT: ImageColorInvert(&image); break; - case COLOR_CONTRAST: ImageColorContrast(&image, -40); break; - case COLOR_BRIGHTNESS: ImageColorBrightness(&image, -80); break; - case FLIP_VERTICAL: ImageFlipVertical(&image); break; - case FLIP_HORIZONTAL: ImageFlipHorizontal(&image); break; + case COLOR_GRAYSCALE: ImageColorGrayscale(&imCopy); break; + case COLOR_TINT: ImageColorTint(&imCopy, GREEN); break; + case COLOR_INVERT: ImageColorInvert(&imCopy); break; + case COLOR_CONTRAST: ImageColorContrast(&imCopy, -40); break; + case COLOR_BRIGHTNESS: ImageColorBrightness(&imCopy, -80); break; + case FLIP_VERTICAL: ImageFlipVertical(&imCopy); break; + case FLIP_HORIZONTAL: ImageFlipHorizontal(&imCopy); break; default: break; } - Color *pixels = GetImageData(image); // Get pixel data from image (RGBA 32bit) + Color *pixels = LoadImageColors(imCopy); // Load pixel data from image (RGBA 32bit) UpdateTexture(texture, pixels); // Update texture with new image data - free(pixels); // Unload pixels data from RAM + UnloadImageColors(pixels); // Unload pixels data from RAM textureReload = false; } @@ -157,7 +159,8 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- UnloadTexture(texture); // Unload texture from VRAM - UnloadImage(image); // Unload image from RAM + UnloadImage(imOrigin); // Unload image-origin from RAM + UnloadImage(imCopy); // Unload image-copy from RAM CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/textures/textures_image_text.c b/examples/textures/textures_image_text.c index aeccba680..cb4f0df37 100644 --- a/examples/textures/textures_image_text.c +++ b/examples/textures/textures_image_text.c @@ -19,7 +19,7 @@ int main(void) const int screenHeight = 450; InitWindow(screenWidth, screenHeight, "raylib [texture] example - image text drawing"); - + Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM) // TTF Font loading with custom generation parameters diff --git a/examples/textures/textures_mouse_painting.c b/examples/textures/textures_mouse_painting.c index dedb8df35..3001e8532 100644 --- a/examples/textures/textures_mouse_painting.c +++ b/examples/textures/textures_mouse_painting.c @@ -15,7 +15,7 @@ #define MAX_COLORS_COUNT 23 // Number of colors available -int main(void) +int main(void) { // Initialization //-------------------------------------------------------------------------------------- @@ -29,13 +29,13 @@ int main(void) RAYWHITE, YELLOW, GOLD, ORANGE, PINK, RED, MAROON, GREEN, LIME, DARKGREEN, SKYBLUE, BLUE, DARKBLUE, PURPLE, VIOLET, DARKPURPLE, BEIGE, BROWN, DARKBROWN, LIGHTGRAY, GRAY, DARKGRAY, BLACK }; - + // Define colorsRecs data (for every rectangle) Rectangle colorsRecs[MAX_COLORS_COUNT] = { 0 }; for (int i = 0; i < MAX_COLORS_COUNT; i++) { - colorsRecs[i].x = 10 + 30*i + 2*i; + colorsRecs[i].x = 10 + 30.0f*i + 2*i; colorsRecs[i].y = 10; colorsRecs[i].width = 30; colorsRecs[i].height = 30; @@ -44,8 +44,9 @@ int main(void) int colorSelected = 0; int colorSelectedPrev = colorSelected; int colorMouseHover = 0; - int brushSize = 20; - + float brushSize = 20.0f; + bool mouseWasPressed = false; + Rectangle btnSaveRec = { 750, 10, 40, 30 }; bool btnSaveMouseHover = false; bool showSaveMessage = false; @@ -68,11 +69,11 @@ int main(void) // Update //---------------------------------------------------------------------------------- Vector2 mousePos = GetMousePosition(); - + // Move between colors with keys if (IsKeyPressed(KEY_RIGHT)) colorSelected++; else if (IsKeyPressed(KEY_LEFT)) colorSelected--; - + if (colorSelected >= MAX_COLORS_COUNT) colorSelected = MAX_COLORS_COUNT - 1; else if (colorSelected < 0) colorSelected = 0; @@ -86,8 +87,8 @@ int main(void) } else colorMouseHover = -1; } - - if ((colorMouseHover >= 0) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + + if ((colorMouseHover >= 0) && IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) { colorSelected = colorMouseHover; colorSelectedPrev = colorSelected; @@ -98,7 +99,7 @@ int main(void) if (brushSize < 2) brushSize = 2; if (brushSize > 50) brushSize = 50; - if (IsKeyPressed(KEY_C)) + if (IsKeyPressed(KEY_C)) { // Clear render texture to clear color BeginTextureMode(target); @@ -106,34 +107,44 @@ int main(void) EndTextureMode(); } - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON) || (GetGestureDetected() == GESTURE_DRAG)) + if (IsMouseButtonDown(MOUSE_BUTTON_LEFT) || (GetGestureDetected() == GESTURE_DRAG)) { // Paint circle into render texture // NOTE: To avoid discontinuous circles, we could store // previous-next mouse points and just draw a line using brush size BeginTextureMode(target); - if (mousePos.y > 50) DrawCircle(mousePos.x, mousePos.y, brushSize, colors[colorSelected]); + if (mousePos.y > 50) DrawCircle((int)mousePos.x, (int)mousePos.y, brushSize, colors[colorSelected]); EndTextureMode(); } - if (IsMouseButtonDown(MOUSE_RIGHT_BUTTON)) + if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT)) { - colorSelected = 0; - + if (!mouseWasPressed) + { + colorSelectedPrev = colorSelected; + colorSelected = 0; + } + + mouseWasPressed = true; + // Erase circle from render texture BeginTextureMode(target); - if (mousePos.y > 50) DrawCircle(mousePos.x, mousePos.y, brushSize, colors[0]); + if (mousePos.y > 50) DrawCircle((int)mousePos.x, (int)mousePos.y, brushSize, colors[0]); EndTextureMode(); } - else colorSelected = colorSelectedPrev; - + else if (IsMouseButtonReleased(MOUSE_BUTTON_RIGHT) && mouseWasPressed) + { + colorSelected = colorSelectedPrev; + mouseWasPressed = false; + } + // Check mouse hover save button if (CheckCollisionPointRec(mousePos, btnSaveRec)) btnSaveMouseHover = true; else btnSaveMouseHover = false; - + // Image saving logic // NOTE: Saving painted texture to a default named image - if ((btnSaveMouseHover && IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) || IsKeyPressed(KEY_S)) + if ((btnSaveMouseHover && IsMouseButtonReleased(MOUSE_BUTTON_LEFT)) || IsKeyPressed(KEY_S)) { Image image = GetTextureData(target.texture); ImageFlipVertical(&image); @@ -141,7 +152,7 @@ int main(void) UnloadImage(image); showSaveMessage = true; } - + if (showSaveMessage) { // On saving, show a full screen message for 2 seconds @@ -158,42 +169,42 @@ int main(void) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RAYWHITE); - // NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom) - DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, WHITE); + // NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom) + DrawTextureRec(target.texture, (Rectangle) { 0, 0, (float)target.texture.width, (float)-target.texture.height }, (Vector2) { 0, 0 }, WHITE); - // Draw drawing circle for reference - if (mousePos.y > 50) - { - if (IsMouseButtonDown(MOUSE_RIGHT_BUTTON)) DrawCircleLines(mousePos.x, mousePos.y, brushSize, GRAY); - else DrawCircle(GetMouseX(), GetMouseY(), brushSize, colors[colorSelected]); - } - - // Draw top panel - DrawRectangle(0, 0, GetScreenWidth(), 50, RAYWHITE); - DrawLine(0, 50, GetScreenWidth(), 50, LIGHTGRAY); + // Draw drawing circle for reference + if (mousePos.y > 50) + { + if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT)) DrawCircleLines((int)mousePos.x, (int)mousePos.y, brushSize, GRAY); + else DrawCircle(GetMouseX(), GetMouseY(), brushSize, colors[colorSelected]); + } - // Draw color selection rectangles - for (int i = 0; i < MAX_COLORS_COUNT; i++) DrawRectangleRec(colorsRecs[i], colors[i]); - DrawRectangleLines(10, 10, 30, 30, LIGHTGRAY); + // Draw top panel + DrawRectangle(0, 0, GetScreenWidth(), 50, RAYWHITE); + DrawLine(0, 50, GetScreenWidth(), 50, LIGHTGRAY); - if (colorMouseHover >= 0) DrawRectangleRec(colorsRecs[colorMouseHover], Fade(WHITE, 0.6f)); + // Draw color selection rectangles + for (int i = 0; i < MAX_COLORS_COUNT; i++) DrawRectangleRec(colorsRecs[i], colors[i]); + DrawRectangleLines(10, 10, 30, 30, LIGHTGRAY); - DrawRectangleLinesEx((Rectangle){ colorsRecs[colorSelected].x - 2, colorsRecs[colorSelected].y - 2, - colorsRecs[colorSelected].width + 4, colorsRecs[colorSelected].height + 4 }, 2, BLACK); + if (colorMouseHover >= 0) DrawRectangleRec(colorsRecs[colorMouseHover], Fade(WHITE, 0.6f)); - // Draw save image button - DrawRectangleLinesEx(btnSaveRec, 2, btnSaveMouseHover? RED : BLACK); - DrawText("SAVE!", 755, 20, 10, btnSaveMouseHover? RED : BLACK); - - // Draw save image message - if (showSaveMessage) - { - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RAYWHITE, 0.8f)); - DrawRectangle(0, 150, GetScreenWidth(), 80, BLACK); - DrawText("IMAGE SAVED: my_amazing_texture_painting.png", 150, 180, 20, RAYWHITE); - } + DrawRectangleLinesEx((Rectangle){ colorsRecs[colorSelected].x - 2, colorsRecs[colorSelected].y - 2, + colorsRecs[colorSelected].width + 4, colorsRecs[colorSelected].height + 4 }, 2, BLACK); + + // Draw save image button + DrawRectangleLinesEx(btnSaveRec, 2, btnSaveMouseHover ? RED : BLACK); + DrawText("SAVE!", 755, 20, 10, btnSaveMouseHover ? RED : BLACK); + + // Draw save image message + if (showSaveMessage) + { + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RAYWHITE, 0.8f)); + DrawRectangle(0, 150, GetScreenWidth(), 80, BLACK); + DrawText("IMAGE SAVED: my_amazing_texture_painting.png", 150, 180, 20, RAYWHITE); + } EndDrawing(); //---------------------------------------------------------------------------------- @@ -202,7 +213,7 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- UnloadRenderTexture(target); // Unload render texture - + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/textures/textures_npatch_drawing.c b/examples/textures/textures_npatch_drawing.c index 1c57e2e72..170b992f3 100644 --- a/examples/textures/textures_npatch_drawing.c +++ b/examples/textures/textures_npatch_drawing.c @@ -36,15 +36,15 @@ int main(void) Rectangle dstRecH = { 160.0f, 93.0f, 32.0f, 32.0f }; Rectangle dstRecV = { 92.0f, 160.0f, 32.0f, 32.0f }; - // A 9-patch (NPT_9PATCH) changes its sizes in both axis - NPatchInfo ninePatchInfo1 = { (Rectangle){ 0.0f, 0.0f, 64.0f, 64.0f }, 12, 40, 12, 12, NPT_9PATCH }; - NPatchInfo ninePatchInfo2 = { (Rectangle){ 0.0f, 128.0f, 64.0f, 64.0f }, 16, 16, 16, 16, NPT_9PATCH }; + // A 9-patch (NPATCH_NINE_PATCH) changes its sizes in both axis + NPatchInfo ninePatchInfo1 = { (Rectangle){ 0.0f, 0.0f, 64.0f, 64.0f }, 12, 40, 12, 12, NPATCH_NINE_PATCH }; + NPatchInfo ninePatchInfo2 = { (Rectangle){ 0.0f, 128.0f, 64.0f, 64.0f }, 16, 16, 16, 16, NPATCH_NINE_PATCH }; - // A horizontal 3-patch (NPT_3PATCH_HORIZONTAL) changes its sizes along the x axis only - NPatchInfo h3PatchInfo = { (Rectangle){ 0.0f, 64.0f, 64.0f, 64.0f }, 8, 8, 8, 8, NPT_3PATCH_HORIZONTAL }; + // A horizontal 3-patch (NPATCH_THREE_PATCH_HORIZONTAL) changes its sizes along the x axis only + NPatchInfo h3PatchInfo = { (Rectangle){ 0.0f, 64.0f, 64.0f, 64.0f }, 8, 8, 8, 8, NPATCH_THREE_PATCH_HORIZONTAL }; - // A vertical 3-patch (NPT_3PATCH_VERTICAL) changes its sizes along the y axis only - NPatchInfo v3PatchInfo = { (Rectangle){ 0.0f, 192.0f, 64.0f, 64.0f }, 6, 6, 6, 6, NPT_3PATCH_VERTICAL }; + // A vertical 3-patch (NPATCH_THREE_PATCH_VERTICAL) changes its sizes along the y axis only + NPatchInfo v3PatchInfo = { (Rectangle){ 0.0f, 192.0f, 64.0f, 64.0f }, 6, 6, 6, 6, NPATCH_THREE_PATCH_VERTICAL }; SetTargetFPS(60); //--------------------------------------------------------------------------------------- diff --git a/examples/textures/textures_poly.c b/examples/textures/textures_poly.c new file mode 100644 index 000000000..ff7283430 --- /dev/null +++ b/examples/textures/textures_poly.c @@ -0,0 +1,96 @@ +/******************************************************************************************* +* +* raylib [shapes] example - Draw Textured Polygon +* +* This example has been created using raylib 3.7 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) +* +* Example contributed by Chris Camacho (@codifies - bedroomcoders.co.uk) and +* reviewed by Ramon Santamaria (@raysan5) +* +* Copyright (c) 2021 Chris Camacho (@codifies) and Ramon Santamaria (@raysan5) +* +********************************************************************************************/ + +#include "raylib.h" +#include "raymath.h" + +#define MAX_POINTS 11 // 10 points and back to the start + +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + Vector2 texcoords[MAX_POINTS] = { + (Vector2){ 0.75f, 0.0f }, + (Vector2){ 0.25f, 0.0f }, + (Vector2){ 0.0f, 0.5f }, + (Vector2){ 0.0f, 0.75f }, + (Vector2){ 0.25f, 1.0f}, + (Vector2){ 0.375f, 0.875f}, + (Vector2){ 0.625f, 0.875f}, + (Vector2){ 0.75f, 1.0f}, + (Vector2){ 1.0f, 0.75f}, + (Vector2){ 1.0f, 0.5f}, + (Vector2){ 0.75f, 0.0f} // Close the poly + }; + + Vector2 points[MAX_POINTS] = { 0 }; + + // Create the poly coords from the UV's + // you don't have to do this you can specify + // them however you want + for (int i = 0; i < MAX_POINTS; i++) + { + points[i].x = (texcoords[i].x - 0.5f)*256.0f; + points[i].y = (texcoords[i].y - 0.5f)*256.0f; + } + + InitWindow(screenWidth, screenHeight, "raylib [textures] example - textured polygon"); + + Texture texture = LoadTexture("resources/cat.png"); + + float ang = 0; + + SetTargetFPS(60); // Set our game to run at 60 frames-per-second + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key + { + // Update + //---------------------------------------------------------------------------------- + ang++; + + Vector2 positions[MAX_POINTS] = { 0 }; + + for (int i = 0; i < MAX_POINTS; i++) positions[i] = Vector2Rotate(points[i], ang); + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + + ClearBackground(RAYWHITE); + + DrawText("textured polygon", 20, 20, 20, DARKGRAY); + + DrawTexturePoly(texture, (Vector2){ GetScreenWidth()/2, GetScreenHeight()/2 }, + positions, texcoords, MAX_POINTS, WHITE); + + EndDrawing(); + //---------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + UnloadTexture(texture); // Unload texture + + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} diff --git a/examples/textures/textures_poly.png b/examples/textures/textures_poly.png new file mode 100644 index 000000000..b977ada82 Binary files /dev/null and b/examples/textures/textures_poly.png differ diff --git a/examples/textures/textures_raw_data.c b/examples/textures/textures_raw_data.c index 99afd1033..615e57934 100644 --- a/examples/textures/textures_raw_data.c +++ b/examples/textures/textures_raw_data.c @@ -27,7 +27,7 @@ int main(void) // NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required) // Load RAW image data (512x512, 32bit RGBA, no file header) - Image fudesumiRaw = LoadImageRaw("resources/fudesumi.raw", 384, 512, UNCOMPRESSED_R8G8B8A8, 0); + Image fudesumiRaw = LoadImageRaw("resources/fudesumi.raw", 384, 512, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, 0); Texture2D fudesumi = LoadTextureFromImage(fudesumiRaw); // Upload CPU (RAM) image to GPU (VRAM) UnloadImage(fudesumiRaw); // Unload CPU (RAM) image data @@ -52,10 +52,10 @@ int main(void) .data = pixels, // We can assign pixels directly to data .width = width, .height = height, - .format = UNCOMPRESSED_R8G8B8A8, + .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, .mipmaps = 1 - }; - + }; + Texture2D checked = LoadTextureFromImage(checkedIm); UnloadImage(checkedIm); // Unload CPU (RAM) image data (pixels) //--------------------------------------------------------------------------------------- diff --git a/examples/textures/textures_rectangle.c b/examples/textures/textures_rectangle.c index 1665917e5..f0d5105ba 100644 --- a/examples/textures/textures_rectangle.c +++ b/examples/textures/textures_rectangle.c @@ -68,7 +68,7 @@ int main(void) DrawTexture(scarfy, 15, 40, WHITE); DrawRectangleLines(15, 40, scarfy.width, scarfy.height, LIME); - DrawRectangleLines(15 + frameRec.x, 40 + frameRec.y, frameRec.width, frameRec.height, RED); + DrawRectangleLines(15 + (int)frameRec.x, 40 + (int)frameRec.y, (int)frameRec.width, (int)frameRec.height, RED); DrawText("FRAME SPEED: ", 165, 210, 10, DARKGRAY); DrawText(TextFormat("%02i FPS", framesSpeed), 575, 210, 10, DARKGRAY); diff --git a/examples/textures/textures_sprite_button.c b/examples/textures/textures_sprite_button.c index a5b2d8d13..3d1a18342 100644 --- a/examples/textures/textures_sprite_button.c +++ b/examples/textures/textures_sprite_button.c @@ -28,11 +28,11 @@ int main(void) Texture2D button = LoadTexture("resources/button.png"); // Load button texture // Define frame rectangle for drawing - int frameHeight = button.height/NUM_FRAMES; - Rectangle sourceRec = { 0, 0, button.width, frameHeight }; + float frameHeight = (float)button.height/NUM_FRAMES; + Rectangle sourceRec = { 0, 0, (float)button.width, frameHeight }; // Define button bounds on screen - Rectangle btnBounds = { screenWidth/2 - button.width/2, screenHeight/2 - button.height/NUM_FRAMES/2, button.width, frameHeight }; + Rectangle btnBounds = { screenWidth/2.0f - button.width/2.0f, screenHeight/2.0f - button.height/NUM_FRAMES/2.0f, (float)button.width, frameHeight }; int btnState = 0; // Button state: 0-NORMAL, 1-MOUSE_HOVER, 2-PRESSED bool btnAction = false; // Button action should be activated @@ -53,10 +53,10 @@ int main(void) // Check button state if (CheckCollisionPointRec(mousePoint, btnBounds)) { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) btnState = 2; + if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) btnState = 2; else btnState = 1; - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) btnAction = true; + if (IsMouseButtonReleased(MOUSE_BUTTON_LEFT)) btnAction = true; } else btnState = 0; diff --git a/examples/textures/textures_sprite_explosion.c b/examples/textures/textures_sprite_explosion.c index 53f2626ed..4cb769060 100644 --- a/examples/textures/textures_sprite_explosion.c +++ b/examples/textures/textures_sprite_explosion.c @@ -30,10 +30,10 @@ int main(void) // Load explosion texture Texture2D explosion = LoadTexture("resources/explosion.png"); - + // Init variables for animation - int frameWidth = explosion.width/NUM_FRAMES_PER_LINE; // Sprite one frame rectangle width - int frameHeight = explosion.height/NUM_LINES; // Sprite one frame rectangle height + float frameWidth = explosion.width/NUM_FRAMES_PER_LINE; // Sprite one frame rectangle width + float frameHeight = explosion.height/NUM_LINES; // Sprite one frame rectangle height int currentFrame = 0; int currentLine = 0; @@ -53,13 +53,13 @@ int main(void) //---------------------------------------------------------------------------------- // Check for mouse button pressed and activate explosion (if not active) - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON) && !active) + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT) && !active) { position = GetMousePosition(); active = true; - position.x -= frameWidth/2; - position.y -= frameHeight/2; + position.x -= frameWidth/2.0f; + position.y -= frameHeight/2.0f; PlaySound(fxBoom); } diff --git a/examples/textures/textures_srcrec_dstrec.c b/examples/textures/textures_srcrec_dstrec.c index e86b729d6..d24ce0cc0 100644 --- a/examples/textures/textures_srcrec_dstrec.c +++ b/examples/textures/textures_srcrec_dstrec.c @@ -21,20 +21,20 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [textures] examples - texture source and destination rectangles"); // NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required) - + Texture2D scarfy = LoadTexture("resources/scarfy.png"); // Texture loading int frameWidth = scarfy.width/6; int frameHeight = scarfy.height; // Source rectangle (part of the texture to use for drawing) - Rectangle sourceRec = { 0.0f, 0.0f, frameWidth, frameHeight }; + Rectangle sourceRec = { 0.0f, 0.0f, (float)frameWidth, (float)frameHeight }; // Destination rectangle (screen rectangle where drawing part of texture) - Rectangle destRec = { screenWidth/2, screenHeight/2, frameWidth*2, frameHeight*2 }; + Rectangle destRec = { screenWidth/2.0f, screenHeight/2.0f, frameWidth*2.0f, frameHeight*2.0f }; // Origin of the texture (rotation/scale point), it's relative to destination rectangle size - Vector2 origin = { frameWidth, frameHeight }; + Vector2 origin = { (float)frameWidth, (float)frameHeight }; int rotation = 0; diff --git a/logo/raylib_144x144.png b/logo/raylib_144x144.png new file mode 100644 index 000000000..7c533d2de Binary files /dev/null and b/logo/raylib_144x144.png differ diff --git a/logo/raylib_logo_animation.gif b/logo/raylib_logo_animation.gif new file mode 100644 index 000000000..25dbc4571 Binary files /dev/null and b/logo/raylib_logo_animation.gif differ diff --git a/parser/README.md b/parser/README.md new file mode 100644 index 000000000..6deaff691 --- /dev/null +++ b/parser/README.md @@ -0,0 +1,65 @@ +## raylib parser + +This parser scans [`raylib.h`](../src/raylib.h) to get information about `structs`, `enums` and `functions`. +All data is separated into parts, usually as strings. The following types are used for data: + + - `struct FunctionInfo` + - `struct StructInfo` + - `struct EnumInfo` + +Check `raylib_parser.c` for details about those structs. + +## Command Line Arguments + +The parser can take a few options... + +- `--help` Displays help information about the parser +- `--json` Outputs the header information in JSON format + +## Constraints + +This parser is specifically designed to work with raylib.h, so, it has some constraints: + + - Functions are expected as a single line with the following structure: +``` + ( , ); +``` + Be careful with functions broken into several lines, it breaks the process! + + - Structures are expected as several lines with the following form: +``` + + typedef struct { + ; + ; + ; + } ; +``` + - Enums are expected as several lines with the following form: +``` + + typedef enum { + = , + , + , + + } ; +``` + +_NOTE: For enums, multiple options are supported:_ + + - If value is not provided, ( + 1) is assigned + - Value description can be provided or not + +## Additional notes + +This parser _could_ work with other C header files if mentioned constraints are followed. + +This parser **does not require `` library**, all data is parsed directly from char buffers. + +### LICENSE: zlib/libpng + +raylib-parser is licensed under an unmodified zlib/libpng license, which is an OSI-certified, +BSD-like license that allows static linking with closed source software: + +Copyright (c) 2021 Ramon Santamaria (@raysan5) \ No newline at end of file diff --git a/parser/raylib_parser.c b/parser/raylib_parser.c new file mode 100644 index 000000000..751e0cada --- /dev/null +++ b/parser/raylib_parser.c @@ -0,0 +1,807 @@ +/********************************************************************************************** + + raylib parser - raylib header parser + + This parser scans raylib.h to get information about structs, enums and functions. + All data is separated into parts, usually as strings. The following types are used for data: + + - struct FunctionInfo + - struct StructInfo + - struct EnumInfo + + CONSTRAINTS: + + This parser is specifically designed to work with raylib.h, so, it has some constraints: + + - Functions are expected as a single line with the following structure: + + ( , ); + + Be careful with functions broken into several lines, it breaks the process! + + - Structures are expected as several lines with the following form: + + + typedef struct { + ; + ; + ; + } ; + + - Enums are expected as several lines with the following form: + + + typedef enum { + = , + , + , + + } ; + + NOTE: Multiple options are supported: + - If value is not provided, ( + 1) is assigned + - Value description can be provided or not + + This parser could work with other C header files if mentioned constraints are followed. + + This parser does not require library, all data is parsed directly from char buffers. + + LICENSE: zlib/libpng + + raylib-parser is licensed under an unmodified zlib/libpng license, which is an OSI-certified, + BSD-like license that allows static linking with closed source software: + + Copyright (c) 2021 Ramon Santamaria (@raysan5) + +**********************************************************************************************/ + +#include // Required for: malloc(), calloc(), realloc(), free(), atoi(), strtol() +#include // Required for: printf(), fopen(), fseek(), ftell(), fread(), fclose() +#include // Required for: bool + +#define MAX_FUNCS_TO_PARSE 512 // Maximum number of functions to parse +#define MAX_STRUCTS_TO_PARSE 64 // Maximum number of structures to parse +#define MAX_ENUMS_TO_PARSE 64 // Maximum number of enums to parse + +#define MAX_LINE_LENGTH 512 // Maximum length of one line (including comments) +#define MAX_STRUCT_LINE_LENGTH 2048 // Maximum length of one struct (multiple lines) + +enum OutputFormat { PlainText, JSON }; // Which format the header information should be in + +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- +// Function info data +typedef struct FunctionInfo { + char name[64]; // Function name + char desc[128]; // Function description (comment at the end) + char retType[32]; // Return value type + int paramCount; // Number of function parameters + char paramType[12][32]; // Parameters type (max: 12 parameters) + char paramName[12][32]; // Parameters name (max: 12 parameters) +} FunctionInfo; + +// Struct info data +typedef struct StructInfo { + char name[64]; // Struct name + char desc[64]; // Struct type description + int fieldCount; // Number of fields in the struct + char fieldType[16][32]; // Field type (max: 16 fields) + char fieldName[16][32]; // Field name (max: 16 fields) + char fieldDesc[16][128]; // Field description (max: 16 fields) +} StructInfo; + +// Enum info data +typedef struct EnumInfo { + char name[64]; // Enum name + char desc[64]; // Enum description + int valueCount; // Number of values in enumerator + char valueName[128][64]; // Value name definition (max: 128 values) + int valueInteger[128]; // Value integer (max: 128 values) + char valueDesc[128][64]; // Value description (max: 128 values) +} EnumInfo; + +//---------------------------------------------------------------------------------- +// Module Functions Declaration +//---------------------------------------------------------------------------------- +char *LoadFileText(const char *fileName, int *length); +char **GetTextLines(const char *buffer, int length, int *linesCount); +void GetDataTypeAndName(const char *typeName, int typeNameLen, char *type, char *name); +bool IsTextEqual(const char *text1, const char *text2, unsigned int count); +void MemoryCopy(void *dest, const void *src, unsigned int count); +char* CharReplace(char* text, char search, char replace); + +// Main entry point +int main(int argc, char* argv[]) +{ + // Help + if (IsTextEqual(argv[1], "--help", 6)) { + printf("Usage:\n"); + printf(" raylib_parser [--json]\n"); + return 0; + } + + // Allow changing the output format. + int outputFormat = 0; + if (IsTextEqual(argv[1], "--json", 6)) { + outputFormat = JSON; + } + + int length = 0; + char *buffer = LoadFileText("../src/raylib.h", &length); + + // Preprocess buffer to get separate lines + // NOTE: GetTextLines() also removes leading spaces/tabs + int linesCount = 0; + char **lines = GetTextLines(buffer, length, &linesCount); + + // Print buffer lines + //for (int i = 0; i < linesCount; i++) printf("_%s_\n", lines[i]); + + // Function lines pointers, selected from buffer "lines" + int funcCount = 0; + char **funcLines = (char **)malloc(MAX_FUNCS_TO_PARSE*sizeof(char *)); + + // Structs data (multiple lines), selected from "buffer" + int structCount = 0; + char **structLines = (char **)malloc(MAX_STRUCTS_TO_PARSE*sizeof(char *)); + for (int i = 0; i < MAX_STRUCTS_TO_PARSE; i++) structLines[i] = (char *)calloc(MAX_STRUCT_LINE_LENGTH, sizeof(char)); + + // Enums lines pointers, selected from buffer "lines" + int enumCount = 0; + int *enumLines = (int *)malloc(MAX_ENUMS_TO_PARSE*sizeof(int)); + + // Prepare required lines for parsing + //-------------------------------------------------------------------------------------------------- + + // Read function lines + for (int i = 0; i < linesCount; i++) + { + // Read function line (starting with "RLAPI") + if (IsTextEqual(lines[i], "RLAPI", 5)) + { + // Keep a pointer to the function line + funcLines[funcCount] = lines[i]; + funcCount++; + } + } + + // Print function lines + //for (int i = 0; i < funcCount; i++) printf("%s\n", funcLines[i]); + + // Read structs data (multiple lines, read directly from buffer) + // TODO: Parse structs data from "lines" instead of "buffer" -> Easier to get struct definition + for (int i = 0; i < length; i++) + { + // Read struct data (starting with "typedef struct", ending with '} ... ;') + // NOTE: We read it directly from buffer + if (IsTextEqual(buffer + i, "typedef struct", 14)) + { + int j = 0; + bool validStruct = false; + + // WARNING: Typedefs between types: typedef Vector4 Quaternion; + + for (int c = 0; c < 128; c++) + { + if (buffer[i + c] == '{') + { + validStruct = true; + break; + } + else if (buffer[i + c] == ';') + { + // Not valid struct: + // i.e typedef struct rAudioBuffer rAudioBuffer; -> Typedef and forward declaration + i += c; + break; + } + } + + if (validStruct) + { + while (buffer[i + j] != '}') + { + structLines[structCount][j] = buffer[i + j]; + j++; + } + + while (buffer[i + j] != '}') + { + structLines[structCount][j] = buffer[i + j]; + j++; + } + + while (buffer[i + j] != '\n') + { + structLines[structCount][j] = buffer[i + j]; + j++; + } + + i += j; + structCount++; + } + } + } + + // Read enum lines + for (int i = 0; i < linesCount; i++) + { + // Read function line (starting with "RLAPI") + if (IsTextEqual(lines[i], "typedef enum {", 14)) + { + // Keep the line position in the array of lines, + // so, we can scan that position and following lines + enumLines[enumCount] = i; + enumCount++; + } + } + + // At this point we have all raylib structs, enums, functions lines data to start parsing + + free(buffer); // Unload text buffer + + // Parsing raylib data + //-------------------------------------------------------------------------------------------------- + + // Structs info data + StructInfo *structs = (StructInfo *)calloc(MAX_STRUCTS_TO_PARSE, sizeof(StructInfo)); + + for (int i = 0; i < structCount; i++) + { + int structLineOffset = 0; + + // Get struct name: typedef struct name { + for (int c = 15; c < 64 + 15; c++) + { + if (structLines[i][c] == '{') + { + structLineOffset = c + 2; + + MemoryCopy(structs[i].name, &structLines[i][15], c - 15 - 1); + break; + } + } + + // Get struct fields and count them -> fields finish with ; + int j = 0; + while (structLines[i][structLineOffset + j] != '}') + { + // WARNING: Some structs have empty spaces and comments -> OK, processed + + int fieldStart = 0; + if ((structLines[i][structLineOffset + j] != ' ') && (structLines[i][structLineOffset + j] != '\n')) fieldStart = structLineOffset + j; + + if (fieldStart != 0) + { + // Scan one field line + int c = 0; + int fieldEndPos = 0; + char fieldLine[256] = { 0 }; + + while (structLines[i][structLineOffset + j] != '\n') + { + if (structLines[i][structLineOffset + j] == ';') fieldEndPos = c; + fieldLine[c] = structLines[i][structLineOffset + j]; + c++; j++; + } + + if (fieldLine[0] != '/') // Field line is not a comment + { + //printf("Struct field: %s_\n", fieldLine); // OK! + + // Get struct field type and name + GetDataTypeAndName(fieldLine, fieldEndPos, structs[i].fieldType[structs[i].fieldCount], structs[i].fieldName[structs[i].fieldCount]); + + // Get the field description + // We start skipping spaces in front of description comment + int descStart = fieldEndPos; + while ((fieldLine[descStart] != '/') && (fieldLine[descStart] != '\0')) descStart++; + + int k = 0; + while ((fieldLine[descStart + k] != '\0') && (fieldLine[descStart + k] != '\n')) + { + structs[i].fieldDesc[structs[i].fieldCount][k] = fieldLine[descStart + k]; + k++; + } + + structs[i].fieldCount++; + } + } + + j++; + } + + } + + for (int i = 0; i < MAX_STRUCTS_TO_PARSE; i++) free(structLines[i]); + free(structLines); + + // Enum info data + EnumInfo *enums = (EnumInfo *)calloc(MAX_ENUMS_TO_PARSE, sizeof(EnumInfo)); + + for (int i = 0; i < enumCount; i++) + { + // TODO: Get enum description from lines[enumLines[i] - 1] + + for (int j = 1; j < 256; j++) // Maximum number of lines following enum first line + { + char *linePtr = lines[enumLines[i] + j]; + + if ((linePtr[0] >= 'A') && (linePtr[0] <= 'Z')) + { + // Parse enum value line, possible options: + //ENUM_VALUE_NAME, + //ENUM_VALUE_NAME + //ENUM_VALUE_NAME = 99 + //ENUM_VALUE_NAME = 99, + //ENUM_VALUE_NAME = 0x00000040, // Value description + + // We start reading the value name + int c = 0; + while ((linePtr[c] != ',') && + (linePtr[c] != ' ') && + (linePtr[c] != '=') && + (linePtr[c] != '\0')) { enums[i].valueName[enums[i].valueCount][c] = linePtr[c]; c++; } + + // After the name we can have: + // '=' -> value is provided + // ',' -> value is equal to previous + 1, there could be a description if not '\0' + // ' ' -> value is equal to previous + 1, there could be a description if not '\0' + // '\0' -> value is equal to previous + 1 + + // Let's start checking if the line is not finished + if ((linePtr[c] != ',') && (linePtr[c] != '\0')) + { + // Two options: + // '=' -> value is provided + // ' ' -> value is equal to previous + 1, there could be a description if not '\0' + bool foundValue = false; + while (linePtr[c] != '\0') + { + if (linePtr[c] == '=') { foundValue = true; break; } + c++; + } + + if (foundValue) + { + if (linePtr[c + 1] == ' ') c += 2; + else c++; + + // Parse integer value + int n = 0; + char integer[16] = { 0 }; + + while ((linePtr[c] != ',') && (linePtr[c] != ' ') && (linePtr[c] != '\0')) + { + integer[n] = linePtr[c]; + c++; n++; + } + + if (integer[1] == 'x') enums[i].valueInteger[enums[i].valueCount] = (int)strtol(integer, NULL, 16); + else enums[i].valueInteger[enums[i].valueCount] = atoi(integer); + } + else enums[i].valueInteger[enums[i].valueCount] = (enums[i].valueInteger[enums[i].valueCount - 1] + 1); + + // TODO: Parse value description if any + } + else enums[i].valueInteger[enums[i].valueCount] = (enums[i].valueInteger[enums[i].valueCount - 1] + 1); + + enums[i].valueCount++; + } + else if (linePtr[0] == '}') + { + // Get enum name from typedef + int c = 0; + while (linePtr[2 + c] != ';') { enums[i].name[c] = linePtr[2 + c]; c++; } + + break; // Enum ended, break for() loop + } + } + } + + // Functions info data + FunctionInfo *funcs = (FunctionInfo *)calloc(MAX_FUNCS_TO_PARSE, sizeof(FunctionInfo)); + + for (int i = 0; i < funcCount; i++) + { + int funcParamsStart = 0; + int funcEnd = 0; + + // Get return type and function name from func line + for (int c = 0; (c < MAX_LINE_LENGTH) && (funcLines[i][c] != '\n'); c++) + { + if (funcLines[i][c] == '(') // Starts function parameters + { + funcParamsStart = c + 1; + + // At this point we have function return type and function name + char funcRetTypeName[128] = { 0 }; + int funcRetTypeNameLen = c - 6; // Substract "RLAPI " + MemoryCopy(funcRetTypeName, &funcLines[i][6], funcRetTypeNameLen); + + GetDataTypeAndName(funcRetTypeName, funcRetTypeNameLen, funcs[i].retType, funcs[i].name); + break; + } + } + + // Get parameters from func line + for (int c = funcParamsStart; c < MAX_LINE_LENGTH; c++) + { + if (funcLines[i][c] == ',') // Starts function parameters + { + // Get parameter type + name, extract info + char funcParamTypeName[128] = { 0 }; + int funcParamTypeNameLen = c - funcParamsStart; + MemoryCopy(funcParamTypeName, &funcLines[i][funcParamsStart], funcParamTypeNameLen); + + GetDataTypeAndName(funcParamTypeName, funcParamTypeNameLen, funcs[i].paramType[funcs[i].paramCount], funcs[i].paramName[funcs[i].paramCount]); + + funcParamsStart = c + 1; + if (funcLines[i][c + 1] == ' ') funcParamsStart += 1; + funcs[i].paramCount++; // Move to next parameter + } + else if (funcLines[i][c] == ')') + { + funcEnd = c + 2; + + // Check if previous word is void + if ((funcLines[i][c - 4] == 'v') && (funcLines[i][c - 3] == 'o') && (funcLines[i][c - 2] == 'i') && (funcLines[i][c - 1] == 'd')) break; + + // Get parameter type + name, extract info + char funcParamTypeName[128] = { 0 }; + int funcParamTypeNameLen = c - funcParamsStart; + MemoryCopy(funcParamTypeName, &funcLines[i][funcParamsStart], funcParamTypeNameLen); + + GetDataTypeAndName(funcParamTypeName, funcParamTypeNameLen, funcs[i].paramType[funcs[i].paramCount], funcs[i].paramName[funcs[i].paramCount]); + + funcs[i].paramCount++; // Move to next parameter + break; + } + } + + // Get function description + for (int c = funcEnd; c < MAX_LINE_LENGTH; c++) + { + if (funcLines[i][c] == '/') + { + MemoryCopy(funcs[i].desc, &funcLines[i][c], 127); // WARNING: Size could be too long for funcLines[i][c]? + break; + } + } + } + + for (int i = 0; i < linesCount; i++) free(lines[i]); + free(lines); + free(funcLines); + + // At this point, all raylib data has been parsed! + //----------------------------------------------------------------------------------------- + // structs[] -> We have all the structs decomposed into pieces for further analysis + // enums[] -> We have all the enums decomposed into pieces for further analysis + // funcs[] -> We have all the functions decomposed into pieces for further analysis + + // Print structs info + switch (outputFormat) + { + case PlainText: { + printf("\nStructures found: %i\n\n", structCount); + for (int i = 0; i < structCount; i++) + { + printf("Struct %02i: %s (%i fields)\n", i + 1, structs[i].name, structs[i].fieldCount); + //printf("Description: %s\n", structs[i].desc); + for (int f = 0; f < structs[i].fieldCount; f++) printf(" Fields %i: %s %s %s\n", f + 1, structs[i].fieldType[f], structs[i].fieldName[f], structs[i].fieldDesc[f]); + } + + // Print enums info + printf("\nEnums found: %i\n\n", enumCount); + for (int i = 0; i < enumCount; i++) + { + printf("Enum %02i: %s (%i values)\n", i + 1, enums[i].name, enums[i].valueCount); + //printf("Description: %s\n", enums[i].desc); + for (int e = 0; e < enums[i].valueCount; e++) printf(" Value %s: %i\n", enums[i].valueName[e], enums[i].valueInteger[e]); + } + + // Print function info + printf("\nFunctions found: %i\n\n", funcCount); + for (int i = 0; i < funcCount; i++) + { + printf("Function %03i: %s() (%i input parameters)\n", i + 1, funcs[i].name, funcs[i].paramCount); + printf(" Description: %s\n", funcs[i].desc); + printf(" Return type: %s\n", funcs[i].retType); + for (int p = 0; p < funcs[i].paramCount; p++) printf(" Param %i: %s (type: %s)\n", p + 1, funcs[i].paramName[p], funcs[i].paramType[p]); + if (funcs[i].paramCount == 0) printf(" No input parameters\n"); + } + } break; + case JSON: { + printf("{\n"); + printf(" \"structs\": [\n"); + for (int i = 0; i < structCount; i++) + { + printf(" {\n"); + printf(" \"name\": \"%s\",\n", structs[i].name); + printf(" \"description\": \"%s\",\n", structs[i].desc); + printf(" \"fields\": [\n"); + for (int f = 0; f < structs[i].fieldCount; f++) + { + printf(" {\n"); + printf(" \"name\": \"%s\",\n", structs[i].fieldName[f]), + printf(" \"type\": \"%s\",\n", structs[i].fieldType[f]), + printf(" \"description\": \"%s\"\n", structs[i].fieldDesc[f] + 3), + printf(" }"); + if (f < structs[i].fieldCount - 1) + printf(",\n"); + else + printf("\n"); + } + printf(" ]\n"); + printf(" }"); + if (i < structCount - 1) + printf(",\n"); + else + printf("\n"); + } + printf(" ],\n"); + + // Print enums info + printf(" \"enums\": [\n"); + for (int i = 0; i < enumCount; i++) + { + printf(" {\n"); + printf(" \"name\": \"%s\",\n", enums[i].name); + printf(" \"description\": \"%s\",\n", enums[i].desc + 3); + printf(" \"values\": [\n"); + for (int e = 0; e < enums[i].valueCount; e++) + { + printf(" {\n"); + printf(" \"name\": \"%s\",\n", enums[i].valueName[e]), + printf(" \"value\": %i,\n", enums[i].valueInteger[e]), + printf(" \"description\": \"%s\"\n", enums[i].valueDesc[e] + 3), + printf(" }"); + if (e < enums[i].valueCount - 1) + printf(",\n"); + else + printf("\n"); + } + printf(" ]\n"); + printf(" }"); + if (i < enumCount - 1) + printf(",\n"); + else + printf("\n"); + } + printf(" ],\n"); + + // Print function info + printf(" \"functions\": [\n"); + for (int i = 0; i < funcCount; i++) + { + printf(" {\n"); + printf(" \"name\": \"%s\",\n", funcs[i].name); + printf(" \"description\": \"%s\",\n", CharReplace(funcs[i].desc, '\\', ' ') + 3); + printf(" \"returnType\": \"%s\"", funcs[i].retType); + + if (funcs[i].paramCount == 0) + printf("\n"); + else + { + printf(",\n \"params\": {\n"); + for (int p = 0; p < funcs[i].paramCount; p++) + { + printf(" \"%s\": \"%s\"", funcs[i].paramName[p], funcs[i].paramType[p]); + if (p < funcs[i].paramCount - 1) + printf(",\n"); + else + printf("\n"); + } + printf(" }\n"); + } + printf(" }"); + + if (i < funcCount - 1) + printf(",\n"); + else + printf("\n"); + } + printf(" ]\n"); + printf("}\n"); + } break; + } + + free(funcs); + free(structs); + free(enums); +} + +//---------------------------------------------------------------------------------- +// Module Functions Definition +//---------------------------------------------------------------------------------- + +// Load text data from file, returns a '\0' terminated string +// NOTE: text chars array should be freed manually +char *LoadFileText(const char *fileName, int *length) +{ + char *text = NULL; + + if (fileName != NULL) + { + FILE *file = fopen(fileName, "rt"); + + if (file != NULL) + { + // WARNING: When reading a file as 'text' file, + // text mode causes carriage return-linefeed translation... + // ...but using fseek() should return correct byte-offset + fseek(file, 0, SEEK_END); + int size = ftell(file); + fseek(file, 0, SEEK_SET); + + if (size > 0) + { + *length = size; + + text = (char *)calloc((size + 1), sizeof(char)); + unsigned int count = (unsigned int)fread(text, sizeof(char), size, file); + + // WARNING: \r\n is converted to \n on reading, so, + // read bytes count gets reduced by the number of lines + if (count < (unsigned int)size) text = realloc(text, count + 1); + + // Zero-terminate the string + text[count] = '\0'; + } + + fclose(file); + } + } + + return text; +} + +// Get all lines from a text buffer (expecting lines ending with '\n') +char **GetTextLines(const char *buffer, int length, int *linesCount) +{ + //#define MAX_LINE_LENGTH 512 + + // Get the number of lines in the text + int count = 0; + for (int i = 0; i < length; i++) if (buffer[i] == '\n') count++; + + //printf("Number of text lines in buffer: %i\n", count); + + // Allocate as many pointers as lines + char **lines = (char **)malloc(count*sizeof(char **)); + + char *bufferPtr = (char *)buffer; + + for (int i = 0; (i < count) || (bufferPtr[0] != '\0'); i++) + { + lines[i] = (char *)calloc(MAX_LINE_LENGTH, sizeof(char)); + + // Remove line leading spaces + // Find last index of space/tab character + int index = 0; + while ((bufferPtr[index] == ' ') || (bufferPtr[index] == '\t')) index++; + + int j = 0; + while (bufferPtr[index + j] != '\n') + { + lines[i][j] = bufferPtr[index + j]; + j++; + } + + bufferPtr += (index + j + 1); + } + + *linesCount = count; + return lines; +} + +// Get data type and name from a string containing both +// NOTE: Useful to parse function parameters and struct fields +void GetDataTypeAndName(const char *typeName, int typeNameLen, char *type, char *name) +{ + for (int k = typeNameLen; k > 0; k--) + { + if (typeName[k] == ' ' && typeName[k - 1] != ',') + { + // Function name starts at this point (and ret type finishes at this point) + MemoryCopy(type, typeName, k); + MemoryCopy(name, typeName + k + 1, typeNameLen - k - 1); + break; + } + else if (typeName[k] == '*') + { + MemoryCopy(type, typeName, k + 1); + MemoryCopy(name, typeName + k + 1, typeNameLen - k - 1); + break; + } + } +} + +// Custom memcpy() to avoid +void MemoryCopy(void *dest, const void *src, unsigned int count) +{ + char *srcPtr = (char *)src; + char *destPtr = (char *)dest; + + for (unsigned int i = 0; i < count; i++) destPtr[i] = srcPtr[i]; +} + +// Compare two text strings, requires number of characters to compare +bool IsTextEqual(const char *text1, const char *text2, unsigned int count) +{ + bool result = true; + + for (unsigned int i = 0; i < count; i++) + { + if (text1[i] != text2[i]) + { + result = false; + break; + } + } + + return result; +} + +// Search and replace a character within a string. +char* CharReplace(char* text, char search, char replace) +{ + for (int i = 0; text[i] != '\0'; i++) + if (text[i] == search) + text[i] = replace; + return text; +} + +/* +// Replace text string +// REQUIRES: strlen(), strstr(), strncpy(), strcpy() -> TODO: Replace by custom implementations! +// WARNING: Returned buffer must be freed by the user (if return != NULL) +char *TextReplace(char *text, const char *replace, const char *by) +{ + // Sanity checks and initialization + if (!text || !replace || !by) return NULL; + + char *result; + + char *insertPoint; // Next insert point + char *temp; // Temp pointer + int replaceLen; // Replace string length of (the string to remove) + int byLen; // Replacement length (the string to replace replace by) + int lastReplacePos; // Distance between replace and end of last replace + int count; // Number of replacements + + replaceLen = strlen(replace); + if (replaceLen == 0) return NULL; // Empty replace causes infinite loop during count + + byLen = strlen(by); + + // Count the number of replacements needed + insertPoint = text; + for (count = 0; (temp = strstr(insertPoint, replace)); count++) insertPoint = temp + replaceLen; + + // Allocate returning string and point temp to it + temp = result = (char *)malloc(strlen(text) + (byLen - replaceLen)*count + 1); + + if (!result) return NULL; // Memory could not be allocated + + // First time through the loop, all the variable are set correctly from here on, + // - 'temp' points to the end of the result string + // - 'insertPoint' points to the next occurrence of replace in text + // - 'text' points to the remainder of text after "end of replace" + while (count--) + { + insertPoint = strstr(text, replace); + lastReplacePos = (int)(insertPoint - text); + temp = strncpy(temp, text, lastReplacePos) + lastReplacePos; + temp = strcpy(temp, by) + byLen; + text += lastReplacePos + replaceLen; // Move to next "end of replace" + } + + // Copy remaind text part after replacement to result (pointed by moving temp) + strcpy(temp, text); + + return result; +} +*/ \ No newline at end of file diff --git a/projects/4coder/Makefile b/projects/4coder/Makefile index 40a1e230a..7ba7bc3f7 100644 --- a/projects/4coder/Makefile +++ b/projects/4coder/Makefile @@ -25,8 +25,7 @@ # Define required raylib variables PROJECT_NAME ?= game -RAYLIB_VERSION ?= 2.5.0 -RAYLIB_API_VERSION ?= 2 +RAYLIB_VERSION ?= 3.7.0 RAYLIB_PATH ?= ..\.. # Define default options diff --git a/projects/CMake/CMakeLists.txt b/projects/CMake/CMakeLists.txt index 496577e92..0876f0d55 100644 --- a/projects/CMake/CMakeLists.txt +++ b/projects/CMake/CMakeLists.txt @@ -34,4 +34,11 @@ add_executable(${PROJECT_NAME} core_basic_window.c) #set(raylib_VERBOSE 1) target_link_libraries(${PROJECT_NAME} raylib) +# Checks if OSX and links appropriate frameworks (Only required on MacOS) +if (APPLE) + target_link_libraries(${PROJECT_NAME} "-framework IOKit") + target_link_libraries(${PROJECT_NAME} "-framework Cocoa") + target_link_libraries(${PROJECT_NAME} "-framework OpenGL") +endif() + # That's it! You should have an example executable that you can run. Have fun! diff --git a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml index a902a93a0..2c8bafb5e 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml +++ b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml @@ -109,18 +109,21 @@ + + + - + - + @@ -215,6 +218,22 @@ + + + + + + + + + + + + + + + + @@ -226,6 +245,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -281,59 +383,79 @@ - + + + + + + + + + + + + - - - - - - - - - - - - - - - - + - + + + + + + + + - - - + + + + + + - - - - + + + + + + + + + + + + + + + + + + @@ -386,7 +508,7 @@ - + @@ -570,6 +692,11 @@ + + + + + @@ -622,9 +749,6 @@ - - - @@ -649,7 +773,7 @@ - + @@ -723,6 +847,15 @@ + + + + + + + + + @@ -770,6 +903,15 @@ + + + + + + + + + @@ -789,8 +931,8 @@ - - + + @@ -799,8 +941,8 @@ - - + + @@ -852,8 +994,8 @@ - - + + @@ -863,8 +1005,8 @@ - - + + @@ -1096,7 +1238,7 @@ - + @@ -1516,7 +1658,7 @@ - + @@ -1566,13 +1708,13 @@ - + - + @@ -1649,6 +1791,16 @@ + + + + + + + + + + @@ -1745,7 +1897,7 @@ - + @@ -1788,7 +1940,7 @@ - + @@ -2142,11 +2294,6 @@ - - - - - @@ -2175,14 +2322,29 @@ - - - - + + + + + + + + + + + + + + + + + + + - + @@ -2209,7 +2371,7 @@ - + @@ -2242,6 +2404,12 @@ + + + + + + @@ -2250,6 +2418,11 @@ + + + + + @@ -2337,11 +2510,6 @@ - - - - - @@ -2477,190 +2645,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2688,7 +2672,7 @@ - + @@ -2820,6 +2804,13 @@ + + + + + + + @@ -2830,6 +2821,11 @@ + + + + + @@ -2850,11 +2846,6 @@ - - - - - diff --git a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h index 20080f495..8079f5c78 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +++ b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h @@ -30,9 +30,10 @@ RLAPI void *GetWindowHandle(void); // Get native RLAPI int GetScreenWidth(void); // Get current screen width RLAPI int GetScreenHeight(void); // Get current screen height RLAPI int GetMonitorCount(void); // Get number of connected monitors +RLAPI int GetCurrentMonitor(void); // Get current connected monitor RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position -RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width -RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height +RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width (max available by monitor) +RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height (max available by monitor) RLAPI int GetMonitorPhysicalWidth(int monitor); // Get specified monitor physical width in millimetres RLAPI int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres RLAPI int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate @@ -60,8 +61,30 @@ RLAPI void BeginMode3D(Camera3D camera); // Initializes RLAPI void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode RLAPI void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing RLAPI void EndTextureMode(void); // Ends drawing to render texture +RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing +RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) +RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) +RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) RLAPI void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) RLAPI void EndScissorMode(void); // End scissor mode +RLAPI void BeginVrStereoMode(VrStereoConfig config); // Begin stereo rendering (requires VR simulator) +RLAPI void EndVrStereoMode(void); // End stereo rendering (requires VR simulator) + +// VR stereo config functions for VR simulator +RLAPI VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device); // Load VR stereo config for VR simulator device parameters +RLAPI void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR stereo config + +// Shader management functions +// NOTE: Shader functionality is not available on OpenGL 1.1 +RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations +RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations +RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location +RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location +RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value +RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector +RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4) +RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d) +RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) // Screen-space-related functions RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position @@ -75,21 +98,27 @@ RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Returns // Timing-related functions RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) RLAPI int GetFPS(void); // Returns current FPS -RLAPI float GetFrameTime(void); // Returns time in seconds for last frame drawn +RLAPI float GetFrameTime(void); // Returns time in seconds for last frame drawn (delta time) RLAPI double GetTime(void); // Returns elapsed time in seconds since InitWindow() // Misc. functions +RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included) +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 SetTraceLogLevel(int logType); // Set the current threshold (minimum) log level -RLAPI void SetTraceLogExit(int logType); // Set the exit threshold (minimum) log level -RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging -RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR) - +RLAPI void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR) +RLAPI void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level RLAPI void *MemAlloc(int size); // Internal memory allocator +RLAPI void *MemRealloc(void *ptr, int size); // Internal memory reallocator RLAPI void MemFree(void *ptr); // Internal memory free -RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png) -RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included) + +// Set custom callbacks +// WARNING: Callbacks setup is intended for advance users +RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log +RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader +RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver +RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader +RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver // Files management functions RLAPI unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read) @@ -100,8 +129,8 @@ RLAPI void UnloadFileText(unsigned char *text); // Unload file RLAPI bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success RLAPI bool FileExists(const char *fileName); // Check if file exists RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists -RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension (including point: .png, .wav) -RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (including point: ".png") +RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (including point: .png, .wav) +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) @@ -148,6 +177,7 @@ RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gam RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed RLAPI int GetGamepadAxisCount(int gamepad); // Return gamepad axis count for a gamepad RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis +RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) // Input-related functions: mouse RLAPI bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once @@ -161,7 +191,6 @@ RLAPI void SetMousePosition(int x, int y); // Set mouse posit RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling RLAPI float GetMouseWheelMove(void); // Returns mouse wheel movement Y -RLAPI int GetMouseCursor(void); // Returns mouse cursor if (MouseCursor enum) RLAPI void SetMouseCursor(int cursor); // Set mouse cursor // Input-related functions: touch @@ -172,30 +201,34 @@ RLAPI Vector2 GetTouchPosition(int index); // Returns touch p //------------------------------------------------------------------------------------ // Gestures and Touch Handling Functions (Module: gestures) //------------------------------------------------------------------------------------ -RLAPI void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags -RLAPI bool IsGestureDetected(int gesture); // Check if a gesture have been detected -RLAPI int GetGestureDetected(void); // Get latest detected gesture -RLAPI int GetTouchPointsCount(void); // Get touch points count -RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds -RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector -RLAPI float GetGestureDragAngle(void); // Get gesture drag angle -RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta -RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle +RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags +RLAPI bool IsGestureDetected(int gesture); // Check if a gesture have been detected +RLAPI int GetGestureDetected(void); // Get latest detected gesture +RLAPI int GetTouchPointsCount(void); // Get touch points count +RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds +RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector +RLAPI float GetGestureDragAngle(void); // Get gesture drag angle +RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta +RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle //------------------------------------------------------------------------------------ // Camera System Functions (Module: camera) //------------------------------------------------------------------------------------ -RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) -RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode +RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) +RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode -RLAPI void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera) -RLAPI void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera) -RLAPI void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera) +RLAPI void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera) +RLAPI void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera) +RLAPI void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera) RLAPI void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown); // Set camera move controls (1st person and 3rd person cameras) //------------------------------------------------------------------------------------ // Basic Shapes Drawing Functions (Module: shapes) //------------------------------------------------------------------------------------ +// 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 // Basic shapes drawing functions RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel @@ -204,23 +237,24 @@ RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Colo RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out +RLAPI void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color); //Draw line using quadratic bezier curves with a control point RLAPI void DrawLineStrip(Vector2 *points, int pointsCount, Color color); // Draw lines sequence RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle -RLAPI void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw a piece of a circle -RLAPI void DrawCircleSectorLines(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw circle sector outline +RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle +RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline -RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring -RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring outline +RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring +RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters -RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle -RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle +RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a vertical-gradient-filled rectangle +RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a horizontal-gradient-filled rectangle RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline RLAPI void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color); // Draw rectangle outline with extended parameters @@ -252,7 +286,7 @@ RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) -RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. "png" +RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. ".png" RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) RLAPI bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success @@ -321,7 +355,7 @@ RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 posi // NOTE: These functions require GPU access RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data -RLAPI TextureCubemap LoadTextureCubemap(Image image, int layoutType); // Load cubemap from image, multiple image cubemap layouts supported +RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) @@ -332,18 +366,19 @@ RLAPI Image GetScreenData(void); // Texture configuration functions RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture -RLAPI void SetTextureFilter(Texture2D texture, int filterMode); // Set texture scaling filter mode -RLAPI void SetTextureWrap(Texture2D texture, int wrapMode); // Set texture wrapping mode +RLAPI void SetTextureFilter(Texture2D texture, int filter); // Set texture scaling filter mode +RLAPI void SetTextureWrap(Texture2D texture, int wrap); // Set texture wrapping mode // Texture drawing functions RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters -RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle +RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle RLAPI void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters -RLAPI void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. -RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters -RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely +RLAPI void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. +RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters +RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely +RLAPI void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointsCount, Color tint); // Draw a textured polygon // Color/pixel related functions RLAPI Color Fade(Color color, float alpha); // Returns color with alpha applied, alpha goes from 0.0f to 1.0f @@ -368,18 +403,17 @@ RLAPI Font GetFontDefault(void); RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCount); // Load font from file with extended parameters RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) -RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount); // 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, int *fontChars, int charsCount); // Load font from memory buffer, fileType refers to extension: i.e. ".ttf" RLAPI CharInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount, int type); // Load font data for further use RLAPI Image GenImageFontAtlas(const CharInfo *chars, Rectangle **recs, int charsCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info RLAPI void UnloadFontData(CharInfo *chars, int charsCount); // Unload font chars info data (RAM) RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM) // Text drawing functions -RLAPI void DrawFPS(int posX, int posY); // Shows current FPS +RLAPI void DrawFPS(int posX, int posY); // Draw current FPS RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters RLAPI void DrawTextRec(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); // Draw text using font inside rectangle limits -RLAPI void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectTint, Color selectBackTint); // Draw text using font inside rectangle limits with support for text selection RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) // Text misc. functions @@ -435,53 +469,55 @@ RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBott RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) -RLAPI void DrawGizmo(Vector3 position); // Draw simple gizmo //------------------------------------------------------------------------------------ // Model 3d Loading and Drawing Functions (Module: models) //------------------------------------------------------------------------------------ // Model loading/unloading functions -RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) -RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) -RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) -RLAPI void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM) +RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) +RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) +RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) +RLAPI void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM) // Mesh loading/unloading functions -RLAPI Mesh *LoadMeshes(const char *fileName, int *meshCount); // Load meshes from model file -RLAPI void UnloadMesh(Mesh mesh); // Unload mesh from memory (RAM and/or VRAM) -RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success +RLAPI void UploadMesh(Mesh *mesh, bool dynamic); // Upload vertex data into GPU and provided VAO/VBO ids +RLAPI void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform +RLAPI void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms +RLAPI void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU +RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success // Material loading/unloading functions -RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file -RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) -RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) -RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) -RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh +RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file +RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) +RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) +RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) +RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh // Model animations loading/unloading functions -RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animsCount); // Load model animations from file -RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose -RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data -RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match +RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animsCount); // Load model animations from file +RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose +RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data +RLAPI void UnloadModelAnimations(ModelAnimation* animations, unsigned int count); // Unload animation array data +RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match // Mesh generation functions -RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh -RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) -RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh -RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) -RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) -RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh -RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh -RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh -RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data -RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data +RLAPI Mesh GenMeshDefault(int vertexCount); // Generate an empty mesh with vertex: position, texcoords, normals, colors +RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh +RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) +RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh +RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) +RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) +RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh +RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh +RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh +RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data +RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data // Mesh manipulation functions -RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits -RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents -RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals -RLAPI void MeshNormalsSmooth(Mesh *mesh); // Smooth (average) vertex normals +RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits +RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents +RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals // Model drawing functions RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) @@ -504,57 +540,6 @@ RLAPI RayHitInfo GetCollisionRayModel(Ray ray, Model model); RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane) -//------------------------------------------------------------------------------------ -// Shaders System Functions (Module: rlgl) -// NOTE: This functions are useless when using OpenGL 1.1 -//------------------------------------------------------------------------------------ - -// Shader loading/unloading functions -RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations -RLAPI Shader LoadShaderCode(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations -RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) - -RLAPI Shader GetShaderDefault(void); // Get default shader -RLAPI Texture2D GetTextureDefault(void); // Get default texture -RLAPI Texture2D GetShapesTexture(void); // Get texture to draw shapes -RLAPI Rectangle GetShapesTextureRec(void); // Get texture rectangle to draw shapes -RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Define default texture used to draw shapes - -// Shader configuration functions -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 uniformLoc, const void *value, int uniformType); // Set shader uniform value -RLAPI void SetShaderValueV(Shader shader, int uniformLoc, const void *value, int uniformType, int count); // Set shader uniform value vector -RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) -RLAPI void SetShaderValueTexture(Shader shader, int uniformLoc, Texture2D texture); // Set shader uniform value for texture -RLAPI void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) -RLAPI void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) -RLAPI Matrix GetMatrixModelview(void); // Get internal modelview matrix -RLAPI Matrix GetMatrixProjection(void); // Get internal projection matrix - -// Texture maps generation (PBR) -// NOTE: Required shaders should be provided -RLAPI TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int size, int format); // Generate cubemap texture from 2D panorama texture -RLAPI TextureCubemap GenTextureIrradiance(Shader shader, TextureCubemap cubemap, int size); // Generate irradiance texture using cubemap data -RLAPI TextureCubemap GenTexturePrefilter(Shader shader, TextureCubemap cubemap, int size); // Generate prefilter texture using cubemap data -RLAPI Texture2D GenTextureBRDF(Shader shader, int size); // Generate BRDF texture - -// Shading begin/end functions -RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing -RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) -RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) -RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) - -// VR control functions -RLAPI void InitVrSimulator(void); // Init VR simulator for selected device parameters -RLAPI void CloseVrSimulator(void); // Close VR simulator for current device -RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera -RLAPI void SetVrConfiguration(VrDeviceInfo info, Shader distortion); // Set stereo rendering configuration parameters -RLAPI bool IsVrSimulatorReady(void); // Detect if VR simulator is ready -RLAPI void ToggleVrMode(void); // Enable/Disable VR experience -RLAPI void BeginVrDrawing(void); // Begin VR simulator stereo rendering -RLAPI void EndVrDrawing(void); // End VR simulator stereo rendering - //------------------------------------------------------------------------------------ // Audio Loading and Playing Functions (Module: audio) //------------------------------------------------------------------------------------ @@ -567,10 +552,10 @@ RLAPI void SetMasterVolume(float volume); // Set mas // Wave/Sound loading/unloading functions RLAPI Wave LoadWave(const char *fileName); // Load wave data from file -RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. "wav" +RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. ".wav" RLAPI Sound LoadSound(const char *fileName); // Load sound from file RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data -RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data +RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount); // Update sound buffer with new data RLAPI void UnloadWave(Wave wave); // Unload wave data RLAPI void UnloadSound(Sound sound); // Unload sound RLAPI bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success @@ -595,13 +580,14 @@ RLAPI void UnloadWaveSamples(float *samples); // Unload // Music management functions RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file +RLAPI Music LoadMusicStreamFromMemory(const char *fileType, unsigned char* data, int dataSize); // Load music stream from data RLAPI void UnloadMusicStream(Music music); // Unload music stream RLAPI void PlayMusicStream(Music music); // Start music playing +RLAPI bool IsMusicPlaying(Music music); // Check if music is playing RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming RLAPI void StopMusicStream(Music music); // Stop music playing RLAPI void PauseMusicStream(Music music); // Pause music playing RLAPI void ResumeMusicStream(Music music); // Resume playing paused music -RLAPI bool IsMusicPlaying(Music music); // Check if music is playing 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 float GetMusicTimeLength(Music music); // Get music time length (in seconds) diff --git a/projects/VS2017.UWP/raylib.App.UWP/App.cpp b/projects/VS2017.UWP/raylib.App.UWP/App.cpp index 05bad920a..d2a369d66 100644 --- a/projects/VS2017.UWP/raylib.App.UWP/App.cpp +++ b/projects/VS2017.UWP/raylib.App.UWP/App.cpp @@ -29,6 +29,20 @@ using namespace raylibUWP; #define MAX_GAMEPAD_BUTTONS 32 // Max bumber of buttons supported (per gamepad) #define MAX_GAMEPAD_AXIS 8 // Max number of axis supported (per gamepad) +// Gamepad bindings struct +struct GamepadBinding +{ + Gamepad^ Gamepad = nullptr; + bool Ready = false; +}; + +// Global variables +static int posX = 100; +static int posY = 100; +static int gTime = 0; +static bool mouseLocked = false; +static GamepadBinding gGamepadBindings[MAX_GAMEPADS]; + // The main function creates an IFrameworkViewSource for our app, and runs the app [Platform::MTAThread] int main(Platform::Array^) @@ -48,7 +62,7 @@ App::App() void App::Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView) { // Register event handlers for app lifecycle. This example includes Activated, so that we - // can make the CoreWindow active and start rendering on the window. + // can make the CoreWindow active and start rendering on the window. applicationView->Activated += ref new TypedEventHandler(this, &App::OnActivated); // Logic for other event handlers could go here. @@ -92,55 +106,38 @@ void App::SetWindow(Windows::UI::Core::CoreWindow^ window) void App::Load(Platform::String ^entryPoint) {} // Ignored for this example -static bool mouseLocked = false; void App::Run() { // Set up our UWP implementation - UWPSetQueryTimeFunc([]() - { - static auto timeStart = std::chrono::high_resolution_clock::now(); - std::chrono::duration time_span = std::chrono::duration_cast>(std::chrono::high_resolution_clock::now() - timeStart); - return time_span.count(); - }); + UWPSetQueryTimeFunc([]() { + static auto timeStart = std::chrono::high_resolution_clock::now(); + std::chrono::duration time_span = std::chrono::duration_cast>(std::chrono::high_resolution_clock::now() - timeStart); + return time_span.count(); }); UWPSetSleepFunc([](double seconds) { std::this_thread::sleep_for(std::chrono::duration(seconds)); }); - UWPSetDisplaySizeFunc([](int* width, int* height) - { - // Get display dimensions - DisplayInformation^ dInfo = DisplayInformation::GetForCurrentView(); - *width = dInfo->ScreenWidthInRawPixels; - *height = dInfo->ScreenHeightInRawPixels; - }); + UWPSetDisplaySizeFunc([](int* width, int* height) { + // Get display dimensions + DisplayInformation^ dInfo = DisplayInformation::GetForCurrentView(); + *width = dInfo->ScreenWidthInRawPixels; + *height = dInfo->ScreenHeightInRawPixels; }); - UWPSetMouseHideFunc([]() - { - CoreWindow::GetForCurrentThread()->PointerCursor = nullptr; - }); + UWPSetMouseHideFunc([]() { CoreWindow::GetForCurrentThread()->PointerCursor = nullptr; }); - UWPSetMouseShowFunc([]() - { - CoreWindow::GetForCurrentThread()->PointerCursor = ref new CoreCursor(CoreCursorType::Arrow, 0); - }); + UWPSetMouseShowFunc([]() { CoreWindow::GetForCurrentThread()->PointerCursor = ref new CoreCursor(CoreCursorType::Arrow, 0); }); - UWPSetMouseLockFunc([]() - { - CoreWindow::GetForCurrentThread()->PointerCursor = nullptr; - mouseLocked = true; - }); + UWPSetMouseLockFunc([]() { + CoreWindow::GetForCurrentThread()->PointerCursor = nullptr; + mouseLocked = true; }); - UWPSetMouseUnlockFunc([]() - { - CoreWindow::GetForCurrentThread()->PointerCursor = ref new CoreCursor(CoreCursorType::Arrow, 0); - mouseLocked = false; - }); + UWPSetMouseUnlockFunc([]() { + CoreWindow::GetForCurrentThread()->PointerCursor = ref new CoreCursor(CoreCursorType::Arrow, 0); + mouseLocked = false; }); - UWPSetMouseSetPosFunc([](int x, int y) - { - CoreWindow^ window = CoreWindow::GetForCurrentThread(); - Point mousePosScreen = Point(x + window->Bounds.X, y + window->Bounds.Y); - window->PointerPosition = mousePosScreen; - }); + UWPSetMouseSetPosFunc([](int x, int y) { + CoreWindow^ window = CoreWindow::GetForCurrentThread(); + Point mousePosScreen = Point(x + window->Bounds.X, y + window->Bounds.Y); + window->PointerPosition = mousePosScreen; }); // Set custom output handle SetTraceLogCallback([](int logType, const char* text, va_list args) @@ -165,7 +162,7 @@ void App::Run() }); // Create window - InitWindow(640, 480, "raylib game example"); + InitWindow(800, 450, "raylib UWP - Basic example"); // Run game loop while (!WindowShouldClose() && !mSuspended) @@ -175,8 +172,13 @@ void App::Run() PreProcessInputs(); GameLoop(); PostProcessInputs(); + CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); - } else CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending); + } + else + { + CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending); + } } CloseWindow(); @@ -187,17 +189,13 @@ void App::Uninitialize() // Do any UWP cleanup here. } -static int posX = 100; -static int posY = 100; -static int gTime = 0; - // This method is called every frame void App::GameLoop() { // Update //---------------------------------------------------------------------------------- - posX += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_X) * 5; - posY += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_Y) * -5; + posX += GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X) * 5; + posY += GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y) * -5; auto mPos = GetMousePosition(); @@ -233,7 +231,7 @@ void App::GameLoop() if (IsKeyDown(KEY_LEFT_ALT)) DrawRectangle(250, 250, 20, 20, BLACK); if (IsKeyDown(KEY_BACKSPACE)) DrawRectangle(280, 250, 20, 20, BLACK); - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) DrawRectangle(280, 250, 20, 20, BLACK); + if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) DrawRectangle(280, 250, 20, 20, BLACK); DrawRectangle(280, (int)pos + 50, 20, 20, BLACK); DrawRectangle(250, 280 + (gTime++ % 60), 10, 10, PURPLE); @@ -242,14 +240,6 @@ void App::GameLoop() //---------------------------------------------------------------------------------- } -struct GamepadBinding -{ - Gamepad^ Gamepad = nullptr; - bool Ready = false; -}; - -static GamepadBinding gGamepadBindings[MAX_GAMEPADS]; - void App::PreProcessInputs() { // Here, we will see if we have bound gamepads. If we do we check they are still present. If they aren't present we free the binding. @@ -408,9 +398,9 @@ void App::OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::C if (device->PointerDeviceType == Windows::Devices::Input::PointerDeviceType::Mouse) { - if (props->IsLeftButtonPressed) UWPMouseButtonEvent(MOUSE_LEFT_BUTTON, true); - if (props->IsMiddleButtonPressed) UWPMouseButtonEvent(MOUSE_MIDDLE_BUTTON, true); - if (props->IsRightButtonPressed) UWPMouseButtonEvent(MOUSE_RIGHT_BUTTON, true); + if (props->IsLeftButtonPressed) UWPMouseButtonEvent(MOUSE_BUTTON_LEFT, true); + if (props->IsMiddleButtonPressed) UWPMouseButtonEvent(MOUSE_BUTTON_MIDDLE, true); + if (props->IsRightButtonPressed) UWPMouseButtonEvent(MOUSE_BUTTON_RIGHT, true); } else if (device->PointerDeviceType == PointerDeviceType::Touch) { @@ -428,9 +418,9 @@ void App::OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI:: if (device->PointerDeviceType == PointerDeviceType::Mouse) { - if (!props->IsLeftButtonPressed) UWPMouseButtonEvent(MOUSE_LEFT_BUTTON, false); - if (!props->IsMiddleButtonPressed) UWPMouseButtonEvent(MOUSE_MIDDLE_BUTTON, false); - if (!props->IsRightButtonPressed) UWPMouseButtonEvent(MOUSE_RIGHT_BUTTON, false); + if (!props->IsLeftButtonPressed) UWPMouseButtonEvent(MOUSE_BUTTON_LEFT, false); + if (!props->IsMiddleButtonPressed) UWPMouseButtonEvent(MOUSE_BUTTON_MIDDLE, false); + if (!props->IsRightButtonPressed) UWPMouseButtonEvent(MOUSE_BUTTON_RIGHT, false); } else if (device->PointerDeviceType == PointerDeviceType::Touch) { @@ -467,86 +457,86 @@ int App::GetRaylibKey(Windows::System::VirtualKey kVey) int actualKey = -1; switch (kVey) { - case VK::Back: actualKey = KEY_BACKSPACE; break; - case VK::Space: actualKey = KEY_SPACE; break; - case VK::Escape: actualKey = KEY_ESCAPE; break; - case VK::Enter: actualKey = KEY_ENTER; break; - case VK::Delete: actualKey = KEY_DELETE; break; - case VK::Right: actualKey = KEY_RIGHT; break; - case VK::Left: actualKey = KEY_LEFT; break; - case VK::Down: actualKey = KEY_DOWN; break; - case VK::Up: actualKey = KEY_UP; break; - case VK::F1: actualKey = KEY_F1; break; - case VK::F2: actualKey = KEY_F2; break; - case VK::F3: actualKey = KEY_F3; break; - case VK::F4: actualKey = KEY_F4; break; - case VK::F5: actualKey = KEY_F5; break; - case VK::F6: actualKey = KEY_F6; break; - case VK::F7: actualKey = KEY_F7; break; - case VK::F8: actualKey = KEY_F8; break; - case VK::F9: actualKey = KEY_F9; break; - case VK::F10: actualKey = KEY_F10; break; - case VK::F11: actualKey = KEY_F11; break; - case VK::F12: actualKey = KEY_F12; break; - case VK::LeftShift: actualKey = KEY_LEFT_SHIFT; break; - case VK::LeftControl: actualKey = KEY_LEFT_CONTROL; break; - case VK::LeftMenu: actualKey = KEY_LEFT_ALT; break; - case VK::RightShift: actualKey = KEY_RIGHT_SHIFT; break; - case VK::RightControl: actualKey = KEY_RIGHT_CONTROL; break; - case VK::RightMenu: actualKey = KEY_RIGHT_ALT; break; - case VK::Number0: actualKey = KEY_ZERO; break; - case VK::Number1: actualKey = KEY_ONE; break; - case VK::Number2: actualKey = KEY_TWO; break; - case VK::Number3: actualKey = KEY_THREE; break; - case VK::Number4: actualKey = KEY_FOUR; break; - case VK::Number5: actualKey = KEY_FIVE; break; - case VK::Number6: actualKey = KEY_SIX; break; - case VK::Number7: actualKey = KEY_SEVEN; break; - case VK::Number8: actualKey = KEY_EIGHT; break; - case VK::Number9: actualKey = KEY_NINE; break; - case VK::NumberPad0: actualKey = KEY_KP_0; break; - case VK::NumberPad1: actualKey = KEY_KP_1; break; - case VK::NumberPad2: actualKey = KEY_KP_2; break; - case VK::NumberPad3: actualKey = KEY_KP_3; break; - case VK::NumberPad4: actualKey = KEY_KP_4; break; - case VK::NumberPad5: actualKey = KEY_KP_5; break; - case VK::NumberPad6: actualKey = KEY_KP_6; break; - case VK::NumberPad7: actualKey = KEY_KP_7; break; - case VK::NumberPad8: actualKey = KEY_KP_8; break; - case VK::NumberPad9: actualKey = KEY_KP_9; break; - case VK::Decimal: actualKey = KEY_KP_DECIMAL; break; - case VK::Divide: actualKey = KEY_KP_DIVIDE; break; - case VK::Multiply: actualKey = KEY_KP_MULTIPLY; break; - case VK::Subtract: actualKey = KEY_KP_SUBTRACT; break; - case VK::Add: actualKey = KEY_KP_ADD; break; - // UWP Doesn't have a specific keypad enter or equal... - case VK::A: actualKey = KEY_A; break; - case VK::B: actualKey = KEY_B; break; - case VK::C: actualKey = KEY_C; break; - case VK::D: actualKey = KEY_D; break; - case VK::E: actualKey = KEY_E; break; - case VK::F: actualKey = KEY_F; break; - case VK::G: actualKey = KEY_G; break; - case VK::H: actualKey = KEY_H; break; - case VK::I: actualKey = KEY_I; break; - case VK::J: actualKey = KEY_J; break; - case VK::K: actualKey = KEY_K; break; - case VK::L: actualKey = KEY_L; break; - case VK::M: actualKey = KEY_M; break; - case VK::N: actualKey = KEY_N; break; - case VK::O: actualKey = KEY_O; break; - case VK::P: actualKey = KEY_P; break; - case VK::Q: actualKey = KEY_Q; break; - case VK::R: actualKey = KEY_R; break; - case VK::S: actualKey = KEY_S; break; - case VK::T: actualKey = KEY_T; break; - case VK::U: actualKey = KEY_U; break; - case VK::V: actualKey = KEY_V; break; - case VK::W: actualKey = KEY_W; break; - case VK::X: actualKey = KEY_X; break; - case VK::Y: actualKey = KEY_Y; break; - case VK::Z: actualKey = KEY_Z; break; - // I don't think we can have any more + case VK::Back: actualKey = KEY_BACKSPACE; break; + case VK::Space: actualKey = KEY_SPACE; break; + case VK::Escape: actualKey = KEY_ESCAPE; break; + case VK::Enter: actualKey = KEY_ENTER; break; + case VK::Delete: actualKey = KEY_DELETE; break; + case VK::Right: actualKey = KEY_RIGHT; break; + case VK::Left: actualKey = KEY_LEFT; break; + case VK::Down: actualKey = KEY_DOWN; break; + case VK::Up: actualKey = KEY_UP; break; + case VK::F1: actualKey = KEY_F1; break; + case VK::F2: actualKey = KEY_F2; break; + case VK::F3: actualKey = KEY_F3; break; + case VK::F4: actualKey = KEY_F4; break; + case VK::F5: actualKey = KEY_F5; break; + case VK::F6: actualKey = KEY_F6; break; + case VK::F7: actualKey = KEY_F7; break; + case VK::F8: actualKey = KEY_F8; break; + case VK::F9: actualKey = KEY_F9; break; + case VK::F10: actualKey = KEY_F10; break; + case VK::F11: actualKey = KEY_F11; break; + case VK::F12: actualKey = KEY_F12; break; + case VK::LeftShift: actualKey = KEY_LEFT_SHIFT; break; + case VK::LeftControl: actualKey = KEY_LEFT_CONTROL; break; + case VK::LeftMenu: actualKey = KEY_LEFT_ALT; break; + case VK::RightShift: actualKey = KEY_RIGHT_SHIFT; break; + case VK::RightControl: actualKey = KEY_RIGHT_CONTROL; break; + case VK::RightMenu: actualKey = KEY_RIGHT_ALT; break; + case VK::Number0: actualKey = KEY_ZERO; break; + case VK::Number1: actualKey = KEY_ONE; break; + case VK::Number2: actualKey = KEY_TWO; break; + case VK::Number3: actualKey = KEY_THREE; break; + case VK::Number4: actualKey = KEY_FOUR; break; + case VK::Number5: actualKey = KEY_FIVE; break; + case VK::Number6: actualKey = KEY_SIX; break; + case VK::Number7: actualKey = KEY_SEVEN; break; + case VK::Number8: actualKey = KEY_EIGHT; break; + case VK::Number9: actualKey = KEY_NINE; break; + case VK::NumberPad0: actualKey = KEY_KP_0; break; + case VK::NumberPad1: actualKey = KEY_KP_1; break; + case VK::NumberPad2: actualKey = KEY_KP_2; break; + case VK::NumberPad3: actualKey = KEY_KP_3; break; + case VK::NumberPad4: actualKey = KEY_KP_4; break; + case VK::NumberPad5: actualKey = KEY_KP_5; break; + case VK::NumberPad6: actualKey = KEY_KP_6; break; + case VK::NumberPad7: actualKey = KEY_KP_7; break; + case VK::NumberPad8: actualKey = KEY_KP_8; break; + case VK::NumberPad9: actualKey = KEY_KP_9; break; + case VK::Decimal: actualKey = KEY_KP_DECIMAL; break; + case VK::Divide: actualKey = KEY_KP_DIVIDE; break; + case VK::Multiply: actualKey = KEY_KP_MULTIPLY; break; + case VK::Subtract: actualKey = KEY_KP_SUBTRACT; break; + case VK::Add: actualKey = KEY_KP_ADD; break; + // UWP Doesn't have a specific keypad enter or equal... + case VK::A: actualKey = KEY_A; break; + case VK::B: actualKey = KEY_B; break; + case VK::C: actualKey = KEY_C; break; + case VK::D: actualKey = KEY_D; break; + case VK::E: actualKey = KEY_E; break; + case VK::F: actualKey = KEY_F; break; + case VK::G: actualKey = KEY_G; break; + case VK::H: actualKey = KEY_H; break; + case VK::I: actualKey = KEY_I; break; + case VK::J: actualKey = KEY_J; break; + case VK::K: actualKey = KEY_K; break; + case VK::L: actualKey = KEY_L; break; + case VK::M: actualKey = KEY_M; break; + case VK::N: actualKey = KEY_N; break; + case VK::O: actualKey = KEY_O; break; + case VK::P: actualKey = KEY_P; break; + case VK::Q: actualKey = KEY_Q; break; + case VK::R: actualKey = KEY_R; break; + case VK::S: actualKey = KEY_S; break; + case VK::T: actualKey = KEY_T; break; + case VK::U: actualKey = KEY_U; break; + case VK::V: actualKey = KEY_V; break; + case VK::W: actualKey = KEY_W; break; + case VK::X: actualKey = KEY_X; break; + case VK::Y: actualKey = KEY_Y; break; + case VK::Z: actualKey = KEY_Z; break; + // I don't think we can have any more } return actualKey; } @@ -555,17 +545,14 @@ void App::OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::Ke { auto k = GetRaylibKey(args->VirtualKey); auto controlState = (sender->GetKeyState(Windows::System::VirtualKey::Control) & Windows::UI::Core::CoreVirtualKeyStates::Down) == Windows::UI::Core::CoreVirtualKeyStates::Down; - if (k != -1) { - UWPKeyDownEvent(k, true, controlState); - } + if (k != -1) UWPKeyDownEvent(k, true, controlState); args->Handled = true; } void App::OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args) { auto k = GetRaylibKey(args->VirtualKey); - if (k != -1) - UWPKeyDownEvent(k, false, false); + if (k != -1) UWPKeyDownEvent(k, false, false); args->Handled = true; } diff --git a/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj index 6f61a751e..0c3c0e774 100644 --- a/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj +++ b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj @@ -47,7 +47,6 @@ Application false - true $(DefaultPlatformToolset) @@ -61,28 +60,28 @@ $(IncludePath) $(LibraryPath) - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\Build\$(ProjectName)\bin\$(Configuration)\$(Platform) + $(SolutionDir)\Build\$(ProjectName)\obj\$(Configuration)\$(Platform) - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\Build\$(ProjectName)\bin\$(Configuration)\$(Platform) + $(SolutionDir)\Build\$(ProjectName)\obj\$(Configuration)\$(Platform) - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\Build\$(ProjectName)\bin\$(Configuration)\$(Platform) + $(SolutionDir)\Build\$(ProjectName)\obj\$(Configuration)\$(Platform) - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\Build\$(ProjectName)\bin\$(Configuration)\$(Platform) + $(SolutionDir)\Build\$(ProjectName)\obj\$(Configuration)\$(Platform) - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\Build\$(ProjectName)\bin\$(Configuration)\$(Platform) + $(SolutionDir)\Build\$(ProjectName)\obj\$(Configuration)\$(Platform) - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\Build\$(ProjectName)\bin\$(Configuration)\$(Platform) + $(SolutionDir)\Build\$(ProjectName)\obj\$(Configuration)\$(Platform) @@ -110,6 +109,9 @@ /bigobj %(AdditionalOptions) 4453;28204 PLATFORM_UWP;_DEBUG;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + MultiThreadedDebugDLL + MultiThreadedDebugDLL true @@ -125,6 +127,9 @@ PLATFORM_UWP;NDEBUG;%(PreprocessorDefinitions) Default false + MultiThreadedDLL + MultiThreadedDLL + MultiThreadedDLL /NODEFAULTLIB %(AdditionalOptions) diff --git a/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj b/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj index ea96bb5f7..41d5c0f77 100644 --- a/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj +++ b/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj @@ -87,19 +87,16 @@ StaticLibrary false - true $(DefaultPlatformToolset) StaticLibrary false - true $(DefaultPlatformToolset) StaticLibrary false - true $(DefaultPlatformToolset) @@ -129,33 +126,33 @@ false - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\Build\$(ProjectName)\bin\$(Configuration)\$(Platform) + $(SolutionDir)\Build\$(ProjectName)\obj\$(Configuration)\$(Platform) false - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\Build\$(ProjectName)\bin\$(Configuration)\$(Platform) + $(SolutionDir)\Build\$(ProjectName)\obj\$(Configuration)\$(Platform) false - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\Build\$(ProjectName)\bin\$(Configuration)\$(Platform) + $(SolutionDir)\Build\$(ProjectName)\obj\$(Configuration)\$(Platform) false - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\Build\$(ProjectName)\bin\$(Configuration)\$(Platform) + $(SolutionDir)\Build\$(ProjectName)\obj\$(Configuration)\$(Platform) false - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\Build\$(ProjectName)\bin\$(Configuration)\$(Platform) + $(SolutionDir)\Build\$(ProjectName)\obj\$(Configuration)\$(Platform) false - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(SolutionDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\Build\$(ProjectName)\bin\$(Configuration)\$(Platform) + $(SolutionDir)\Build\$(ProjectName)\obj\$(Configuration)\$(Platform) diff --git a/projects/VS2017/raylib/raylib.vcxproj b/projects/VS2017/raylib/raylib.vcxproj index 756c400db..2567b0ccf 100644 --- a/projects/VS2017/raylib/raylib.vcxproj +++ b/projects/VS2017/raylib/raylib.vcxproj @@ -69,28 +69,24 @@ StaticLibrary false $(DefaultPlatformToolset) - true Unicode StaticLibrary false $(DefaultPlatformToolset) - true Unicode DynamicLibrary false $(DefaultPlatformToolset) - true Unicode DynamicLibrary false $(DefaultPlatformToolset) - true Unicode @@ -256,6 +252,7 @@ _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP $(ProjectDir)..\..\..\src\external\glfw\include CompileAsC + Windows @@ -295,6 +292,7 @@ $(ProjectDir)..\..\..\src\external\glfw\include CompileAsC MultiThreaded + Windows diff --git a/projects/VS2019/examples/audio_module_playing.vcxproj b/projects/VS2019/examples/audio_module_playing.vcxproj new file mode 100644 index 000000000..12ad30133 --- /dev/null +++ b/projects/VS2019/examples/audio_module_playing.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6} + Win32Proj + audio_module_playing + 10.0 + audio_module_playing + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/audio_multichannel_sound.vcxproj b/projects/VS2019/examples/audio_multichannel_sound.vcxproj new file mode 100644 index 000000000..cf21b8032 --- /dev/null +++ b/projects/VS2019/examples/audio_multichannel_sound.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F} + Win32Proj + audio_multichannel_sound + 10.0 + audio_multichannel_sound + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/audio_music_stream.vcxproj b/projects/VS2019/examples/audio_music_stream.vcxproj new file mode 100644 index 000000000..8204fafb6 --- /dev/null +++ b/projects/VS2019/examples/audio_music_stream.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9} + Win32Proj + audio_music_stream + 10.0 + audio_music_stream + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/audio_raw_stream.vcxproj b/projects/VS2019/examples/audio_raw_stream.vcxproj new file mode 100644 index 000000000..83868073b --- /dev/null +++ b/projects/VS2019/examples/audio_raw_stream.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB} + Win32Proj + audio_raw_stream + 10.0 + audio_raw_stream + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/audio_sound_loading.vcxproj b/projects/VS2019/examples/audio_sound_loading.vcxproj new file mode 100644 index 000000000..64d59c33c --- /dev/null +++ b/projects/VS2019/examples/audio_sound_loading.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {F81C5819-85B6-4D2E-B6DC-104A7634461B} + Win32Proj + audio_sound_loading + 10.0 + audio_sound_loading + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\audio + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_2d_camera.vcxproj b/projects/VS2019/examples/core_2d_camera.vcxproj new file mode 100644 index 000000000..f9c470e75 --- /dev/null +++ b/projects/VS2019/examples/core_2d_camera.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {66CC5B13-881A-412F-8C51-746622A91C5A} + Win32Proj + core_2d_camera + 10.0 + core_2d_camera + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_2d_camera_platformer.vcxproj b/projects/VS2019/examples/core_2d_camera_platformer.vcxproj new file mode 100644 index 000000000..17a1c95c7 --- /dev/null +++ b/projects/VS2019/examples/core_2d_camera_platformer.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B} + Win32Proj + core_2d_camera_platformer + 10.0 + core_2d_camera_platformer + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_3d_camera_first_person.vcxproj b/projects/VS2019/examples/core_3d_camera_first_person.vcxproj new file mode 100644 index 000000000..bc54434ea --- /dev/null +++ b/projects/VS2019/examples/core_3d_camera_first_person.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {557138B0-7BE2-4392-B2E2-B45734031A62} + Win32Proj + core_3d_camera_first_person + 10.0 + core_3d_camera_first_person + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_3d_camera_free.vcxproj b/projects/VS2019/examples/core_3d_camera_free.vcxproj new file mode 100644 index 000000000..9412ad8d2 --- /dev/null +++ b/projects/VS2019/examples/core_3d_camera_free.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {9EED87BB-527F-4D05-9384-6D16CFD627A8} + Win32Proj + core_3d_camera_free + 10.0 + core_3d_camera_free + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_3d_camera_mode.vcxproj b/projects/VS2019/examples/core_3d_camera_mode.vcxproj new file mode 100644 index 000000000..ec6250d4d --- /dev/null +++ b/projects/VS2019/examples/core_3d_camera_mode.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965} + Win32Proj + core_3d_camera_mode + 10.0 + core_3d_camera_mode + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_3d_picking.vcxproj b/projects/VS2019/examples/core_3d_picking.vcxproj new file mode 100644 index 000000000..36277fa1e --- /dev/null +++ b/projects/VS2019/examples/core_3d_picking.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {FD193822-3D5C-4161-A147-884C2ABDE483} + Win32Proj + core_3d_picking + 10.0 + core_3d_picking + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_basic_window.vcxproj b/projects/VS2019/examples/core_basic_window.vcxproj index 846aed4e0..c280c2d08 100644 --- a/projects/VS2019/examples/core_basic_window.vcxproj +++ b/projects/VS2019/examples/core_basic_window.vcxproj @@ -1,5 +1,5 @@  - + Debug.DLL @@ -126,43 +126,75 @@ true - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ true - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ true - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ true - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ false - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ false - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ false - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ false - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger @@ -177,8 +209,8 @@ Console true - %(AdditionalLibraryDirectories) - 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) @@ -195,8 +227,8 @@ Console true - %(AdditionalLibraryDirectories);$(SolutionDir)\bin\$(Platform)\$(Configuration)\ - raylib.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) @@ -212,9 +244,13 @@ Console true - %(AdditionalLibraryDirectories) - 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + @@ -229,9 +265,13 @@ Console true - %(AdditionalLibraryDirectories) - 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + @@ -251,8 +291,8 @@ true true true - 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) - %(AdditionalLibraryDirectories) + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ @@ -273,8 +313,8 @@ true true true - raylib.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) - %(AdditionalLibraryDirectories);$(SolutionDir)\bin\$(Platform)\$(Configuration)\ + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ @@ -295,9 +335,15 @@ true true true - 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) - %(AdditionalLibraryDirectories) + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + @@ -317,9 +363,15 @@ true true true - 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) - %(AdditionalLibraryDirectories) + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + diff --git a/projects/VS2019/examples/core_custom_logging.vcxproj b/projects/VS2019/examples/core_custom_logging.vcxproj new file mode 100644 index 000000000..d631abb6f --- /dev/null +++ b/projects/VS2019/examples/core_custom_logging.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {20AD0AC9-9159-4744-99CC-6AC5779D6B87} + Win32Proj + core_custom_logging + 10.0 + core_custom_logging + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_drop_files.vcxproj b/projects/VS2019/examples/core_drop_files.vcxproj new file mode 100644 index 000000000..b3932d8b0 --- /dev/null +++ b/projects/VS2019/examples/core_drop_files.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {0199E349-0701-40BC-8A7F-06A54FFA3E7C} + Win32Proj + core_drop_files + 10.0 + core_drop_files + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_input_gamepad.vcxproj b/projects/VS2019/examples/core_input_gamepad.vcxproj new file mode 100644 index 000000000..e28033955 --- /dev/null +++ b/projects/VS2019/examples/core_input_gamepad.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {8F19E3DA-8929-4000-87B5-3CA6929636CC} + Win32Proj + core_input_gamepad + 10.0 + core_input_gamepad + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_input_gestures.vcxproj b/projects/VS2019/examples/core_input_gestures.vcxproj new file mode 100644 index 000000000..5603c802a --- /dev/null +++ b/projects/VS2019/examples/core_input_gestures.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {51A00565-5787-4911-9CC0-28403AA4909D} + Win32Proj + core_input_gestures + 10.0 + core_input_gestures + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_input_keys.vcxproj b/projects/VS2019/examples/core_input_keys.vcxproj new file mode 100644 index 000000000..76ceec8ba --- /dev/null +++ b/projects/VS2019/examples/core_input_keys.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {92B64AE7-D773-4F05-89F1-CE59BBF4F053} + Win32Proj + core_input_keys + 10.0 + core_input_keys + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_input_mouse.vcxproj b/projects/VS2019/examples/core_input_mouse.vcxproj new file mode 100644 index 000000000..5d9af4fa4 --- /dev/null +++ b/projects/VS2019/examples/core_input_mouse.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3} + Win32Proj + core_input_mouse + 10.0 + core_input_mouse + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_basic_window_cpp.vcxproj b/projects/VS2019/examples/core_input_mouse_wheel.vcxproj similarity index 61% rename from projects/VS2019/examples/core_basic_window_cpp.vcxproj rename to projects/VS2019/examples/core_input_mouse_wheel.vcxproj index 333cf4ace..e9dcf2b4b 100644 --- a/projects/VS2019/examples/core_basic_window_cpp.vcxproj +++ b/projects/VS2019/examples/core_input_mouse_wheel.vcxproj @@ -1,5 +1,5 @@  - + Debug.DLL @@ -35,11 +35,11 @@ - {B655E850-3322-42F7-941D-6AC18FD66CA1} + {0981CA98-E4A5-4DF1-987F-A41D09131EFC} Win32Proj - raylib_example_cpp + core_input_mouse_wheel 10.0 - core_basic_window_cpp + core_input_mouse_wheel @@ -126,43 +126,75 @@ true - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj_cpp\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ true - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj_cpp\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ true - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj_cpp\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ true - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj_cpp\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ false - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj_cpp\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ false - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj_cpp\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ false - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj_cpp\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ false - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj_cpp\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger @@ -170,15 +202,15 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) - CompileAsCpp Console true - 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) - %(AdditionalLibraryDirectories) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.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) @@ -187,15 +219,16 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) - CompileAsCpp + /FS %(AdditionalOptions) Console true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ raylib.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) - %(AdditionalLibraryDirectories);$(SolutionDir)\bin\$(Platform)\$(Configuration)\ @@ -204,16 +237,20 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) - CompileAsCpp Console true - 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) - %(AdditionalLibraryDirectories) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.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) + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + @@ -221,16 +258,20 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) - CompileAsCpp Console true - 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) - %(AdditionalLibraryDirectories) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.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) + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + @@ -240,17 +281,18 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - CompileAsCpp + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true Console true true true - %(AdditionalLibraryDirectories) - 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) + raylib.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ @@ -261,17 +303,18 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - CompileAsCpp + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true Console true true true - %(AdditionalLibraryDirectories);$(SolutionDir)\bin\$(Platform)\$(Configuration)\ raylib.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ @@ -282,18 +325,25 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - CompileAsCpp + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true Console true true true - %(AdditionalLibraryDirectories) - 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) + raylib.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + @@ -303,27 +353,34 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - CompileAsCpp + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true Console true true true - %(AdditionalLibraryDirectories) - 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) + raylib.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} - - - diff --git a/projects/VS2019/examples/core_input_multitouch.vcxproj b/projects/VS2019/examples/core_input_multitouch.vcxproj new file mode 100644 index 000000000..514ad4a83 --- /dev/null +++ b/projects/VS2019/examples/core_input_multitouch.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {A643BB06-735D-47F3-BFE7-B6D3C36F7097} + Win32Proj + core_input_multitouch + 10.0 + core_input_multitouch + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_loading_thread.vcxproj b/projects/VS2019/examples/core_loading_thread.vcxproj new file mode 100644 index 000000000..f738d75ec --- /dev/null +++ b/projects/VS2019/examples/core_loading_thread.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {F026020F-7B00-40C8-91C3-5DE85EC45A95} + Win32Proj + core_loading_thread + 10.0 + core_loading_thread + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_quat_conversion.vcxproj b/projects/VS2019/examples/core_quat_conversion.vcxproj new file mode 100644 index 000000000..8948a6042 --- /dev/null +++ b/projects/VS2019/examples/core_quat_conversion.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A} + Win32Proj + core_quat_conversion + 10.0 + core_quat_conversion + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_random_values.vcxproj b/projects/VS2019/examples/core_random_values.vcxproj new file mode 100644 index 000000000..bb6a4911c --- /dev/null +++ b/projects/VS2019/examples/core_random_values.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A} + Win32Proj + core_random_values + 10.0 + core_random_values + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_scissor_test.vcxproj b/projects/VS2019/examples/core_scissor_test.vcxproj new file mode 100644 index 000000000..576d6f571 --- /dev/null +++ b/projects/VS2019/examples/core_scissor_test.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {59089B0C-AAB4-4532-B294-44DEAE7178B7} + Win32Proj + core_scissor_test + 10.0 + core_scissor_test + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_split_screen.vcxproj b/projects/VS2019/examples/core_split_screen.vcxproj new file mode 100644 index 000000000..1005e2eaf --- /dev/null +++ b/projects/VS2019/examples/core_split_screen.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {946A1700-C7AA-46F0-AEF2-67C98B5722AC} + Win32Proj + core_split_screen + 10.0 + core_split_screen + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_storage_values.vcxproj b/projects/VS2019/examples/core_storage_values.vcxproj new file mode 100644 index 000000000..735dc2f28 --- /dev/null +++ b/projects/VS2019/examples/core_storage_values.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {C298876B-6C12-4EA4-903B-33450BCD9884} + Win32Proj + core_storage_values + 10.0 + core_storage_values + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_vr_simulator.vcxproj b/projects/VS2019/examples/core_vr_simulator.vcxproj new file mode 100644 index 000000000..4bf004d01 --- /dev/null +++ b/projects/VS2019/examples/core_vr_simulator.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {83F586FA-C801-4979-ACCA-006BD628CC88} + Win32Proj + core_vr_simulator + 10.0 + core_vr_simulator + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_window_flags.vcxproj b/projects/VS2019/examples/core_window_flags.vcxproj new file mode 100644 index 000000000..a4a1f597d --- /dev/null +++ b/projects/VS2019/examples/core_window_flags.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22} + Win32Proj + core_window_flags + 10.0 + core_window_flags + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_window_letterbox.vcxproj b/projects/VS2019/examples/core_window_letterbox.vcxproj new file mode 100644 index 000000000..c46cd6217 --- /dev/null +++ b/projects/VS2019/examples/core_window_letterbox.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {FF2970AE-E2E9-405F-B321-D523A1BD44A0} + Win32Proj + core_window_letterbox + 10.0 + core_window_letterbox + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/core_world_screen.vcxproj b/projects/VS2019/examples/core_world_screen.vcxproj new file mode 100644 index 000000000..cadaf5cb8 --- /dev/null +++ b/projects/VS2019/examples/core_world_screen.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {79417CE2-FEEB-42F0-BC53-62D5267B19B1} + Win32Proj + core_world_screen + 10.0 + core_world_screen + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/easings_testbed.vcxproj b/projects/VS2019/examples/easings_testbed.vcxproj new file mode 100644 index 000000000..12b83f60b --- /dev/null +++ b/projects/VS2019/examples/easings_testbed.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {E1B6D565-9D7C-46B7-9202-ECF54974DE50} + Win32Proj + easings_testbed + 10.0 + easings_testbed + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/embedded_files_loading.vcxproj b/projects/VS2019/examples/embedded_files_loading.vcxproj new file mode 100644 index 000000000..a088c5090 --- /dev/null +++ b/projects/VS2019/examples/embedded_files_loading.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {FDE6080B-E203-4066-910D-AD0302566008} + Win32Proj + embedded_files_loading + 10.0 + embedded_files_loading + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_animation.vcxproj b/projects/VS2019/examples/models_animation.vcxproj new file mode 100644 index 000000000..52b4f18b1 --- /dev/null +++ b/projects/VS2019/examples/models_animation.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {AFDDE100-2D36-4749-817D-12E54C56312F} + Win32Proj + models_animation + 10.0 + models_animation + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_billboard.vcxproj b/projects/VS2019/examples/models_billboard.vcxproj new file mode 100644 index 000000000..5198f6a97 --- /dev/null +++ b/projects/VS2019/examples/models_billboard.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {B7812167-50FB-4934-996F-DF6FE4CBBFDF} + Win32Proj + models_billboard + 10.0 + models_billboard + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_box_collisions.vcxproj b/projects/VS2019/examples/models_box_collisions.vcxproj new file mode 100644 index 000000000..231648107 --- /dev/null +++ b/projects/VS2019/examples/models_box_collisions.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {39DB56C7-05F8-492C-A8D4-F19E40FECB59} + Win32Proj + models_box_collisions + 10.0 + models_box_collisions + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_cubicmap.vcxproj b/projects/VS2019/examples/models_cubicmap.vcxproj new file mode 100644 index 000000000..bc71d5ff1 --- /dev/null +++ b/projects/VS2019/examples/models_cubicmap.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99} + Win32Proj + models_cubicmap + 10.0 + models_cubicmap + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_first_person_maze.vcxproj b/projects/VS2019/examples/models_first_person_maze.vcxproj new file mode 100644 index 000000000..74e53cfaf --- /dev/null +++ b/projects/VS2019/examples/models_first_person_maze.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62} + Win32Proj + models_first_person_maze + 10.0 + models_first_person_maze + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_geometric_shapes.vcxproj b/projects/VS2019/examples/models_geometric_shapes.vcxproj new file mode 100644 index 000000000..8b0ba8ff5 --- /dev/null +++ b/projects/VS2019/examples/models_geometric_shapes.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {14BA7F98-02CC-4648-9236-676BFF9458AF} + Win32Proj + models_geometric_shapes + 10.0 + models_geometric_shapes + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_gltf_animation.vcxproj b/projects/VS2019/examples/models_gltf_animation.vcxproj new file mode 100644 index 000000000..96e07de5d --- /dev/null +++ b/projects/VS2019/examples/models_gltf_animation.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {FADC31C3-09AA-4DB4-A289-153482D10C09} + Win32Proj + models_gltf_animation + 10.0 + models_gltf_animation + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_gltf_model.vcxproj b/projects/VS2019/examples/models_gltf_model.vcxproj new file mode 100644 index 000000000..92c3ba914 --- /dev/null +++ b/projects/VS2019/examples/models_gltf_model.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71} + Win32Proj + models_gltf_model + 10.0 + models_gltf_model + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_heightmap.vcxproj b/projects/VS2019/examples/models_heightmap.vcxproj new file mode 100644 index 000000000..e16eff288 --- /dev/null +++ b/projects/VS2019/examples/models_heightmap.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {0859A973-E4FE-4688-8D16-0253163FDE24} + Win32Proj + models_heightmap + 10.0 + models_heightmap + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_loading.vcxproj b/projects/VS2019/examples/models_loading.vcxproj new file mode 100644 index 000000000..4b1be702e --- /dev/null +++ b/projects/VS2019/examples/models_loading.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {F3412853-2B6A-4334-8CF2-B796CDAE0850} + Win32Proj + models_loading + 10.0 + models_loading + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_material_pbr.vcxproj b/projects/VS2019/examples/models_material_pbr.vcxproj new file mode 100644 index 000000000..56c21de52 --- /dev/null +++ b/projects/VS2019/examples/models_material_pbr.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {3A6C48C6-80AB-456F-A3A5-969930958971} + Win32Proj + models_material_pbr + 10.0 + models_material_pbr + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_mesh_generation.vcxproj b/projects/VS2019/examples/models_mesh_generation.vcxproj new file mode 100644 index 000000000..9342c43a1 --- /dev/null +++ b/projects/VS2019/examples/models_mesh_generation.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912} + Win32Proj + models_mesh_generation + 10.0 + models_mesh_generation + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_mesh_picking.vcxproj b/projects/VS2019/examples/models_mesh_picking.vcxproj new file mode 100644 index 000000000..e9221146c --- /dev/null +++ b/projects/VS2019/examples/models_mesh_picking.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {D03F2C82-9553-4AFA-8F49-9234009122B6} + Win32Proj + models_mesh_picking + 10.0 + models_mesh_picking + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_orthographic_projection.vcxproj b/projects/VS2019/examples/models_orthographic_projection.vcxproj new file mode 100644 index 000000000..1502db9f8 --- /dev/null +++ b/projects/VS2019/examples/models_orthographic_projection.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3} + Win32Proj + models_orthographic_projection + 10.0 + models_orthographic_projection + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_rlgl_solar_system.vcxproj b/projects/VS2019/examples/models_rlgl_solar_system.vcxproj new file mode 100644 index 000000000..e260b2dbe --- /dev/null +++ b/projects/VS2019/examples/models_rlgl_solar_system.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {A53CCF42-A972-478F-9336-0F618B3EC06A} + Win32Proj + models_rlgl_solar_system + 10.0 + models_rlgl_solar_system + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_skybox.vcxproj b/projects/VS2019/examples/models_skybox.vcxproj new file mode 100644 index 000000000..bcb901485 --- /dev/null +++ b/projects/VS2019/examples/models_skybox.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA} + Win32Proj + models_skybox + 10.0 + models_skybox + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_waving_cubes.vcxproj b/projects/VS2019/examples/models_waving_cubes.vcxproj new file mode 100644 index 000000000..9ba062cab --- /dev/null +++ b/projects/VS2019/examples/models_waving_cubes.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {870723DD-945A-4136-B65B-4AF3BF85369C} + Win32Proj + models_waving_cubes + 10.0 + models_waving_cubes + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/models_yaw_pitch_roll.vcxproj b/projects/VS2019/examples/models_yaw_pitch_roll.vcxproj new file mode 100644 index 000000000..ff301b3a6 --- /dev/null +++ b/projects/VS2019/examples/models_yaw_pitch_roll.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97} + Win32Proj + models_yaw_pitch_roll + 10.0 + models_yaw_pitch_roll + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/network_ping_pong.vcxproj b/projects/VS2019/examples/network_ping_pong.vcxproj new file mode 100644 index 000000000..a03a68325 --- /dev/null +++ b/projects/VS2019/examples/network_ping_pong.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5} + Win32Proj + network_ping_pong + 10.0 + network_ping_pong + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/network_resolve_host.vcxproj b/projects/VS2019/examples/network_resolve_host.vcxproj new file mode 100644 index 000000000..c8888dca1 --- /dev/null +++ b/projects/VS2019/examples/network_resolve_host.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5} + Win32Proj + network_resolve_host + 10.0 + network_resolve_host + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/network_tcp_client.vcxproj b/projects/VS2019/examples/network_tcp_client.vcxproj new file mode 100644 index 000000000..8ce75f649 --- /dev/null +++ b/projects/VS2019/examples/network_tcp_client.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F} + Win32Proj + network_tcp_client + 10.0 + network_tcp_client + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/network_tcp_server.vcxproj b/projects/VS2019/examples/network_tcp_server.vcxproj new file mode 100644 index 000000000..329c1cb03 --- /dev/null +++ b/projects/VS2019/examples/network_tcp_server.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {537851A6-25F0-4F47-A43E-A0D272591DBA} + Win32Proj + network_tcp_server + 10.0 + network_tcp_server + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/network_test.vcxproj b/projects/VS2019/examples/network_test.vcxproj new file mode 100644 index 000000000..d0db579f8 --- /dev/null +++ b/projects/VS2019/examples/network_test.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73} + Win32Proj + network_test + 10.0 + network_test + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/network_udp_client.vcxproj b/projects/VS2019/examples/network_udp_client.vcxproj new file mode 100644 index 000000000..1672c36d6 --- /dev/null +++ b/projects/VS2019/examples/network_udp_client.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {19B5E933-AF1B-48E3-AC23-9359C00B8963} + Win32Proj + network_udp_client + 10.0 + network_udp_client + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/network_udp_server.vcxproj b/projects/VS2019/examples/network_udp_server.vcxproj new file mode 100644 index 000000000..fcef9e944 --- /dev/null +++ b/projects/VS2019/examples/network_udp_server.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {280017A6-E892-4E1C-902F-C7690CB55267} + Win32Proj + network_udp_server + 10.0 + network_udp_server + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\network + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;ws2_32.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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;ws2_32.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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/physics_demo.vcxproj b/projects/VS2019/examples/physics_demo.vcxproj new file mode 100644 index 000000000..e5d1a443b --- /dev/null +++ b/projects/VS2019/examples/physics_demo.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097} + Win32Proj + physics_demo + 10.0 + physics_demo + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/physics_friction.vcxproj b/projects/VS2019/examples/physics_friction.vcxproj new file mode 100644 index 000000000..f12c3907b --- /dev/null +++ b/projects/VS2019/examples/physics_friction.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {A6260ED4-5361-4B61-B6B9-8D8119457BA4} + Win32Proj + physics_friction + 10.0 + physics_friction + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/physics_movement.vcxproj b/projects/VS2019/examples/physics_movement.vcxproj new file mode 100644 index 000000000..4b6ad08a6 --- /dev/null +++ b/projects/VS2019/examples/physics_movement.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {29817904-E3D3-4C28-BD8D-A3A09DD199D2} + Win32Proj + physics_movement + 10.0 + physics_movement + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/physics_restitution.vcxproj b/projects/VS2019/examples/physics_restitution.vcxproj new file mode 100644 index 000000000..0561524f3 --- /dev/null +++ b/projects/VS2019/examples/physics_restitution.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1} + Win32Proj + physics_restitution + 10.0 + physics_restitution + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/physics_shatter.vcxproj b/projects/VS2019/examples/physics_shatter.vcxproj new file mode 100644 index 000000000..e4f501f03 --- /dev/null +++ b/projects/VS2019/examples/physics_shatter.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {F272EF74-990E-4637-AF9E-77DC7139D95D} + Win32Proj + physics_shatter + 10.0 + physics_shatter + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\physics + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/raudio_standalone.vcxproj b/projects/VS2019/examples/raudio_standalone.vcxproj new file mode 100644 index 000000000..5a415685c --- /dev/null +++ b/projects/VS2019/examples/raudio_standalone.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B} + Win32Proj + raudio_standalone + 10.0 + raudio_standalone + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/rlgl_standalone.vcxproj b/projects/VS2019/examples/rlgl_standalone.vcxproj new file mode 100644 index 000000000..466740431 --- /dev/null +++ b/projects/VS2019/examples/rlgl_standalone.vcxproj @@ -0,0 +1,391 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {C8765523-58F8-4C8E-9914-693396F6F0FF} + Win32Proj + rlgl_standalone + 10.0 + rlgl_standalone + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\others + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) + + + Console + true + + + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + + + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) + + + Console + true + + + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) + + + Console + true + + + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + + + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + + + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + + + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + + + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_basic_lighting.vcxproj b/projects/VS2019/examples/shaders_basic_lighting.vcxproj new file mode 100644 index 000000000..7861b0681 --- /dev/null +++ b/projects/VS2019/examples/shaders_basic_lighting.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA} + Win32Proj + shaders_basic_lighting + 10.0 + shaders_basic_lighting + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_custom_uniform.vcxproj b/projects/VS2019/examples/shaders_custom_uniform.vcxproj new file mode 100644 index 000000000..890aedbd2 --- /dev/null +++ b/projects/VS2019/examples/shaders_custom_uniform.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870} + Win32Proj + shaders_custom_uniform + 10.0 + shaders_custom_uniform + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_eratosthenes.vcxproj b/projects/VS2019/examples/shaders_eratosthenes.vcxproj new file mode 100644 index 000000000..95725d81a --- /dev/null +++ b/projects/VS2019/examples/shaders_eratosthenes.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1} + Win32Proj + shaders_eratosthenes + 10.0 + shaders_eratosthenes + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_fog.vcxproj b/projects/VS2019/examples/shaders_fog.vcxproj new file mode 100644 index 000000000..cd97064b8 --- /dev/null +++ b/projects/VS2019/examples/shaders_fog.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF} + Win32Proj + shaders_fog + 10.0 + shaders_fog + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_hot_reloading.vcxproj b/projects/VS2019/examples/shaders_hot_reloading.vcxproj new file mode 100644 index 000000000..e10ec74e5 --- /dev/null +++ b/projects/VS2019/examples/shaders_hot_reloading.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {CF3755C4-937D-4ABF-B7B3-95140808717F} + Win32Proj + shaders_hot_reloading + 10.0 + shaders_hot_reloading + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_julia_set.vcxproj b/projects/VS2019/examples/shaders_julia_set.vcxproj new file mode 100644 index 000000000..72ee38444 --- /dev/null +++ b/projects/VS2019/examples/shaders_julia_set.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {D34939FE-8873-4C53-8D6C-74DED78EA3C4} + Win32Proj + shaders_julia_set + 10.0 + shaders_julia_set + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_mesh_instancing.vcxproj b/projects/VS2019/examples/shaders_mesh_instancing.vcxproj new file mode 100644 index 000000000..8a5f1435c --- /dev/null +++ b/projects/VS2019/examples/shaders_mesh_instancing.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {274C0319-7E1E-4188-936B-8DF3331230B3} + Win32Proj + shaders_mesh_instancing + 10.0 + shaders_mesh_instancing + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_model_shader.vcxproj b/projects/VS2019/examples/shaders_model_shader.vcxproj new file mode 100644 index 000000000..f7034cf12 --- /dev/null +++ b/projects/VS2019/examples/shaders_model_shader.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {D408A730-363A-4ABF-BCEF-5D63DCC66042} + Win32Proj + shaders_model_shader + 10.0 + shaders_model_shader + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_multi_sample2d.vcxproj b/projects/VS2019/examples/shaders_multi_sample2d.vcxproj new file mode 100644 index 000000000..d80c2870b --- /dev/null +++ b/projects/VS2019/examples/shaders_multi_sample2d.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED} + Win32Proj + shaders_multi_sample2d + 10.0 + shaders_multi_sample2d + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_palette_switch.vcxproj b/projects/VS2019/examples/shaders_palette_switch.vcxproj new file mode 100644 index 000000000..f1f6486dc --- /dev/null +++ b/projects/VS2019/examples/shaders_palette_switch.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {52FB7463-C128-42AF-A02F-78F48473EA9A} + Win32Proj + shaders_palette_switch + 10.0 + shaders_palette_switch + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_postprocessing.vcxproj b/projects/VS2019/examples/shaders_postprocessing.vcxproj new file mode 100644 index 000000000..31304856a --- /dev/null +++ b/projects/VS2019/examples/shaders_postprocessing.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {7381D91E-5C72-48F0-AAB4-95C9B10D7484} + Win32Proj + shaders_postprocessing + 10.0 + shaders_postprocessing + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_raymarching.vcxproj b/projects/VS2019/examples/shaders_raymarching.vcxproj new file mode 100644 index 000000000..46e2efe6d --- /dev/null +++ b/projects/VS2019/examples/shaders_raymarching.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {D36EC43E-B31F-4CF4-8285-93A7A9D90189} + Win32Proj + shaders_raymarching + 10.0 + shaders_raymarching + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_shapes_textures.vcxproj b/projects/VS2019/examples/shaders_shapes_textures.vcxproj new file mode 100644 index 000000000..5cbe90435 --- /dev/null +++ b/projects/VS2019/examples/shaders_shapes_textures.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629} + Win32Proj + shaders_shapes_textures + 10.0 + shaders_shapes_textures + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_simple_mask.vcxproj b/projects/VS2019/examples/shaders_simple_mask.vcxproj new file mode 100644 index 000000000..a2cbd012a --- /dev/null +++ b/projects/VS2019/examples/shaders_simple_mask.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {600C3D4F-0670-4DB4-B30F-520A729053B5} + Win32Proj + shaders_simple_mask + 10.0 + shaders_simple_mask + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_spotlight.vcxproj b/projects/VS2019/examples/shaders_spotlight.vcxproj new file mode 100644 index 000000000..8351362d7 --- /dev/null +++ b/projects/VS2019/examples/shaders_spotlight.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {11F33A39-74B7-4018-B5F9-CC285A673A8F} + Win32Proj + shaders_spotlight + 10.0 + shaders_spotlight + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_texture_drawing.vcxproj b/projects/VS2019/examples/shaders_texture_drawing.vcxproj new file mode 100644 index 000000000..621d9d6f9 --- /dev/null +++ b/projects/VS2019/examples/shaders_texture_drawing.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {A6F5E35E-B4A7-41B3-853A-75558E6E0715} + Win32Proj + shaders_texture_drawing + 10.0 + shaders_texture_drawing + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shaders_texture_waves.vcxproj b/projects/VS2019/examples/shaders_texture_waves.vcxproj new file mode 100644 index 000000000..7a1ffa30b --- /dev/null +++ b/projects/VS2019/examples/shaders_texture_waves.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8} + Win32Proj + shaders_texture_waves + 10.0 + shaders_texture_waves + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_basic_shapes.vcxproj b/projects/VS2019/examples/shapes_basic_shapes.vcxproj new file mode 100644 index 000000000..198fbdae8 --- /dev/null +++ b/projects/VS2019/examples/shapes_basic_shapes.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {C27794B5-1293-4EA7-BC0E-0F18E6325539} + Win32Proj + shapes_basic_shapes + 10.0 + shapes_basic_shapes + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_bouncing_ball.vcxproj b/projects/VS2019/examples/shapes_bouncing_ball.vcxproj new file mode 100644 index 000000000..bc2196922 --- /dev/null +++ b/projects/VS2019/examples/shapes_bouncing_ball.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {02F41059-12A2-4A96-8D77-07EFE4B108FD} + Win32Proj + shapes_bouncing_ball + 10.0 + shapes_bouncing_ball + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_collision_area.vcxproj b/projects/VS2019/examples/shapes_collision_area.vcxproj new file mode 100644 index 000000000..11df1e0a4 --- /dev/null +++ b/projects/VS2019/examples/shapes_collision_area.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {B774E0B9-9514-4E88-975F-4EB6C3B8D519} + Win32Proj + shapes_collision_area + 10.0 + shapes_collision_area + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_colors_palette.vcxproj b/projects/VS2019/examples/shapes_colors_palette.vcxproj new file mode 100644 index 000000000..6e798c52b --- /dev/null +++ b/projects/VS2019/examples/shapes_colors_palette.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {D91367C2-2189-4859-A7FE-D2CAB84FA15C} + Win32Proj + shapes_colors_palette + 10.0 + shapes_colors_palette + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_draw_circle_sector.vcxproj b/projects/VS2019/examples/shapes_draw_circle_sector.vcxproj new file mode 100644 index 000000000..be37881fc --- /dev/null +++ b/projects/VS2019/examples/shapes_draw_circle_sector.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {33459B4E-1839-4856-BF6B-22480D11FE31} + Win32Proj + shapes_draw_circle_sector + 10.0 + shapes_draw_circle_sector + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_draw_rectangle_rounded.vcxproj b/projects/VS2019/examples/shapes_draw_rectangle_rounded.vcxproj new file mode 100644 index 000000000..af8ce6fd5 --- /dev/null +++ b/projects/VS2019/examples/shapes_draw_rectangle_rounded.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {48871156-181A-475A-BD8D-200086A09675} + Win32Proj + shapes_draw_rectangle_rounded + 10.0 + shapes_draw_rectangle_rounded + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_draw_ring.vcxproj b/projects/VS2019/examples/shapes_draw_ring.vcxproj new file mode 100644 index 000000000..1488c9522 --- /dev/null +++ b/projects/VS2019/examples/shapes_draw_ring.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1} + Win32Proj + shapes_draw_ring + 10.0 + shapes_draw_ring + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_easings_ball_anim.vcxproj b/projects/VS2019/examples/shapes_easings_ball_anim.vcxproj new file mode 100644 index 000000000..74f55c6b8 --- /dev/null +++ b/projects/VS2019/examples/shapes_easings_ball_anim.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {1C49E35A-2838-49D9-9D5F-4B8134960EF6} + Win32Proj + shapes_easings_ball_anim + 10.0 + shapes_easings_ball_anim + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_easings_box_anim.vcxproj b/projects/VS2019/examples/shapes_easings_box_anim.vcxproj new file mode 100644 index 000000000..32c02e1c1 --- /dev/null +++ b/projects/VS2019/examples/shapes_easings_box_anim.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {F91142E2-A999-47F0-9E74-38C1E2930EBE} + Win32Proj + shapes_easings_box_anim + 10.0 + shapes_easings_box_anim + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_easings_rectangle_array.vcxproj b/projects/VS2019/examples/shapes_easings_rectangle_array.vcxproj new file mode 100644 index 000000000..0361bbf0a --- /dev/null +++ b/projects/VS2019/examples/shapes_easings_rectangle_array.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {1EDD4BCF-345C-4065-8CBD-7285224293C3} + Win32Proj + shapes_easings_rectangle_array + 10.0 + shapes_easings_rectangle_array + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_following_eyes.vcxproj b/projects/VS2019/examples/shapes_following_eyes.vcxproj new file mode 100644 index 000000000..083ef6204 --- /dev/null +++ b/projects/VS2019/examples/shapes_following_eyes.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {F3F6FE4D-9D9E-451A-B0BA-81456104B672} + Win32Proj + shapes_following_eyes + 10.0 + shapes_following_eyes + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_lines_bezier.vcxproj b/projects/VS2019/examples/shapes_lines_bezier.vcxproj new file mode 100644 index 000000000..142feb924 --- /dev/null +++ b/projects/VS2019/examples/shapes_lines_bezier.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {03E7018C-44A2-4C46-9CE7-F2A135A2692B} + Win32Proj + shapes_lines_bezier + 10.0 + shapes_lines_bezier + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_logo_raylib.vcxproj b/projects/VS2019/examples/shapes_logo_raylib.vcxproj new file mode 100644 index 000000000..7a796e9dc --- /dev/null +++ b/projects/VS2019/examples/shapes_logo_raylib.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5} + Win32Proj + shapes_logo_raylib + 10.0 + shapes_logo_raylib + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_logo_raylib_anim.vcxproj b/projects/VS2019/examples/shapes_logo_raylib_anim.vcxproj new file mode 100644 index 000000000..954bf8a0d --- /dev/null +++ b/projects/VS2019/examples/shapes_logo_raylib_anim.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79} + Win32Proj + shapes_logo_raylib_anim + 10.0 + shapes_logo_raylib_anim + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/shapes_rectangle_scaling.vcxproj b/projects/VS2019/examples/shapes_rectangle_scaling.vcxproj new file mode 100644 index 000000000..46df80553 --- /dev/null +++ b/projects/VS2019/examples/shapes_rectangle_scaling.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF} + Win32Proj + shapes_rectangle_scaling + 10.0 + shapes_rectangle_scaling + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shapes + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/text_font_filters.vcxproj b/projects/VS2019/examples/text_font_filters.vcxproj new file mode 100644 index 000000000..28a60766e --- /dev/null +++ b/projects/VS2019/examples/text_font_filters.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A} + Win32Proj + text_font_filters + 10.0 + text_font_filters + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/text_font_loading.vcxproj b/projects/VS2019/examples/text_font_loading.vcxproj new file mode 100644 index 000000000..9a5b1f491 --- /dev/null +++ b/projects/VS2019/examples/text_font_loading.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {D550AB93-DF31-4B76-873F-F075018352F4} + Win32Proj + text_font_loading + 10.0 + text_font_loading + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/text_font_sdf.vcxproj b/projects/VS2019/examples/text_font_sdf.vcxproj new file mode 100644 index 000000000..94e6f91ca --- /dev/null +++ b/projects/VS2019/examples/text_font_sdf.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {31B41997-3890-45E3-93FE-C57B363E9C0D} + Win32Proj + text_font_sdf + 10.0 + text_font_sdf + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/text_font_spritefont.vcxproj b/projects/VS2019/examples/text_font_spritefont.vcxproj new file mode 100644 index 000000000..2cca27710 --- /dev/null +++ b/projects/VS2019/examples/text_font_spritefont.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {81064BCE-EEC1-43B0-9912-F05F2B54B11A} + Win32Proj + text_font_spritefont + 10.0 + text_font_spritefont + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/text_format_text.vcxproj b/projects/VS2019/examples/text_format_text.vcxproj new file mode 100644 index 000000000..11f64c3ef --- /dev/null +++ b/projects/VS2019/examples/text_format_text.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB} + Win32Proj + text_format_text + 10.0 + text_format_text + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/text_input_box.vcxproj b/projects/VS2019/examples/text_input_box.vcxproj new file mode 100644 index 000000000..b676c68ee --- /dev/null +++ b/projects/VS2019/examples/text_input_box.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {2BB0C1D4-9298-45AC-B244-67A99769A292} + Win32Proj + text_input_box + 10.0 + text_input_box + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/text_raylib_fonts.vcxproj b/projects/VS2019/examples/text_raylib_fonts.vcxproj new file mode 100644 index 000000000..d6eba6b18 --- /dev/null +++ b/projects/VS2019/examples/text_raylib_fonts.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F} + Win32Proj + text_raylib_fonts + 10.0 + text_raylib_fonts + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/text_rectangle_bounds.vcxproj b/projects/VS2019/examples/text_rectangle_bounds.vcxproj new file mode 100644 index 000000000..84fd35b97 --- /dev/null +++ b/projects/VS2019/examples/text_rectangle_bounds.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {25BCB876-B60A-499B-9046-E9801CFD7780} + Win32Proj + text_rectangle_bounds + 10.0 + text_rectangle_bounds + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/text_unicode.vcxproj b/projects/VS2019/examples/text_unicode.vcxproj new file mode 100644 index 000000000..c9b03bf58 --- /dev/null +++ b/projects/VS2019/examples/text_unicode.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D} + Win32Proj + text_unicode + 10.0 + text_unicode + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/text_writing_anim.vcxproj b/projects/VS2019/examples/text_writing_anim.vcxproj new file mode 100644 index 000000000..4ab989069 --- /dev/null +++ b/projects/VS2019/examples/text_writing_anim.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E} + Win32Proj + text_writing_anim + 10.0 + text_writing_anim + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\text + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_background_scrolling.vcxproj b/projects/VS2019/examples/textures_background_scrolling.vcxproj new file mode 100644 index 000000000..7ca736092 --- /dev/null +++ b/projects/VS2019/examples/textures_background_scrolling.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC} + Win32Proj + textures_background_scrolling + 10.0 + textures_background_scrolling + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_blend_modes.vcxproj b/projects/VS2019/examples/textures_blend_modes.vcxproj new file mode 100644 index 000000000..783e82580 --- /dev/null +++ b/projects/VS2019/examples/textures_blend_modes.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {6D75CD88-1A03-4955-B8C7-ACFC3742154F} + Win32Proj + textures_blend_modes + 10.0 + textures_blend_modes + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_bunnymark.vcxproj b/projects/VS2019/examples/textures_bunnymark.vcxproj new file mode 100644 index 000000000..c5640c67b --- /dev/null +++ b/projects/VS2019/examples/textures_bunnymark.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC} + Win32Proj + textures_bunnymark + 10.0 + textures_bunnymark + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_draw_tiled.vcxproj b/projects/VS2019/examples/textures_draw_tiled.vcxproj new file mode 100644 index 000000000..85a361cc8 --- /dev/null +++ b/projects/VS2019/examples/textures_draw_tiled.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {0BF60202-43F7-48E9-8717-D31E56FA5BE0} + Win32Proj + textures_draw_tiled + 10.0 + textures_draw_tiled + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_image_drawing.vcxproj b/projects/VS2019/examples/textures_image_drawing.vcxproj new file mode 100644 index 000000000..42737073d --- /dev/null +++ b/projects/VS2019/examples/textures_image_drawing.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {0C2D2F82-AE67-400C-B19C-8C9B957B132A} + Win32Proj + textures_image_drawing + 10.0 + textures_image_drawing + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_image_generation.vcxproj b/projects/VS2019/examples/textures_image_generation.vcxproj new file mode 100644 index 000000000..754bb6e32 --- /dev/null +++ b/projects/VS2019/examples/textures_image_generation.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {B19DD336-538E-4091-A559-EAA717FEC899} + Win32Proj + textures_image_generation + 10.0 + textures_image_generation + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_image_loading.vcxproj b/projects/VS2019/examples/textures_image_loading.vcxproj new file mode 100644 index 000000000..95f8fa93f --- /dev/null +++ b/projects/VS2019/examples/textures_image_loading.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE} + Win32Proj + textures_image_loading + 10.0 + textures_image_loading + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_image_processing.vcxproj b/projects/VS2019/examples/textures_image_processing.vcxproj new file mode 100644 index 000000000..0085aa74e --- /dev/null +++ b/projects/VS2019/examples/textures_image_processing.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {9F4135E3-9814-452C-9B35-0EFBCD792B49} + Win32Proj + textures_image_processing + 10.0 + textures_image_processing + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_image_text.vcxproj b/projects/VS2019/examples/textures_image_text.vcxproj new file mode 100644 index 000000000..cf658b71e --- /dev/null +++ b/projects/VS2019/examples/textures_image_text.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {9782E0C8-2BD3-4F67-B420-21CF19CA2435} + Win32Proj + textures_image_text + 10.0 + textures_image_text + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_logo_raylib.vcxproj b/projects/VS2019/examples/textures_logo_raylib.vcxproj new file mode 100644 index 000000000..309969e8e --- /dev/null +++ b/projects/VS2019/examples/textures_logo_raylib.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {7E855020-7FA4-482D-B510-2E709354FE8B} + Win32Proj + textures_logo_raylib + 10.0 + textures_logo_raylib + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_mouse_painting.vcxproj b/projects/VS2019/examples/textures_mouse_painting.vcxproj new file mode 100644 index 000000000..f2db6b510 --- /dev/null +++ b/projects/VS2019/examples/textures_mouse_painting.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {25923141-9859-4AFE-8168-0DF78322FC63} + Win32Proj + textures_mouse_painting + 10.0 + textures_mouse_painting + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_npatch_drawing.vcxproj b/projects/VS2019/examples/textures_npatch_drawing.vcxproj new file mode 100644 index 000000000..f26b4d43e --- /dev/null +++ b/projects/VS2019/examples/textures_npatch_drawing.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {0AB968E0-E993-45CE-8875-7453C96DF583} + Win32Proj + textures_npatch_drawing + 10.0 + textures_npatch_drawing + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_particles_blending.vcxproj b/projects/VS2019/examples/textures_particles_blending.vcxproj new file mode 100644 index 000000000..81ce6e234 --- /dev/null +++ b/projects/VS2019/examples/textures_particles_blending.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {2B78CF0A-5403-45E2-99BD-493F1679BCDB} + Win32Proj + textures_particles_blending + 10.0 + textures_particles_blending + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_raw_data.vcxproj b/projects/VS2019/examples/textures_raw_data.vcxproj new file mode 100644 index 000000000..ef1501067 --- /dev/null +++ b/projects/VS2019/examples/textures_raw_data.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7} + Win32Proj + textures_raw_data + 10.0 + textures_raw_data + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_rectangle.vcxproj b/projects/VS2019/examples/textures_rectangle.vcxproj new file mode 100644 index 000000000..a4736962d --- /dev/null +++ b/projects/VS2019/examples/textures_rectangle.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC} + Win32Proj + textures_rectangle + 10.0 + textures_rectangle + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_sprite_button.vcxproj b/projects/VS2019/examples/textures_sprite_button.vcxproj new file mode 100644 index 000000000..5a76481f4 --- /dev/null +++ b/projects/VS2019/examples/textures_sprite_button.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E} + Win32Proj + textures_sprite_button + 10.0 + textures_sprite_button + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_sprite_explosion.vcxproj b/projects/VS2019/examples/textures_sprite_explosion.vcxproj new file mode 100644 index 000000000..fd3d47717 --- /dev/null +++ b/projects/VS2019/examples/textures_sprite_explosion.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4} + Win32Proj + textures_sprite_explosion + 10.0 + textures_sprite_explosion + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_srcrec_dstrec.vcxproj b/projects/VS2019/examples/textures_srcrec_dstrec.vcxproj new file mode 100644 index 000000000..102adf4cc --- /dev/null +++ b/projects/VS2019/examples/textures_srcrec_dstrec.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {103B292B-049B-4B15-85A1-9F902840DB2C} + Win32Proj + textures_srcrec_dstrec + 10.0 + textures_srcrec_dstrec + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/examples/textures_to_image.vcxproj b/projects/VS2019/examples/textures_to_image.vcxproj new file mode 100644 index 000000000..478c33058 --- /dev/null +++ b/projects/VS2019/examples/textures_to_image.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0} + Win32Proj + textures_to_image + 10.0 + textures_to_image + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\textures + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + 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) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + 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) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2019/raylib.sln b/projects/VS2019/raylib.sln index 8fab7aefb..53d2a18ad 100644 --- a/projects/VS2019/raylib.sln +++ b/projects/VS2019/raylib.sln @@ -1,16 +1,280 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2024 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29411.108 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_basic_window", "examples\core_basic_window.vcxproj", "{0981CA98-E4A5-4DF1-987F-A41D09131EFC}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib", "raylib\raylib.vcxproj", "{E89D61AC-55DE-4482-AFD4-DF7242EBC859}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_basic_window_cpp", "examples\core_basic_window_cpp.vcxproj", "{B655E850-3322-42F7-941D-6AC18FD66CA1}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_basic_window", "examples\core_basic_window.vcxproj", "{0981CA98-E4A5-4DF1-987F-A41D09131EFC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_rectangle", "examples\textures_rectangle.vcxproj", "{C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_srcrec_dstrec", "examples\textures_srcrec_dstrec.vcxproj", "{103B292B-049B-4B15-85A1-9F902840DB2C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_image_drawing", "examples\textures_image_drawing.vcxproj", "{0C2D2F82-AE67-400C-B19C-8C9B957B132A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "audio_module_playing", "examples\audio_module_playing.vcxproj", "{E6784F91-4E4E-4956-A079-73FAB1AC7BE6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "audio_multichannel_sound", "examples\audio_multichannel_sound.vcxproj", "{9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "audio_music_stream", "examples\audio_music_stream.vcxproj", "{BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "audio_raw_stream", "examples\audio_raw_stream.vcxproj", "{93A1F656-0D29-4C5E-B140-11F23FF5D6AB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "audio_sound_loading", "examples\audio_sound_loading.vcxproj", "{F81C5819-85B6-4D2E-B6DC-104A7634461B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_2d_camera", "examples\core_2d_camera.vcxproj", "{66CC5B13-881A-412F-8C51-746622A91C5A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_2d_camera_platformer", "examples\core_2d_camera_platformer.vcxproj", "{CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_3d_camera_first_person", "examples\core_3d_camera_first_person.vcxproj", "{557138B0-7BE2-4392-B2E2-B45734031A62}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_3d_camera_free", "examples\core_3d_camera_free.vcxproj", "{9EED87BB-527F-4D05-9384-6D16CFD627A8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_3d_camera_mode", "examples\core_3d_camera_mode.vcxproj", "{6D1CA2F1-7FCA-4249-9220-075C2DF4F965}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_3d_picking", "examples\core_3d_picking.vcxproj", "{FD193822-3D5C-4161-A147-884C2ABDE483}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_custom_logging", "examples\core_custom_logging.vcxproj", "{20AD0AC9-9159-4744-99CC-6AC5779D6B87}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_drop_files", "examples\core_drop_files.vcxproj", "{0199E349-0701-40BC-8A7F-06A54FFA3E7C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_input_gamepad", "examples\core_input_gamepad.vcxproj", "{8F19E3DA-8929-4000-87B5-3CA6929636CC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_input_gestures", "examples\core_input_gestures.vcxproj", "{51A00565-5787-4911-9CC0-28403AA4909D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_input_keys", "examples\core_input_keys.vcxproj", "{92B64AE7-D773-4F05-89F1-CE59BBF4F053}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_input_mouse", "examples\core_input_mouse.vcxproj", "{A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_input_multitouch", "examples\core_input_multitouch.vcxproj", "{A643BB06-735D-47F3-BFE7-B6D3C36F7097}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_loading_thread", "examples\core_loading_thread.vcxproj", "{F026020F-7B00-40C8-91C3-5DE85EC45A95}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_quat_conversion", "examples\core_quat_conversion.vcxproj", "{6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_random_values", "examples\core_random_values.vcxproj", "{6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_scissor_test", "examples\core_scissor_test.vcxproj", "{59089B0C-AAB4-4532-B294-44DEAE7178B7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_storage_values", "examples\core_storage_values.vcxproj", "{C298876B-6C12-4EA4-903B-33450BCD9884}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_vr_simulator", "examples\core_vr_simulator.vcxproj", "{83F586FA-C801-4979-ACCA-006BD628CC88}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_window_flags", "examples\core_window_flags.vcxproj", "{86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_window_letterbox", "examples\core_window_letterbox.vcxproj", "{FF2970AE-E2E9-405F-B321-D523A1BD44A0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_world_screen", "examples\core_world_screen.vcxproj", "{79417CE2-FEEB-42F0-BC53-62D5267B19B1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_animation", "examples\models_animation.vcxproj", "{AFDDE100-2D36-4749-817D-12E54C56312F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_billboard", "examples\models_billboard.vcxproj", "{B7812167-50FB-4934-996F-DF6FE4CBBFDF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_box_collisions", "examples\models_box_collisions.vcxproj", "{39DB56C7-05F8-492C-A8D4-F19E40FECB59}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_cubicmap", "examples\models_cubicmap.vcxproj", "{82F3D34B-8DB2-4C6A-98B1-132245DD9D99}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "core", "core", "{6C82BAAE-BDDF-457D-8FA8-7E2490B07035}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "audio", "audio", "{CC132A4D-D081-4C26-BFB9-AB11984054F8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "models", "models", "{AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "textures", "textures", "{DA049009-21FF-4AC0-84E4-830DD1BCD0CE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shapes", "shapes", "{278D8859-20B1-428F-8448-064F46E1F021}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shaders", "shaders", "{5317807F-61D4-4E0F-B6DC-2D9F12621ED9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_first_person_maze", "examples\models_first_person_maze.vcxproj", "{CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_geometric_shapes", "examples\models_geometric_shapes.vcxproj", "{14BA7F98-02CC-4648-9236-676BFF9458AF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_gltf_animation", "examples\models_gltf_animation.vcxproj", "{FADC31C3-09AA-4DB4-A289-153482D10C09}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_gltf_model", "examples\models_gltf_model.vcxproj", "{F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_heightmap", "examples\models_heightmap.vcxproj", "{0859A973-E4FE-4688-8D16-0253163FDE24}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_loading", "examples\models_loading.vcxproj", "{F3412853-2B6A-4334-8CF2-B796CDAE0850}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_material_pbr", "examples\models_material_pbr.vcxproj", "{3A6C48C6-80AB-456F-A3A5-969930958971}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_mesh_generation", "examples\models_mesh_generation.vcxproj", "{BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_mesh_picking", "examples\models_mesh_picking.vcxproj", "{D03F2C82-9553-4AFA-8F49-9234009122B6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_orthographic_projection", "examples\models_orthographic_projection.vcxproj", "{FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_rlgl_solar_system", "examples\models_rlgl_solar_system.vcxproj", "{A53CCF42-A972-478F-9336-0F618B3EC06A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_skybox", "examples\models_skybox.vcxproj", "{0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_waving_cubes", "examples\models_waving_cubes.vcxproj", "{870723DD-945A-4136-B65B-4AF3BF85369C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_yaw_pitch_roll", "examples\models_yaw_pitch_roll.vcxproj", "{EA6488AD-445B-4835-87FB-EBC9E2EDAF97}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_to_image", "examples\textures_to_image.vcxproj", "{E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_sprite_explosion", "examples\textures_sprite_explosion.vcxproj", "{472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_sprite_button", "examples\textures_sprite_button.vcxproj", "{589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_raw_data", "examples\textures_raw_data.vcxproj", "{3AD868E6-8355-4F29-B5ED-7DE94AD786E7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_particles_blending", "examples\textures_particles_blending.vcxproj", "{2B78CF0A-5403-45E2-99BD-493F1679BCDB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_npatch_drawing", "examples\textures_npatch_drawing.vcxproj", "{0AB968E0-E993-45CE-8875-7453C96DF583}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_mouse_painting", "examples\textures_mouse_painting.vcxproj", "{25923141-9859-4AFE-8168-0DF78322FC63}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_logo_raylib", "examples\textures_logo_raylib.vcxproj", "{7E855020-7FA4-482D-B510-2E709354FE8B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_image_text", "examples\textures_image_text.vcxproj", "{9782E0C8-2BD3-4F67-B420-21CF19CA2435}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_image_processing", "examples\textures_image_processing.vcxproj", "{9F4135E3-9814-452C-9B35-0EFBCD792B49}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_image_loading", "examples\textures_image_loading.vcxproj", "{C45343E6-DAB6-4F3A-A00A-8BED71A098BE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_image_generation", "examples\textures_image_generation.vcxproj", "{B19DD336-538E-4091-A559-EAA717FEC899}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_draw_tiled", "examples\textures_draw_tiled.vcxproj", "{0BF60202-43F7-48E9-8717-D31E56FA5BE0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_bunnymark", "examples\textures_bunnymark.vcxproj", "{4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_blend_modes", "examples\textures_blend_modes.vcxproj", "{6D75CD88-1A03-4955-B8C7-ACFC3742154F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_background_scrolling", "examples\textures_background_scrolling.vcxproj", "{8DD0EB7E-668E-452D-91D7-906C64A9C8AC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "text", "text", "{8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "physics", "physics", "{D6B669E2-68D0-4E62-83D1-E14DDD6A356F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "network", "network", "{F62E751F-C5A9-46CA-AF6D-33925880EF83}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "other", "other", "{E9D708A5-9C1F-4B84-A795-C5F191801762}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "text_writing_anim", "examples\text_writing_anim.vcxproj", "{F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "text_unicode", "examples\text_unicode.vcxproj", "{1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "text_rectangle_bounds", "examples\text_rectangle_bounds.vcxproj", "{25BCB876-B60A-499B-9046-E9801CFD7780}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "text_raylib_fonts", "examples\text_raylib_fonts.vcxproj", "{56FB0A45-145F-4EAE-B2C8-E5833E682D8F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "text_input_box", "examples\text_input_box.vcxproj", "{2BB0C1D4-9298-45AC-B244-67A99769A292}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "text_format_text", "examples\text_format_text.vcxproj", "{99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "text_font_spritefont", "examples\text_font_spritefont.vcxproj", "{81064BCE-EEC1-43B0-9912-F05F2B54B11A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "text_font_sdf", "examples\text_font_sdf.vcxproj", "{31B41997-3890-45E3-93FE-C57B363E9C0D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "text_font_loading", "examples\text_font_loading.vcxproj", "{D550AB93-DF31-4B76-873F-F075018352F4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "text_font_filters", "examples\text_font_filters.vcxproj", "{8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_rectangle_scaling", "examples\shapes_rectangle_scaling.vcxproj", "{F90FCDC5-EE14-4B89-96DB-4392E28F34AF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_logo_raylib_anim", "examples\shapes_logo_raylib_anim.vcxproj", "{93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_logo_raylib", "examples\shapes_logo_raylib.vcxproj", "{56E68E37-B3FC-4799-91AF-0CA10B6D55A5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_lines_bezier", "examples\shapes_lines_bezier.vcxproj", "{03E7018C-44A2-4C46-9CE7-F2A135A2692B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_following_eyes", "examples\shapes_following_eyes.vcxproj", "{F3F6FE4D-9D9E-451A-B0BA-81456104B672}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_basic_shapes", "examples\shapes_basic_shapes.vcxproj", "{C27794B5-1293-4EA7-BC0E-0F18E6325539}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_bouncing_ball", "examples\shapes_bouncing_ball.vcxproj", "{02F41059-12A2-4A96-8D77-07EFE4B108FD}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_collision_area", "examples\shapes_collision_area.vcxproj", "{B774E0B9-9514-4E88-975F-4EB6C3B8D519}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_colors_palette", "examples\shapes_colors_palette.vcxproj", "{D91367C2-2189-4859-A7FE-D2CAB84FA15C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_draw_circle_sector", "examples\shapes_draw_circle_sector.vcxproj", "{33459B4E-1839-4856-BF6B-22480D11FE31}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_draw_rectangle_rounded", "examples\shapes_draw_rectangle_rounded.vcxproj", "{48871156-181A-475A-BD8D-200086A09675}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_draw_ring", "examples\shapes_draw_ring.vcxproj", "{C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_easings_ball_anim", "examples\shapes_easings_ball_anim.vcxproj", "{1C49E35A-2838-49D9-9D5F-4B8134960EF6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_easings_box_anim", "examples\shapes_easings_box_anim.vcxproj", "{F91142E2-A999-47F0-9E74-38C1E2930EBE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_easings_rectangle_array", "examples\shapes_easings_rectangle_array.vcxproj", "{1EDD4BCF-345C-4065-8CBD-7285224293C3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "physics_demo", "examples\physics_demo.vcxproj", "{581F89BD-FBB9-4699-B8DB-EB38E6DEE097}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "physics_friction", "examples\physics_friction.vcxproj", "{A6260ED4-5361-4B61-B6B9-8D8119457BA4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "physics_movement", "examples\physics_movement.vcxproj", "{29817904-E3D3-4C28-BD8D-A3A09DD199D2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "physics_restitution", "examples\physics_restitution.vcxproj", "{C7A235DF-460E-4816-9F3B-E0DEFA376EF1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "physics_shatter", "examples\physics_shatter.vcxproj", "{F272EF74-990E-4637-AF9E-77DC7139D95D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_basic_lighting", "examples\shaders_basic_lighting.vcxproj", "{A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_custom_uniform", "examples\shaders_custom_uniform.vcxproj", "{B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_eratosthenes", "examples\shaders_eratosthenes.vcxproj", "{D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_fog", "examples\shaders_fog.vcxproj", "{4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_hot_reloading", "examples\shaders_hot_reloading.vcxproj", "{CF3755C4-937D-4ABF-B7B3-95140808717F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_julia_set", "examples\shaders_julia_set.vcxproj", "{D34939FE-8873-4C53-8D6C-74DED78EA3C4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_model_shader", "examples\shaders_model_shader.vcxproj", "{D408A730-363A-4ABF-BCEF-5D63DCC66042}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_multi_sample2d", "examples\shaders_multi_sample2d.vcxproj", "{F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_palette_switch", "examples\shaders_palette_switch.vcxproj", "{52FB7463-C128-42AF-A02F-78F48473EA9A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_postprocessing", "examples\shaders_postprocessing.vcxproj", "{7381D91E-5C72-48F0-AAB4-95C9B10D7484}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_raymarching", "examples\shaders_raymarching.vcxproj", "{D36EC43E-B31F-4CF4-8285-93A7A9D90189}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_mesh_instancing", "examples\shaders_mesh_instancing.vcxproj", "{274C0319-7E1E-4188-936B-8DF3331230B3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_shapes_textures", "examples\shaders_shapes_textures.vcxproj", "{41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_simple_mask", "examples\shaders_simple_mask.vcxproj", "{600C3D4F-0670-4DB4-B30F-520A729053B5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_spotlight", "examples\shaders_spotlight.vcxproj", "{11F33A39-74B7-4018-B5F9-CC285A673A8F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_texture_drawing", "examples\shaders_texture_drawing.vcxproj", "{A6F5E35E-B4A7-41B3-853A-75558E6E0715}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_texture_waves", "examples\shaders_texture_waves.vcxproj", "{291B4975-8EFF-4C7C-8AF3-44A77B8491B8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "network_ping_pong", "examples\network_ping_pong.vcxproj", "{ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "network_resolve_host", "examples\network_resolve_host.vcxproj", "{ECC50F23-5205-43C3-8D72-98B03B2C7ED5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "network_tcp_client", "examples\network_tcp_client.vcxproj", "{8A1BB135-57E2-4BF1-B923-3EA21C141C2F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "network_tcp_server", "examples\network_tcp_server.vcxproj", "{537851A6-25F0-4F47-A43E-A0D272591DBA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "network_test", "examples\network_test.vcxproj", "{D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "network_udp_client", "examples\network_udp_client.vcxproj", "{19B5E933-AF1B-48E3-AC23-9359C00B8963}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "network_udp_server", "examples\network_udp_server.vcxproj", "{280017A6-E892-4E1C-902F-C7690CB55267}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "embedded_files_loading", "examples\embedded_files_loading.vcxproj", "{FDE6080B-E203-4066-910D-AD0302566008}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "easings_testbed", "examples\easings_testbed.vcxproj", "{E1B6D565-9D7C-46B7-9202-ECF54974DE50}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raudio_standalone", "examples\raudio_standalone.vcxproj", "{6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rlgl_standalone", "examples\rlgl_standalone.vcxproj", "{C8765523-58F8-4C8E-9914-693396F6F0FF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_split_screen", "examples\core_split_screen.vcxproj", "{946A1700-C7AA-46F0-AEF2-67C98B5722AC}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug.DLL|x64 = Debug.DLL|x64 @@ -23,22 +287,6 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x64.ActiveCfg = Debug|x64 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x64.Build.0 = Debug|x64 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x86.ActiveCfg = Debug|Win32 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x86.Build.0 = Debug|Win32 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x64.Build.0 = Release.DLL|x64 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x86.Build.0 = Release.DLL|Win32 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.ActiveCfg = Release|x64 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.Build.0 = Release|x64 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.ActiveCfg = Release|Win32 - {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.Build.0 = Release|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 @@ -55,29 +303,2125 @@ Global {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x64.Build.0 = Release|x64 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x86.ActiveCfg = Release|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x86.Build.0 = Release|Win32 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug|x64.ActiveCfg = Debug|x64 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug|x64.Build.0 = Debug|x64 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug|x86.ActiveCfg = Debug|Win32 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug|x86.Build.0 = Debug|Win32 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release.DLL|x64.Build.0 = Release.DLL|x64 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release.DLL|x86.Build.0 = Release.DLL|Win32 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release|x64.ActiveCfg = Release|x64 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release|x64.Build.0 = Release|x64 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release|x86.ActiveCfg = Release|Win32 - {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release|x86.Build.0 = Release|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x64.ActiveCfg = Debug|x64 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x64.Build.0 = Debug|x64 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x86.ActiveCfg = Debug|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x86.Build.0 = Debug|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.ActiveCfg = Release|x64 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.Build.0 = Release|x64 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.ActiveCfg = Release|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.Build.0 = Release|Win32 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Debug|x64.ActiveCfg = Debug|x64 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Debug|x64.Build.0 = Debug|x64 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Debug|x86.ActiveCfg = Debug|Win32 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Debug|x86.Build.0 = Debug|Win32 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Release|x64.ActiveCfg = Release|x64 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Release|x64.Build.0 = Release|x64 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Release|x86.ActiveCfg = Release|Win32 + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}.Release|x86.Build.0 = Release|Win32 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Debug|x64.ActiveCfg = Debug|x64 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Debug|x64.Build.0 = Debug|x64 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Debug|x86.ActiveCfg = Debug|Win32 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Debug|x86.Build.0 = Debug|Win32 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Release|x64.ActiveCfg = Release|x64 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Release|x64.Build.0 = Release|x64 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Release|x86.ActiveCfg = Release|Win32 + {103B292B-049B-4B15-85A1-9F902840DB2C}.Release|x86.Build.0 = Release|Win32 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Debug|x64.ActiveCfg = Debug|x64 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Debug|x64.Build.0 = Debug|x64 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Debug|x86.ActiveCfg = Debug|Win32 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Debug|x86.Build.0 = Debug|Win32 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Release|x64.ActiveCfg = Release|x64 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Release|x64.Build.0 = Release|x64 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Release|x86.ActiveCfg = Release|Win32 + {0C2D2F82-AE67-400C-B19C-8C9B957B132A}.Release|x86.Build.0 = Release|Win32 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Debug|x64.ActiveCfg = Debug|x64 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Debug|x64.Build.0 = Debug|x64 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Debug|x86.ActiveCfg = Debug|Win32 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Debug|x86.Build.0 = Debug|Win32 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Release|x64.ActiveCfg = Release|x64 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Release|x64.Build.0 = Release|x64 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Release|x86.ActiveCfg = Release|Win32 + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6}.Release|x86.Build.0 = Release|Win32 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Debug|x64.ActiveCfg = Debug|x64 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Debug|x64.Build.0 = Debug|x64 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Debug|x86.ActiveCfg = Debug|Win32 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Debug|x86.Build.0 = Debug|Win32 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Release|x64.ActiveCfg = Release|x64 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Release|x64.Build.0 = Release|x64 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Release|x86.ActiveCfg = Release|Win32 + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F}.Release|x86.Build.0 = Release|Win32 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Debug|x64.ActiveCfg = Debug|x64 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Debug|x64.Build.0 = Debug|x64 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Debug|x86.ActiveCfg = Debug|Win32 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Debug|x86.Build.0 = Debug|Win32 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Release|x64.ActiveCfg = Release|x64 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Release|x64.Build.0 = Release|x64 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Release|x86.ActiveCfg = Release|Win32 + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9}.Release|x86.Build.0 = Release|Win32 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Debug|x64.ActiveCfg = Debug|x64 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Debug|x64.Build.0 = Debug|x64 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Debug|x86.ActiveCfg = Debug|Win32 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Debug|x86.Build.0 = Debug|Win32 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Release|x64.ActiveCfg = Release|x64 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Release|x64.Build.0 = Release|x64 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Release|x86.ActiveCfg = Release|Win32 + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB}.Release|x86.Build.0 = Release|Win32 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Debug|x64.ActiveCfg = Debug|x64 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Debug|x64.Build.0 = Debug|x64 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Debug|x86.ActiveCfg = Debug|Win32 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Debug|x86.Build.0 = Debug|Win32 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Release|x64.ActiveCfg = Release|x64 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Release|x64.Build.0 = Release|x64 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Release|x86.ActiveCfg = Release|Win32 + {F81C5819-85B6-4D2E-B6DC-104A7634461B}.Release|x86.Build.0 = Release|Win32 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Debug|x64.ActiveCfg = Debug|x64 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Debug|x64.Build.0 = Debug|x64 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Debug|x86.ActiveCfg = Debug|Win32 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Debug|x86.Build.0 = Debug|Win32 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Release|x64.ActiveCfg = Release|x64 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Release|x64.Build.0 = Release|x64 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Release|x86.ActiveCfg = Release|Win32 + {66CC5B13-881A-412F-8C51-746622A91C5A}.Release|x86.Build.0 = Release|Win32 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Debug|x64.ActiveCfg = Debug|x64 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Debug|x64.Build.0 = Debug|x64 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Debug|x86.ActiveCfg = Debug|Win32 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Debug|x86.Build.0 = Debug|Win32 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Release|x64.ActiveCfg = Release|x64 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Release|x64.Build.0 = Release|x64 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Release|x86.ActiveCfg = Release|Win32 + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B}.Release|x86.Build.0 = Release|Win32 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Debug|x64.ActiveCfg = Debug|x64 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Debug|x64.Build.0 = Debug|x64 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Debug|x86.ActiveCfg = Debug|Win32 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Debug|x86.Build.0 = Debug|Win32 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Release|x64.ActiveCfg = Release|x64 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Release|x64.Build.0 = Release|x64 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Release|x86.ActiveCfg = Release|Win32 + {557138B0-7BE2-4392-B2E2-B45734031A62}.Release|x86.Build.0 = Release|Win32 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Debug|x64.ActiveCfg = Debug|x64 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Debug|x64.Build.0 = Debug|x64 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Debug|x86.ActiveCfg = Debug|Win32 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Debug|x86.Build.0 = Debug|Win32 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Release|x64.ActiveCfg = Release|x64 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Release|x64.Build.0 = Release|x64 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Release|x86.ActiveCfg = Release|Win32 + {9EED87BB-527F-4D05-9384-6D16CFD627A8}.Release|x86.Build.0 = Release|Win32 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Debug|x64.ActiveCfg = Debug|x64 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Debug|x64.Build.0 = Debug|x64 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Debug|x86.ActiveCfg = Debug|Win32 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Debug|x86.Build.0 = Debug|Win32 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Release|x64.ActiveCfg = Release|x64 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Release|x64.Build.0 = Release|x64 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Release|x86.ActiveCfg = Release|Win32 + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965}.Release|x86.Build.0 = Release|Win32 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Debug|x64.ActiveCfg = Debug|x64 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Debug|x64.Build.0 = Debug|x64 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Debug|x86.ActiveCfg = Debug|Win32 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Debug|x86.Build.0 = Debug|Win32 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Release|x64.ActiveCfg = Release|x64 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Release|x64.Build.0 = Release|x64 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Release|x86.ActiveCfg = Release|Win32 + {FD193822-3D5C-4161-A147-884C2ABDE483}.Release|x86.Build.0 = Release|Win32 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Debug|x64.ActiveCfg = Debug|x64 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Debug|x64.Build.0 = Debug|x64 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Debug|x86.ActiveCfg = Debug|Win32 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Debug|x86.Build.0 = Debug|Win32 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Release|x64.ActiveCfg = Release|x64 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Release|x64.Build.0 = Release|x64 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Release|x86.ActiveCfg = Release|Win32 + {20AD0AC9-9159-4744-99CC-6AC5779D6B87}.Release|x86.Build.0 = Release|Win32 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Debug|x64.ActiveCfg = Debug|x64 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Debug|x64.Build.0 = Debug|x64 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Debug|x86.ActiveCfg = Debug|Win32 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Debug|x86.Build.0 = Debug|Win32 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Release|x64.ActiveCfg = Release|x64 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Release|x64.Build.0 = Release|x64 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Release|x86.ActiveCfg = Release|Win32 + {0199E349-0701-40BC-8A7F-06A54FFA3E7C}.Release|x86.Build.0 = Release|Win32 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Debug|x64.ActiveCfg = Debug|x64 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Debug|x64.Build.0 = Debug|x64 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Debug|x86.ActiveCfg = Debug|Win32 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Debug|x86.Build.0 = Debug|Win32 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Release|x64.ActiveCfg = Release|x64 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Release|x64.Build.0 = Release|x64 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Release|x86.ActiveCfg = Release|Win32 + {8F19E3DA-8929-4000-87B5-3CA6929636CC}.Release|x86.Build.0 = Release|Win32 + {51A00565-5787-4911-9CC0-28403AA4909D}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {51A00565-5787-4911-9CC0-28403AA4909D}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {51A00565-5787-4911-9CC0-28403AA4909D}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {51A00565-5787-4911-9CC0-28403AA4909D}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {51A00565-5787-4911-9CC0-28403AA4909D}.Debug|x64.ActiveCfg = Debug|x64 + {51A00565-5787-4911-9CC0-28403AA4909D}.Debug|x64.Build.0 = Debug|x64 + {51A00565-5787-4911-9CC0-28403AA4909D}.Debug|x86.ActiveCfg = Debug|Win32 + {51A00565-5787-4911-9CC0-28403AA4909D}.Debug|x86.Build.0 = Debug|Win32 + {51A00565-5787-4911-9CC0-28403AA4909D}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {51A00565-5787-4911-9CC0-28403AA4909D}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {51A00565-5787-4911-9CC0-28403AA4909D}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {51A00565-5787-4911-9CC0-28403AA4909D}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {51A00565-5787-4911-9CC0-28403AA4909D}.Release|x64.ActiveCfg = Release|x64 + {51A00565-5787-4911-9CC0-28403AA4909D}.Release|x64.Build.0 = Release|x64 + {51A00565-5787-4911-9CC0-28403AA4909D}.Release|x86.ActiveCfg = Release|Win32 + {51A00565-5787-4911-9CC0-28403AA4909D}.Release|x86.Build.0 = Release|Win32 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Debug|x64.ActiveCfg = Debug|x64 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Debug|x64.Build.0 = Debug|x64 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Debug|x86.ActiveCfg = Debug|Win32 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Debug|x86.Build.0 = Debug|Win32 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Release|x64.ActiveCfg = Release|x64 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Release|x64.Build.0 = Release|x64 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Release|x86.ActiveCfg = Release|Win32 + {92B64AE7-D773-4F05-89F1-CE59BBF4F053}.Release|x86.Build.0 = Release|Win32 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Debug|x64.ActiveCfg = Debug|x64 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Debug|x64.Build.0 = Debug|x64 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Debug|x86.ActiveCfg = Debug|Win32 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Debug|x86.Build.0 = Debug|Win32 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Release|x64.ActiveCfg = Release|x64 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Release|x64.Build.0 = Release|x64 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Release|x86.ActiveCfg = Release|Win32 + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3}.Release|x86.Build.0 = Release|Win32 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Debug|x64.ActiveCfg = Debug|x64 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Debug|x64.Build.0 = Debug|x64 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Debug|x86.ActiveCfg = Debug|Win32 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Debug|x86.Build.0 = Debug|Win32 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Release|x64.ActiveCfg = Release|x64 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Release|x64.Build.0 = Release|x64 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Release|x86.ActiveCfg = Release|Win32 + {A643BB06-735D-47F3-BFE7-B6D3C36F7097}.Release|x86.Build.0 = Release|Win32 + {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug|x64.ActiveCfg = Debug|x64 + {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug|x64.Build.0 = Debug|x64 + {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug|x86.ActiveCfg = Debug|Win32 + {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug|x86.Build.0 = Debug|Win32 + {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release|x64.ActiveCfg = Release|x64 + {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release|x64.Build.0 = Release|x64 + {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release|x86.ActiveCfg = Release|Win32 + {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release|x86.Build.0 = Release|Win32 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Debug|x64.ActiveCfg = Debug|x64 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Debug|x64.Build.0 = Debug|x64 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Debug|x86.ActiveCfg = Debug|Win32 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Debug|x86.Build.0 = Debug|Win32 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Release|x64.ActiveCfg = Release|x64 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Release|x64.Build.0 = Release|x64 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Release|x86.ActiveCfg = Release|Win32 + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A}.Release|x86.Build.0 = Release|Win32 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Debug|x64.ActiveCfg = Debug|x64 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Debug|x64.Build.0 = Debug|x64 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Debug|x86.ActiveCfg = Debug|Win32 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Debug|x86.Build.0 = Debug|Win32 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Release|x64.ActiveCfg = Release|x64 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Release|x64.Build.0 = Release|x64 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Release|x86.ActiveCfg = Release|Win32 + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Release|x86.Build.0 = Release|Win32 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Debug|x64.ActiveCfg = Debug|x64 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Debug|x64.Build.0 = Debug|x64 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Debug|x86.ActiveCfg = Debug|Win32 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Debug|x86.Build.0 = Debug|Win32 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Release|x64.ActiveCfg = Release|x64 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Release|x64.Build.0 = Release|x64 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Release|x86.ActiveCfg = Release|Win32 + {59089B0C-AAB4-4532-B294-44DEAE7178B7}.Release|x86.Build.0 = Release|Win32 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Debug|x64.ActiveCfg = Debug|x64 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Debug|x64.Build.0 = Debug|x64 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Debug|x86.ActiveCfg = Debug|Win32 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Debug|x86.Build.0 = Debug|Win32 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Release|x64.ActiveCfg = Release|x64 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Release|x64.Build.0 = Release|x64 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Release|x86.ActiveCfg = Release|Win32 + {C298876B-6C12-4EA4-903B-33450BCD9884}.Release|x86.Build.0 = Release|Win32 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Debug|x64.ActiveCfg = Debug|x64 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Debug|x64.Build.0 = Debug|x64 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Debug|x86.ActiveCfg = Debug|Win32 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Debug|x86.Build.0 = Debug|Win32 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Release|x64.ActiveCfg = Release|x64 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Release|x64.Build.0 = Release|x64 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Release|x86.ActiveCfg = Release|Win32 + {83F586FA-C801-4979-ACCA-006BD628CC88}.Release|x86.Build.0 = Release|Win32 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Debug|x64.ActiveCfg = Debug|x64 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Debug|x64.Build.0 = Debug|x64 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Debug|x86.ActiveCfg = Debug|Win32 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Debug|x86.Build.0 = Debug|Win32 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Release|x64.ActiveCfg = Release|x64 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Release|x64.Build.0 = Release|x64 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Release|x86.ActiveCfg = Release|Win32 + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22}.Release|x86.Build.0 = Release|Win32 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Debug|x64.ActiveCfg = Debug|x64 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Debug|x64.Build.0 = Debug|x64 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Debug|x86.ActiveCfg = Debug|Win32 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Debug|x86.Build.0 = Debug|Win32 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Release|x64.ActiveCfg = Release|x64 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Release|x64.Build.0 = Release|x64 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Release|x86.ActiveCfg = Release|Win32 + {FF2970AE-E2E9-405F-B321-D523A1BD44A0}.Release|x86.Build.0 = Release|Win32 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Debug|x64.ActiveCfg = Debug|x64 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Debug|x64.Build.0 = Debug|x64 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Debug|x86.ActiveCfg = Debug|Win32 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Debug|x86.Build.0 = Debug|Win32 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Release|x64.ActiveCfg = Release|x64 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Release|x64.Build.0 = Release|x64 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Release|x86.ActiveCfg = Release|Win32 + {79417CE2-FEEB-42F0-BC53-62D5267B19B1}.Release|x86.Build.0 = Release|Win32 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Debug|x64.ActiveCfg = Debug|x64 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Debug|x64.Build.0 = Debug|x64 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Debug|x86.ActiveCfg = Debug|Win32 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Debug|x86.Build.0 = Debug|Win32 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Release|x64.ActiveCfg = Release|x64 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Release|x64.Build.0 = Release|x64 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Release|x86.ActiveCfg = Release|Win32 + {AFDDE100-2D36-4749-817D-12E54C56312F}.Release|x86.Build.0 = Release|Win32 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Debug|x64.ActiveCfg = Debug|x64 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Debug|x64.Build.0 = Debug|x64 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Debug|x86.ActiveCfg = Debug|Win32 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Debug|x86.Build.0 = Debug|Win32 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Release|x64.ActiveCfg = Release|x64 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Release|x64.Build.0 = Release|x64 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Release|x86.ActiveCfg = Release|Win32 + {B7812167-50FB-4934-996F-DF6FE4CBBFDF}.Release|x86.Build.0 = Release|Win32 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Debug|x64.ActiveCfg = Debug|x64 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Debug|x64.Build.0 = Debug|x64 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Debug|x86.ActiveCfg = Debug|Win32 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Debug|x86.Build.0 = Debug|Win32 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Release|x64.ActiveCfg = Release|x64 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Release|x64.Build.0 = Release|x64 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Release|x86.ActiveCfg = Release|Win32 + {39DB56C7-05F8-492C-A8D4-F19E40FECB59}.Release|x86.Build.0 = Release|Win32 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Debug|x64.ActiveCfg = Debug|x64 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Debug|x64.Build.0 = Debug|x64 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Debug|x86.ActiveCfg = Debug|Win32 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Debug|x86.Build.0 = Debug|Win32 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Release|x64.ActiveCfg = Release|x64 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Release|x64.Build.0 = Release|x64 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Release|x86.ActiveCfg = Release|Win32 + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99}.Release|x86.Build.0 = Release|Win32 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Debug|x64.ActiveCfg = Debug|x64 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Debug|x64.Build.0 = Debug|x64 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Debug|x86.ActiveCfg = Debug|Win32 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Debug|x86.Build.0 = Debug|Win32 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Release|x64.ActiveCfg = Release|x64 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Release|x64.Build.0 = Release|x64 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Release|x86.ActiveCfg = Release|Win32 + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62}.Release|x86.Build.0 = Release|Win32 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Debug|x64.ActiveCfg = Debug|x64 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Debug|x64.Build.0 = Debug|x64 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Debug|x86.ActiveCfg = Debug|Win32 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Debug|x86.Build.0 = Debug|Win32 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Release|x64.ActiveCfg = Release|x64 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Release|x64.Build.0 = Release|x64 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Release|x86.ActiveCfg = Release|Win32 + {14BA7F98-02CC-4648-9236-676BFF9458AF}.Release|x86.Build.0 = Release|Win32 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Debug|x64.ActiveCfg = Debug|x64 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Debug|x64.Build.0 = Debug|x64 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Debug|x86.ActiveCfg = Debug|Win32 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Debug|x86.Build.0 = Debug|Win32 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Release|x64.ActiveCfg = Release|x64 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Release|x64.Build.0 = Release|x64 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Release|x86.ActiveCfg = Release|Win32 + {FADC31C3-09AA-4DB4-A289-153482D10C09}.Release|x86.Build.0 = Release|Win32 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Debug|x64.ActiveCfg = Debug|x64 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Debug|x64.Build.0 = Debug|x64 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Debug|x86.ActiveCfg = Debug|Win32 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Debug|x86.Build.0 = Debug|Win32 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Release|x64.ActiveCfg = Release|x64 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Release|x64.Build.0 = Release|x64 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Release|x86.ActiveCfg = Release|Win32 + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71}.Release|x86.Build.0 = Release|Win32 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Debug|x64.ActiveCfg = Debug|x64 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Debug|x64.Build.0 = Debug|x64 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Debug|x86.ActiveCfg = Debug|Win32 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Debug|x86.Build.0 = Debug|Win32 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Release|x64.ActiveCfg = Release|x64 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Release|x64.Build.0 = Release|x64 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Release|x86.ActiveCfg = Release|Win32 + {0859A973-E4FE-4688-8D16-0253163FDE24}.Release|x86.Build.0 = Release|Win32 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Debug|x64.ActiveCfg = Debug|x64 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Debug|x64.Build.0 = Debug|x64 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Debug|x86.ActiveCfg = Debug|Win32 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Debug|x86.Build.0 = Debug|Win32 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Release|x64.ActiveCfg = Release|x64 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Release|x64.Build.0 = Release|x64 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Release|x86.ActiveCfg = Release|Win32 + {F3412853-2B6A-4334-8CF2-B796CDAE0850}.Release|x86.Build.0 = Release|Win32 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Debug|x64.ActiveCfg = Debug|x64 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Debug|x64.Build.0 = Debug|x64 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Debug|x86.ActiveCfg = Debug|Win32 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Debug|x86.Build.0 = Debug|Win32 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Release|x64.ActiveCfg = Release|x64 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Release|x64.Build.0 = Release|x64 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Release|x86.ActiveCfg = Release|Win32 + {3A6C48C6-80AB-456F-A3A5-969930958971}.Release|x86.Build.0 = Release|Win32 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Debug|x64.ActiveCfg = Debug|x64 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Debug|x64.Build.0 = Debug|x64 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Debug|x86.ActiveCfg = Debug|Win32 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Debug|x86.Build.0 = Debug|Win32 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Release|x64.ActiveCfg = Release|x64 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Release|x64.Build.0 = Release|x64 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Release|x86.ActiveCfg = Release|Win32 + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912}.Release|x86.Build.0 = Release|Win32 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Debug|x64.ActiveCfg = Debug|x64 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Debug|x64.Build.0 = Debug|x64 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Debug|x86.ActiveCfg = Debug|Win32 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Debug|x86.Build.0 = Debug|Win32 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Release|x64.ActiveCfg = Release|x64 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Release|x64.Build.0 = Release|x64 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Release|x86.ActiveCfg = Release|Win32 + {D03F2C82-9553-4AFA-8F49-9234009122B6}.Release|x86.Build.0 = Release|Win32 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Debug|x64.ActiveCfg = Debug|x64 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Debug|x64.Build.0 = Debug|x64 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Debug|x86.ActiveCfg = Debug|Win32 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Debug|x86.Build.0 = Debug|Win32 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Release|x64.ActiveCfg = Release|x64 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Release|x64.Build.0 = Release|x64 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Release|x86.ActiveCfg = Release|Win32 + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3}.Release|x86.Build.0 = Release|Win32 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Debug|x64.ActiveCfg = Debug|x64 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Debug|x64.Build.0 = Debug|x64 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Debug|x86.ActiveCfg = Debug|Win32 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Debug|x86.Build.0 = Debug|Win32 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Release|x64.ActiveCfg = Release|x64 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Release|x64.Build.0 = Release|x64 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Release|x86.ActiveCfg = Release|Win32 + {A53CCF42-A972-478F-9336-0F618B3EC06A}.Release|x86.Build.0 = Release|Win32 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Debug|x64.ActiveCfg = Debug|x64 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Debug|x64.Build.0 = Debug|x64 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Debug|x86.ActiveCfg = Debug|Win32 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Debug|x86.Build.0 = Debug|Win32 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Release|x64.ActiveCfg = Release|x64 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Release|x64.Build.0 = Release|x64 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Release|x86.ActiveCfg = Release|Win32 + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA}.Release|x86.Build.0 = Release|Win32 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Debug|x64.ActiveCfg = Debug|x64 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Debug|x64.Build.0 = Debug|x64 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Debug|x86.ActiveCfg = Debug|Win32 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Debug|x86.Build.0 = Debug|Win32 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Release|x64.ActiveCfg = Release|x64 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Release|x64.Build.0 = Release|x64 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Release|x86.ActiveCfg = Release|Win32 + {870723DD-945A-4136-B65B-4AF3BF85369C}.Release|x86.Build.0 = Release|Win32 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Debug|x64.ActiveCfg = Debug|x64 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Debug|x64.Build.0 = Debug|x64 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Debug|x86.ActiveCfg = Debug|Win32 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Debug|x86.Build.0 = Debug|Win32 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Release|x64.ActiveCfg = Release|x64 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Release|x64.Build.0 = Release|x64 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Release|x86.ActiveCfg = Release|Win32 + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97}.Release|x86.Build.0 = Release|Win32 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Debug|x64.ActiveCfg = Debug|x64 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Debug|x64.Build.0 = Debug|x64 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Debug|x86.ActiveCfg = Debug|Win32 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Debug|x86.Build.0 = Debug|Win32 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Release|x64.ActiveCfg = Release|x64 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Release|x64.Build.0 = Release|x64 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Release|x86.ActiveCfg = Release|Win32 + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0}.Release|x86.Build.0 = Release|Win32 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Debug|x64.ActiveCfg = Debug|x64 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Debug|x64.Build.0 = Debug|x64 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Debug|x86.ActiveCfg = Debug|Win32 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Debug|x86.Build.0 = Debug|Win32 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Release|x64.ActiveCfg = Release|x64 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Release|x64.Build.0 = Release|x64 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Release|x86.ActiveCfg = Release|Win32 + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4}.Release|x86.Build.0 = Release|Win32 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Debug|x64.ActiveCfg = Debug|x64 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Debug|x64.Build.0 = Debug|x64 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Debug|x86.ActiveCfg = Debug|Win32 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Debug|x86.Build.0 = Debug|Win32 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Release|x64.ActiveCfg = Release|x64 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Release|x64.Build.0 = Release|x64 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Release|x86.ActiveCfg = Release|Win32 + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E}.Release|x86.Build.0 = Release|Win32 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Debug|x64.ActiveCfg = Debug|x64 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Debug|x64.Build.0 = Debug|x64 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Debug|x86.ActiveCfg = Debug|Win32 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Debug|x86.Build.0 = Debug|Win32 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Release|x64.ActiveCfg = Release|x64 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Release|x64.Build.0 = Release|x64 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Release|x86.ActiveCfg = Release|Win32 + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7}.Release|x86.Build.0 = Release|Win32 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Debug|x64.ActiveCfg = Debug|x64 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Debug|x64.Build.0 = Debug|x64 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Debug|x86.ActiveCfg = Debug|Win32 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Debug|x86.Build.0 = Debug|Win32 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Release|x64.ActiveCfg = Release|x64 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Release|x64.Build.0 = Release|x64 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Release|x86.ActiveCfg = Release|Win32 + {2B78CF0A-5403-45E2-99BD-493F1679BCDB}.Release|x86.Build.0 = Release|Win32 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Debug|x64.ActiveCfg = Debug|x64 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Debug|x64.Build.0 = Debug|x64 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Debug|x86.ActiveCfg = Debug|Win32 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Debug|x86.Build.0 = Debug|Win32 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Release|x64.ActiveCfg = Release|x64 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Release|x64.Build.0 = Release|x64 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Release|x86.ActiveCfg = Release|Win32 + {0AB968E0-E993-45CE-8875-7453C96DF583}.Release|x86.Build.0 = Release|Win32 + {25923141-9859-4AFE-8168-0DF78322FC63}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {25923141-9859-4AFE-8168-0DF78322FC63}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {25923141-9859-4AFE-8168-0DF78322FC63}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {25923141-9859-4AFE-8168-0DF78322FC63}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {25923141-9859-4AFE-8168-0DF78322FC63}.Debug|x64.ActiveCfg = Debug|x64 + {25923141-9859-4AFE-8168-0DF78322FC63}.Debug|x64.Build.0 = Debug|x64 + {25923141-9859-4AFE-8168-0DF78322FC63}.Debug|x86.ActiveCfg = Debug|Win32 + {25923141-9859-4AFE-8168-0DF78322FC63}.Debug|x86.Build.0 = Debug|Win32 + {25923141-9859-4AFE-8168-0DF78322FC63}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {25923141-9859-4AFE-8168-0DF78322FC63}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {25923141-9859-4AFE-8168-0DF78322FC63}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {25923141-9859-4AFE-8168-0DF78322FC63}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {25923141-9859-4AFE-8168-0DF78322FC63}.Release|x64.ActiveCfg = Release|x64 + {25923141-9859-4AFE-8168-0DF78322FC63}.Release|x64.Build.0 = Release|x64 + {25923141-9859-4AFE-8168-0DF78322FC63}.Release|x86.ActiveCfg = Release|Win32 + {25923141-9859-4AFE-8168-0DF78322FC63}.Release|x86.Build.0 = Release|Win32 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Debug|x64.ActiveCfg = Debug|x64 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Debug|x64.Build.0 = Debug|x64 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Debug|x86.ActiveCfg = Debug|Win32 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Debug|x86.Build.0 = Debug|Win32 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Release|x64.ActiveCfg = Release|x64 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Release|x64.Build.0 = Release|x64 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Release|x86.ActiveCfg = Release|Win32 + {7E855020-7FA4-482D-B510-2E709354FE8B}.Release|x86.Build.0 = Release|Win32 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Debug|x64.ActiveCfg = Debug|x64 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Debug|x64.Build.0 = Debug|x64 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Debug|x86.ActiveCfg = Debug|Win32 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Debug|x86.Build.0 = Debug|Win32 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Release|x64.ActiveCfg = Release|x64 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Release|x64.Build.0 = Release|x64 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Release|x86.ActiveCfg = Release|Win32 + {9782E0C8-2BD3-4F67-B420-21CF19CA2435}.Release|x86.Build.0 = Release|Win32 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Debug|x64.ActiveCfg = Debug|x64 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Debug|x64.Build.0 = Debug|x64 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Debug|x86.ActiveCfg = Debug|Win32 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Debug|x86.Build.0 = Debug|Win32 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Release|x64.ActiveCfg = Release|x64 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Release|x64.Build.0 = Release|x64 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Release|x86.ActiveCfg = Release|Win32 + {9F4135E3-9814-452C-9B35-0EFBCD792B49}.Release|x86.Build.0 = Release|Win32 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Debug|x64.ActiveCfg = Debug|x64 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Debug|x64.Build.0 = Debug|x64 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Debug|x86.ActiveCfg = Debug|Win32 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Debug|x86.Build.0 = Debug|Win32 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Release|x64.ActiveCfg = Release|x64 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Release|x64.Build.0 = Release|x64 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Release|x86.ActiveCfg = Release|Win32 + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE}.Release|x86.Build.0 = Release|Win32 + {B19DD336-538E-4091-A559-EAA717FEC899}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {B19DD336-538E-4091-A559-EAA717FEC899}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {B19DD336-538E-4091-A559-EAA717FEC899}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {B19DD336-538E-4091-A559-EAA717FEC899}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {B19DD336-538E-4091-A559-EAA717FEC899}.Debug|x64.ActiveCfg = Debug|x64 + {B19DD336-538E-4091-A559-EAA717FEC899}.Debug|x64.Build.0 = Debug|x64 + {B19DD336-538E-4091-A559-EAA717FEC899}.Debug|x86.ActiveCfg = Debug|Win32 + {B19DD336-538E-4091-A559-EAA717FEC899}.Debug|x86.Build.0 = Debug|Win32 + {B19DD336-538E-4091-A559-EAA717FEC899}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {B19DD336-538E-4091-A559-EAA717FEC899}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {B19DD336-538E-4091-A559-EAA717FEC899}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {B19DD336-538E-4091-A559-EAA717FEC899}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {B19DD336-538E-4091-A559-EAA717FEC899}.Release|x64.ActiveCfg = Release|x64 + {B19DD336-538E-4091-A559-EAA717FEC899}.Release|x64.Build.0 = Release|x64 + {B19DD336-538E-4091-A559-EAA717FEC899}.Release|x86.ActiveCfg = Release|Win32 + {B19DD336-538E-4091-A559-EAA717FEC899}.Release|x86.Build.0 = Release|Win32 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Debug|x64.ActiveCfg = Debug|x64 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Debug|x64.Build.0 = Debug|x64 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Debug|x86.ActiveCfg = Debug|Win32 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Debug|x86.Build.0 = Debug|Win32 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Release|x64.ActiveCfg = Release|x64 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Release|x64.Build.0 = Release|x64 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Release|x86.ActiveCfg = Release|Win32 + {0BF60202-43F7-48E9-8717-D31E56FA5BE0}.Release|x86.Build.0 = Release|Win32 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Debug|x64.ActiveCfg = Debug|x64 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Debug|x64.Build.0 = Debug|x64 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Debug|x86.ActiveCfg = Debug|Win32 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Debug|x86.Build.0 = Debug|Win32 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Release|x64.ActiveCfg = Release|x64 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Release|x64.Build.0 = Release|x64 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Release|x86.ActiveCfg = Release|Win32 + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC}.Release|x86.Build.0 = Release|Win32 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Debug|x64.ActiveCfg = Debug|x64 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Debug|x64.Build.0 = Debug|x64 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Debug|x86.ActiveCfg = Debug|Win32 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Debug|x86.Build.0 = Debug|Win32 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Release|x64.ActiveCfg = Release|x64 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Release|x64.Build.0 = Release|x64 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Release|x86.ActiveCfg = Release|Win32 + {6D75CD88-1A03-4955-B8C7-ACFC3742154F}.Release|x86.Build.0 = Release|Win32 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Debug|x64.ActiveCfg = Debug|x64 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Debug|x64.Build.0 = Debug|x64 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Debug|x86.ActiveCfg = Debug|Win32 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Debug|x86.Build.0 = Debug|Win32 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Release|x64.ActiveCfg = Release|x64 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Release|x64.Build.0 = Release|x64 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Release|x86.ActiveCfg = Release|Win32 + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC}.Release|x86.Build.0 = Release|Win32 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Debug|x64.ActiveCfg = Debug|x64 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Debug|x64.Build.0 = Debug|x64 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Debug|x86.ActiveCfg = Debug|Win32 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Debug|x86.Build.0 = Debug|Win32 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Release|x64.ActiveCfg = Release|x64 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Release|x64.Build.0 = Release|x64 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Release|x86.ActiveCfg = Release|Win32 + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E}.Release|x86.Build.0 = Release|Win32 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Debug|x64.ActiveCfg = Debug|x64 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Debug|x64.Build.0 = Debug|x64 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Debug|x86.ActiveCfg = Debug|Win32 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Debug|x86.Build.0 = Debug|Win32 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Release|x64.ActiveCfg = Release|x64 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Release|x64.Build.0 = Release|x64 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Release|x86.ActiveCfg = Release|Win32 + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D}.Release|x86.Build.0 = Release|Win32 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Debug|x64.ActiveCfg = Debug|x64 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Debug|x64.Build.0 = Debug|x64 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Debug|x86.ActiveCfg = Debug|Win32 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Debug|x86.Build.0 = Debug|Win32 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Release|x64.ActiveCfg = Release|x64 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Release|x64.Build.0 = Release|x64 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Release|x86.ActiveCfg = Release|Win32 + {25BCB876-B60A-499B-9046-E9801CFD7780}.Release|x86.Build.0 = Release|Win32 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Debug|x64.ActiveCfg = Debug|x64 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Debug|x64.Build.0 = Debug|x64 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Debug|x86.ActiveCfg = Debug|Win32 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Debug|x86.Build.0 = Debug|Win32 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Release|x64.ActiveCfg = Release|x64 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Release|x64.Build.0 = Release|x64 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Release|x86.ActiveCfg = Release|Win32 + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F}.Release|x86.Build.0 = Release|Win32 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Debug|x64.ActiveCfg = Debug|x64 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Debug|x64.Build.0 = Debug|x64 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Debug|x86.ActiveCfg = Debug|Win32 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Debug|x86.Build.0 = Debug|Win32 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Release|x64.ActiveCfg = Release|x64 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Release|x64.Build.0 = Release|x64 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Release|x86.ActiveCfg = Release|Win32 + {2BB0C1D4-9298-45AC-B244-67A99769A292}.Release|x86.Build.0 = Release|Win32 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Debug|x64.ActiveCfg = Debug|x64 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Debug|x64.Build.0 = Debug|x64 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Debug|x86.ActiveCfg = Debug|Win32 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Debug|x86.Build.0 = Debug|Win32 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Release|x64.ActiveCfg = Release|x64 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Release|x64.Build.0 = Release|x64 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Release|x86.ActiveCfg = Release|Win32 + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB}.Release|x86.Build.0 = Release|Win32 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Debug|x64.ActiveCfg = Debug|x64 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Debug|x64.Build.0 = Debug|x64 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Debug|x86.ActiveCfg = Debug|Win32 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Debug|x86.Build.0 = Debug|Win32 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Release|x64.ActiveCfg = Release|x64 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Release|x64.Build.0 = Release|x64 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Release|x86.ActiveCfg = Release|Win32 + {81064BCE-EEC1-43B0-9912-F05F2B54B11A}.Release|x86.Build.0 = Release|Win32 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Debug|x64.ActiveCfg = Debug|x64 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Debug|x64.Build.0 = Debug|x64 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Debug|x86.ActiveCfg = Debug|Win32 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Debug|x86.Build.0 = Debug|Win32 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Release|x64.ActiveCfg = Release|x64 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Release|x64.Build.0 = Release|x64 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Release|x86.ActiveCfg = Release|Win32 + {31B41997-3890-45E3-93FE-C57B363E9C0D}.Release|x86.Build.0 = Release|Win32 + {D550AB93-DF31-4B76-873F-F075018352F4}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {D550AB93-DF31-4B76-873F-F075018352F4}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {D550AB93-DF31-4B76-873F-F075018352F4}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {D550AB93-DF31-4B76-873F-F075018352F4}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {D550AB93-DF31-4B76-873F-F075018352F4}.Debug|x64.ActiveCfg = Debug|x64 + {D550AB93-DF31-4B76-873F-F075018352F4}.Debug|x64.Build.0 = Debug|x64 + {D550AB93-DF31-4B76-873F-F075018352F4}.Debug|x86.ActiveCfg = Debug|Win32 + {D550AB93-DF31-4B76-873F-F075018352F4}.Debug|x86.Build.0 = Debug|Win32 + {D550AB93-DF31-4B76-873F-F075018352F4}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {D550AB93-DF31-4B76-873F-F075018352F4}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {D550AB93-DF31-4B76-873F-F075018352F4}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {D550AB93-DF31-4B76-873F-F075018352F4}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {D550AB93-DF31-4B76-873F-F075018352F4}.Release|x64.ActiveCfg = Release|x64 + {D550AB93-DF31-4B76-873F-F075018352F4}.Release|x64.Build.0 = Release|x64 + {D550AB93-DF31-4B76-873F-F075018352F4}.Release|x86.ActiveCfg = Release|Win32 + {D550AB93-DF31-4B76-873F-F075018352F4}.Release|x86.Build.0 = Release|Win32 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Debug|x64.ActiveCfg = Debug|x64 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Debug|x64.Build.0 = Debug|x64 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Debug|x86.ActiveCfg = Debug|Win32 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Debug|x86.Build.0 = Debug|Win32 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Release|x64.ActiveCfg = Release|x64 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Release|x64.Build.0 = Release|x64 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Release|x86.ActiveCfg = Release|Win32 + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A}.Release|x86.Build.0 = Release|Win32 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Debug|x64.ActiveCfg = Debug|x64 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Debug|x64.Build.0 = Debug|x64 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Debug|x86.ActiveCfg = Debug|Win32 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Debug|x86.Build.0 = Debug|Win32 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Release|x64.ActiveCfg = Release|x64 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Release|x64.Build.0 = Release|x64 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Release|x86.ActiveCfg = Release|Win32 + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF}.Release|x86.Build.0 = Release|Win32 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Debug|x64.ActiveCfg = Debug|x64 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Debug|x64.Build.0 = Debug|x64 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Debug|x86.ActiveCfg = Debug|Win32 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Debug|x86.Build.0 = Debug|Win32 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Release|x64.ActiveCfg = Release|x64 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Release|x64.Build.0 = Release|x64 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Release|x86.ActiveCfg = Release|Win32 + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79}.Release|x86.Build.0 = Release|Win32 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Debug|x64.ActiveCfg = Debug|x64 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Debug|x64.Build.0 = Debug|x64 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Debug|x86.ActiveCfg = Debug|Win32 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Debug|x86.Build.0 = Debug|Win32 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Release|x64.ActiveCfg = Release|x64 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Release|x64.Build.0 = Release|x64 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Release|x86.ActiveCfg = Release|Win32 + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5}.Release|x86.Build.0 = Release|Win32 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Debug|x64.ActiveCfg = Debug|x64 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Debug|x64.Build.0 = Debug|x64 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Debug|x86.ActiveCfg = Debug|Win32 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Debug|x86.Build.0 = Debug|Win32 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Release|x64.ActiveCfg = Release|x64 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Release|x64.Build.0 = Release|x64 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Release|x86.ActiveCfg = Release|Win32 + {03E7018C-44A2-4C46-9CE7-F2A135A2692B}.Release|x86.Build.0 = Release|Win32 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Debug|x64.ActiveCfg = Debug|x64 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Debug|x64.Build.0 = Debug|x64 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Debug|x86.ActiveCfg = Debug|Win32 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Debug|x86.Build.0 = Debug|Win32 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Release|x64.ActiveCfg = Release|x64 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Release|x64.Build.0 = Release|x64 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Release|x86.ActiveCfg = Release|Win32 + {F3F6FE4D-9D9E-451A-B0BA-81456104B672}.Release|x86.Build.0 = Release|Win32 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Debug|x64.ActiveCfg = Debug|x64 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Debug|x64.Build.0 = Debug|x64 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Debug|x86.ActiveCfg = Debug|Win32 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Debug|x86.Build.0 = Debug|Win32 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Release|x64.ActiveCfg = Release|x64 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Release|x64.Build.0 = Release|x64 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Release|x86.ActiveCfg = Release|Win32 + {C27794B5-1293-4EA7-BC0E-0F18E6325539}.Release|x86.Build.0 = Release|Win32 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Debug|x64.ActiveCfg = Debug|x64 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Debug|x64.Build.0 = Debug|x64 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Debug|x86.ActiveCfg = Debug|Win32 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Debug|x86.Build.0 = Debug|Win32 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Release|x64.ActiveCfg = Release|x64 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Release|x64.Build.0 = Release|x64 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Release|x86.ActiveCfg = Release|Win32 + {02F41059-12A2-4A96-8D77-07EFE4B108FD}.Release|x86.Build.0 = Release|Win32 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Debug|x64.ActiveCfg = Debug|x64 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Debug|x64.Build.0 = Debug|x64 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Debug|x86.ActiveCfg = Debug|Win32 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Debug|x86.Build.0 = Debug|Win32 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Release|x64.ActiveCfg = Release|x64 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Release|x64.Build.0 = Release|x64 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Release|x86.ActiveCfg = Release|Win32 + {B774E0B9-9514-4E88-975F-4EB6C3B8D519}.Release|x86.Build.0 = Release|Win32 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Debug|x64.ActiveCfg = Debug|x64 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Debug|x64.Build.0 = Debug|x64 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Debug|x86.ActiveCfg = Debug|Win32 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Debug|x86.Build.0 = Debug|Win32 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Release|x64.ActiveCfg = Release|x64 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Release|x64.Build.0 = Release|x64 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Release|x86.ActiveCfg = Release|Win32 + {D91367C2-2189-4859-A7FE-D2CAB84FA15C}.Release|x86.Build.0 = Release|Win32 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Debug|x64.ActiveCfg = Debug|x64 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Debug|x64.Build.0 = Debug|x64 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Debug|x86.ActiveCfg = Debug|Win32 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Debug|x86.Build.0 = Debug|Win32 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Release|x64.ActiveCfg = Release|x64 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Release|x64.Build.0 = Release|x64 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Release|x86.ActiveCfg = Release|Win32 + {33459B4E-1839-4856-BF6B-22480D11FE31}.Release|x86.Build.0 = Release|Win32 + {48871156-181A-475A-BD8D-200086A09675}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {48871156-181A-475A-BD8D-200086A09675}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {48871156-181A-475A-BD8D-200086A09675}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {48871156-181A-475A-BD8D-200086A09675}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {48871156-181A-475A-BD8D-200086A09675}.Debug|x64.ActiveCfg = Debug|x64 + {48871156-181A-475A-BD8D-200086A09675}.Debug|x64.Build.0 = Debug|x64 + {48871156-181A-475A-BD8D-200086A09675}.Debug|x86.ActiveCfg = Debug|Win32 + {48871156-181A-475A-BD8D-200086A09675}.Debug|x86.Build.0 = Debug|Win32 + {48871156-181A-475A-BD8D-200086A09675}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {48871156-181A-475A-BD8D-200086A09675}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {48871156-181A-475A-BD8D-200086A09675}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {48871156-181A-475A-BD8D-200086A09675}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {48871156-181A-475A-BD8D-200086A09675}.Release|x64.ActiveCfg = Release|x64 + {48871156-181A-475A-BD8D-200086A09675}.Release|x64.Build.0 = Release|x64 + {48871156-181A-475A-BD8D-200086A09675}.Release|x86.ActiveCfg = Release|Win32 + {48871156-181A-475A-BD8D-200086A09675}.Release|x86.Build.0 = Release|Win32 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Debug|x64.ActiveCfg = Debug|x64 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Debug|x64.Build.0 = Debug|x64 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Debug|x86.ActiveCfg = Debug|Win32 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Debug|x86.Build.0 = Debug|Win32 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Release|x64.ActiveCfg = Release|x64 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Release|x64.Build.0 = Release|x64 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Release|x86.ActiveCfg = Release|Win32 + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1}.Release|x86.Build.0 = Release|Win32 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Debug|x64.ActiveCfg = Debug|x64 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Debug|x64.Build.0 = Debug|x64 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Debug|x86.ActiveCfg = Debug|Win32 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Debug|x86.Build.0 = Debug|Win32 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Release|x64.ActiveCfg = Release|x64 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Release|x64.Build.0 = Release|x64 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Release|x86.ActiveCfg = Release|Win32 + {1C49E35A-2838-49D9-9D5F-4B8134960EF6}.Release|x86.Build.0 = Release|Win32 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Debug|x64.ActiveCfg = Debug|x64 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Debug|x64.Build.0 = Debug|x64 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Debug|x86.ActiveCfg = Debug|Win32 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Debug|x86.Build.0 = Debug|Win32 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Release|x64.ActiveCfg = Release|x64 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Release|x64.Build.0 = Release|x64 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Release|x86.ActiveCfg = Release|Win32 + {F91142E2-A999-47F0-9E74-38C1E2930EBE}.Release|x86.Build.0 = Release|Win32 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Debug|x64.ActiveCfg = Debug|x64 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Debug|x64.Build.0 = Debug|x64 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Debug|x86.ActiveCfg = Debug|Win32 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Debug|x86.Build.0 = Debug|Win32 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Release|x64.ActiveCfg = Release|x64 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Release|x64.Build.0 = Release|x64 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Release|x86.ActiveCfg = Release|Win32 + {1EDD4BCF-345C-4065-8CBD-7285224293C3}.Release|x86.Build.0 = Release|Win32 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Debug|x64.ActiveCfg = Debug|x64 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Debug|x64.Build.0 = Debug|x64 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Debug|x86.ActiveCfg = Debug|Win32 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Debug|x86.Build.0 = Debug|Win32 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Release|x64.ActiveCfg = Release|x64 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Release|x64.Build.0 = Release|x64 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Release|x86.ActiveCfg = Release|Win32 + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097}.Release|x86.Build.0 = Release|Win32 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Debug|x64.ActiveCfg = Debug|x64 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Debug|x64.Build.0 = Debug|x64 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Debug|x86.ActiveCfg = Debug|Win32 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Debug|x86.Build.0 = Debug|Win32 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Release|x64.ActiveCfg = Release|x64 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Release|x64.Build.0 = Release|x64 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Release|x86.ActiveCfg = Release|Win32 + {A6260ED4-5361-4B61-B6B9-8D8119457BA4}.Release|x86.Build.0 = Release|Win32 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Debug|x64.ActiveCfg = Debug|x64 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Debug|x64.Build.0 = Debug|x64 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Debug|x86.ActiveCfg = Debug|Win32 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Debug|x86.Build.0 = Debug|Win32 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Release|x64.ActiveCfg = Release|x64 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Release|x64.Build.0 = Release|x64 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Release|x86.ActiveCfg = Release|Win32 + {29817904-E3D3-4C28-BD8D-A3A09DD199D2}.Release|x86.Build.0 = Release|Win32 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Debug|x64.ActiveCfg = Debug|x64 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Debug|x64.Build.0 = Debug|x64 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Debug|x86.ActiveCfg = Debug|Win32 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Debug|x86.Build.0 = Debug|Win32 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Release|x64.ActiveCfg = Release|x64 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Release|x64.Build.0 = Release|x64 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Release|x86.ActiveCfg = Release|Win32 + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1}.Release|x86.Build.0 = Release|Win32 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Debug|x64.ActiveCfg = Debug|x64 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Debug|x64.Build.0 = Debug|x64 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Debug|x86.ActiveCfg = Debug|Win32 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Debug|x86.Build.0 = Debug|Win32 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Release|x64.ActiveCfg = Release|x64 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Release|x64.Build.0 = Release|x64 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Release|x86.ActiveCfg = Release|Win32 + {F272EF74-990E-4637-AF9E-77DC7139D95D}.Release|x86.Build.0 = Release|Win32 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Debug|x64.ActiveCfg = Debug|x64 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Debug|x64.Build.0 = Debug|x64 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Debug|x86.ActiveCfg = Debug|Win32 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Debug|x86.Build.0 = Debug|Win32 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Release|x64.ActiveCfg = Release|x64 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Release|x64.Build.0 = Release|x64 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Release|x86.ActiveCfg = Release|Win32 + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA}.Release|x86.Build.0 = Release|Win32 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Debug|x64.ActiveCfg = Debug|x64 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Debug|x64.Build.0 = Debug|x64 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Debug|x86.ActiveCfg = Debug|Win32 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Debug|x86.Build.0 = Debug|Win32 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Release|x64.ActiveCfg = Release|x64 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Release|x64.Build.0 = Release|x64 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Release|x86.ActiveCfg = Release|Win32 + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870}.Release|x86.Build.0 = Release|Win32 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Debug|x64.ActiveCfg = Debug|x64 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Debug|x64.Build.0 = Debug|x64 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Debug|x86.ActiveCfg = Debug|Win32 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Debug|x86.Build.0 = Debug|Win32 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Release|x64.ActiveCfg = Release|x64 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Release|x64.Build.0 = Release|x64 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Release|x86.ActiveCfg = Release|Win32 + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1}.Release|x86.Build.0 = Release|Win32 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Debug|x64.ActiveCfg = Debug|x64 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Debug|x64.Build.0 = Debug|x64 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Debug|x86.ActiveCfg = Debug|Win32 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Debug|x86.Build.0 = Debug|Win32 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Release|x64.ActiveCfg = Release|x64 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Release|x64.Build.0 = Release|x64 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Release|x86.ActiveCfg = Release|Win32 + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF}.Release|x86.Build.0 = Release|Win32 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Debug|x64.ActiveCfg = Debug|x64 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Debug|x64.Build.0 = Debug|x64 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Debug|x86.ActiveCfg = Debug|Win32 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Debug|x86.Build.0 = Debug|Win32 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Release|x64.ActiveCfg = Release|x64 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Release|x64.Build.0 = Release|x64 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Release|x86.ActiveCfg = Release|Win32 + {CF3755C4-937D-4ABF-B7B3-95140808717F}.Release|x86.Build.0 = Release|Win32 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Debug|x64.ActiveCfg = Debug|x64 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Debug|x64.Build.0 = Debug|x64 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Debug|x86.ActiveCfg = Debug|Win32 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Debug|x86.Build.0 = Debug|Win32 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Release|x64.ActiveCfg = Release|x64 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Release|x64.Build.0 = Release|x64 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Release|x86.ActiveCfg = Release|Win32 + {D34939FE-8873-4C53-8D6C-74DED78EA3C4}.Release|x86.Build.0 = Release|Win32 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Debug|x64.ActiveCfg = Debug|x64 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Debug|x64.Build.0 = Debug|x64 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Debug|x86.ActiveCfg = Debug|Win32 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Debug|x86.Build.0 = Debug|Win32 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Release|x64.ActiveCfg = Release|x64 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Release|x64.Build.0 = Release|x64 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Release|x86.ActiveCfg = Release|Win32 + {D408A730-363A-4ABF-BCEF-5D63DCC66042}.Release|x86.Build.0 = Release|Win32 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Debug|x64.ActiveCfg = Debug|x64 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Debug|x64.Build.0 = Debug|x64 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Debug|x86.ActiveCfg = Debug|Win32 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Debug|x86.Build.0 = Debug|Win32 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Release|x64.ActiveCfg = Release|x64 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Release|x64.Build.0 = Release|x64 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Release|x86.ActiveCfg = Release|Win32 + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED}.Release|x86.Build.0 = Release|Win32 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Debug|x64.ActiveCfg = Debug|x64 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Debug|x64.Build.0 = Debug|x64 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Debug|x86.ActiveCfg = Debug|Win32 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Debug|x86.Build.0 = Debug|Win32 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Release|x64.ActiveCfg = Release|x64 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Release|x64.Build.0 = Release|x64 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Release|x86.ActiveCfg = Release|Win32 + {52FB7463-C128-42AF-A02F-78F48473EA9A}.Release|x86.Build.0 = Release|Win32 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Debug|x64.ActiveCfg = Debug|x64 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Debug|x64.Build.0 = Debug|x64 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Debug|x86.ActiveCfg = Debug|Win32 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Debug|x86.Build.0 = Debug|Win32 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Release|x64.ActiveCfg = Release|x64 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Release|x64.Build.0 = Release|x64 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Release|x86.ActiveCfg = Release|Win32 + {7381D91E-5C72-48F0-AAB4-95C9B10D7484}.Release|x86.Build.0 = Release|Win32 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Debug|x64.ActiveCfg = Debug|x64 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Debug|x64.Build.0 = Debug|x64 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Debug|x86.ActiveCfg = Debug|Win32 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Debug|x86.Build.0 = Debug|Win32 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Release|x64.ActiveCfg = Release|x64 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Release|x64.Build.0 = Release|x64 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Release|x86.ActiveCfg = Release|Win32 + {D36EC43E-B31F-4CF4-8285-93A7A9D90189}.Release|x86.Build.0 = Release|Win32 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Debug|x64.ActiveCfg = Debug|x64 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Debug|x64.Build.0 = Debug|x64 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Debug|x86.ActiveCfg = Debug|Win32 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Debug|x86.Build.0 = Debug|Win32 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Release|x64.ActiveCfg = Release|x64 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Release|x64.Build.0 = Release|x64 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Release|x86.ActiveCfg = Release|Win32 + {274C0319-7E1E-4188-936B-8DF3331230B3}.Release|x86.Build.0 = Release|Win32 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Debug|x64.ActiveCfg = Debug|x64 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Debug|x64.Build.0 = Debug|x64 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Debug|x86.ActiveCfg = Debug|Win32 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Debug|x86.Build.0 = Debug|Win32 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Release|x64.ActiveCfg = Release|x64 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Release|x64.Build.0 = Release|x64 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Release|x86.ActiveCfg = Release|Win32 + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629}.Release|x86.Build.0 = Release|Win32 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Debug|x64.ActiveCfg = Debug|x64 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Debug|x64.Build.0 = Debug|x64 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Debug|x86.ActiveCfg = Debug|Win32 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Debug|x86.Build.0 = Debug|Win32 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Release|x64.ActiveCfg = Release|x64 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Release|x64.Build.0 = Release|x64 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Release|x86.ActiveCfg = Release|Win32 + {600C3D4F-0670-4DB4-B30F-520A729053B5}.Release|x86.Build.0 = Release|Win32 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Debug|x64.ActiveCfg = Debug|x64 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Debug|x64.Build.0 = Debug|x64 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Debug|x86.ActiveCfg = Debug|Win32 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Debug|x86.Build.0 = Debug|Win32 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Release|x64.ActiveCfg = Release|x64 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Release|x64.Build.0 = Release|x64 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Release|x86.ActiveCfg = Release|Win32 + {11F33A39-74B7-4018-B5F9-CC285A673A8F}.Release|x86.Build.0 = Release|Win32 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Debug|x64.ActiveCfg = Debug|x64 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Debug|x64.Build.0 = Debug|x64 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Debug|x86.ActiveCfg = Debug|Win32 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Debug|x86.Build.0 = Debug|Win32 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Release|x64.ActiveCfg = Release|x64 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Release|x64.Build.0 = Release|x64 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Release|x86.ActiveCfg = Release|Win32 + {A6F5E35E-B4A7-41B3-853A-75558E6E0715}.Release|x86.Build.0 = Release|Win32 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Debug|x64.ActiveCfg = Debug|x64 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Debug|x64.Build.0 = Debug|x64 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Debug|x86.ActiveCfg = Debug|Win32 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Debug|x86.Build.0 = Debug|Win32 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Release|x64.ActiveCfg = Release|x64 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Release|x64.Build.0 = Release|x64 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Release|x86.ActiveCfg = Release|Win32 + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8}.Release|x86.Build.0 = Release|Win32 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Debug|x64.ActiveCfg = Debug|x64 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Debug|x64.Build.0 = Debug|x64 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Debug|x86.ActiveCfg = Debug|Win32 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Debug|x86.Build.0 = Debug|Win32 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Release|x64.ActiveCfg = Release|x64 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Release|x64.Build.0 = Release|x64 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Release|x86.ActiveCfg = Release|Win32 + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5}.Release|x86.Build.0 = Release|Win32 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Debug|x64.ActiveCfg = Debug|x64 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Debug|x64.Build.0 = Debug|x64 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Debug|x86.ActiveCfg = Debug|Win32 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Debug|x86.Build.0 = Debug|Win32 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Release|x64.ActiveCfg = Release|x64 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Release|x64.Build.0 = Release|x64 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Release|x86.ActiveCfg = Release|Win32 + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5}.Release|x86.Build.0 = Release|Win32 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Debug|x64.ActiveCfg = Debug|x64 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Debug|x64.Build.0 = Debug|x64 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Debug|x86.ActiveCfg = Debug|Win32 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Debug|x86.Build.0 = Debug|Win32 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Release|x64.ActiveCfg = Release|x64 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Release|x64.Build.0 = Release|x64 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Release|x86.ActiveCfg = Release|Win32 + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F}.Release|x86.Build.0 = Release|Win32 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Debug|x64.ActiveCfg = Debug|x64 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Debug|x64.Build.0 = Debug|x64 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Debug|x86.ActiveCfg = Debug|Win32 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Debug|x86.Build.0 = Debug|Win32 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Release|x64.ActiveCfg = Release|x64 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Release|x64.Build.0 = Release|x64 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Release|x86.ActiveCfg = Release|Win32 + {537851A6-25F0-4F47-A43E-A0D272591DBA}.Release|x86.Build.0 = Release|Win32 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Debug|x64.ActiveCfg = Debug|x64 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Debug|x64.Build.0 = Debug|x64 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Debug|x86.ActiveCfg = Debug|Win32 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Debug|x86.Build.0 = Debug|Win32 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Release|x64.ActiveCfg = Release|x64 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Release|x64.Build.0 = Release|x64 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Release|x86.ActiveCfg = Release|Win32 + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73}.Release|x86.Build.0 = Release|Win32 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Debug|x64.ActiveCfg = Debug|x64 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Debug|x64.Build.0 = Debug|x64 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Debug|x86.ActiveCfg = Debug|Win32 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Debug|x86.Build.0 = Debug|Win32 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Release|x64.ActiveCfg = Release|x64 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Release|x64.Build.0 = Release|x64 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Release|x86.ActiveCfg = Release|Win32 + {19B5E933-AF1B-48E3-AC23-9359C00B8963}.Release|x86.Build.0 = Release|Win32 + {280017A6-E892-4E1C-902F-C7690CB55267}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {280017A6-E892-4E1C-902F-C7690CB55267}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {280017A6-E892-4E1C-902F-C7690CB55267}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {280017A6-E892-4E1C-902F-C7690CB55267}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {280017A6-E892-4E1C-902F-C7690CB55267}.Debug|x64.ActiveCfg = Debug|x64 + {280017A6-E892-4E1C-902F-C7690CB55267}.Debug|x64.Build.0 = Debug|x64 + {280017A6-E892-4E1C-902F-C7690CB55267}.Debug|x86.ActiveCfg = Debug|Win32 + {280017A6-E892-4E1C-902F-C7690CB55267}.Debug|x86.Build.0 = Debug|Win32 + {280017A6-E892-4E1C-902F-C7690CB55267}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {280017A6-E892-4E1C-902F-C7690CB55267}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {280017A6-E892-4E1C-902F-C7690CB55267}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {280017A6-E892-4E1C-902F-C7690CB55267}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {280017A6-E892-4E1C-902F-C7690CB55267}.Release|x64.ActiveCfg = Release|x64 + {280017A6-E892-4E1C-902F-C7690CB55267}.Release|x64.Build.0 = Release|x64 + {280017A6-E892-4E1C-902F-C7690CB55267}.Release|x86.ActiveCfg = Release|Win32 + {280017A6-E892-4E1C-902F-C7690CB55267}.Release|x86.Build.0 = Release|Win32 + {FDE6080B-E203-4066-910D-AD0302566008}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {FDE6080B-E203-4066-910D-AD0302566008}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {FDE6080B-E203-4066-910D-AD0302566008}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {FDE6080B-E203-4066-910D-AD0302566008}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {FDE6080B-E203-4066-910D-AD0302566008}.Debug|x64.ActiveCfg = Debug|x64 + {FDE6080B-E203-4066-910D-AD0302566008}.Debug|x64.Build.0 = Debug|x64 + {FDE6080B-E203-4066-910D-AD0302566008}.Debug|x86.ActiveCfg = Debug|Win32 + {FDE6080B-E203-4066-910D-AD0302566008}.Debug|x86.Build.0 = Debug|Win32 + {FDE6080B-E203-4066-910D-AD0302566008}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {FDE6080B-E203-4066-910D-AD0302566008}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {FDE6080B-E203-4066-910D-AD0302566008}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {FDE6080B-E203-4066-910D-AD0302566008}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {FDE6080B-E203-4066-910D-AD0302566008}.Release|x64.ActiveCfg = Release|x64 + {FDE6080B-E203-4066-910D-AD0302566008}.Release|x64.Build.0 = Release|x64 + {FDE6080B-E203-4066-910D-AD0302566008}.Release|x86.ActiveCfg = Release|Win32 + {FDE6080B-E203-4066-910D-AD0302566008}.Release|x86.Build.0 = Release|Win32 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Debug|x64.ActiveCfg = Debug|x64 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Debug|x64.Build.0 = Debug|x64 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Debug|x86.ActiveCfg = Debug|Win32 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Debug|x86.Build.0 = Debug|Win32 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Release|x64.ActiveCfg = Release|x64 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Release|x64.Build.0 = Release|x64 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Release|x86.ActiveCfg = Release|Win32 + {E1B6D565-9D7C-46B7-9202-ECF54974DE50}.Release|x86.Build.0 = Release|Win32 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Debug|x64.ActiveCfg = Debug|x64 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Debug|x64.Build.0 = Debug|x64 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Debug|x86.ActiveCfg = Debug|Win32 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Debug|x86.Build.0 = Debug|Win32 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Release|x64.ActiveCfg = Release|x64 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Release|x64.Build.0 = Release|x64 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Release|x86.ActiveCfg = Release|Win32 + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B}.Release|x86.Build.0 = Release|Win32 + {C8765523-58F8-4C8E-9914-693396F6F0FF}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {C8765523-58F8-4C8E-9914-693396F6F0FF}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {C8765523-58F8-4C8E-9914-693396F6F0FF}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {C8765523-58F8-4C8E-9914-693396F6F0FF}.Debug|x64.ActiveCfg = Debug|x64 + {C8765523-58F8-4C8E-9914-693396F6F0FF}.Debug|x64.Build.0 = Debug|x64 + {C8765523-58F8-4C8E-9914-693396F6F0FF}.Debug|x86.ActiveCfg = Debug|Win32 + {C8765523-58F8-4C8E-9914-693396F6F0FF}.Debug|x86.Build.0 = Debug|Win32 + {C8765523-58F8-4C8E-9914-693396F6F0FF}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {C8765523-58F8-4C8E-9914-693396F6F0FF}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {C8765523-58F8-4C8E-9914-693396F6F0FF}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {C8765523-58F8-4C8E-9914-693396F6F0FF}.Release|x64.ActiveCfg = Release|x64 + {C8765523-58F8-4C8E-9914-693396F6F0FF}.Release|x64.Build.0 = Release|x64 + {C8765523-58F8-4C8E-9914-693396F6F0FF}.Release|x86.ActiveCfg = Release|Win32 + {C8765523-58F8-4C8E-9914-693396F6F0FF}.Release|x86.Build.0 = Release|Win32 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Debug|x64.ActiveCfg = Debug|x64 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Debug|x64.Build.0 = Debug|x64 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Debug|x86.ActiveCfg = Debug|Win32 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Debug|x86.Build.0 = Debug|Win32 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Release|x64.ActiveCfg = Release|x64 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Release|x64.Build.0 = Release|x64 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Release|x86.ActiveCfg = Release|Win32 + {946A1700-C7AA-46F0-AEF2-67C98B5722AC}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {0981CA98-E4A5-4DF1-987F-A41D09131EFC} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} - {B655E850-3322-42F7-941D-6AC18FD66CA1} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + {0981CA98-E4A5-4DF1-987F-A41D09131EFC} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {103B292B-049B-4B15-85A1-9F902840DB2C} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {0C2D2F82-AE67-400C-B19C-8C9B957B132A} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {E6784F91-4E4E-4956-A079-73FAB1AC7BE6} = {CC132A4D-D081-4C26-BFB9-AB11984054F8} + {9875B0C8-3893-43F8-88B2-4BAAAE3E8E6F} = {CC132A4D-D081-4C26-BFB9-AB11984054F8} + {BFB22AB2-041B-4A1B-80C0-1D4BE410C8A9} = {CC132A4D-D081-4C26-BFB9-AB11984054F8} + {93A1F656-0D29-4C5E-B140-11F23FF5D6AB} = {CC132A4D-D081-4C26-BFB9-AB11984054F8} + {F81C5819-85B6-4D2E-B6DC-104A7634461B} = {CC132A4D-D081-4C26-BFB9-AB11984054F8} + {66CC5B13-881A-412F-8C51-746622A91C5A} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {CB75B7C9-4E00-43B8-B2A9-9ACB4FC40F9B} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {557138B0-7BE2-4392-B2E2-B45734031A62} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {9EED87BB-527F-4D05-9384-6D16CFD627A8} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {6D1CA2F1-7FCA-4249-9220-075C2DF4F965} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {FD193822-3D5C-4161-A147-884C2ABDE483} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {20AD0AC9-9159-4744-99CC-6AC5779D6B87} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {0199E349-0701-40BC-8A7F-06A54FFA3E7C} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {8F19E3DA-8929-4000-87B5-3CA6929636CC} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {51A00565-5787-4911-9CC0-28403AA4909D} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {92B64AE7-D773-4F05-89F1-CE59BBF4F053} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {A2BA5E5C-FDB9-4939-B0B5-2B753A5E33D3} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {A643BB06-735D-47F3-BFE7-B6D3C36F7097} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {F026020F-7B00-40C8-91C3-5DE85EC45A95} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {6900D0A1-A1B7-4F7C-9492-C2333E94BB1A} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {59089B0C-AAB4-4532-B294-44DEAE7178B7} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {C298876B-6C12-4EA4-903B-33450BCD9884} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {83F586FA-C801-4979-ACCA-006BD628CC88} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {86CBE96B-F5FE-483C-BA4A-DC9B1D43AF22} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {FF2970AE-E2E9-405F-B321-D523A1BD44A0} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {79417CE2-FEEB-42F0-BC53-62D5267B19B1} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {AFDDE100-2D36-4749-817D-12E54C56312F} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {B7812167-50FB-4934-996F-DF6FE4CBBFDF} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {39DB56C7-05F8-492C-A8D4-F19E40FECB59} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {82F3D34B-8DB2-4C6A-98B1-132245DD9D99} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + {CC132A4D-D081-4C26-BFB9-AB11984054F8} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + {278D8859-20B1-428F-8448-064F46E1F021} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + {CBD6C0F8-8200-4E9A-9D7C-6505A2AA4A62} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {14BA7F98-02CC-4648-9236-676BFF9458AF} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {FADC31C3-09AA-4DB4-A289-153482D10C09} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {F5FC9279-DE63-4EF3-B31F-CFCEF9B11F71} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {0859A973-E4FE-4688-8D16-0253163FDE24} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {F3412853-2B6A-4334-8CF2-B796CDAE0850} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {3A6C48C6-80AB-456F-A3A5-969930958971} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {BE097E8F-B6F3-45DC-8A27-E0EBC31AB912} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {D03F2C82-9553-4AFA-8F49-9234009122B6} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {FE232CA5-6C0D-4ADF-9A21-775D4DC048D3} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {A53CCF42-A972-478F-9336-0F618B3EC06A} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {0037A3CD-4F50-48B2-9AC3-5A0D1D16D2CA} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {870723DD-945A-4136-B65B-4AF3BF85369C} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {EA6488AD-445B-4835-87FB-EBC9E2EDAF97} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {E07B6DBE-3358-4BA0-AABF-CDD8F96AECF0} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {472BCBDC-62E0-441D-B2FD-0EE0FC6CEEB4} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {589C8E9B-0BB3-4D6D-A70C-0A28E469F20E} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {3AD868E6-8355-4F29-B5ED-7DE94AD786E7} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {2B78CF0A-5403-45E2-99BD-493F1679BCDB} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {0AB968E0-E993-45CE-8875-7453C96DF583} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {25923141-9859-4AFE-8168-0DF78322FC63} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {7E855020-7FA4-482D-B510-2E709354FE8B} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {9782E0C8-2BD3-4F67-B420-21CF19CA2435} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {9F4135E3-9814-452C-9B35-0EFBCD792B49} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {C45343E6-DAB6-4F3A-A00A-8BED71A098BE} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {B19DD336-538E-4091-A559-EAA717FEC899} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {0BF60202-43F7-48E9-8717-D31E56FA5BE0} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {4E863E5B-0B95-43BE-8D4F-B9EB6C394FEC} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {6D75CD88-1A03-4955-B8C7-ACFC3742154F} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {8DD0EB7E-668E-452D-91D7-906C64A9C8AC} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE} + {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + {D6B669E2-68D0-4E62-83D1-E14DDD6A356F} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + {F62E751F-C5A9-46CA-AF6D-33925880EF83} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + {E9D708A5-9C1F-4B84-A795-C5F191801762} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + {F6FD9C75-AAA7-48C9-B19D-FD37C8FB9B7E} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A} + {1FE8758D-7E8A-41F3-9B6D-FD50E9A2A03D} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A} + {25BCB876-B60A-499B-9046-E9801CFD7780} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A} + {56FB0A45-145F-4EAE-B2C8-E5833E682D8F} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A} + {2BB0C1D4-9298-45AC-B244-67A99769A292} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A} + {99A40FC5-9DB0-4B80-8D97-867EF00FA2CB} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A} + {81064BCE-EEC1-43B0-9912-F05F2B54B11A} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A} + {31B41997-3890-45E3-93FE-C57B363E9C0D} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A} + {D550AB93-DF31-4B76-873F-F075018352F4} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A} + {8CF3F7BA-4C99-43EB-B4F1-7CA346817D0A} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A} + {F90FCDC5-EE14-4B89-96DB-4392E28F34AF} = {278D8859-20B1-428F-8448-064F46E1F021} + {93A864C9-93B7-4E5C-ACE7-E8FC5F9EFF79} = {278D8859-20B1-428F-8448-064F46E1F021} + {56E68E37-B3FC-4799-91AF-0CA10B6D55A5} = {278D8859-20B1-428F-8448-064F46E1F021} + {03E7018C-44A2-4C46-9CE7-F2A135A2692B} = {278D8859-20B1-428F-8448-064F46E1F021} + {F3F6FE4D-9D9E-451A-B0BA-81456104B672} = {278D8859-20B1-428F-8448-064F46E1F021} + {C27794B5-1293-4EA7-BC0E-0F18E6325539} = {278D8859-20B1-428F-8448-064F46E1F021} + {02F41059-12A2-4A96-8D77-07EFE4B108FD} = {278D8859-20B1-428F-8448-064F46E1F021} + {B774E0B9-9514-4E88-975F-4EB6C3B8D519} = {278D8859-20B1-428F-8448-064F46E1F021} + {D91367C2-2189-4859-A7FE-D2CAB84FA15C} = {278D8859-20B1-428F-8448-064F46E1F021} + {33459B4E-1839-4856-BF6B-22480D11FE31} = {278D8859-20B1-428F-8448-064F46E1F021} + {48871156-181A-475A-BD8D-200086A09675} = {278D8859-20B1-428F-8448-064F46E1F021} + {C4416DA1-9E62-46BA-9CD3-F8963C79E1A1} = {278D8859-20B1-428F-8448-064F46E1F021} + {1C49E35A-2838-49D9-9D5F-4B8134960EF6} = {278D8859-20B1-428F-8448-064F46E1F021} + {F91142E2-A999-47F0-9E74-38C1E2930EBE} = {278D8859-20B1-428F-8448-064F46E1F021} + {1EDD4BCF-345C-4065-8CBD-7285224293C3} = {278D8859-20B1-428F-8448-064F46E1F021} + {581F89BD-FBB9-4699-B8DB-EB38E6DEE097} = {D6B669E2-68D0-4E62-83D1-E14DDD6A356F} + {A6260ED4-5361-4B61-B6B9-8D8119457BA4} = {D6B669E2-68D0-4E62-83D1-E14DDD6A356F} + {29817904-E3D3-4C28-BD8D-A3A09DD199D2} = {D6B669E2-68D0-4E62-83D1-E14DDD6A356F} + {C7A235DF-460E-4816-9F3B-E0DEFA376EF1} = {D6B669E2-68D0-4E62-83D1-E14DDD6A356F} + {F272EF74-990E-4637-AF9E-77DC7139D95D} = {D6B669E2-68D0-4E62-83D1-E14DDD6A356F} + {A6B2A11B-0669-4AF5-A025-8DD02DBBE5EA} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {B176BB4A-CA31-4E2A-B790-3EA0ED2EE870} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {D08AA2A0-2F94-4BF5-B42D-E92450F03FD1} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {4A7D0ECA-D7CC-4E66-B741-C92E9C1B42FF} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {CF3755C4-937D-4ABF-B7B3-95140808717F} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {D34939FE-8873-4C53-8D6C-74DED78EA3C4} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {D408A730-363A-4ABF-BCEF-5D63DCC66042} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {F532AFBC-9E62-4A89-BB99-1044E4B2D8ED} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {52FB7463-C128-42AF-A02F-78F48473EA9A} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {7381D91E-5C72-48F0-AAB4-95C9B10D7484} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {D36EC43E-B31F-4CF4-8285-93A7A9D90189} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {274C0319-7E1E-4188-936B-8DF3331230B3} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {41BBCC10-CFDE-48A1-B2E0-A0EC6A668629} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {600C3D4F-0670-4DB4-B30F-520A729053B5} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {11F33A39-74B7-4018-B5F9-CC285A673A8F} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {A6F5E35E-B4A7-41B3-853A-75558E6E0715} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {291B4975-8EFF-4C7C-8AF3-44A77B8491B8} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} + {ABE24543-FF93-4C1F-ADB4-AC6ED88682F5} = {F62E751F-C5A9-46CA-AF6D-33925880EF83} + {ECC50F23-5205-43C3-8D72-98B03B2C7ED5} = {F62E751F-C5A9-46CA-AF6D-33925880EF83} + {8A1BB135-57E2-4BF1-B923-3EA21C141C2F} = {F62E751F-C5A9-46CA-AF6D-33925880EF83} + {537851A6-25F0-4F47-A43E-A0D272591DBA} = {F62E751F-C5A9-46CA-AF6D-33925880EF83} + {D6EA45E6-7559-49A6-9CE2-E6CB770CAE73} = {F62E751F-C5A9-46CA-AF6D-33925880EF83} + {19B5E933-AF1B-48E3-AC23-9359C00B8963} = {F62E751F-C5A9-46CA-AF6D-33925880EF83} + {280017A6-E892-4E1C-902F-C7690CB55267} = {F62E751F-C5A9-46CA-AF6D-33925880EF83} + {FDE6080B-E203-4066-910D-AD0302566008} = {E9D708A5-9C1F-4B84-A795-C5F191801762} + {E1B6D565-9D7C-46B7-9202-ECF54974DE50} = {E9D708A5-9C1F-4B84-A795-C5F191801762} + {6237BEDE-BAAA-4A06-9C5E-8089BAA14C8B} = {E9D708A5-9C1F-4B84-A795-C5F191801762} + {C8765523-58F8-4C8E-9914-693396F6F0FF} = {E9D708A5-9C1F-4B84-A795-C5F191801762} + {946A1700-C7AA-46F0-AEF2-67C98B5722AC} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E926C768-6307-4423-A1EC-57E95B1FAB29} diff --git a/projects/VS2019/raylib/raylib.rc b/projects/VS2019/raylib/raylib.rc index 37166bba2..34b89514f 100644 Binary files a/projects/VS2019/raylib/raylib.rc and b/projects/VS2019/raylib/raylib.rc differ diff --git a/projects/VS2019/raylib/raylib.vcxproj b/projects/VS2019/raylib/raylib.vcxproj index 3cf214102..f95daaf38 100644 --- a/projects/VS2019/raylib/raylib.vcxproj +++ b/projects/VS2019/raylib/raylib.vcxproj @@ -69,28 +69,24 @@ StaticLibrary false $(DefaultPlatformToolset) - true Unicode StaticLibrary false $(DefaultPlatformToolset) - true Unicode DynamicLibrary false $(DefaultPlatformToolset) - true Unicode DynamicLibrary false $(DefaultPlatformToolset) - true Unicode @@ -124,36 +120,36 @@ - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ - $(ProjectDir)\obj\$(Platform)\$(Configuration)\ - $(SolutionDir)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ @@ -256,6 +252,7 @@ _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP $(ProjectDir)..\..\..\src\external\glfw\include CompileAsC + Windows @@ -295,6 +292,7 @@ $(ProjectDir)..\..\..\src\external\glfw\include CompileAsC MultiThreaded + Windows diff --git a/projects/VSCode/Makefile b/projects/VSCode/Makefile index b15eb7f6f..dd36164da 100644 --- a/projects/VSCode/Makefile +++ b/projects/VSCode/Makefile @@ -25,8 +25,7 @@ # Define required raylib variables PROJECT_NAME ?= game -RAYLIB_VERSION ?= 3.0.0 -RAYLIB_API_VERSION ?= 300 +RAYLIB_VERSION ?= 3.7.0 RAYLIB_PATH ?= ..\.. # Define compiler path on Windows diff --git a/projects/VSCode/main.c b/projects/VSCode/main.c index 88f356eac..835b4b08f 100644 --- a/projects/VSCode/main.c +++ b/projects/VSCode/main.c @@ -35,7 +35,7 @@ int main() camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; camera.fovy = 60.0f; - camera.type = CAMERA_PERSPECTIVE; + camera.projection = CAMERA_PERSPECTIVE; SetCameraMode(camera, CAMERA_ORBITAL); diff --git a/projects/VSCode_tcc_win/main.c b/projects/VSCode_tcc_win/main.c index 7a68a373e..ed1bbcfd5 100644 --- a/projects/VSCode_tcc_win/main.c +++ b/projects/VSCode_tcc_win/main.c @@ -36,7 +36,7 @@ int main() camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; camera.fovy = 60.0f; - camera.type = CAMERA_PERSPECTIVE; + camera.projection = CAMERA_PERSPECTIVE; SetCameraMode(camera, CAMERA_ORBITAL); diff --git a/projects/scripts/README.md b/projects/scripts/README.md index ccc4b4dbe..abb65b77c 100644 --- a/projects/scripts/README.md +++ b/projects/scripts/README.md @@ -6,7 +6,7 @@ exception to this however, and that is Windows, because Windows doesn't have a built-in C compiler. On Windows, you'll need to install [Visual Studio][visual-studio] or the [build tools][vs-tools]. If you didn't install them in the default location, write your changes around -line 101 of [`windows-build.bat`](windows-build.bat). +line 101 of [`build-windows.bat`](build-windows.bat). ## Script customization First of all, the scripts have a few variables at the very top, which diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3319ef03d..3dcd96bfb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,7 @@ # Setup the project and settings project(raylib C) -set(PROJECT_VERSION 3.5.0) -set(API_VERSION 351) +set(PROJECT_VERSION 3.7.0) +set(API_VERSION 370) include(GNUInstallDirs) include(JoinPaths) @@ -10,6 +10,8 @@ include(JoinPaths) if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) if(RAYLIB_IS_MAIN) set(default_build_type Debug) + else() + message(WARNING "Default build type is not set (CMAKE_BUILD_TYPE)") endif() message(STATUS "Setting build type to '${default_build_type}' as none was specified.") @@ -18,15 +20,15 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") endif() -# Get the sources together +# Used as public API to be included into other projects set(raylib_public_headers raylib.h rlgl.h - physac.h raymath.h raudio.h ) +# Sources to be compiled set(raylib_sources core.c models.c @@ -36,7 +38,7 @@ set(raylib_sources utils.c ) -# cmake/GlfwImport.cmake handles the details around the inclusion of glfw +# /cmake/GlfwImport.cmake handles the details around the inclusion of glfw include(GlfwImport) @@ -47,56 +49,42 @@ else () MESSAGE(STATUS "Audio Backend: None (-DUSE_AUDIO=OFF)") endif () +# Sets additional platform options and link libraries for each platform +# also selects the proper graphics API and version for that platform +# Produces a variable LIBS_PRIVATE that will be used later include(LibraryConfigurations) -set(LIBS_PRIVATE ${LIBS_PRIVATE} ${OPENAL_LIBRARY}) +add_library(raylib ${raylib_sources} ${raylib_public_headers}) -if (STATIC) +if (NOT BUILD_SHARED_LIBS) MESSAGE(STATUS "Building raylib static library") - - add_library(raylib STATIC ${raylib_sources} ${raylib_public_headers}) add_library(raylib_static ALIAS raylib) - - add_test("pkg-config--static" ${PROJECT_SOURCE_DIR}/../cmake/test-pkgconfig.sh --static) -endif (STATIC) - - -if (SHARED) +else() MESSAGE(STATUS "Building raylib shared library") - add_library(raylib SHARED ${raylib_sources} ${raylib_public_headers}) - if (MSVC) target_compile_definitions(raylib PRIVATE $ INTERFACE $ ) endif () - - add_test("pkg-config" ${PROJECT_SOURCE_DIR}/../cmake/test-pkgconfig.sh) -endif () +endif() -# Setting target properties set_target_properties(raylib PROPERTIES PUBLIC_HEADER "${raylib_public_headers}" VERSION ${PROJECT_VERSION} SOVERSION ${API_VERSION} ) -if (WITH_PIC OR SHARED) +if (WITH_PIC OR BUILD_SHARED_LIBS) set_property(TARGET raylib PROPERTY POSITION_INDEPENDENT_CODE ON) endif () -# Linking libraries target_link_libraries(raylib "${LIBS_PRIVATE}") -if (${PLATFORM} MATCHES "Desktop") - target_link_libraries(raylib glfw) -endif () -# Adding compile definitions -target_compile_definitions(raylib - PUBLIC "${PLATFORM_CPP}" - PUBLIC "${GRAPHICS}" - ) +# Sets some compile time definitions for the pre-processor +# If CUSTOMIZE_BUILD option is on you will not use config.h by default +# and you will be able to select more build options +include(CompileDefinitions) # Registering include directories target_include_directories(raylib @@ -105,7 +93,6 @@ target_include_directories(raylib $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_BINARY_DIR} # For cmake/config.h ${OPENGL_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR} ) @@ -113,6 +100,8 @@ target_include_directories(raylib # Copy the header files to the build directory for convenience file(COPY ${raylib_public_headers} DESTINATION "include") +# Includes information on how the library will be installed on the system +# when cmake --install is run include(InstallConfigurations) # Print the flags for the user @@ -126,6 +115,7 @@ message(STATUS "Compiling with the flags:") message(STATUS " PLATFORM=" ${PLATFORM_CPP}) message(STATUS " GRAPHICS=" ${GRAPHICS}) +# Options if you want to create an installer using CPack include(PackConfigurations) enable_testing() diff --git a/src/Makefile b/src/Makefile index 193e3eb5f..2943c89a0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -43,8 +43,8 @@ .PHONY: all clean install uninstall # Define required raylib variables -RAYLIB_VERSION = 3.5.0 -RAYLIB_API_VERSION = 350 +RAYLIB_VERSION = 3.7.1 +RAYLIB_API_VERSION = 371 # Define raylib source code path RAYLIB_SRC_PATH ?= ../src @@ -77,7 +77,7 @@ RAYLIB_MODULE_RAYGUI ?= FALSE RAYLIB_MODULE_PHYSAC ?= FALSE RAYLIB_MODULE_RAYGUI_PATH ?= $(RAYLIB_SRC_PATH)/../../raygui/src -RAYLIB_MODULE_PHYSAC_PATH ?= $(RAYLIB_SRC_PATH) +RAYLIB_MODULE_PHYSAC_PATH ?= $(RAYLIB_SRC_PATH)/extras # Use external GLFW library instead of rglfw module # TODO: Review usage of examples on Linux. @@ -160,8 +160,8 @@ ifeq ($(PLATFORM),PLATFORM_WEB) EMSDK_PATH ?= C:/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH = $(EMSDK_PATH)/upstream/bin - PYTHON_PATH = $(EMSDK_PATH)/python/3.7.4-pywin32_64bit - NODE_PATH = $(EMSDK_PATH)/node/12.18.1_64bit/bin + PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit + NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH);C:\raylib\MinGW\bin:$$(PATH) endif @@ -171,7 +171,7 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) # Starting on August 2020, minimum required target API is Android 10 (API level 29) ANDROID_ARCH ?= arm64 ANDROID_API_VERSION ?= 29 - + # Android required path variables # NOTE: Starting with Android NDK r21, no more toolchain generation is required, NDK is the toolchain on itself ifeq ($(OS),Windows_NT) @@ -181,7 +181,7 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) ANDROID_NDK ?= /usr/lib/android/ndk ANDROID_TOOLCHAIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64 endif - + # NOTE: Sysroot can also be reference from $(ANDROID_NDK)/sysroot ANDROID_SYSROOT ?= $(ANDROID_TOOLCHAIN)/sysroot @@ -197,7 +197,7 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) ifeq ($(ANDROID_ARCH),x86_64) ANDROID_ARCH_NAME = x86_64 endif - + endif # Define raylib graphics api depending on selected platform @@ -413,7 +413,7 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) NATIVE_APP_GLUE = $(ANDROID_NDK)/sources/android/native_app_glue # Include android_native_app_glue.h INCLUDE_PATHS += -I$(NATIVE_APP_GLUE) - + # Android required libraries INCLUDE_PATHS += -I$(ANDROID_SYSROOT)/usr/include ifeq ($(ANDROID_ARCH),arm) @@ -507,7 +507,7 @@ else cd $(RAYLIB_RELEASE_PATH) && ln -fsv lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION) lib$(RAYLIB_LIB_NAME).so endif ifeq ($(PLATFORM_OS),OSX) - $(CC) -dynamiclib -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).dylib $(OBJS) $(LDFLAGS) -compatibility_version $(RAYLIB_API_VERSION) -current_version $(RAYLIB_VERSION) -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo + $(CC) -dynamiclib -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).dylib $(OBJS) $(LDFLAGS) -compatibility_version $(RAYLIB_API_VERSION) -current_version $(RAYLIB_VERSION) -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo install_name_tool -id "lib$(RAYLIB_LIB_NAME).$(VERSION).dylib" $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).dylib @echo "raylib shared library generated (lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).dylib)!" cd $(RAYLIB_RELEASE_PATH) && ln -fs lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).dylib lib$(RAYLIB_LIB_NAME).$(RAYLIB_API_VERSION).dylib @@ -606,7 +606,7 @@ physac.o : physac.c physac.h # Compile android_native_app_glue module android_native_app_glue.o : $(NATIVE_APP_GLUE)/android_native_app_glue.c $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) - + # Install generated and needed files to desired directories. # On GNU/Linux and BSDs, there are some standard directories that contain extra @@ -650,7 +650,7 @@ ifeq ($(ROOT),root) cp --update raylib.h $(RAYLIB_H_INSTALL_PATH)/raylib.h cp --update raymath.h $(RAYLIB_H_INSTALL_PATH)/raymath.h cp --update rlgl.h $(RAYLIB_H_INSTALL_PATH)/rlgl.h - cp --update physac.h $(RAYLIB_H_INSTALL_PATH)/physac.h + cp --update extras/physac.h $(RAYLIB_H_INSTALL_PATH)/physac.h @echo "raylib development files installed/updated!" else @echo "This function currently works on GNU/Linux systems. Add yours today (^;" diff --git a/src/camera.h b/src/camera.h index 15958ddde..35eda8310 100644 --- a/src/camera.h +++ b/src/camera.h @@ -91,7 +91,7 @@ typedef enum { CAMERA_PERSPECTIVE = 0, CAMERA_ORTHOGRAPHIC - } CameraType; + } CameraProjection; #endif #ifdef __cplusplus @@ -222,7 +222,7 @@ static CameraData CAMERA = { // Global CAMERA state context .moveControl = { 'W', 'S', 'D', 'A', 'E', 'Q' }, .smoothZoomControl = 341, // raylib: KEY_LEFT_CONTROL .altControl = 342, // raylib: KEY_LEFT_ALT - .panControl = 2 // raylib: MOUSE_MIDDLE_BUTTON + .panControl = 2 // raylib: MOUSE_BUTTON_MIDDLE }; //---------------------------------------------------------------------------------- diff --git a/src/config.h b/src/config.h index dbe77cd9f..7c4777af6 100644 --- a/src/config.h +++ b/src/config.h @@ -25,14 +25,6 @@ * **********************************************************************************************/ -#define RAYLIB_VERSION "3.5" - -// Edit to control what features Makefile'd raylib is compiled with -#if defined(RAYLIB_CMAKE) - // Edit cmake/RaylibOptions.cmake for CMake instead - #include "cmake/config.h" -#else - //------------------------------------------------------------------------------------ // Module: core - Configuration Flags //------------------------------------------------------------------------------------ @@ -46,10 +38,13 @@ #define SUPPORT_SSH_KEYBOARD_RPI 1 // Draw a mouse pointer on screen #define SUPPORT_MOUSE_CURSOR_NATIVE 1 +// Setting a higher resolution can improve the accuracy of time-out intervals in wait functions. +// However, it can also reduce overall system performance, because the thread scheduler switches tasks more often. +#define SUPPORT_WINMM_HIGHRES_TIMER 1 // Use busy wait loop for timing sync, if not defined, a high-resolution timer is setup and used //#define SUPPORT_BUSY_WAIT_LOOP 1 -// Use a half-busy wait loop, in this case frame sleeps for some time and runs a busy-wait-loop at the end -#define SUPPORT_HALFBUSY_WAIT_LOOP +// Use a partial-busy wait loop, in this case frame sleeps for most of the time, but then runs a busy loop at the end for accuracy +#define SUPPORT_PARTIALBUSY_WAIT_LOOP // Wait for events passively (sleeping while no events) instead of polling them actively every frame //#define SUPPORT_EVENTS_WAITING 1 // Allow automatic screen capture of current screen pressing F12, defined in KeyCallback() @@ -60,6 +55,8 @@ #define SUPPORT_COMPRESSION_API 1 // Support saving binary data automatically to a generated storage.data file. This file is managed internally. #define SUPPORT_DATA_STORAGE 1 +// Support automatic generated events, loading and recording of those events when required +#define SUPPORT_EVENTS_AUTOMATION 1 // core: Configuration values //------------------------------------------------------------------------------------ @@ -81,13 +78,11 @@ //------------------------------------------------------------------------------------ -// Module: rlgl - Configuration Flags +// Module: rlgl - Configuration values //------------------------------------------------------------------------------------ -// Support VR simulation functionality (stereo rendering) -#define SUPPORT_VR_SIMULATOR 1 +// Show OpenGL extensions and capabilities detailed logs on init +//#define SUPPORT_GL_DETAILS_INFO 1 -// rlgl: Configuration values -//------------------------------------------------------------------------------------ #if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) #define DEFAULT_BATCH_BUFFER_ELEMENTS 8192 // Default internal render batch limits #elif defined(GRAPHICS_API_OPENGL_ES2) @@ -98,6 +93,7 @@ #define DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture) #define MAX_MATRIX_STACK_SIZE 32 // Maximum size of internal Matrix stack +#define MAX_MESH_VERTEX_BUFFERS 7 // Maximum vertex buffers (VBO) per mesh #define MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported #define MAX_MATERIAL_MAPS 12 // Maximum number of shader maps supported @@ -116,9 +112,6 @@ //------------------------------------------------------------------------------------ // Module: shapes - Configuration Flags //------------------------------------------------------------------------------------ -// Draw rectangle shapes using font texture white character instead of default white texture -// Allows drawing rectangles and text with a single draw call, very useful for GUI systems! -#define SUPPORT_FONT_TEXTURE 1 // Use QUADS instead of TRIANGLES for drawing when possible // Some lines-based shapes could still use lines #define SUPPORT_QUADS_DRAW_MODE 1 @@ -192,7 +185,7 @@ #define SUPPORT_FILEFORMAT_WAV 1 #define SUPPORT_FILEFORMAT_OGG 1 #define SUPPORT_FILEFORMAT_XM 1 -//#define SUPPORT_FILEFORMAT_MOD 1 +#define SUPPORT_FILEFORMAT_MOD 1 #define SUPPORT_FILEFORMAT_MP3 1 //#define SUPPORT_FILEFORMAT_FLAC 1 @@ -200,14 +193,15 @@ //------------------------------------------------------------------------------------ #define AUDIO_DEVICE_FORMAT ma_format_f32 // Device output format (miniaudio: float-32bit) #define AUDIO_DEVICE_CHANNELS 2 // Device output channels: stereo -#define AUDIO_DEVICE_SAMPLE_RATE 44100 // Device output sample rate +#define AUDIO_DEVICE_SAMPLE_RATE 0 // Device sample rate (device default) -#define DEFAULT_AUDIO_BUFFER_SIZE 4096 // Default audio buffer size for streaming #define MAX_AUDIO_BUFFER_POOL_CHANNELS 16 // Maximum number of audio pool channels //------------------------------------------------------------------------------------ // Module: utils - Configuration Flags //------------------------------------------------------------------------------------ +// Standard file io library (stdio.h) included +#define SUPPORT_STANDARD_FILEIO // Show TRACELOG() output messages // NOTE: By default LOG_DEBUG traces not shown #define SUPPORT_TRACELOG 1 @@ -217,6 +211,3 @@ //------------------------------------------------------------------------------------ #define MAX_TRACELOG_MSG_LENGTH 128 // Max length of one trace-log message #define MAX_UWP_MESSAGES 512 // Max UWP messages to process - - -#endif //defined(RAYLIB_CMAKE) diff --git a/src/config.h.in b/src/config.h.in deleted file mode 100644 index 4cb217b5c..000000000 --- a/src/config.h.in +++ /dev/null @@ -1,91 +0,0 @@ -// config.h.in - -// core.c -// Camera module is included (camera.h) and multiple predefined cameras are available: free, 1st/3rd person, orbital -#cmakedefine SUPPORT_CAMERA_SYSTEM 1 -// Gestures module is included (gestures.h) to support gestures detection: tap, hold, swipe, drag -#cmakedefine SUPPORT_GESTURES_SYSTEM 1 -// Mouse gestures are directly mapped like touches and processed by gestures system. -#cmakedefine SUPPORT_MOUSE_GESTURES 1 -// Reconfigure standard input to receive key inputs, works with SSH connection. -#cmakedefine SUPPORT_SSH_KEYBOARD_RPI 1 -// Use busy wait loop for timing sync, if not defined, a high-resolution timer is setup and used -#cmakedefine SUPPORT_BUSY_WAIT_LOOP 1 -// Wait for events passively (sleeping while no events) instead of polling them actively every frame -#cmakedefine SUPPORT_EVENTS_WAITING 1 -// Allow automatic screen capture of current screen pressing F12, defined in KeyCallback() -#cmakedefine SUPPORT_SCREEN_CAPTURE 1 -// Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback() -#cmakedefine SUPPORT_GIF_RECORDING 1 -// Support high DPI displays -#cmakedefine SUPPORT_HIGH_DPI 1 -// Support CompressData() and DecompressData() functions -#cmakedefine SUPPORT_COMPRESSION_API 1 -// Support for persistent data storage -#cmakedefine SUPPORT_DATA_STORAGE 1 - -// rlgl.h -// Support VR simulation functionality (stereo rendering) -#cmakedefine SUPPORT_VR_SIMULATOR 1 - -// shapes.c -// Draw rectangle shapes using font texture white character instead of default white texture -#cmakedefine SUPPORT_FONT_TEXTURE 1 -// Use QUADS instead of TRIANGLES for drawing when possible -// Some lines-based shapes could still use lines -#cmakedefine SUPPORT_QUADS_DRAW_MODE 1 - -// textures.c -// Selecte desired fileformats to be supported for image data loading. -#cmakedefine SUPPORT_FILEFORMAT_PNG 1 -#cmakedefine SUPPORT_FILEFORMAT_DDS 1 -#cmakedefine SUPPORT_FILEFORMAT_HDR 1 -#cmakedefine SUPPORT_FILEFORMAT_KTX 1 -#cmakedefine SUPPORT_FILEFORMAT_ASTC 1 -#cmakedefine SUPPORT_FILEFORMAT_BMP 1 -#cmakedefine SUPPORT_FILEFORMAT_TGA 1 -#cmakedefine SUPPORT_FILEFORMAT_JPG 1 -#cmakedefine SUPPORT_FILEFORMAT_GIF 1 -#cmakedefine SUPPORT_FILEFORMAT_PSD 1 -#cmakedefine SUPPORT_FILEFORMAT_PKM 1 -#cmakedefine SUPPORT_FILEFORMAT_PVR 1 -// Support image export functionality (.png, .bmp, .tga, .jpg) -#define SUPPORT_IMAGE_EXPORT 1 -// Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop... If not defined only three image editing functions supported: ImageFormat(), ImageAlphaMask(), ImageToPOT() -#cmakedefine SUPPORT_IMAGE_MANIPULATION 1 -// Support procedural image generation functionality (gradient, spot, perlin-noise, cellular) -#cmakedefine SUPPORT_IMAGE_GENERATION 1 - -// text.c -// Default font is loaded on window initialization to be available for the user to render simple text. NOTE: If enabled, uses external module functions to load default raylib font (module: text) -#cmakedefine SUPPORT_DEFAULT_FONT 1 -// Selected desired fileformats to be supported for loading. -#cmakedefine SUPPORT_FILEFORMAT_FNT 1 -#cmakedefine SUPPORT_FILEFORMAT_TTF 1 -// Support text management functions -// If not defined, still some functions are supported: TextLength(), TextFormat() -#cmakedefine SUPPORT_TEXT_MANIPULATION 1 - -// models.c -// Selected desired fileformats to be supported for loading. -#cmakedefine SUPPORT_FILEFORMAT_OBJ 1 -#cmakedefine SUPPORT_FILEFORMAT_MTL 1 -#cmakedefine SUPPORT_FILEFORMAT_IQM 1 -#cmakedefine SUPPORT_FILEFORMAT_GLTF 1 -// Support procedural mesh generation functions, uses external par_shapes.h library -// NOTE: Some generated meshes DO NOT include generated texture coordinates -#cmakedefine SUPPORT_MESH_GENERATION 1 - -// raudio.c -// Desired fileformats to be supported for loading. -#cmakedefine SUPPORT_FILEFORMAT_WAV 1 -#cmakedefine SUPPORT_FILEFORMAT_OGG 1 -#cmakedefine SUPPORT_FILEFORMAT_XM 1 -#cmakedefine SUPPORT_FILEFORMAT_MOD 1 -#cmakedefine SUPPORT_FILEFORMAT_FLAC 1 -#cmakedefine SUPPORT_FILEFORMAT_MP3 1 - -// utils.c -// Show TraceLog() output messages. NOTE: By default LOG_DEBUG traces not shown -#cmakedefine SUPPORT_TRACELOG 1 - diff --git a/src/core.c b/src/core.c index 3cac4796a..df6b642a0 100644 --- a/src/core.c +++ b/src/core.c @@ -62,8 +62,8 @@ * #define SUPPORT_BUSY_WAIT_LOOP * Use busy wait loop for timing sync, if not defined, a high-resolution timer is setup and used * -* #define SUPPORT_HALFBUSY_WAIT_LOOP -* Use a half-busy wait loop, in this case frame sleeps for some time and runs a busy-wait-loop at the end +* #define SUPPORT_PARTIALBUSY_WAIT_LOOP +* Use a partial-busy wait loop, in this case frame sleeps for most of the time and runs a busy-wait-loop at the end * * #define SUPPORT_EVENTS_WAITING * Wait for events passively (sleeping while no events) instead of polling them actively every frame @@ -80,7 +80,10 @@ * for linkage * * #define SUPPORT_DATA_STORAGE -* Support saving binary data automatically to a generated storage.data file. This file is managed internally. +* Support saving binary data automatically to a generated storage.data file. This file is managed internally +* +* #define SUPPORT_EVENTS_AUTOMATION +* Support automatic generated events, loading and recording of those events when required * * DEPENDENCIES: * rglfw - Manage graphic device, OpenGL context and inputs on PLATFORM_DESKTOP (Windows, Linux, OSX. FreeBSD, OpenBSD, NetBSD, DragonFly) @@ -115,8 +118,6 @@ // Check if config flags have been externally provided on compilation line #if !defined(EXTERNAL_CONFIG_FLAGS) #include "config.h" // Defines module configuration flags -#else - #define RAYLIB_VERSION "3.5" #endif #include "utils.h" // Required for: TRACELOG macros @@ -153,7 +154,7 @@ #if defined(SUPPORT_COMPRESSION_API) #define SINFL_IMPLEMENTATION #include "external/sinfl.h" - + #define SDEFL_IMPLEMENTATION #include "external/sdefl.h" #endif @@ -162,7 +163,7 @@ #include // Required for: sprintf() [Used in OpenURL()] #include // Required for: strrchr(), strcmp(), strlen() #include // Required for: time() [Used in InitTimer()] -#include // Required for: tan() [Used in BeginMode3D()] +#include // Required for: tan() [Used in BeginMode3D()], atan2f() [Used in LoadVrStereoConfig()] #include // Required for: stat() [Used in GetFileModTime()] @@ -189,32 +190,33 @@ #if defined(PLATFORM_DESKTOP) #define GLFW_INCLUDE_NONE // Disable the standard OpenGL header inclusion on GLFW3 // NOTE: Already provided by rlgl implementation (on glad.h) - #include // GLFW3 library: Windows, OpenGL context and Input management + #include "GLFW/glfw3.h" // GLFW3 library: Windows, OpenGL context and Input management // NOTE: GLFW3 already includes gl.h (OpenGL) headers // Support retrieving native window handlers #if defined(_WIN32) #define GLFW_EXPOSE_NATIVE_WIN32 - #include // WARNING: It requires customization to avoid windows.h inclusion! + #include "GLFW/glfw3native.h" // WARNING: It requires customization to avoid windows.h inclusion! - #if !defined(SUPPORT_BUSY_WAIT_LOOP) + #if defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP) // NOTE: Those functions require linking with winmm library unsigned int __stdcall timeBeginPeriod(unsigned int uPeriod); unsigned int __stdcall timeEndPeriod(unsigned int uPeriod); #endif - - #elif defined(__linux__) + #endif + #if defined(__linux__) || defined(__FreeBSD__) #include // Required for: timespec, nanosleep(), select() - POSIX //#define GLFW_EXPOSE_NATIVE_X11 // WARNING: Exposing Xlib.h > X.h results in dup symbols for Font type //#define GLFW_EXPOSE_NATIVE_WAYLAND //#define GLFW_EXPOSE_NATIVE_MIR - #include // Required for: glfwGetX11Window() - #elif defined(__APPLE__) + #include "GLFW/glfw3native.h" // Required for: glfwGetX11Window() + #endif + #if defined(__APPLE__) #include // Required for: usleep() //#define GLFW_EXPOSE_NATIVE_COCOA // WARNING: Fails due to type redefinition - #include // Required for: glfwGetCocoaWindow() + #include "GLFW/glfw3native.h" // Required for: glfwGetCocoaWindow() #endif #endif @@ -223,8 +225,8 @@ #include // Defines AWINDOW_FLAG_FULLSCREEN and others #include // Defines basic app state struct and manages activity - #include // EGL library - Native platform display device control functions - #include // OpenGL ES 2.0 library + #include // Native platform windowing system interface + //#include // OpenGL ES 2.0 library (not required in this module) #endif #if defined(PLATFORM_RPI) || defined(PLATFORM_DRM) @@ -249,41 +251,35 @@ #include // Direct Rendering Manager modesetting interface #endif - #include "EGL/egl.h" // EGL library - Native platform display device control functions - #include "EGL/eglext.h" // EGL library - Extensions - #include "GLES2/gl2.h" // OpenGL ES 2.0 library + #include "EGL/egl.h" // Native platform windowing system interface + #include "EGL/eglext.h" // EGL extensions + //#include "GLES2/gl2.h" // OpenGL ES 2.0 library (not required in this module) #endif #if defined(PLATFORM_UWP) - #include "EGL/egl.h" // EGL library - Native platform display device control functions - #include "EGL/eglext.h" // EGL library - Extensions - #include "GLES2/gl2.h" // OpenGL ES 2.0 library + #include "EGL/egl.h" // Native platform windowing system interface + #include "EGL/eglext.h" // EGL extensions + //#include "GLES2/gl2.h" // OpenGL ES 2.0 library (not required in this module) #include "uwp_events.h" // UWP bootstrapping functions #endif #if defined(PLATFORM_WEB) #define GLFW_INCLUDE_ES2 // GLFW3: Enable OpenGL ES 2.0 (translated to WebGL) - #include // GLFW3 library: Windows, OpenGL context and Input management + #include "GLFW/glfw3.h" // GLFW3 library: Windows, OpenGL context and Input management #include // Required for: timespec, nanosleep(), select() - POSIX #include // Emscripten library - LLVM to JavaScript compiler #include // Emscripten HTML5 library #endif -#if defined(SUPPORT_COMPRESSION_API) - // NOTE: Those declarations require stb_image and stb_image_write definitions, included in textures module - unsigned char *stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality); - char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen); -#endif - //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- #if defined(PLATFORM_RPI) || defined(PLATFORM_DRM) #define USE_LAST_TOUCH_DEVICE // When multiple touchscreens are connected, only use the one with the highest event number - #define DEFAULT_GAMEPAD_DEV "/dev/input/js" // Gamepad input (base dev for all gamepads: js0, js1, ...) - #define DEFAULT_EVDEV_PATH "/dev/input/" // Path to the linux input events + #define DEFAULT_GAMEPAD_DEV "/dev/input/js" // Gamepad input (base dev for all gamepads: js0, js1, ...) + #define DEFAULT_EVDEV_PATH "/dev/input/" // Path to the linux input events #endif #ifndef MAX_FILEPATH_LENGTH @@ -294,23 +290,29 @@ #endif #endif +#ifndef MAX_KEYBOARD_KEYS + #define MAX_KEYBOARD_KEYS 512 // Maximum number of keyboard keys supported +#endif +#ifndef MAX_MOUSE_BUTTONS + #define MAX_MOUSE_BUTTONS 8 // Maximum number of mouse buttons supported +#endif #ifndef MAX_GAMEPADS - #define MAX_GAMEPADS 4 // Max number of gamepads supported + #define MAX_GAMEPADS 4 // Maximum number of gamepads supported #endif #ifndef MAX_GAMEPAD_AXIS - #define MAX_GAMEPAD_AXIS 8 // Max number of axis supported (per gamepad) + #define MAX_GAMEPAD_AXIS 8 // Maximum number of axis supported (per gamepad) #endif #ifndef MAX_GAMEPAD_BUTTONS - #define MAX_GAMEPAD_BUTTONS 32 // Max bumber of buttons supported (per gamepad) + #define MAX_GAMEPAD_BUTTONS 32 // Maximum number of buttons supported (per gamepad) #endif #ifndef MAX_TOUCH_POINTS #define MAX_TOUCH_POINTS 10 // Maximum number of touch points supported #endif #ifndef MAX_KEY_PRESSED_QUEUE - #define MAX_KEY_PRESSED_QUEUE 16 // Max number of keys in the key input queue + #define MAX_KEY_PRESSED_QUEUE 16 // Maximum number of keys in the key input queue #endif #ifndef MAX_CHAR_PRESSED_QUEUE - #define MAX_CHAR_PRESSED_QUEUE 16 // Max number of characters in the char input queue + #define MAX_CHAR_PRESSED_QUEUE 16 // Maximum number of characters in the char input queue #endif #if defined(SUPPORT_DATA_STORAGE) @@ -319,6 +321,10 @@ #endif #endif +#ifndef MAX_DECOMPRESSION_SIZE + #define MAX_DECOMPRESSION_SIZE 64 // Maximum size allocated for decompression in MB +#endif + // Flags operation macros #define FLAG_SET(n, f) ((n) |= (f)) #define FLAG_CLEAR(n, f) ((n) &= ~(f)) @@ -410,8 +416,8 @@ typedef struct CoreData { #endif struct { int exitKey; // Default exit key - char currentKeyState[512]; // Registers current frame key state - char previousKeyState[512]; // Registers previous frame key state + char currentKeyState[MAX_KEYBOARD_KEYS]; // Registers current frame key state + char previousKeyState[MAX_KEYBOARD_KEYS]; // Registers previous frame key state int keyPressedQueue[MAX_KEY_PRESSED_QUEUE]; // Input keys queue int keyPressedQueueCount; // Input keys queue count @@ -426,20 +432,21 @@ typedef struct CoreData { #endif } Keyboard; struct { - Vector2 position; // Mouse position on screen Vector2 offset; // Mouse offset Vector2 scale; // Mouse scaling + Vector2 currentPosition; // Mouse position on screen + Vector2 previousPosition; // Previous mouse position int cursor; // Tracks current mouse cursor bool cursorHidden; // Track if cursor is hidden bool cursorOnScreen; // Tracks if cursor is inside client area - char currentButtonState[3]; // Registers current mouse button state - char previousButtonState[3]; // Registers previous mouse button state + char currentButtonState[MAX_MOUSE_BUTTONS]; // Registers current mouse button state + char previousButtonState[MAX_MOUSE_BUTTONS]; // Registers previous mouse button state float currentWheelMove; // Registers current mouse wheel variation float previousWheelMove; // Registers previous mouse wheel variation #if defined(PLATFORM_RPI) || defined(PLATFORM_DRM) - char currentButtonStateEvdev[3]; // Holds the new mouse state for the next polling event to grab (Can't be written directly due to multithreading, app could miss the update) + char currentButtonStateEvdev[MAX_MOUSE_BUTTONS]; // Holds the new mouse state for the next polling event to grab (Can't be written directly due to multithreading, app could miss the update) #endif } Mouse; struct { @@ -450,12 +457,10 @@ typedef struct CoreData { struct { int lastButtonPressed; // Register last gamepad button pressed int axisCount; // Register number of available gamepad axis -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM) || defined(PLATFORM_WEB) || defined(PLATFORM_UWP) bool ready[MAX_GAMEPADS]; // Flag to know if gamepad is ready - float axisState[MAX_GAMEPADS][MAX_GAMEPAD_AXIS]; // Gamepad axis state - char currentState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Current gamepad buttons state - char previousState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Previous gamepad buttons state -#endif + char currentButtonState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Current gamepad buttons state + char previousButtonState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Previous gamepad buttons state + float axisState[MAX_GAMEPADS][MAX_GAMEPAD_AXIS]; // Gamepad axis state #if defined(PLATFORM_RPI) || defined(PLATFORM_DRM) pthread_t threadId; // Gamepad reading thread id int streamId[MAX_GAMEPADS]; // Gamepad device file descriptor @@ -473,6 +478,7 @@ typedef struct CoreData { #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM) || defined(PLATFORM_UWP) unsigned long long base; // Base time measure for hi-res timer #endif + unsigned int frameCounter; // Frame counter } Time; } CoreData; @@ -493,6 +499,93 @@ static int gifFramesCounter = 0; // GIF frames counter static bool gifRecording = false; // GIF recording state static MsfGifState gifState = { 0 }; // MSGIF context state #endif + +#if defined(SUPPORT_EVENTS_AUTOMATION) +#define MAX_CODE_AUTOMATION_EVENTS 16384 + +typedef enum AutomationEventType { + EVENT_NONE = 0, + // Input events + INPUT_KEY_UP, // param[0]: key + INPUT_KEY_DOWN, // param[0]: key + INPUT_KEY_PRESSED, // param[0]: key + INPUT_KEY_RELEASED, // param[0]: key + INPUT_MOUSE_BUTTON_UP, // param[0]: button + INPUT_MOUSE_BUTTON_DOWN, // param[0]: button + INPUT_MOUSE_POSITION, // param[0]: x, param[1]: y + INPUT_MOUSE_WHEEL_MOTION, // param[0]: delta + INPUT_GAMEPAD_CONNECT, // param[0]: gamepad + INPUT_GAMEPAD_DISCONNECT, // param[0]: gamepad + INPUT_GAMEPAD_BUTTON_UP, // param[0]: button + INPUT_GAMEPAD_BUTTON_DOWN, // param[0]: button + INPUT_GAMEPAD_AXIS_MOTION, // param[0]: axis, param[1]: delta + INPUT_TOUCH_UP, // param[0]: id + INPUT_TOUCH_DOWN, // param[0]: id + INPUT_TOUCH_POSITION, // param[0]: x, param[1]: y + INPUT_GESTURE, // param[0]: gesture + // Window events + WINDOW_CLOSE, // no params + WINDOW_MAXIMIZE, // no params + WINDOW_MINIMIZE, // no params + WINDOW_RESIZE, // param[0]: width, param[1]: height + // Custom events + ACTION_TAKE_SCREENSHOT, + ACTION_SETTARGETFPS +} AutomationEventType; + +// Event type +// Used to enable events flags +typedef enum { + EVENT_INPUT_KEYBOARD = 0, + EVENT_INPUT_MOUSE = 1, + EVENT_INPUT_GAMEPAD = 2, + EVENT_INPUT_TOUCH = 4, + EVENT_INPUT_GESTURE = 8, + EVENT_WINDOW = 16, + EVENT_CUSTOM = 32 +} EventType; + +static const char *autoEventTypeName[] = { + "EVENT_NONE", + "INPUT_KEY_UP", + "INPUT_KEY_DOWN", + "INPUT_KEY_PRESSED", + "INPUT_KEY_RELEASED", + "INPUT_MOUSE_BUTTON_UP", + "INPUT_MOUSE_BUTTON_DOWN", + "INPUT_MOUSE_POSITION", + "INPUT_MOUSE_WHEEL_MOTION", + "INPUT_GAMEPAD_CONNECT", + "INPUT_GAMEPAD_DISCONNECT", + "INPUT_GAMEPAD_BUTTON_UP", + "INPUT_GAMEPAD_BUTTON_DOWN", + "INPUT_GAMEPAD_AXIS_MOTION", + "INPUT_TOUCH_UP", + "INPUT_TOUCH_DOWN", + "INPUT_TOUCH_POSITION", + "INPUT_GESTURE", + "WINDOW_CLOSE", + "WINDOW_MAXIMIZE", + "WINDOW_MINIMIZE", + "WINDOW_RESIZE", + "ACTION_TAKE_SCREENSHOT", + "ACTION_SETTARGETFPS" +}; + +// Automation Event (20 bytes) +typedef struct AutomationEvent { + unsigned int frame; // Event frame + unsigned int type; // Event type (AutoEventType) + int params[3]; // Event parameters (if required) +} AutomationEvent; + +static AutomationEvent *events = NULL; // Events array +static unsigned int eventCount = 0; // Events count +static bool eventsPlaying = false; // Play events +static bool eventsRecording = false; // Record events + +//static short eventsEnabled = 0b0000001111111111; // Events enabled for checking +#endif //----------------------------------------------------------------------------------- //---------------------------------------------------------------------------------- @@ -509,12 +602,11 @@ extern void UnloadFontDefault(void); // [Module: text] Unloads default fo static bool InitGraphicsDevice(int width, int height); // Initialize graphics device static void SetupFramebuffer(int width, int height); // Setup main framebuffer static void SetupViewport(int width, int height); // Set viewport for a provided width and height -static void SwapBuffers(void); // Copy back buffer to front buffers +static void SwapBuffers(void); // Copy back buffer to front buffer static void InitTimer(void); // Initialize timer static void Wait(float ms); // Wait for some milliseconds (stop program execution) -static int GetGamepadButton(int button); // Get gamepad button generic to all platforms static void PollInputEvents(void); // Register user events #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) @@ -542,10 +634,6 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) #endif #if defined(PLATFORM_WEB) -static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const EmscriptenFullscreenChangeEvent *event, void *userData); -static EM_BOOL EmscriptenWindowResizedCallback(int eventType, const void *reserved, void *userData); -static EM_BOOL EmscriptenKeyboardCallback(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData); -static EM_BOOL EmscriptenMouseCallback(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData); static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData); static EM_BOOL EmscriptenGamepadCallback(int eventType, const EmscriptenGamepadEvent *gamepadEvent, void *userData); #endif @@ -576,8 +664,15 @@ static int FindNearestConnectorMode(const drmModeConnector *connector, uint widt #endif // PLATFORM_RPI || PLATFORM_DRM +#if defined(SUPPORT_EVENTS_AUTOMATION) +static void LoadAutomationEvents(const char *fileName); +static void ExportAutomationEvents(const char *fileName); +static void RecordAutomationEvent(unsigned int frame); +static void PlayAutomationEvent(unsigned int frame); +#endif + #if defined(_WIN32) - // NOTE: We include Sleep() function signature here to avoid windows.h inclusion + // NOTE: We include Sleep() function signature here to avoid windows.h inclusion (kernel32 lib) void __stdcall Sleep(unsigned long msTimeout); // Required for Wait() #endif @@ -655,7 +750,7 @@ void InitWindow(int width, int height, const char *title) #if defined(PLATFORM_UWP) if (!UWPIsConfigured()) { - TRACELOG(LOG_ERROR, "UWP Functions have not been set yet, please set these before initializing raylib!"); + TRACELOG(LOG_FATAL, "UWP Functions have not been set yet, please set these before initializing raylib!"); return; } #endif @@ -739,7 +834,12 @@ void InitWindow(int width, int height, const char *title) // NOTE: returns true if window and graphic device has been initialized successfully CORE.Window.ready = InitGraphicsDevice(width, height); - if (!CORE.Window.ready) return; + // If graphic device is no properly initialized, we end program + if (!CORE.Window.ready) + { + TRACELOG(LOG_FATAL, "Failed to initialize Graphic Device"); + return; + } // Init hi-res timer InitTimer(); @@ -751,12 +851,15 @@ void InitWindow(int width, int height, const char *title) Rectangle rec = GetFontDefault().recs[95]; // NOTE: We setup a 1px padding on char rectangle to avoid pixel bleeding on MSAA filtering SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 1, rec.y + 1, rec.width - 2, rec.height - 2 }); +#else + // Set default internal texture (1px white) and rectangle to be used for shapes drawing + SetShapesTexture(rlGetTextureDefault(), (Rectangle){ 0.0f, 0.0f, 1.0f, 1.0f }); #endif #if defined(PLATFORM_DESKTOP) if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0) { // Set default font texture filter for HighDPI (blurry) - SetTextureFilter(GetFontDefault().texture, FILTER_BILINEAR); + SetTextureFilter(GetFontDefault().texture, TEXTURE_FILTER_BILINEAR); } #endif @@ -772,15 +875,13 @@ void InitWindow(int width, int height, const char *title) #endif #if defined(PLATFORM_WEB) - // Detect fullscreen change events - emscripten_set_fullscreenchange_callback("#canvas", NULL, 1, EmscriptenFullscreenChangeCallback); + // Check fullscreen change events + //emscripten_set_fullscreenchange_callback("#canvas", NULL, 1, EmscriptenFullscreenChangeCallback); + //emscripten_set_resize_callback("#canvas", NULL, 1, EmscriptenResizeCallback); // Support keyboard events //emscripten_set_keypress_callback("#canvas", NULL, 1, EmscriptenKeyboardCallback); - emscripten_set_keydown_callback("#canvas", NULL, 1, EmscriptenKeyboardCallback); - - // Support mouse events - emscripten_set_click_callback("#canvas", NULL, 1, EmscriptenMouseCallback); + //emscripten_set_keydown_callback("#canvas", NULL, 1, EmscriptenKeyboardCallback); // Support touch events emscripten_set_touchstart_callback("#canvas", NULL, 1, EmscriptenTouchCallback); @@ -793,9 +894,15 @@ void InitWindow(int width, int height, const char *title) emscripten_set_gamepaddisconnected_callback(NULL, 1, EmscriptenGamepadCallback); #endif - CORE.Input.Mouse.position.x = (float)CORE.Window.screen.width/2.0f; - CORE.Input.Mouse.position.y = (float)CORE.Window.screen.height/2.0f; -#endif // PLATFORM_ANDROID + CORE.Input.Mouse.currentPosition.x = (float)CORE.Window.screen.width/2.0f; + CORE.Input.Mouse.currentPosition.y = (float)CORE.Window.screen.height/2.0f; + +#if defined(SUPPORT_EVENTS_AUTOMATION) + events = (AutomationEvent *)malloc(MAX_CODE_AUTOMATION_EVENTS*sizeof(AutomationEvent)); + CORE.Time.frameCounter = 0; +#endif + +#endif // PLATFORM_DESKTOP || PLATFORM_WEB || PLATFORM_RPI || PLATFORM_DRM || PLATFORM_UWP } // Close window and unload OpenGL context @@ -821,7 +928,7 @@ void CloseWindow(void) glfwTerminate(); #endif -#if !defined(SUPPORT_BUSY_WAIT_LOOP) && defined(_WIN32) && !defined(PLATFORM_UWP) +#if defined(_WIN32) && defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP) && !defined(PLATFORM_UWP) timeEndPeriod(1); // Restore time period #endif @@ -908,7 +1015,7 @@ void CloseWindow(void) close(CORE.Input.Keyboard.fd); CORE.Input.Keyboard.fd = -1; } - + for (int i = 0; i < sizeof(CORE.Input.eventWorker)/sizeof(InputEventWorker); ++i) { if (CORE.Input.eventWorker[i].threadId) @@ -916,11 +1023,16 @@ void CloseWindow(void) pthread_join(CORE.Input.eventWorker[i].threadId, NULL); } } - + if (CORE.Input.Gamepad.threadId) pthread_join(CORE.Input.Gamepad.threadId, NULL); #endif +#if defined(SUPPORT_EVENTS_AUTOMATION) + free(events); +#endif + + CORE.Window.ready = false; TRACELOG(LOG_INFO, "Window closed successfully"); } @@ -1036,62 +1148,100 @@ void ToggleFullscreen(void) // Store previous window position (in case we exit fullscreen) glfwGetWindowPos(CORE.Window.handle, &CORE.Window.position.x, &CORE.Window.position.y); - GLFWmonitor *monitor = glfwGetWindowMonitor(CORE.Window.handle); + int monitorCount = 0; + GLFWmonitor** monitors = glfwGetMonitors(&monitorCount); + + int monitorIndex = GetCurrentMonitor(); + + // Use current monitor, so we correctly get the display the window is on + GLFWmonitor* monitor = monitorIndex < monitorCount ? monitors[monitorIndex] : NULL; + if (!monitor) { TRACELOG(LOG_WARNING, "GLFW: Failed to get monitor"); - glfwSetWindowMonitor(CORE.Window.handle, glfwGetPrimaryMonitor(), 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE); + + CORE.Window.fullscreen = false; // Toggle fullscreen flag + CORE.Window.flags &= ~FLAG_FULLSCREEN_MODE; + + glfwSetWindowMonitor(CORE.Window.handle, NULL, 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE); return; } - const GLFWvidmode *mode = glfwGetVideoMode(monitor); - glfwSetWindowMonitor(CORE.Window.handle, monitor, 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, mode->refreshRate); + CORE.Window.fullscreen = true; // Toggle fullscreen flag + CORE.Window.flags |= FLAG_FULLSCREEN_MODE; - // Try to enable GPU V-Sync, so frames are limited to screen refresh rate (60Hz -> 60 FPS) - // NOTE: V-Sync can be enabled by graphic driver configuration - if (CORE.Window.flags & FLAG_VSYNC_HINT) glfwSwapInterval(1); - } - else glfwSetWindowMonitor(CORE.Window.handle, NULL, CORE.Window.position.x, CORE.Window.position.y, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE); - - CORE.Window.fullscreen = !CORE.Window.fullscreen; // Toggle fullscreen flag - CORE.Window.flags ^= FLAG_FULLSCREEN_MODE; - -#endif -#if defined(PLATFORM_WEB) - /* - EM_ASM( - if (document.fullscreenElement) document.exitFullscreen(); - else Module.requestFullscreen(true, true); - ); - */ - - //EM_ASM(Module.requestFullscreen(false, false);); - - /* - if (!CORE.Window.fullscreen) - { - //https://github.com/emscripten-core/emscripten/issues/5124 - EmscriptenFullscreenStrategy strategy = { - .scaleMode = EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH, //EMSCRIPTEN_FULLSCREEN_SCALE_ASPECT, - .canvasResolutionScaleMode = EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEF, - .filteringMode = EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT, - .canvasResizedCallback = EmscriptenWindowResizedCallback, //on_canvassize_changed, - .canvasResizedCallbackUserData = NULL - }; - - emscripten_request_fullscreen("#canvas", false); - //emscripten_request_fullscreen_strategy("#canvas", EM_FALSE, &strategy); - //emscripten_enter_soft_fullscreen("canvas", &strategy); - TRACELOG(LOG_INFO, "emscripten_request_fullscreen_strategy"); + glfwSetWindowMonitor(CORE.Window.handle, monitor, 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE); } else { - TRACELOG(LOG_INFO, "emscripten_exit_fullscreen"); - emscripten_exit_fullscreen(); + CORE.Window.fullscreen = false; // Toggle fullscreen flag + CORE.Window.flags &= ~FLAG_FULLSCREEN_MODE; + + glfwSetWindowMonitor(CORE.Window.handle, NULL, CORE.Window.position.x, CORE.Window.position.y, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE); } - */ + + // Try to enable GPU V-Sync, so frames are limited to screen refresh rate (60Hz -> 60 FPS) + // NOTE: V-Sync can be enabled by graphic driver configuration + if (CORE.Window.flags & FLAG_VSYNC_HINT) glfwSwapInterval(1); +#endif +#if defined(PLATFORM_WEB) + EM_ASM + ( + // This strategy works well while using raylib minimal web shell for emscripten, + // it re-scales the canvas to fullscreen using monitor resolution, for tools this + // is a good strategy but maybe games prefer to keep current canvas resolution and + // display it in fullscreen, adjusting monitor resolution if possible + if (document.fullscreenElement) document.exitFullscreen(); + else Module.requestFullscreen(false, true); + ); + +/* + if (!CORE.Window.fullscreen) + { + // Option 1: Request fullscreen for the canvas element + // This option does not seem to work at all + //emscripten_request_fullscreen("#canvas", false); + + // Option 2: Request fullscreen for the canvas element with strategy + // This option does not seem to work at all + // Ref: https://github.com/emscripten-core/emscripten/issues/5124 + // EmscriptenFullscreenStrategy strategy = { + // .scaleMode = EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH, //EMSCRIPTEN_FULLSCREEN_SCALE_ASPECT, + // .canvasResolutionScaleMode = EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEF, + // .filteringMode = EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT, + // .canvasResizedCallback = EmscriptenWindowResizedCallback, + // .canvasResizedCallbackUserData = NULL + // }; + //emscripten_request_fullscreen_strategy("#canvas", EM_FALSE, &strategy); + + // Option 3: Request fullscreen for the canvas element with strategy + // It works as expected but only inside the browser (client area) + EmscriptenFullscreenStrategy strategy = { + .scaleMode = EMSCRIPTEN_FULLSCREEN_SCALE_ASPECT, + .canvasResolutionScaleMode = EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEF, + .filteringMode = EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT, + .canvasResizedCallback = EmscriptenWindowResizedCallback, + .canvasResizedCallbackUserData = NULL + }; + emscripten_enter_soft_fullscreen("#canvas", &strategy); + + int width, height; + emscripten_get_canvas_element_size("#canvas", &width, &height); + TRACELOG(LOG_WARNING, "Emscripten: Enter fullscreen: Canvas size: %i x %i", width, height); + } + else + { + //emscripten_exit_fullscreen(); + emscripten_exit_soft_fullscreen(); + + int width, height; + emscripten_get_canvas_element_size("#canvas", &width, &height); + TRACELOG(LOG_WARNING, "Emscripten: Exit fullscreen: Canvas size: %i x %i", width, height); + } +*/ CORE.Window.fullscreen = !CORE.Window.fullscreen; // Toggle fullscreen flag + CORE.Window.flags ^= FLAG_FULLSCREEN_MODE; #endif #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM) TRACELOG(LOG_WARNING, "SYSTEM: Failed to toggle to windowed mode"); @@ -1342,7 +1492,7 @@ void ClearWindowState(unsigned int flags) void SetWindowIcon(Image image) { #if defined(PLATFORM_DESKTOP) - if (image.format == UNCOMPRESSED_R8G8B8A8) + if (image.format == PIXELFORMAT_UNCOMPRESSED_R8G8B8A8) { GLFWimage icon[1] = { 0 }; @@ -1422,13 +1572,13 @@ void SetWindowSize(int width, int height) // Get current screen width int GetScreenWidth(void) { - return CORE.Window.screen.width; + return CORE.Window.currentFbo.width; } // Get current screen height int GetScreenHeight(void) { - return CORE.Window.screen.height; + return CORE.Window.currentFbo.height; } // Get native window handle @@ -1437,18 +1587,20 @@ void *GetWindowHandle(void) #if defined(PLATFORM_DESKTOP) && defined(_WIN32) // NOTE: Returned handle is: void *HWND (windows.h) return glfwGetWin32Window(CORE.Window.handle); -#elif defined(__linux__) +#endif +#if defined(__linux__) // NOTE: Returned handle is: unsigned long Window (X.h) // typedef unsigned long XID; // typedef XID Window; //unsigned long id = (unsigned long)glfwGetX11Window(window); return NULL; // TODO: Find a way to return value... cast to void *? -#elif defined(__APPLE__) +#endif +#if defined(__APPLE__) // NOTE: Returned handle is: (objc_object *) return NULL; // TODO: return (void *)glfwGetCocoaWindow(window); -#else - return NULL; #endif + + return NULL; } // Get number of monitors @@ -1490,7 +1642,7 @@ int GetCurrentMonitor(void) int y = 0; glfwGetWindowPos(CORE.Window.handle, &x, &y); - + for (int i = 0; i < monitorCount; i++) { int mx = 0; @@ -1530,7 +1682,7 @@ Vector2 GetMonitorPosition(int monitor) return (Vector2){ 0, 0 }; } -// Get selected monitor width +// Get selected monitor width (max available by monitor) int GetMonitorWidth(int monitor) { #if defined(PLATFORM_DESKTOP) @@ -1539,15 +1691,19 @@ int GetMonitorWidth(int monitor) if ((monitor >= 0) && (monitor < monitorCount)) { - const GLFWvidmode *mode = glfwGetVideoMode(monitors[monitor]); - return mode->width; + int count = 0; + const GLFWvidmode *modes = glfwGetVideoModes(monitors[monitor], &count); + + // We return the maximum resolution available, the last one in the modes array + if (count > 0) return modes[count - 1].width; + else TRACELOG(LOG_WARNING, "GLFW: Failed to find video mode for selected monitor"); } else TRACELOG(LOG_WARNING, "GLFW: Failed to find selected monitor"); #endif return 0; } -// Get selected monitor width +// Get selected monitor width (max available by monitor) int GetMonitorHeight(int monitor) { #if defined(PLATFORM_DESKTOP) @@ -1556,8 +1712,12 @@ int GetMonitorHeight(int monitor) if ((monitor >= 0) && (monitor < monitorCount)) { - const GLFWvidmode *mode = glfwGetVideoMode(monitors[monitor]); - return mode->height; + int count = 0; + const GLFWvidmode *modes = glfwGetVideoModes(monitors[monitor], &count); + + // We return the maximum resolution available, the last one in the modes array + if (count > 0) return modes[count - 1].height; + else TRACELOG(LOG_WARNING, "GLFW: Failed to find video mode for selected monitor"); } else TRACELOG(LOG_WARNING, "GLFW: Failed to find selected monitor"); #endif @@ -1738,6 +1898,9 @@ void EnableCursor(void) #if defined(PLATFORM_DESKTOP) glfwSetInputMode(CORE.Window.handle, GLFW_CURSOR, GLFW_CURSOR_NORMAL); #endif +#if defined(PLATFORM_WEB) + emscripten_exit_pointerlock(); +#endif #if defined(PLATFORM_UWP) UWPGetMouseUnlockFunc()(); #endif @@ -1750,6 +1913,9 @@ void DisableCursor(void) #if defined(PLATFORM_DESKTOP) glfwSetInputMode(CORE.Window.handle, GLFW_CURSOR, GLFW_CURSOR_DISABLED); #endif +#if defined(PLATFORM_WEB) + emscripten_request_pointerlock("#canvas", 1); +#endif #if defined(PLATFORM_UWP) UWPGetMouseLockFunc()(); #endif @@ -1791,11 +1957,11 @@ void EndDrawing(void) // we draw a small rectangle for user reference if (!CORE.Input.Mouse.cursorHidden) { - DrawRectangle(CORE.Input.Mouse.position.x, CORE.Input.Mouse.position.y, 3, 3, MAROON); + DrawRectangle(CORE.Input.Mouse.currentPosition.x, CORE.Input.Mouse.currentPosition.y, 3, 3, MAROON); } #endif - rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + rlDrawRenderBatchActive(); // Update and draw internal render batch #if defined(SUPPORT_GIF_RECORDING) #define GIF_RECORD_FRAMERATE 10 @@ -1812,21 +1978,47 @@ void EndDrawing(void) unsigned char *screenData = rlReadScreenPixels(CORE.Window.screen.width, CORE.Window.screen.height); msf_gif_frame(&gifState, screenData, 10, 16, CORE.Window.screen.width*4); - RL_FREE(screenData); // Free image data + RL_FREE(screenData); // Free image data } if (((gifFramesCounter/15)%2) == 1) { - DrawCircle(30, CORE.Window.screen.height - 20, 10, RED); - DrawText("RECORDING", 50, CORE.Window.screen.height - 25, 10, MAROON); + DrawCircle(30, CORE.Window.screen.height - 20, 10, MAROON); + DrawText("GIF RECORDING", 50, CORE.Window.screen.height - 25, 10, RED); } - rlglDraw(); // Draw RECORDING message + rlDrawRenderBatchActive(); // Update and draw internal render batch + } +#endif + +#if defined(SUPPORT_EVENTS_AUTOMATION) + if (eventsRecording) + { + gifFramesCounter++; + + if (((gifFramesCounter/15)%2) == 1) + { + DrawCircle(30, CORE.Window.screen.height - 20, 10, MAROON); + DrawText("EVENTS RECORDING", 50, CORE.Window.screen.height - 25, 10, RED); + } + + rlDrawRenderBatchActive(); // Update and draw internal render batch + } + else if (eventsPlaying) + { + gifFramesCounter++; + + if (((gifFramesCounter/15)%2) == 1) + { + DrawCircle(30, CORE.Window.screen.height - 20, 10, LIME); + DrawText("EVENTS PLAYING", 50, CORE.Window.screen.height - 25, 10, GREEN); + } + + rlDrawRenderBatchActive(); // Update and draw internal render batch } #endif SwapBuffers(); // Copy back buffer to front buffer - PollInputEvents(); // Poll user events // Frame time control system CORE.Time.current = GetTime(); @@ -1844,16 +2036,31 @@ void EndDrawing(void) double waitTime = CORE.Time.current - CORE.Time.previous; CORE.Time.previous = CORE.Time.current; - CORE.Time.frame += waitTime; // Total frame time: update + draw + wait + CORE.Time.frame += waitTime; // Total frame time: update + draw + wait } + + PollInputEvents(); // Poll user events + +#if defined(SUPPORT_EVENTS_AUTOMATION) + if (eventsRecording) RecordAutomationEvent(CORE.Time.frameCounter); + + // TODO: When should we play? After/before/replace PollInputEvents()? + if (eventsPlaying) + { + if (CORE.Time.frameCounter >= eventCount) eventsPlaying = false; + PlayAutomationEvent(CORE.Time.frameCounter); + } +#endif + + CORE.Time.frameCounter++; } // Initialize 2D mode with custom camera (2D) void BeginMode2D(Camera2D camera) { - rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + rlDrawRenderBatchActive(); // Update and draw internal render batch - rlLoadIdentity(); // Reset current matrix (modelview) + rlLoadIdentity(); // Reset current matrix (modelview) // Apply 2d camera transformation to modelview rlMultMatrixf(MatrixToFloat(GetCameraMatrix2D(camera))); @@ -1865,24 +2072,25 @@ void BeginMode2D(Camera2D camera) // Ends 2D mode with custom camera void EndMode2D(void) { - rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + rlDrawRenderBatchActive(); // Update and draw internal render batch - rlLoadIdentity(); // Reset current matrix (modelview) + rlLoadIdentity(); // Reset current matrix (modelview) rlMultMatrixf(MatrixToFloat(CORE.Window.screenScale)); // Apply screen scaling if required } // Initializes 3D mode with custom camera (3D) void BeginMode3D(Camera3D camera) { - rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + rlDrawRenderBatchActive(); // Update and draw internal render batch - rlMatrixMode(RL_PROJECTION); // Switch to projection matrix - rlPushMatrix(); // Save previous matrix, which contains the settings for the 2d ortho projection - rlLoadIdentity(); // Reset current matrix (projection) + rlMatrixMode(RL_PROJECTION); // Switch to projection matrix + rlPushMatrix(); // Save previous matrix, which contains the settings for the 2d ortho projection + rlLoadIdentity(); // Reset current matrix (projection) float aspect = (float)CORE.Window.currentFbo.width/(float)CORE.Window.currentFbo.height; - if (camera.type == CAMERA_PERSPECTIVE) + // NOTE: zNear and zFar values are important when computing depth buffer values + if (camera.projection == CAMERA_PERSPECTIVE) { // Setup perspective projection double top = RL_CULL_DISTANCE_NEAR*tan(camera.fovy*0.5*DEG2RAD); @@ -1890,7 +2098,7 @@ void BeginMode3D(Camera3D camera) rlFrustum(-right, right, -top, top, RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR); } - else if (camera.type == CAMERA_ORTHOGRAPHIC) + else if (camera.projection == CAMERA_ORTHOGRAPHIC) { // Setup orthographic projection double top = camera.fovy/2.0; @@ -1899,55 +2107,53 @@ void BeginMode3D(Camera3D camera) rlOrtho(-right, right, -top,top, RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR); } - // NOTE: zNear and zFar values are important when computing depth buffer values - - rlMatrixMode(RL_MODELVIEW); // Switch back to modelview matrix - rlLoadIdentity(); // Reset current matrix (modelview) + rlMatrixMode(RL_MODELVIEW); // Switch back to modelview matrix + rlLoadIdentity(); // Reset current matrix (modelview) // Setup Camera view Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); rlMultMatrixf(MatrixToFloat(matView)); // Multiply modelview matrix by view matrix (camera) - rlEnableDepthTest(); // Enable DEPTH_TEST for 3D + rlEnableDepthTest(); // Enable DEPTH_TEST for 3D } // Ends 3D mode and returns to default 2D orthographic mode void EndMode3D(void) { - rlglDraw(); // Process internal buffers (update + draw) + rlDrawRenderBatchActive(); // Update and draw internal render batch - rlMatrixMode(RL_PROJECTION); // Switch to projection matrix - rlPopMatrix(); // Restore previous matrix (projection) from matrix stack + rlMatrixMode(RL_PROJECTION); // Switch to projection matrix + rlPopMatrix(); // Restore previous matrix (projection) from matrix stack - rlMatrixMode(RL_MODELVIEW); // Switch back to modelview matrix - rlLoadIdentity(); // Reset current matrix (modelview) + rlMatrixMode(RL_MODELVIEW); // Switch back to modelview matrix + rlLoadIdentity(); // Reset current matrix (modelview) rlMultMatrixf(MatrixToFloat(CORE.Window.screenScale)); // Apply screen scaling if required - rlDisableDepthTest(); // Disable DEPTH_TEST for 2D + rlDisableDepthTest(); // Disable DEPTH_TEST for 2D } // Initializes render texture for drawing void BeginTextureMode(RenderTexture2D target) { - rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + rlDrawRenderBatchActive(); // Update and draw internal render batch - rlEnableFramebuffer(target.id); // Enable render target + rlEnableFramebuffer(target.id); // Enable render target // Set viewport to framebuffer size rlViewport(0, 0, target.texture.width, target.texture.height); - rlMatrixMode(RL_PROJECTION); // Switch to projection matrix - rlLoadIdentity(); // Reset current matrix (projection) + rlMatrixMode(RL_PROJECTION); // Switch to projection matrix + rlLoadIdentity(); // Reset current matrix (projection) // Set orthographic projection to current framebuffer size // NOTE: Configured top-left corner as (0, 0) rlOrtho(0, target.texture.width, target.texture.height, 0, 0.0f, 1.0f); - rlMatrixMode(RL_MODELVIEW); // Switch back to modelview matrix - rlLoadIdentity(); // Reset current matrix (modelview) + rlMatrixMode(RL_MODELVIEW); // Switch back to modelview matrix + rlLoadIdentity(); // Reset current matrix (modelview) - //rlScalef(0.0f, -1.0f, 0.0f); // Flip Y-drawing (?) + //rlScalef(0.0f, -1.0f, 0.0f); // Flip Y-drawing (?) // Setup current width/height for proper aspect ratio // calculation when using BeginMode3D() @@ -1958,23 +2164,48 @@ void BeginTextureMode(RenderTexture2D target) // Ends drawing to render texture void EndTextureMode(void) { - rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + rlDrawRenderBatchActive(); // Update and draw internal render batch - rlDisableFramebuffer(); // Disable render target (fbo) + rlDisableFramebuffer(); // Disable render target (fbo) // Set viewport to default framebuffer size SetupViewport(CORE.Window.render.width, CORE.Window.render.height); - // Reset current screen size - CORE.Window.currentFbo.width = GetScreenWidth(); - CORE.Window.currentFbo.height = GetScreenHeight(); + // Reset current fbo to screen size + CORE.Window.currentFbo.width = CORE.Window.screen.width; + CORE.Window.currentFbo.height = CORE.Window.screen.height; +} + +// Begin custom shader mode +void BeginShaderMode(Shader shader) +{ + rlSetShader(shader); +} + +// End custom shader mode (returns to default shader) +void EndShaderMode(void) +{ + rlSetShader(rlGetShaderDefault()); +} + +// Begin blending mode (alpha, additive, multiplied, subtract, custom) +// NOTE: Blend modes supported are enumerated in BlendMode enum +void BeginBlendMode(int mode) +{ + rlSetBlendMode(mode); +} + +// End blending mode (reset to default: alpha blending) +void EndBlendMode(void) +{ + rlSetBlendMode(BLEND_ALPHA); } // Begin scissor mode (define screen area for following drawing) // NOTE: Scissor rec refers to bottom-left corner, we change it to upper-left void BeginScissorMode(int x, int y, int width, int height) { - rlglDraw(); // Force drawing elements + rlDrawRenderBatchActive(); // Update and draw internal render batch rlEnableScissorTest(); rlScissor(x, CORE.Window.currentFbo.height - (y + height), width, height); @@ -1983,14 +2214,264 @@ void BeginScissorMode(int x, int y, int width, int height) // End scissor mode void EndScissorMode(void) { - rlglDraw(); // Force drawing elements + rlDrawRenderBatchActive(); // Update and draw internal render batch rlDisableScissorTest(); } -// Returns a ray trace from mouse position +// Begin VR drawing configuration +void BeginVrStereoMode(VrStereoConfig config) +{ + rlEnableStereoRender(); + + // Set stereo render matrices + rlSetMatrixProjectionStereo(config.projection[0], config.projection[1]); + rlSetMatrixViewOffsetStereo(config.viewOffset[0], config.viewOffset[1]); +} + +// End VR drawing process (and desktop mirror) +void EndVrStereoMode(void) +{ + rlDisableStereoRender(); +} + +// Load VR stereo config for VR simulator device parameters +VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device) +{ + VrStereoConfig config = { 0 }; + +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + // Compute aspect ratio + float aspect = ((float)device.hResolution*0.5f)/(float)device.vResolution; + + // Compute lens parameters + float lensShift = (device.hScreenSize*0.25f - device.lensSeparationDistance*0.5f)/device.hScreenSize; + config.leftLensCenter[0] = 0.25f + lensShift; + config.leftLensCenter[1] = 0.5f; + config.rightLensCenter[0] = 0.75f - lensShift; + config.rightLensCenter[1] = 0.5f; + config.leftScreenCenter[0] = 0.25f; + config.leftScreenCenter[1] = 0.5f; + config.rightScreenCenter[0] = 0.75f; + config.rightScreenCenter[1] = 0.5f; + + // Compute distortion scale parameters + // NOTE: To get lens max radius, lensShift must be normalized to [-1..1] + float lensRadius = fabsf(-1.0f - 4.0f*lensShift); + float lensRadiusSq = lensRadius*lensRadius; + float distortionScale = device.lensDistortionValues[0] + + device.lensDistortionValues[1]*lensRadiusSq + + device.lensDistortionValues[2]*lensRadiusSq*lensRadiusSq + + device.lensDistortionValues[3]*lensRadiusSq*lensRadiusSq*lensRadiusSq; + + float normScreenWidth = 0.5f; + float normScreenHeight = 1.0f; + config.scaleIn[0] = 2.0f/normScreenWidth; + config.scaleIn[1] = 2.0f/normScreenHeight/aspect; + config.scale[0] = normScreenWidth*0.5f/distortionScale; + config.scale[1] = normScreenHeight*0.5f*aspect/distortionScale; + + // Fovy is normally computed with: 2*atan2f(device.vScreenSize, 2*device.eyeToScreenDistance) + // ...but with lens distortion it is increased (see Oculus SDK Documentation) + //float fovy = 2.0f*atan2f(device.vScreenSize*0.5f*distortionScale, device.eyeToScreenDistance); // Really need distortionScale? + float fovy = 2.0f*(float)atan2f(device.vScreenSize*0.5f, device.eyeToScreenDistance); + + // Compute camera projection matrices + float projOffset = 4.0f*lensShift; // Scaled to projection space coordinates [-1..1] + Matrix proj = MatrixPerspective(fovy, aspect, RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR); + + config.projection[0] = MatrixMultiply(proj, MatrixTranslate(projOffset, 0.0f, 0.0f)); + config.projection[1] = MatrixMultiply(proj, MatrixTranslate(-projOffset, 0.0f, 0.0f)); + + // Compute camera transformation matrices + // NOTE: Camera movement might seem more natural if we model the head. + // Our axis of rotation is the base of our head, so we might want to add + // some y (base of head to eye level) and -z (center of head to eye protrusion) to the camera positions. + config.viewOffset[0] = MatrixTranslate(-device.interpupillaryDistance*0.5f, 0.075f, 0.045f); + config.viewOffset[1] = MatrixTranslate(device.interpupillaryDistance*0.5f, 0.075f, 0.045f); + + // Compute eyes Viewports + /* + config.eyeViewportRight[0] = 0; + config.eyeViewportRight[1] = 0; + config.eyeViewportRight[2] = device.hResolution/2; + config.eyeViewportRight[3] = device.vResolution; + + config.eyeViewportLeft[0] = device.hResolution/2; + config.eyeViewportLeft[1] = 0; + config.eyeViewportLeft[2] = device.hResolution/2; + config.eyeViewportLeft[3] = device.vResolution; + */ +#else + TRACELOG(LOG_WARNING, "RLGL: VR Simulator not supported on OpenGL 1.1"); +#endif + + return config; +} + +// Unload VR stereo config properties +void UnloadVrStereoConfig(VrStereoConfig config) +{ + //... +} + +// Load shader from files and bind default locations +// NOTE: If shader string is NULL, using default vertex/fragment shaders +Shader LoadShader(const char *vsFileName, const char *fsFileName) +{ + Shader shader = { 0 }; + shader.locs = (int *)RL_CALLOC(MAX_SHADER_LOCATIONS, sizeof(int)); + + // NOTE: All locations must be reseted to -1 (no location) + for (int i = 0; i < MAX_SHADER_LOCATIONS; i++) shader.locs[i] = -1; + + char *vShaderStr = NULL; + char *fShaderStr = NULL; + + if (vsFileName != NULL) vShaderStr = LoadFileText(vsFileName); + if (fsFileName != NULL) fShaderStr = LoadFileText(fsFileName); + + shader.id = rlLoadShaderCode(vShaderStr, fShaderStr); + + if (vShaderStr != NULL) UnloadFileText(vShaderStr); + if (fShaderStr != NULL) UnloadFileText(fShaderStr); + + // After shader loading, we TRY to set default location names + if (shader.id > 0) + { + // Default shader attrib locations have been fixed before linking: + // vertex position location = 0 + // vertex texcoord location = 1 + // vertex normal location = 2 + // vertex color location = 3 + // vertex tangent location = 4 + // vertex texcoord2 location = 5 + + // NOTE: If any location is not found, loc point becomes -1 + + // Get handles to GLSL input attibute locations + shader.locs[SHADER_LOC_VERTEX_POSITION] = rlGetLocationAttrib(shader.id, DEFAULT_SHADER_ATTRIB_NAME_POSITION); + shader.locs[SHADER_LOC_VERTEX_TEXCOORD01] = rlGetLocationAttrib(shader.id, DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD); + shader.locs[SHADER_LOC_VERTEX_TEXCOORD02] = rlGetLocationAttrib(shader.id, DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2); + shader.locs[SHADER_LOC_VERTEX_NORMAL] = rlGetLocationAttrib(shader.id, DEFAULT_SHADER_ATTRIB_NAME_NORMAL); + shader.locs[SHADER_LOC_VERTEX_TANGENT] = rlGetLocationAttrib(shader.id, DEFAULT_SHADER_ATTRIB_NAME_TANGENT); + shader.locs[SHADER_LOC_VERTEX_COLOR] = rlGetLocationAttrib(shader.id, DEFAULT_SHADER_ATTRIB_NAME_COLOR); + + // Get handles to GLSL uniform locations (vertex shader) + shader.locs[SHADER_LOC_MATRIX_MVP] = rlGetLocationUniform(shader.id, "mvp"); + shader.locs[SHADER_LOC_MATRIX_VIEW] = rlGetLocationUniform(shader.id, "view"); + shader.locs[SHADER_LOC_MATRIX_PROJECTION] = rlGetLocationUniform(shader.id, "projection"); + shader.locs[SHADER_LOC_MATRIX_NORMAL] = rlGetLocationUniform(shader.id, "matNormal"); + + // Get handles to GLSL uniform locations (fragment shader) + shader.locs[SHADER_LOC_COLOR_DIFFUSE] = rlGetLocationUniform(shader.id, "colDiffuse"); + shader.locs[SHADER_LOC_MAP_DIFFUSE] = rlGetLocationUniform(shader.id, "texture0"); + shader.locs[SHADER_LOC_MAP_SPECULAR] = rlGetLocationUniform(shader.id, "texture1"); + shader.locs[SHADER_LOC_MAP_NORMAL] = rlGetLocationUniform(shader.id, "texture2"); + } + + return shader; +} + +// Load shader from code strings and bind default locations +RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode) +{ + Shader shader = { 0 }; + shader.locs = (int *)RL_CALLOC(MAX_SHADER_LOCATIONS, sizeof(int)); + + shader.id = rlLoadShaderCode(vsCode, fsCode); + + // After shader loading, we TRY to set default location names + if (shader.id > 0) + { + // Default shader attrib locations have been fixed before linking: + // vertex position location = 0 + // vertex texcoord location = 1 + // vertex normal location = 2 + // vertex color location = 3 + // vertex tangent location = 4 + // vertex texcoord2 location = 5 + + // NOTE: If any location is not found, loc point becomes -1 + + // Get handles to GLSL input attibute locations + shader.locs[SHADER_LOC_VERTEX_POSITION] = rlGetLocationAttrib(shader.id, DEFAULT_SHADER_ATTRIB_NAME_POSITION); + shader.locs[SHADER_LOC_VERTEX_TEXCOORD01] = rlGetLocationAttrib(shader.id, DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD); + shader.locs[SHADER_LOC_VERTEX_TEXCOORD02] = rlGetLocationAttrib(shader.id, DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2); + shader.locs[SHADER_LOC_VERTEX_NORMAL] = rlGetLocationAttrib(shader.id, DEFAULT_SHADER_ATTRIB_NAME_NORMAL); + shader.locs[SHADER_LOC_VERTEX_TANGENT] = rlGetLocationAttrib(shader.id, DEFAULT_SHADER_ATTRIB_NAME_TANGENT); + shader.locs[SHADER_LOC_VERTEX_COLOR] = rlGetLocationAttrib(shader.id, DEFAULT_SHADER_ATTRIB_NAME_COLOR); + + // Get handles to GLSL uniform locations (vertex shader) + shader.locs[SHADER_LOC_MATRIX_MVP] = rlGetLocationUniform(shader.id, "mvp"); + shader.locs[SHADER_LOC_MATRIX_PROJECTION] = rlGetLocationUniform(shader.id, "projection"); + shader.locs[SHADER_LOC_MATRIX_VIEW] = rlGetLocationUniform(shader.id, "view"); + + // Get handles to GLSL uniform locations (fragment shader) + shader.locs[SHADER_LOC_COLOR_DIFFUSE] = rlGetLocationUniform(shader.id, "colDiffuse"); + shader.locs[SHADER_LOC_MAP_DIFFUSE] = rlGetLocationUniform(shader.id, "texture0"); + shader.locs[SHADER_LOC_MAP_SPECULAR] = rlGetLocationUniform(shader.id, "texture1"); + shader.locs[SHADER_LOC_MAP_NORMAL] = rlGetLocationUniform(shader.id, "texture2"); + } + + return shader; +} + +// Unload shader from GPU memory (VRAM) +void UnloadShader(Shader shader) +{ + if (shader.id != rlGetShaderDefault().id) + { + rlUnloadShaderProgram(shader.id); + RL_FREE(shader.locs); + } +} + +// Get shader uniform location +int GetShaderLocation(Shader shader, const char *uniformName) +{ + return rlGetLocationUniform(shader.id, uniformName); +} + +// Get shader attribute location +int GetShaderLocationAttrib(Shader shader, const char *attribName) +{ + return rlGetLocationAttrib(shader.id, attribName); +} + +// Set shader uniform value +void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType) +{ + SetShaderValueV(shader, locIndex, value, uniformType, 1); +} + +// Set shader uniform value vector +void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count) +{ + rlEnableShader(shader.id); + rlSetUniform(locIndex, value, uniformType, count); + //rlDisableShader(); // Avoid reseting current shader program, in case other uniforms are set +} + +// Set shader uniform value (matrix 4x4) +void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat) +{ + rlEnableShader(shader.id); + rlSetUniformMatrix(locIndex, mat); + //rlDisableShader(); +} + +// Set shader uniform value for texture +void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture) +{ + rlEnableShader(shader.id); + rlSetUniformSampler(locIndex, texture.id); + //rlDisableShader(); +} + +// Get a ray trace from mouse position Ray GetMouseRay(Vector2 mouse, Camera camera) { - Ray ray; + Ray ray = { 0 }; // Calculate normalized device coordinates // NOTE: y value is negative @@ -2006,12 +2487,12 @@ Ray GetMouseRay(Vector2 mouse, Camera camera) Matrix matProj = MatrixIdentity(); - if (camera.type == CAMERA_PERSPECTIVE) + if (camera.projection == CAMERA_PERSPECTIVE) { // Calculate projection matrix from perspective matProj = MatrixPerspective(camera.fovy*DEG2RAD, ((double)GetScreenWidth()/(double)GetScreenHeight()), RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR); } - else if (camera.type == CAMERA_ORTHOGRAPHIC) + else if (camera.projection == CAMERA_ORTHOGRAPHIC) { float aspect = (float)CORE.Window.screen.width/(float)CORE.Window.screen.height; double top = camera.fovy/2.0; @@ -2033,8 +2514,8 @@ Ray GetMouseRay(Vector2 mouse, Camera camera) // Calculate normalized direction vector Vector3 direction = Vector3Normalize(Vector3Subtract(farPoint, nearPoint)); - if (camera.type == CAMERA_PERSPECTIVE) ray.position = camera.position; - else if (camera.type == CAMERA_ORTHOGRAPHIC) ray.position = cameraPlanePointerPos; + if (camera.projection == CAMERA_PERSPECTIVE) ray.position = camera.position; + else if (camera.projection == CAMERA_ORTHOGRAPHIC) ray.position = cameraPlanePointerPos; // Apply calculated vectors to ray ray.direction = direction; @@ -2048,7 +2529,7 @@ Matrix GetCameraMatrix(Camera camera) return MatrixLookAt(camera.position, camera.target, camera.up); } -// Returns camera 2d transform matrix +// Get camera 2d transform matrix Matrix GetCameraMatrix2D(Camera2D camera) { Matrix matTransform = { 0 }; @@ -2076,7 +2557,7 @@ Matrix GetCameraMatrix2D(Camera2D camera) return matTransform; } -// Returns the screen space position from a 3d world space position +// Get the screen space position from a 3d world space position Vector2 GetWorldToScreen(Vector3 position, Camera camera) { Vector2 screenPosition = GetWorldToScreenEx(position, camera, GetScreenWidth(), GetScreenHeight()); @@ -2084,18 +2565,18 @@ Vector2 GetWorldToScreen(Vector3 position, Camera camera) return screenPosition; } -// Returns size position for a 3d world space position (useful for texture drawing) +// Get size position for a 3d world space position (useful for texture drawing) Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height) { // Calculate projection matrix (from perspective instead of frustum Matrix matProj = MatrixIdentity(); - if (camera.type == CAMERA_PERSPECTIVE) + if (camera.projection == CAMERA_PERSPECTIVE) { // Calculate projection matrix from perspective - matProj = MatrixPerspective(camera.fovy * DEG2RAD, ((double)width/(double)height), RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR); + matProj = MatrixPerspective(camera.fovy*DEG2RAD, ((double)width/(double)height), RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR); } - else if (camera.type == CAMERA_ORTHOGRAPHIC) + else if (camera.projection == CAMERA_ORTHOGRAPHIC) { float aspect = (float)CORE.Window.screen.width/(float)CORE.Window.screen.height; double top = camera.fovy/2.0; @@ -2126,7 +2607,7 @@ Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int heigh return screenPosition; } -// Returns the screen space position for a 2d camera world space position +// Get the screen space position for a 2d camera world space position Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera) { Matrix matCamera = GetCameraMatrix2D(camera); @@ -2135,7 +2616,7 @@ Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera) return (Vector2){ transform.x, transform.y }; } -// Returns the world space position for a 2d camera screen space position +// Get the world space position for a 2d camera screen space position Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera) { Matrix invMatCamera = MatrixInvert(GetCameraMatrix2D(camera)); @@ -2153,7 +2634,7 @@ void SetTargetFPS(int fps) TRACELOG(LOG_INFO, "TIMER: Target time per frame: %02.03f milliseconds", (float)CORE.Time.target*1000); } -// Returns current FPS +// Get current FPS // NOTE: We calculate an average framerate int GetFPS(void) { @@ -2180,7 +2661,7 @@ int GetFPS(void) return (int)roundf(1.0f/average); } -// Returns time in seconds for last frame drawn +// Get time in seconds for last frame drawn (delta time) float GetFrameTime(void) { return (float)CORE.Time.frame; @@ -2227,7 +2708,7 @@ void SetConfigFlags(unsigned int flags) void TakeScreenshot(const char *fileName) { unsigned char *imgData = rlReadScreenPixels(CORE.Window.render.width, CORE.Window.render.height); - Image image = { imgData, CORE.Window.render.width, CORE.Window.render.height, 1, UNCOMPRESSED_R8G8B8A8 }; + Image image = { imgData, CORE.Window.render.width, CORE.Window.render.height, 1, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 }; char path[512] = { 0 }; #if defined(PLATFORM_ANDROID) @@ -2255,7 +2736,7 @@ void TakeScreenshot(const char *fileName) TRACELOG(LOG_INFO, "SYSTEM: [%s] Screenshot taken successfully", path); } -// Returns a random value between min and max (both included) +// Get a random value between min and max (both included) int GetRandomValue(int min, int max) { if (min > max) @@ -2300,7 +2781,7 @@ bool IsFileExtension(const char *fileName, const char *ext) for (int i = 0; i < extCount; i++) { - if (TextIsEqual(fileExtLower, TextToLower(checkExts[i] + 1))) + if (TextIsEqual(fileExtLower, TextToLower(checkExts[i]))) { result = true; break; @@ -2329,14 +2810,14 @@ bool DirectoryExists(const char *dirPath) return result; } -// Get pointer to extension for a filename string +// Get pointer to extension for a filename string (includes the dot: .png) const char *GetFileExtension(const char *fileName) { const char *dot = strrchr(fileName, '.'); if (!dot || dot == fileName) return NULL; - return (dot + 1); + return dot; } // String pointer reverse break: returns right-most occurrence of charset in s @@ -2473,8 +2954,8 @@ char **GetDirectoryFiles(const char *dirPath, int *fileCount) ClearDirectoryFiles(); // Memory allocation for MAX_DIRECTORY_FILES - dirFilesPath = (char **)RL_MALLOC(sizeof(char *)*MAX_DIRECTORY_FILES); - for (int i = 0; i < MAX_DIRECTORY_FILES; i++) dirFilesPath[i] = (char *)RL_MALLOC(sizeof(char)*MAX_FILEPATH_LENGTH); + dirFilesPath = (char **)RL_MALLOC(MAX_DIRECTORY_FILES*sizeof(char *)); + for (int i = 0; i < MAX_DIRECTORY_FILES; i++) dirFilesPath[i] = (char *)RL_MALLOC(MAX_FILEPATH_LENGTH*sizeof(char)); int counter = 0; struct dirent *entity; @@ -2580,8 +3061,8 @@ unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLe int bounds = sdefl_bound(dataLength); compData = (unsigned char *)RL_CALLOC(bounds, 1); *compDataLength = sdeflate(&sdefl, compData, data, dataLength, COMPRESSION_QUALITY_DEFLATE); // Compression level 8, same as stbwi - - TraceLog(LOG_INFO, "SYSTEM: Data compressed: Original size: %i -> Comp. size: %i\n", dataLength, compDataLength); + + TraceLog(LOG_INFO, "SYSTEM: Compress data: Original size: %i -> Comp. size: %i", dataLength, compDataLength); #endif return compData; @@ -2590,19 +3071,23 @@ unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLe // Decompress data (DEFLATE algorythm) unsigned char *DecompressData(unsigned char *compData, int compDataLength, int *dataLength) { - char *data = NULL; + unsigned char *data = NULL; #if defined(SUPPORT_COMPRESSION_API) // Decompress data from a valid DEFLATE stream data = RL_CALLOC(MAX_DECOMPRESSION_SIZE*1024*1024, 1); int length = sinflate(data, compData, compDataLength); - RL_REALLOC(data, length); + unsigned char *temp = RL_REALLOC(data, length); + + if (temp != NULL) data = temp; + else TRACELOG(LOG_WARNING, "SYSTEM: Failed to re-allocate required decompression memory"); + *dataLength = length; - TraceLog(LOG_INFO, "SYSTEM: Data compressed: Original size: %i -> Comp. size: %i\n", dataLength, compDataLength); + TraceLog(LOG_INFO, "SYSTEM: Decompress data: Comp. size: %i -> Original size: %i", compDataLength, dataLength); #endif - return (unsigned char *)data; + return data; } // Save integer value to storage file (to defined position) @@ -2678,7 +3163,7 @@ bool SaveStorageValue(unsigned int position, int value) dataPtr[position] = value; success = SaveFileData(path, fileData, dataSize); - RL_FREE(fileData); + UnloadFileData(fileData); } #endif @@ -2690,6 +3175,7 @@ bool SaveStorageValue(unsigned int position, int value) int LoadStorageValue(unsigned int position) { int value = 0; + #if defined(SUPPORT_DATA_STORAGE) char path[512] = { 0 }; #if defined(PLATFORM_ANDROID) @@ -2716,7 +3202,7 @@ int LoadStorageValue(unsigned int position) value = dataPtr[position]; } - RL_FREE(fileData); + UnloadFileData(fileData); } #endif return value; @@ -2741,9 +3227,11 @@ void OpenURL(const char *url) char *cmd = (char *)RL_CALLOC(strlen(url) + 10, sizeof(char)); #if defined(_WIN32) sprintf(cmd, "explorer %s", url); - #elif defined(__linux__) + #endif + #if defined(__linux__) || defined(__FreeBSD__) sprintf(cmd, "xdg-open '%s'", url); // Alternatives: firefox, x-www-browser - #elif defined(__APPLE__) + #endif + #if defined(__APPLE__) sprintf(cmd, "open '%s'", url); #endif system(cmd); @@ -2758,7 +3246,7 @@ void OpenURL(const char *url) //---------------------------------------------------------------------------------- // Module Functions Definition - Input (Keyboard, Mouse, Gamepad) Functions //---------------------------------------------------------------------------------- -// Detect if a key has been pressed once +// Check if a key has been pressed once bool IsKeyPressed(int key) { bool pressed = false; @@ -2769,14 +3257,14 @@ bool IsKeyPressed(int key) return pressed; } -// Detect if a key is being pressed (key held down) +// Check if a key is being pressed (key held down) bool IsKeyDown(int key) { if (CORE.Input.Keyboard.currentKeyState[key] == 1) return true; else return false; } -// Detect if a key has been released once +// Check if a key has been released once bool IsKeyReleased(int key) { bool released = false; @@ -2787,7 +3275,7 @@ bool IsKeyReleased(int key) return released; } -// Detect if a key is NOT being pressed (key not held down) +// Check if a key is NOT being pressed (key not held down) bool IsKeyUp(int key) { if (CORE.Input.Keyboard.currentKeyState[key] == 0) return true; @@ -2849,14 +3337,12 @@ void SetExitKey(int key) // NOTE: Gamepad support not implemented in emscripten GLFW3 (PLATFORM_WEB) -// Detect if a gamepad is available +// Check if a gamepad is available bool IsGamepadAvailable(int gamepad) { bool result = false; -#if !defined(PLATFORM_ANDROID) if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad]) result = true; -#endif return result; } @@ -2865,33 +3351,29 @@ bool IsGamepadAvailable(int gamepad) bool IsGamepadName(int gamepad, const char *name) { bool result = false; - -#if !defined(PLATFORM_ANDROID) const char *currentName = NULL; if (CORE.Input.Gamepad.ready[gamepad]) currentName = GetGamepadName(gamepad); if ((name != NULL) && (currentName != NULL)) result = (strcmp(name, currentName) == 0); -#endif return result; } -// Return gamepad internal name id +// Get gamepad internal name id const char *GetGamepadName(int gamepad) { #if defined(PLATFORM_DESKTOP) if (CORE.Input.Gamepad.ready[gamepad]) return glfwGetJoystickName(gamepad); else return NULL; -#elif defined(PLATFORM_RPI) || defined(PLATFORM_DRM) - if (CORE.Input.Gamepad.ready[gamepad]) ioctl(CORE.Input.Gamepad.streamId[gamepad], JSIOCGNAME(64), &CORE.Input.Gamepad.name); - - return CORE.Input.Gamepad.name; -#else - return NULL; #endif +#if defined(PLATFORM_RPI) || defined(PLATFORM_DRM) + if (CORE.Input.Gamepad.ready[gamepad]) ioctl(CORE.Input.Gamepad.streamId[gamepad], JSIOCGNAME(64), &CORE.Input.Gamepad.name); + return CORE.Input.Gamepad.name; +#endif + return NULL; } -// Return gamepad axis count +// Get gamepad axis count int GetGamepadAxisCount(int gamepad) { #if defined(PLATFORM_RPI) || defined(PLATFORM_DRM) @@ -2899,73 +3381,63 @@ int GetGamepadAxisCount(int gamepad) if (CORE.Input.Gamepad.ready[gamepad]) ioctl(CORE.Input.Gamepad.streamId[gamepad], JSIOCGAXES, &axisCount); CORE.Input.Gamepad.axisCount = axisCount; #endif + return CORE.Input.Gamepad.axisCount; } -// Return axis movement vector for a gamepad +// Get axis movement vector for a gamepad float GetGamepadAxisMovement(int gamepad, int axis) { float value = 0; -#if !defined(PLATFORM_ANDROID) if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (axis < MAX_GAMEPAD_AXIS) && - ((axis == GAMEPAD_AXIS_LEFT_TRIGGER) || (axis == GAMEPAD_AXIS_RIGHT_TRIGGER) || - (fabsf(CORE.Input.Gamepad.axisState[gamepad][axis]) >= 0.2f))) value = CORE.Input.Gamepad.axisState[gamepad][axis]; -#endif + (fabsf(CORE.Input.Gamepad.axisState[gamepad][axis]) > 0.1f)) value = CORE.Input.Gamepad.axisState[gamepad][axis]; // 0.1f = GAMEPAD_AXIS_MINIMUM_DRIFT/DELTA return value; } -// Detect if a gamepad button has been pressed once +// Check if a gamepad button has been pressed once bool IsGamepadButtonPressed(int gamepad, int button) { bool pressed = false; -#if !defined(PLATFORM_ANDROID) if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && - (CORE.Input.Gamepad.currentState[gamepad][button] != CORE.Input.Gamepad.previousState[gamepad][button]) && - (CORE.Input.Gamepad.currentState[gamepad][button] == 1)) pressed = true; -#endif + (CORE.Input.Gamepad.previousButtonState[gamepad][button] == 0) && (CORE.Input.Gamepad.currentButtonState[gamepad][button] == 1)) pressed = true; + else pressed = false; return pressed; } -// Detect if a gamepad button is being pressed +// Check if a gamepad button is being pressed bool IsGamepadButtonDown(int gamepad, int button) { bool result = false; -#if !defined(PLATFORM_ANDROID) if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && - (CORE.Input.Gamepad.currentState[gamepad][button] == 1)) result = true; -#endif + (CORE.Input.Gamepad.currentButtonState[gamepad][button] == 1)) result = true; return result; } -// Detect if a gamepad button has NOT been pressed once +// Check if a gamepad button has NOT been pressed once bool IsGamepadButtonReleased(int gamepad, int button) { bool released = false; -#if !defined(PLATFORM_ANDROID) if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && - (CORE.Input.Gamepad.currentState[gamepad][button] != CORE.Input.Gamepad.previousState[gamepad][button]) && - (CORE.Input.Gamepad.currentState[gamepad][button] == 0)) released = true; -#endif + (CORE.Input.Gamepad.previousButtonState[gamepad][button] == 1) && (CORE.Input.Gamepad.currentButtonState[gamepad][button] == 0)) released = true; + else released = false; return released; } -// Detect if a mouse button is NOT being pressed +// Check if a gamepad button is NOT being pressed bool IsGamepadButtonUp(int gamepad, int button) { bool result = false; -#if !defined(PLATFORM_ANDROID) if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && - (CORE.Input.Gamepad.currentState[gamepad][button] == 0)) result = true; -#endif + (CORE.Input.Gamepad.currentButtonState[gamepad][button] == 0)) result = true; return result; } @@ -2976,7 +3448,19 @@ int GetGamepadButtonPressed(void) return CORE.Input.Gamepad.lastButtonPressed; } -// Detect if a mouse button has been pressed once +// Set internal gamepad mappings +int SetGamepadMappings(const char *mappings) +{ + int result = 0; + +#if defined(PLATFORM_DESKTOP) + result = glfwUpdateGamepadMappings(mappings); +#endif + + return result; +} + +// Check if a mouse button has been pressed once bool IsMouseButtonPressed(int button) { bool pressed = false; @@ -2989,7 +3473,7 @@ bool IsMouseButtonPressed(int button) return pressed; } -// Detect if a mouse button is being pressed +// Check if a mouse button is being pressed bool IsMouseButtonDown(int button) { bool down = false; @@ -3002,7 +3486,7 @@ bool IsMouseButtonDown(int button) return down; } -// Detect if a mouse button has been released once +// Check if a mouse button has been released once bool IsMouseButtonReleased(int button) { bool released = false; @@ -3015,33 +3499,33 @@ bool IsMouseButtonReleased(int button) return released; } -// Detect if a mouse button is NOT being pressed +// Check if a mouse button is NOT being pressed bool IsMouseButtonUp(int button) { return !IsMouseButtonDown(button); } -// Returns mouse position X +// Get mouse position X int GetMouseX(void) { #if defined(PLATFORM_ANDROID) return (int)CORE.Input.Touch.position[0].x; #else - return (int)((CORE.Input.Mouse.position.x + CORE.Input.Mouse.offset.x)*CORE.Input.Mouse.scale.x); + return (int)((CORE.Input.Mouse.currentPosition.x + CORE.Input.Mouse.offset.x)*CORE.Input.Mouse.scale.x); #endif } -// Returns mouse position Y +// Get mouse position Y int GetMouseY(void) { #if defined(PLATFORM_ANDROID) return (int)CORE.Input.Touch.position[0].y; #else - return (int)((CORE.Input.Mouse.position.y + CORE.Input.Mouse.offset.y)*CORE.Input.Mouse.scale.y); + return (int)((CORE.Input.Mouse.currentPosition.y + CORE.Input.Mouse.offset.y)*CORE.Input.Mouse.scale.y); #endif } -// Returns mouse position XY +// Get mouse position XY Vector2 GetMousePosition(void) { Vector2 position = { 0 }; @@ -3049,8 +3533,8 @@ Vector2 GetMousePosition(void) #if defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB) position = GetTouchPosition(0); #else - position.x = (CORE.Input.Mouse.position.x + CORE.Input.Mouse.offset.x)*CORE.Input.Mouse.scale.x; - position.y = (CORE.Input.Mouse.position.y + CORE.Input.Mouse.offset.y)*CORE.Input.Mouse.scale.y; + position.x = (CORE.Input.Mouse.currentPosition.x + CORE.Input.Mouse.offset.x)*CORE.Input.Mouse.scale.x; + position.y = (CORE.Input.Mouse.currentPosition.y + CORE.Input.Mouse.offset.y)*CORE.Input.Mouse.scale.y; #endif return position; @@ -3059,10 +3543,10 @@ Vector2 GetMousePosition(void) // Set mouse position XY void SetMousePosition(int x, int y) { - CORE.Input.Mouse.position = (Vector2){ (float)x, (float)y }; + CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y }; #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) // NOTE: emscripten not implemented - glfwSetCursorPos(CORE.Window.handle, CORE.Input.Mouse.position.x, CORE.Input.Mouse.position.y); + glfwSetCursorPos(CORE.Window.handle, CORE.Input.Mouse.currentPosition.x, CORE.Input.Mouse.currentPosition.y); #endif #if defined(PLATFORM_UWP) UWPGetMouseSetPosFunc()(x, y); @@ -3083,22 +3567,17 @@ void SetMouseScale(float scaleX, float scaleY) CORE.Input.Mouse.scale = (Vector2){ scaleX, scaleY }; } -// Returns mouse wheel movement Y +// Get mouse wheel movement Y float GetMouseWheelMove(void) { #if defined(PLATFORM_ANDROID) return 0.0f; -#elif defined(PLATFORM_WEB) - return CORE.Input.Mouse.previousWheelMove/100.0f; -#else - return CORE.Input.Mouse.previousWheelMove; #endif -} +#if defined(PLATFORM_WEB) + return CORE.Input.Mouse.previousWheelMove/100.0f; +#endif -// Returns mouse cursor -int GetMouseCursor(void) -{ - return CORE.Input.Mouse.cursor; + return CORE.Input.Mouse.previousWheelMove; } // Set mouse cursor @@ -3116,7 +3595,7 @@ void SetMouseCursor(int cursor) #endif } -// Returns touch position X for touch point 0 (relative to screen size) +// Get touch position X for touch point 0 (relative to screen size) int GetTouchX(void) { #if defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB) || defined(PLATFORM_UWP) @@ -3126,7 +3605,7 @@ int GetTouchX(void) #endif } -// Returns touch position Y for touch point 0 (relative to screen size) +// Get touch position Y for touch point 0 (relative to screen size) int GetTouchY(void) { #if defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB) || defined(PLATFORM_UWP) @@ -3136,17 +3615,22 @@ int GetTouchY(void) #endif } -// Returns touch position XY for a touch point index (relative to screen size) +// Get touch position XY for a touch point index (relative to screen size) // TODO: Touch position should be scaled depending on display size and render size Vector2 GetTouchPosition(int index) { Vector2 position = { -1.0f, -1.0f }; -#if defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM) || defined(PLATFORM_UWP) +#if defined(PLATFORM_DESKTOP) + // TODO: GLFW does not support multi-touch input just yet + // https://www.codeproject.com/Articles/668404/Programming-for-Multi-Touch + // https://docs.microsoft.com/en-us/windows/win32/wintouch/getting-started-with-multi-touch-messages + if (index == 0) position = GetMousePosition(); +#endif +#if defined(PLATFORM_ANDROID) if (index < MAX_TOUCH_POINTS) position = CORE.Input.Touch.position[index]; else TRACELOG(LOG_WARNING, "INPUT: Required touch point out of range (Max touch points: %i)", MAX_TOUCH_POINTS); - #if defined(PLATFORM_ANDROID) if ((CORE.Window.screen.width > CORE.Window.display.width) || (CORE.Window.screen.height > CORE.Window.display.height)) { position.x = position.x*((float)CORE.Window.screen.width/(float)(CORE.Window.display.width - CORE.Window.renderOffset.x)) - CORE.Window.renderOffset.x/2; @@ -3157,13 +3641,12 @@ Vector2 GetTouchPosition(int index) position.x = position.x*((float)CORE.Window.render.width/(float)CORE.Window.display.width) - CORE.Window.renderOffset.x/2; position.y = position.y*((float)CORE.Window.render.height/(float)CORE.Window.display.height) - CORE.Window.renderOffset.y/2; } - #endif +#endif +#if defined(PLATFORM_WEB) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM) || defined(PLATFORM_UWP) + if (index < MAX_TOUCH_POINTS) position = CORE.Input.Touch.position[index]; + else TRACELOG(LOG_WARNING, "INPUT: Required touch point out of range (Max touch points: %i)", MAX_TOUCH_POINTS); -#elif defined(PLATFORM_DESKTOP) - // TODO: GLFW is not supporting multi-touch input just yet - // https://www.codeproject.com/Articles/668404/Programming-for-Multi-Touch - // https://docs.microsoft.com/en-us/windows/win32/wintouch/getting-started-with-multi-touch-messages - if (index == 0) position = GetMousePosition(); + // TODO: Touch position scaling required? #endif return position; @@ -3213,7 +3696,7 @@ static bool InitGraphicsDevice(int width, int height) CORE.Window.display.width = mode->width; CORE.Window.display.height = mode->height; - // Screen size security check + // Set screen width/height to the display width/height if they are 0 if (CORE.Window.screen.width == 0) CORE.Window.screen.width = CORE.Window.display.width; if (CORE.Window.screen.height == 0) CORE.Window.screen.height = CORE.Window.display.height; #endif // PLATFORM_DESKTOP @@ -3268,14 +3751,19 @@ static bool InitGraphicsDevice(int width, int height) // NOTE: This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. // On platforms like macOS the resolution of the framebuffer is changed independently of the window size. glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE); // Scale content area based on the monitor content scale where window is placed on - #if !defined(__APPLE__) + #if defined(__APPLE__) glfwWindowHint(GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_TRUE); #endif } else glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_FALSE); #endif - if (CORE.Window.flags & FLAG_MSAA_4X_HINT) glfwWindowHint(GLFW_SAMPLES, 4); // Tries to enable multisampling x4 (MSAA), default is 0 + if (CORE.Window.flags & FLAG_MSAA_4X_HINT) + { + // NOTE: MSAA is only enabled for main framebuffer, not user-created FBOs + TRACELOG(LOG_INFO, "DISPLAY: Trying to enable MSAA x4"); + glfwWindowHint(GLFW_SAMPLES, 4); // Tries to enable multisampling x4 (MSAA), default is 0 + } // NOTE: When asking for an OpenGL context version, most drivers provide highest supported version // with forward compatibility to older OpenGL versions. @@ -3312,6 +3800,14 @@ static bool InitGraphicsDevice(int width, int height) #endif } +#if defined(PLATFORM_DESKTOP) + // NOTE: GLFW 3.4+ defers initialization of the Joystick subsystem on the first call to any Joystick related functions. + // Forcing this initialization here avoids doing it on `PollInputEvents` called by `EndDrawing` after first frame has been just drawn. + // The initialization will still happen and possible delays still occur, but before the window is shown, which is a nicer experience. + // REF: https://github.com/raysan5/raylib/issues/1554 + if (MAX_GAMEPADS > 0) glfwSetJoystickCallback(NULL); +#endif + if (CORE.Window.fullscreen) { // remember center for switchinging from fullscreen to window @@ -3426,12 +3922,6 @@ static bool InitGraphicsDevice(int width, int height) glfwSwapInterval(0); // No V-Sync by default #endif -#if defined(PLATFORM_DESKTOP) - // Load OpenGL 3.3 extensions - // NOTE: GLFW loader function is passed as parameter - rlLoadExtensions(glfwGetProcAddress); -#endif - // Try to enable GPU V-Sync, so frames are limited to screen refresh rate (60Hz -> 60 FPS) // NOTE: V-Sync can be enabled by graphic driver configuration if (CORE.Window.flags & FLAG_VSYNC_HINT) @@ -3440,11 +3930,11 @@ static bool InitGraphicsDevice(int width, int height) glfwSwapInterval(1); TRACELOG(LOG_INFO, "DISPLAY: Trying to enable VSYNC"); } -#endif // PLATFORM_DESKTOP || PLATFORM_WEB +#endif // PLATFORM_DESKTOP || PLATFORM_WEB #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM) || defined(PLATFORM_UWP) CORE.Window.fullscreen = true; - CORE.Window.flags &= FLAG_FULLSCREEN_MODE; + CORE.Window.flags |= FLAG_FULLSCREEN_MODE; #if defined(PLATFORM_RPI) bcm_host_init(); @@ -3472,7 +3962,7 @@ static bool InitGraphicsDevice(int width, int height) #else TRACELOG(LOG_INFO, "DISPLAY: No graphic card set, trying card1"); CORE.Window.fd = open("/dev/dri/card1", O_RDWR); // VideoCore VI (Raspberry Pi 4) - if (-1 == CORE.Window.fd) + if ((-1 == CORE.Window.fd) || (drmModeGetResources(CORE.Window.fd) == NULL)) { TRACELOG(LOG_INFO, "DISPLAY: Failed to open graphic card1, trying card0"); CORE.Window.fd = open("/dev/dri/card0", O_RDWR); // VideoCore IV (Raspberry Pi 1-3) @@ -3553,7 +4043,7 @@ static bool InitGraphicsDevice(int width, int height) } const bool allowInterlaced = CORE.Window.flags & FLAG_INTERLACED_HINT; - const int fps = (CORE.Time.target > 0) ? (1.0 / CORE.Time.target) : 60; + const int fps = (CORE.Time.target > 0) ? (1.0/CORE.Time.target) : 60; // try to find an exact matching mode CORE.Window.modeIndex = FindExactConnectorMode(CORE.Window.connector, CORE.Window.screen.width, CORE.Window.screen.height, fps, allowInterlaced); // if nothing found, try to find a nearly matching mode @@ -3836,7 +4326,7 @@ static bool InitGraphicsDevice(int width, int height) } #if defined(PLATFORM_DRM) - if (!eglGetConfigs(CORE.Window.device, NULL, 0, &numConfigs)) + if (!eglChooseConfig(CORE.Window.device, NULL, NULL, 0, &numConfigs)) { TRACELOG(LOG_WARNING, "DISPLAY: Failed to get EGL config count: 0x%x", eglGetError()); return false; @@ -3844,7 +4334,7 @@ static bool InitGraphicsDevice(int width, int height) TRACELOG(LOG_TRACE, "DISPLAY: EGL configs available: %d", numConfigs); - EGLConfig *configs = calloc(numConfigs, sizeof(*configs)); + EGLConfig *configs = RL_CALLOC(numConfigs, sizeof(*configs)); if (!configs) { TRACELOG(LOG_WARNING, "DISPLAY: Failed to get memory for EGL configs"); @@ -3852,15 +4342,6 @@ static bool InitGraphicsDevice(int width, int height) } EGLint matchingNumConfigs = 0; - if (!eglGetConfigs(CORE.Window.device, configs, numConfigs, &matchingNumConfigs)) - { - TRACELOG(LOG_WARNING, "DISPLAY: Failed to get EGL configs: 0x%x", eglGetError()); - free(configs); - return false; - } - - TRACELOG(LOG_TRACE, "DISPLAY: EGL matching configs available: %d", matchingNumConfigs); - if (!eglChooseConfig(CORE.Window.device, framebufferAttribs, configs, numConfigs, &matchingNumConfigs)) { TRACELOG(LOG_WARNING, "DISPLAY: Failed to choose EGL config: 0x%x", eglGetError()); @@ -3868,6 +4349,8 @@ static bool InitGraphicsDevice(int width, int height) return false; } + TRACELOG(LOG_TRACE, "DISPLAY: EGL matching configs available: %d", matchingNumConfigs); + // find the EGL config that matches the previously setup GBM format int found = 0; for (EGLint i = 0; i < matchingNumConfigs; ++i) @@ -3888,7 +4371,7 @@ static bool InitGraphicsDevice(int width, int height) } } - free(configs); + RL_FREE(configs); if (!found) { @@ -4018,7 +4501,15 @@ static bool InitGraphicsDevice(int width, int height) TRACELOG(LOG_INFO, " > Screen size: %i x %i", CORE.Window.screen.width, CORE.Window.screen.height); TRACELOG(LOG_INFO, " > Viewport offsets: %i, %i", CORE.Window.renderOffset.x, CORE.Window.renderOffset.y); } -#endif // PLATFORM_ANDROID || PLATFORM_RPI || PLATFORM_DRM || PLATFORM_UWP +#endif // PLATFORM_ANDROID || PLATFORM_RPI || PLATFORM_DRM || PLATFORM_UWP + + // Load OpenGL extensions + // NOTE: GL procedures address loader is required to load extensions +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) + rlLoadExtensions(glfwGetProcAddress); +#else + rlLoadExtensions(eglGetProcAddress); +#endif // Initialize OpenGL context (states and resources) // NOTE: CORE.Window.screen.width and CORE.Window.screen.height not used, just stored as globals in rlgl @@ -4030,11 +4521,15 @@ static bool InitGraphicsDevice(int width, int height) #if defined(PLATFORM_DESKTOP) if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0) { + // NOTE: On APPLE platforms system should manage window/input scaling and also framebuffer scaling + // Framebuffer scaling should be activated with: glfwWindowHint(GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_TRUE); + #if !defined(__APPLE__) glfwGetFramebufferSize(CORE.Window.handle, &fbWidth, &fbHeight); // Screen scaling matrix is required in case desired screen area is different than display area CORE.Window.screenScale = MatrixScale((float)fbWidth/CORE.Window.screen.width, (float)fbHeight/CORE.Window.screen.height, 1.0f); - #if !defined(__APPLE__) + + // Mouse input scaling for the new screen size SetMouseScale((float)CORE.Window.screen.width/fbWidth, (float)CORE.Window.screen.height/fbHeight); #endif } @@ -4064,9 +4559,15 @@ static void SetupViewport(int width, int height) CORE.Window.render.height = height; // Set viewport width and height - // NOTE: We consider render size and offset in case black bars are required and + // NOTE: We consider render size (scaled) and offset in case black bars are required and // render area does not match full display area (this situation is only applicable on fullscreen mode) +#if defined(__APPLE__) + float xScale = 1.0f, yScale = 1.0f; + glfwGetWindowContentScale(CORE.Window.handle, &xScale, &yScale); + rlViewport(CORE.Window.renderOffset.x/2*xScale, CORE.Window.renderOffset.y/2*yScale, (CORE.Window.render.width - CORE.Window.renderOffset.x)*xScale, (CORE.Window.render.height - CORE.Window.renderOffset.y)*yScale); +#else rlViewport(CORE.Window.renderOffset.x/2, CORE.Window.renderOffset.y/2, CORE.Window.render.width - CORE.Window.renderOffset.x, CORE.Window.render.height - CORE.Window.renderOffset.y); +#endif rlMatrixMode(RL_PROJECTION); // Switch to projection matrix rlLoadIdentity(); // Reset current matrix (projection) @@ -4160,14 +4661,18 @@ static void SetupFramebuffer(int width, int height) // Initialize hi-resolution timer static void InitTimer(void) { - srand((unsigned int)time(NULL)); // Initialize random seed + srand((unsigned int)time(NULL)); // Initialize random seed -#if !defined(SUPPORT_BUSY_WAIT_LOOP) && defined(_WIN32) && !defined(PLATFORM_UWP) - timeBeginPeriod(1); // Setup high-resolution timer to 1ms (granularity of 1-2 ms) +// Setting a higher resolution can improve the accuracy of time-out intervals in wait functions. +// However, it can also reduce overall system performance, because the thread scheduler switches tasks more often. +// High resolutions can also prevent the CPU power management system from entering power-saving modes. +// Setting a higher resolution does not improve the accuracy of the high-resolution performance counter. +#if defined(_WIN32) && defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP) && !defined(PLATFORM_UWP) + timeBeginPeriod(1); // Setup high-resolution timer to 1ms (granularity of 1-2 ms) #endif #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM) - struct timespec now; + struct timespec now = { 0 }; if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) // Success { @@ -4176,7 +4681,7 @@ static void InitTimer(void) else TRACELOG(LOG_WARNING, "TIMER: Hi-resolution timer not available"); #endif - CORE.Time.previous = GetTime(); // Get time as double + CORE.Time.previous = GetTime(); // Get time as double } // Wait for some milliseconds (stop program execution) @@ -4198,15 +4703,21 @@ static void Wait(float ms) // Busy wait loop while ((nextTime - prevTime) < ms/1000.0f) nextTime = GetTime(); #else - #if defined(SUPPORT_HALFBUSY_WAIT_LOOP) - #define MAX_HALFBUSY_WAIT_TIME 4 + #if defined(SUPPORT_PARTIALBUSY_WAIT_LOOP) + #define DEFAULT_PARTIALBUSY_WAIT_TIME 4 + #define PARTIALBUSY_WAIT_FACTOR 0.95 + + double halfWait = DEFAULT_PARTIALBUSY_WAIT_TIME; + if (CORE.Time.target > 0) halfWait = CORE.Time.target*PARTIALBUSY_WAIT_FACTOR; + double destTime = GetTime() + ms/1000; - if (ms > MAX_HALFBUSY_WAIT_TIME) ms -= MAX_HALFBUSY_WAIT_TIME; + if (ms > halfWait) ms -= (float)halfWait; #endif #if defined(_WIN32) Sleep((unsigned int)ms); - #elif defined(__linux__) || defined(PLATFORM_WEB) + #endif + #if defined(__linux__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) struct timespec req = { 0 }; time_t sec = (int)(ms/1000.0f); ms -= (sec*1000); @@ -4215,75 +4726,17 @@ static void Wait(float ms) // NOTE: Use nanosleep() on Unix platforms... usleep() it's deprecated. while (nanosleep(&req, &req) == -1) continue; - #elif defined(__APPLE__) + #endif + #if defined(__APPLE__) usleep(ms*1000.0f); #endif - #if defined(SUPPORT_HALFBUSY_WAIT_LOOP) + #if defined(SUPPORT_PARTIALBUSY_WAIT_LOOP) while (GetTime() < destTime) { } #endif #endif } -// Get gamepad button generic to all platforms -static int GetGamepadButton(int button) -{ - int btn = GAMEPAD_BUTTON_UNKNOWN; -#if defined(PLATFORM_DESKTOP) - switch (button) - { - case GLFW_GAMEPAD_BUTTON_Y: btn = GAMEPAD_BUTTON_RIGHT_FACE_UP; break; - case GLFW_GAMEPAD_BUTTON_B: btn = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT; break; - case GLFW_GAMEPAD_BUTTON_A: btn = GAMEPAD_BUTTON_RIGHT_FACE_DOWN; break; - case GLFW_GAMEPAD_BUTTON_X: btn = GAMEPAD_BUTTON_RIGHT_FACE_LEFT; break; - - case GLFW_GAMEPAD_BUTTON_LEFT_BUMPER: btn = GAMEPAD_BUTTON_LEFT_TRIGGER_1; break; - case GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER: btn = GAMEPAD_BUTTON_RIGHT_TRIGGER_1; break; - - case GLFW_GAMEPAD_BUTTON_BACK: btn = GAMEPAD_BUTTON_MIDDLE_LEFT; break; - case GLFW_GAMEPAD_BUTTON_GUIDE: btn = GAMEPAD_BUTTON_MIDDLE; break; - case GLFW_GAMEPAD_BUTTON_START: btn = GAMEPAD_BUTTON_MIDDLE_RIGHT; break; - - case GLFW_GAMEPAD_BUTTON_DPAD_UP: btn = GAMEPAD_BUTTON_LEFT_FACE_UP; break; - case GLFW_GAMEPAD_BUTTON_DPAD_RIGHT: btn = GAMEPAD_BUTTON_LEFT_FACE_RIGHT; break; - case GLFW_GAMEPAD_BUTTON_DPAD_DOWN: btn = GAMEPAD_BUTTON_LEFT_FACE_DOWN; break; - case GLFW_GAMEPAD_BUTTON_DPAD_LEFT: btn = GAMEPAD_BUTTON_LEFT_FACE_LEFT; break; - - case GLFW_GAMEPAD_BUTTON_LEFT_THUMB: btn = GAMEPAD_BUTTON_LEFT_THUMB; break; - case GLFW_GAMEPAD_BUTTON_RIGHT_THUMB: btn = GAMEPAD_BUTTON_RIGHT_THUMB; break; - } -#endif - -#if defined(PLATFORM_UWP) - btn = button; // UWP will provide the correct button -#endif - -#if defined(PLATFORM_WEB) - // Gamepad Buttons reference: https://www.w3.org/TR/gamepad/#gamepad-interface - switch (button) - { - case 0: btn = GAMEPAD_BUTTON_RIGHT_FACE_DOWN; break; - case 1: btn = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT; break; - case 2: btn = GAMEPAD_BUTTON_RIGHT_FACE_LEFT; break; - case 3: btn = GAMEPAD_BUTTON_RIGHT_FACE_UP; break; - case 4: btn = GAMEPAD_BUTTON_LEFT_TRIGGER_1; break; - case 5: btn = GAMEPAD_BUTTON_RIGHT_TRIGGER_1; break; - case 6: btn = GAMEPAD_BUTTON_LEFT_TRIGGER_2; break; - case 7: btn = GAMEPAD_BUTTON_RIGHT_TRIGGER_2; break; - case 8: btn = GAMEPAD_BUTTON_MIDDLE_LEFT; break; - case 9: btn = GAMEPAD_BUTTON_MIDDLE_RIGHT; break; - case 10: btn = GAMEPAD_BUTTON_LEFT_THUMB; break; - case 11: btn = GAMEPAD_BUTTON_RIGHT_THUMB; break; - case 12: btn = GAMEPAD_BUTTON_LEFT_FACE_UP; break; - case 13: btn = GAMEPAD_BUTTON_LEFT_FACE_DOWN; break; - case 14: btn = GAMEPAD_BUTTON_LEFT_FACE_LEFT; break; - case 15: btn = GAMEPAD_BUTTON_LEFT_FACE_RIGHT; break; - } -#endif - - return btn; -} - // Poll (store) all input events static void PollInputEvents(void) { @@ -4306,7 +4759,7 @@ static void PollInputEvents(void) #if defined(PLATFORM_RPI) || defined(PLATFORM_DRM) // Register previous keys states for (int i = 0; i < 512; i++) CORE.Input.Keyboard.previousKeyState[i] = CORE.Input.Keyboard.currentKeyState[i]; - + PollKeyboardEvents(); // Register previous mouse states @@ -4317,6 +4770,16 @@ static void PollInputEvents(void) CORE.Input.Mouse.previousButtonState[i] = CORE.Input.Mouse.currentButtonState[i]; CORE.Input.Mouse.currentButtonState[i] = CORE.Input.Mouse.currentButtonStateEvdev[i]; } + + // Register gamepads buttons events + for (int i = 0; i < MAX_GAMEPADS; i++) + { + if (CORE.Input.Gamepad.ready[i]) // Check if gamepad is available + { + // Register previous gamepad states + for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) CORE.Input.Gamepad.previousButtonState[i][k] = CORE.Input.Gamepad.currentButtonState[i][k]; + } + } #endif #if defined(PLATFORM_UWP) @@ -4327,7 +4790,7 @@ static void PollInputEvents(void) { if (CORE.Input.Gamepad.ready[i]) { - for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) CORE.Input.Gamepad.previousState[i][k] = CORE.Input.Gamepad.currentState[i][k]; + for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) CORE.Input.Gamepad.previousButtonState[i][k] = CORE.Input.Gamepad.currentButtonState[i][k]; } } @@ -4350,6 +4813,9 @@ static void PollInputEvents(void) // Register previous mouse wheel state CORE.Input.Mouse.previousWheelMove = CORE.Input.Mouse.currentWheelMove; CORE.Input.Mouse.currentWheelMove = 0.0f; + + // Register previous mouse position + CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; #endif // Register previous touch states @@ -4370,7 +4836,7 @@ static void PollInputEvents(void) if (CORE.Input.Gamepad.ready[i]) // Check if gamepad is available { // Register previous gamepad states - for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) CORE.Input.Gamepad.previousState[i][k] = CORE.Input.Gamepad.currentState[i][k]; + for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) CORE.Input.Gamepad.previousButtonState[i][k] = CORE.Input.Gamepad.currentButtonState[i][k]; // Get current gamepad state // NOTE: There is no callback available, so we get it manually @@ -4382,14 +4848,41 @@ static void PollInputEvents(void) for (int k = 0; (buttons != NULL) && (k < GLFW_GAMEPAD_BUTTON_DPAD_LEFT + 1) && (k < MAX_GAMEPAD_BUTTONS); k++) { - const GamepadButton button = GetGamepadButton(k); + GamepadButton button = -1; - if (buttons[k] == GLFW_PRESS) + switch (k) { - CORE.Input.Gamepad.currentState[i][button] = 1; - CORE.Input.Gamepad.lastButtonPressed = button; + case GLFW_GAMEPAD_BUTTON_Y: button = GAMEPAD_BUTTON_RIGHT_FACE_UP; break; + case GLFW_GAMEPAD_BUTTON_B: button = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT; break; + case GLFW_GAMEPAD_BUTTON_A: button = GAMEPAD_BUTTON_RIGHT_FACE_DOWN; break; + case GLFW_GAMEPAD_BUTTON_X: button = GAMEPAD_BUTTON_RIGHT_FACE_LEFT; break; + + case GLFW_GAMEPAD_BUTTON_LEFT_BUMPER: button = GAMEPAD_BUTTON_LEFT_TRIGGER_1; break; + case GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER: button = GAMEPAD_BUTTON_RIGHT_TRIGGER_1; break; + + case GLFW_GAMEPAD_BUTTON_BACK: button = GAMEPAD_BUTTON_MIDDLE_LEFT; break; + case GLFW_GAMEPAD_BUTTON_GUIDE: button = GAMEPAD_BUTTON_MIDDLE; break; + case GLFW_GAMEPAD_BUTTON_START: button = GAMEPAD_BUTTON_MIDDLE_RIGHT; break; + + case GLFW_GAMEPAD_BUTTON_DPAD_UP: button = GAMEPAD_BUTTON_LEFT_FACE_UP; break; + case GLFW_GAMEPAD_BUTTON_DPAD_RIGHT: button = GAMEPAD_BUTTON_LEFT_FACE_RIGHT; break; + case GLFW_GAMEPAD_BUTTON_DPAD_DOWN: button = GAMEPAD_BUTTON_LEFT_FACE_DOWN; break; + case GLFW_GAMEPAD_BUTTON_DPAD_LEFT: button = GAMEPAD_BUTTON_LEFT_FACE_LEFT; break; + + case GLFW_GAMEPAD_BUTTON_LEFT_THUMB: button = GAMEPAD_BUTTON_LEFT_THUMB; break; + case GLFW_GAMEPAD_BUTTON_RIGHT_THUMB: button = GAMEPAD_BUTTON_RIGHT_THUMB; break; + default: break; + } + + if (button != -1) // Check for valid button + { + if (buttons[k] == GLFW_PRESS) + { + CORE.Input.Gamepad.currentButtonState[i][button] = 1; + CORE.Input.Gamepad.lastButtonPressed = button; + } + else CORE.Input.Gamepad.currentButtonState[i][button] = 0; } - else CORE.Input.Gamepad.currentState[i][button] = 0; } // Get current axis state @@ -4401,10 +4894,10 @@ static void PollInputEvents(void) } // Register buttons for 2nd triggers (because GLFW doesn't count these as buttons but rather axis) - CORE.Input.Gamepad.currentState[i][GAMEPAD_BUTTON_LEFT_TRIGGER_2] = (char)(CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_LEFT_TRIGGER] > 0.1); - CORE.Input.Gamepad.currentState[i][GAMEPAD_BUTTON_RIGHT_TRIGGER_2] = (char)(CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_RIGHT_TRIGGER] > 0.1); + CORE.Input.Gamepad.currentButtonState[i][GAMEPAD_BUTTON_LEFT_TRIGGER_2] = (char)(CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_LEFT_TRIGGER] > 0.1); + CORE.Input.Gamepad.currentButtonState[i][GAMEPAD_BUTTON_RIGHT_TRIGGER_2] = (char)(CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_RIGHT_TRIGGER] > 0.1); - CORE.Input.Gamepad.axisCount = GLFW_GAMEPAD_AXIS_LAST; + CORE.Input.Gamepad.axisCount = GLFW_GAMEPAD_AXIS_LAST + 1; } } @@ -4415,7 +4908,7 @@ static void PollInputEvents(void) #else glfwPollEvents(); // Register keyboard/mouse events (callbacks)... and window events! #endif -#endif //defined(PLATFORM_DESKTOP) +#endif // PLATFORM_DESKTOP // Gamepad support using emscripten API // NOTE: GLFW3 joystick functionality not available in web @@ -4427,7 +4920,7 @@ static void PollInputEvents(void) for (int i = 0; (i < numGamepads) && (i < MAX_GAMEPADS); i++) { // Register previous gamepad button states - for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) CORE.Input.Gamepad.previousState[i][k] = CORE.Input.Gamepad.currentState[i][k]; + for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) CORE.Input.Gamepad.previousButtonState[i][k] = CORE.Input.Gamepad.currentButtonState[i][k]; EmscriptenGamepadEvent gamepadState; @@ -4438,13 +4931,39 @@ static void PollInputEvents(void) // Register buttons data for every connected gamepad for (int j = 0; (j < gamepadState.numButtons) && (j < MAX_GAMEPAD_BUTTONS); j++) { - const GamepadButton button = GetGamepadButton(j); - if (gamepadState.digitalButton[j] == 1) + GamepadButton button = -1; + + // Gamepad Buttons reference: https://www.w3.org/TR/gamepad/#gamepad-interface + switch (j) { - CORE.Input.Gamepad.currentState[i][button] = 1; - CORE.Input.Gamepad.lastButtonPressed = button; + case 0: button = GAMEPAD_BUTTON_RIGHT_FACE_DOWN; break; + case 1: button = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT; break; + case 2: button = GAMEPAD_BUTTON_RIGHT_FACE_LEFT; break; + case 3: button = GAMEPAD_BUTTON_RIGHT_FACE_UP; break; + case 4: button = GAMEPAD_BUTTON_LEFT_TRIGGER_1; break; + case 5: button = GAMEPAD_BUTTON_RIGHT_TRIGGER_1; break; + case 6: button = GAMEPAD_BUTTON_LEFT_TRIGGER_2; break; + case 7: button = GAMEPAD_BUTTON_RIGHT_TRIGGER_2; break; + case 8: button = GAMEPAD_BUTTON_MIDDLE_LEFT; break; + case 9: button = GAMEPAD_BUTTON_MIDDLE_RIGHT; break; + case 10: button = GAMEPAD_BUTTON_LEFT_THUMB; break; + case 11: button = GAMEPAD_BUTTON_RIGHT_THUMB; break; + case 12: button = GAMEPAD_BUTTON_LEFT_FACE_UP; break; + case 13: button = GAMEPAD_BUTTON_LEFT_FACE_DOWN; break; + case 14: button = GAMEPAD_BUTTON_LEFT_FACE_LEFT; break; + case 15: button = GAMEPAD_BUTTON_LEFT_FACE_RIGHT; break; + default: break; + } + + if (button != -1) // Check for valid button + { + if (gamepadState.digitalButton[j] == 1) + { + CORE.Input.Gamepad.currentButtonState[i][button] = 1; + CORE.Input.Gamepad.lastButtonPressed = button; + } + else CORE.Input.Gamepad.currentButtonState[i][button] = 0; } - else CORE.Input.Gamepad.currentState[i][button] = 0; //TRACELOGD("INPUT: Gamepad %d, button %d: Digital: %d, Analog: %g", gamepadState.index, j, gamepadState.digitalButton[j], gamepadState.analogButton[j]); } @@ -4551,9 +5070,10 @@ static void SwapBuffers(void) { gbm_surface_release_buffer(CORE.Window.gbmSurface, CORE.Window.prevBO); } + CORE.Window.prevBO = bo; -#endif // defined(PLATFORM_DRM) -#endif // defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM) || defined(PLATFORM_UWP) +#endif // PLATFORM_DRM +#endif // PLATFORM_ANDROID || PLATFORM_RPI || PLATFORM_DRM || PLATFORM_UWP } #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) @@ -4569,16 +5089,17 @@ static void ErrorCallback(int error, const char *description) static void WindowSizeCallback(GLFWwindow *window, int width, int height) { SetupViewport(width, height); // Reset viewport and projection matrix for new size + CORE.Window.currentFbo.width = width; + CORE.Window.currentFbo.height = height; + CORE.Window.resizedLastFrame = true; + + if (IsWindowFullscreen()) return; // Set current screen size CORE.Window.screen.width = width; CORE.Window.screen.height = height; - CORE.Window.currentFbo.width = width; - CORE.Window.currentFbo.height = height; - // NOTE: Postprocessing texture is not scaled to new size - CORE.Window.resizedLastFrame = true; } // GLFW3 WindowIconify Callback, runs when window is minimized/restored @@ -4615,6 +5136,7 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i // NOTE: Before closing window, while loop must be left! } +#if defined(SUPPORT_SCREEN_CAPTURE) else if (key == GLFW_KEY_F12 && action == GLFW_PRESS) { #if defined(SUPPORT_GIF_RECORDING) @@ -4658,13 +5180,28 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i } else #endif // SUPPORT_GIF_RECORDING -#if defined(SUPPORT_SCREEN_CAPTURE) { TakeScreenshot(TextFormat("screenshot%03i.png", screenshotCounter)); screenshotCounter++; } -#endif // SUPPORT_SCREEN_CAPTURE } +#endif // SUPPORT_SCREEN_CAPTURE +#if defined(SUPPORT_EVENTS_AUTOMATION) + else if (key == GLFW_KEY_F11 && action == GLFW_PRESS) + { + eventsRecording = !eventsRecording; + + // On finish recording, we export events into a file + if (!eventsRecording) ExportAutomationEvents("eventsrec.rep"); + } + else if (key == GLFW_KEY_F9 && action == GLFW_PRESS) + { + LoadAutomationEvents("eventsrec.rep"); + eventsPlaying = true; + + TRACELOG(LOG_WARNING, "eventsPlaying enabled!"); + } +#endif else { // WARNING: GLFW could return GLFW_REPEAT, we need to consider it as 1 @@ -4673,7 +5210,7 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i else CORE.Input.Keyboard.currentKeyState[key] = 1; // Check if there is space available in the key queue - if ((CORE.Input.Keyboard.keyPressedQueueCount < MAX_KEY_PRESSED_QUEUE) && (action == GLFW_RELEASE)) + if ((CORE.Input.Keyboard.keyPressedQueueCount < MAX_KEY_PRESSED_QUEUE) && (action == GLFW_PRESS)) { // Add character to the queue CORE.Input.Keyboard.keyPressedQueue[CORE.Input.Keyboard.keyPressedQueueCount] = key; @@ -4739,9 +5276,9 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int // GLFW3 Cursor Position Callback, runs on mouse move static void MouseCursorPosCallback(GLFWwindow *window, double x, double y) { - CORE.Input.Mouse.position.x = (float)x; - CORE.Input.Mouse.position.y = (float)y; - CORE.Input.Touch.position[0] = CORE.Input.Mouse.position; + CORE.Input.Mouse.currentPosition.x = (float)x; + CORE.Input.Mouse.currentPosition.y = (float)y; + CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition; #if defined(SUPPORT_GESTURES_SYSTEM) && defined(SUPPORT_MOUSE_GESTURES) // Process mouse events as touches to be able to use mouse-gestures @@ -4787,11 +5324,11 @@ static void WindowDropCallback(GLFWwindow *window, int count, const char **paths { ClearDroppedFiles(); - CORE.Window.dropFilesPath = (char **)RL_MALLOC(sizeof(char *)*count); + CORE.Window.dropFilesPath = (char **)RL_MALLOC(count*sizeof(char *)); for (int i = 0; i < count; i++) { - CORE.Window.dropFilesPath[i] = (char *)RL_MALLOC(sizeof(char)*MAX_FILEPATH_LENGTH); + CORE.Window.dropFilesPath[i] = (char *)RL_MALLOC(MAX_FILEPATH_LENGTH*sizeof(char)); strcpy(CORE.Window.dropFilesPath[i], paths[i]); } @@ -4829,7 +5366,7 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) } else { - CORE.Window.display.width = ANativeWindow_getWidth(CORE.Android.app->window); + CORE.Window.display.width = ANativeWindow_getWidth(CORE.Android.app->window); CORE.Window.display.height = ANativeWindow_getHeight(CORE.Android.app->window); // Init graphics device (display device and OpenGL context) @@ -4987,11 +5524,11 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) if (flags == AMOTION_EVENT_ACTION_DOWN || flags == AMOTION_EVENT_ACTION_MOVE) { - CORE.Input.Touch.currentTouchState[MOUSE_LEFT_BUTTON] = 1; + CORE.Input.Touch.currentTouchState[MOUSE_BUTTON_LEFT] = 1; } else if (flags == AMOTION_EVENT_ACTION_UP) { - CORE.Input.Touch.currentTouchState[MOUSE_LEFT_BUTTON] = 0; + CORE.Input.Touch.currentTouchState[MOUSE_BUTTON_LEFT] = 0; } #if defined(SUPPORT_GESTURES_SYSTEM) @@ -5037,69 +5574,6 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) #endif #if defined(PLATFORM_WEB) -// Register fullscreen change events -static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const EmscriptenFullscreenChangeEvent *event, void *userData) -{ - //isFullscreen: int event->isFullscreen - //fullscreenEnabled: int event->fullscreenEnabled - //fs element nodeName: (char *) event->nodeName - //fs element id: (char *) event->id - //Current element size: (int) event->elementWidth, (int) event->elementHeight - //Screen size:(int) event->screenWidth, (int) event->screenHeight -/* - if (event->isFullscreen) - { - CORE.Window.fullscreen = true; - TRACELOG(LOG_INFO, "WEB: Canvas scaled to fullscreen. ElementSize: (%ix%i), ScreenSize(%ix%i)", event->elementWidth, event->elementHeight, event->screenWidth, event->screenHeight); - } - else - { - CORE.Window.fullscreen = false; - TRACELOG(LOG_INFO, "WEB: Canvas scaled to windowed. ElementSize: (%ix%i), ScreenSize(%ix%i)", event->elementWidth, event->elementHeight, event->screenWidth, event->screenHeight); - } - - // TODO: Depending on scaling factor (screen vs element), calculate factor to scale mouse/touch input -*/ - return 0; -} - -// Register keyboard input events -static EM_BOOL EmscriptenKeyboardCallback(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData) -{ - if ((eventType == EMSCRIPTEN_EVENT_KEYDOWN) && (keyEvent->keyCode == 27)) // ESCAPE key (strcmp(keyEvent->code, "Escape") == 0) - { - // WARNING: Not executed when pressing Esc to exit fullscreen, it seems document has priority over #canvas - - emscripten_exit_pointerlock(); - CORE.Window.fullscreen = false; - //TRACELOG(LOG_INFO, "CORE.Window.fullscreen = %s", CORE.Window.fullscreen? "true" : "false"); - } - - return 0; -} - -// Register mouse input events -static EM_BOOL EmscriptenMouseCallback(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData) -{ - // Lock mouse pointer when click on screen - if (eventType == EMSCRIPTEN_EVENT_CLICK) - { - EmscriptenPointerlockChangeEvent plce; - emscripten_get_pointerlock_status(&plce); - - int result = emscripten_request_pointerlock("#canvas", 1); // TODO: It does not work! - - // result -> EMSCRIPTEN_RESULT_DEFERRED - // The requested operation cannot be completed now for web security reasons, - // and has been deferred for completion in the next event handler. --> but it never happens! - - //if (!plce.isActive) emscripten_request_pointerlock(0, 1); - //else emscripten_exit_pointerlock(); - } - - return 0; -} - // Register touch input events static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData) { @@ -5185,16 +5659,6 @@ static EM_BOOL EmscriptenGamepadCallback(int eventType, const EmscriptenGamepadE return 0; } - -static EM_BOOL EmscriptenWindowResizedCallback(int eventType, const void *reserved, void *userData) -{ - double width, height; - emscripten_get_element_css_size("canvas", &width, &height); - - // TODO. - - return true; -} #endif #if defined(PLATFORM_RPI) || defined(PLATFORM_DRM) @@ -5260,10 +5724,10 @@ static void ProcessKeyboard(void) bufferByteCount = read(STDIN_FILENO, keysBuffer, MAX_KEYBUFFER_SIZE); // POSIX system call // Reset pressed keys array (it will be filled below) - if (bufferByteCount > 0) for (int i = 0; i < 512; i++) CORE.Input.Keyboard.currentKeyState[i] = 0; + if (bufferByteCount > 0) for (int i = 0; i < MAX_KEYBOARD_KEYS; i++) CORE.Input.Keyboard.currentKeyState[i] = 0; // Check keys from event input workers (This is the new keyboard reading method) - //for (int i = 0; i < 512; i++) CORE.Input.Keyboard.currentKeyState[i] = CORE.Input.Keyboard.currentKeyStateEvdev[i]; + //for (int i = 0; i < MAX_KEYBOARD_KEYS; i++) CORE.Input.Keyboard.currentKeyState[i] = CORE.Input.Keyboard.currentKeyStateEvdev[i]; // Fill all read bytes (looking for keys) for (int i = 0; i < bufferByteCount; i++) @@ -5272,7 +5736,7 @@ static void ProcessKeyboard(void) // Up -> 1b 5b 41 / Left -> 1b 5b 44 / Right -> 1b 5b 43 / Down -> 1b 5b 42 if (keysBuffer[i] == 0x1b) { - // Detect ESC to stop program + // Check if ESCAPE key has been pressed to stop program if (bufferByteCount == 1) CORE.Input.Keyboard.currentKeyState[CORE.Input.Keyboard.exitKey] = 1; else { @@ -5369,7 +5833,7 @@ static void RestoreKeyboard(void) // Reconfigure keyboard to default mode ioctl(STDIN_FILENO, KDSKBMODE, CORE.Input.Keyboard.defaultMode); } -#endif //SUPPORT_SSH_KEYBOARD_RPI +#endif // SUPPORT_SSH_KEYBOARD_RPI // Initialise user input from evdev(/dev/input/event) this means mouse, keyboard or gamepad devices static void InitEvdevInput(void) @@ -5377,7 +5841,7 @@ static void InitEvdevInput(void) char path[MAX_FILEPATH_LENGTH]; DIR *directory; struct dirent *entity; - + // Initialise keyboard file descriptor CORE.Input.Keyboard.fd = -1; @@ -5640,7 +6104,7 @@ static void PollKeyboardEvents(void) struct input_event event; int keycode; - + // Try to read data from the keyboard and only continue if successful while (read(fd, &event, sizeof(event)) == (int)sizeof(event)) { @@ -5702,8 +6166,8 @@ static void *EventThread(void *arg) { if (event.code == REL_X) { - CORE.Input.Mouse.position.x += event.value; - CORE.Input.Touch.position[0].x = CORE.Input.Mouse.position.x; + CORE.Input.Mouse.currentPosition.x += event.value; + CORE.Input.Touch.position[0].x = CORE.Input.Mouse.currentPosition.x; #if defined(SUPPORT_GESTURES_SYSTEM) touchAction = TOUCH_MOVE; @@ -5713,8 +6177,8 @@ static void *EventThread(void *arg) if (event.code == REL_Y) { - CORE.Input.Mouse.position.y += event.value; - CORE.Input.Touch.position[0].y = CORE.Input.Mouse.position.y; + CORE.Input.Mouse.currentPosition.y += event.value; + CORE.Input.Touch.position[0].y = CORE.Input.Mouse.currentPosition.y; #if defined(SUPPORT_GESTURES_SYSTEM) touchAction = TOUCH_MOVE; @@ -5731,7 +6195,8 @@ static void *EventThread(void *arg) // Basic movement if (event.code == ABS_X) { - CORE.Input.Mouse.position.x = (event.value - worker->absRange.x)*CORE.Window.screen.width/worker->absRange.width; // Scale acording to absRange + CORE.Input.Mouse.currentPosition.x = (event.value - worker->absRange.x)*CORE.Window.screen.width/worker->absRange.width; // Scale acording to absRange + CORE.Input.Touch.position[0].x = (event.value - worker->absRange.x)*CORE.Window.screen.width/worker->absRange.width; // Scale acording to absRange #if defined(SUPPORT_GESTURES_SYSTEM) touchAction = TOUCH_MOVE; @@ -5741,7 +6206,8 @@ static void *EventThread(void *arg) if (event.code == ABS_Y) { - CORE.Input.Mouse.position.y = (event.value - worker->absRange.y)*CORE.Window.screen.height/worker->absRange.height; // Scale acording to absRange + CORE.Input.Mouse.currentPosition.y = (event.value - worker->absRange.y)*CORE.Window.screen.height/worker->absRange.height; // Scale acording to absRange + CORE.Input.Touch.position[0].y = (event.value - worker->absRange.y)*CORE.Window.screen.height/worker->absRange.height; // Scale acording to absRange #if defined(SUPPORT_GESTURES_SYSTEM) touchAction = TOUCH_MOVE; @@ -5750,7 +6216,7 @@ static void *EventThread(void *arg) } // Multitouch movement - if (event.code == ABS_MT_SLOT) worker->touchSlot = event.value; // Remeber the slot number for the folowing events + if (event.code == ABS_MT_SLOT) worker->touchSlot = event.value; // Remember the slot number for the folowing events if (event.code == ABS_MT_POSITION_X) { @@ -5771,6 +6237,33 @@ static void *EventThread(void *arg) CORE.Input.Touch.position[worker->touchSlot].y = -1; } } + + // Touchscreen tap + if (event.code == ABS_PRESSURE) + { + int previousMouseLeftButtonState = CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT]; + + if (!event.value && previousMouseLeftButtonState) + { + CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = 0; + + #if defined(SUPPORT_GESTURES_SYSTEM) + touchAction = TOUCH_UP; + gestureUpdate = true; + #endif + } + + if (event.value && !previousMouseLeftButtonState) + { + CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = 1; + + #if defined(SUPPORT_GESTURES_SYSTEM) + touchAction = TOUCH_DOWN; + gestureUpdate = true; + #endif + } + } + } // Button parsing @@ -5779,7 +6272,7 @@ static void *EventThread(void *arg) // Mouse button parsing if ((event.code == BTN_TOUCH) || (event.code == BTN_LEFT)) { - CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_LEFT_BUTTON] = event.value; + CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = event.value; #if defined(SUPPORT_GESTURES_SYSTEM) if (event.value > 0) touchAction = TOUCH_DOWN; @@ -5788,18 +6281,22 @@ static void *EventThread(void *arg) #endif } - if (event.code == BTN_RIGHT) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_RIGHT_BUTTON] = event.value; - if (event.code == BTN_MIDDLE) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_MIDDLE_BUTTON] = event.value; + if (event.code == BTN_RIGHT) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_RIGHT] = event.value; + if (event.code == BTN_MIDDLE) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_MIDDLE] = event.value; + if (event.code == BTN_SIDE) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_SIDE] = event.value; + if (event.code == BTN_EXTRA) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_EXTRA] = event.value; + if (event.code == BTN_FORWARD) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_FORWARD] = event.value; + if (event.code == BTN_BACK) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_BACK] = event.value; } // Screen confinement if (!CORE.Input.Mouse.cursorHidden) { - if (CORE.Input.Mouse.position.x < 0) CORE.Input.Mouse.position.x = 0; - if (CORE.Input.Mouse.position.x > CORE.Window.screen.width/CORE.Input.Mouse.scale.x) CORE.Input.Mouse.position.x = CORE.Window.screen.width/CORE.Input.Mouse.scale.x; + if (CORE.Input.Mouse.currentPosition.x < 0) CORE.Input.Mouse.currentPosition.x = 0; + if (CORE.Input.Mouse.currentPosition.x > CORE.Window.screen.width/CORE.Input.Mouse.scale.x) CORE.Input.Mouse.currentPosition.x = CORE.Window.screen.width/CORE.Input.Mouse.scale.x; - if (CORE.Input.Mouse.position.y < 0) CORE.Input.Mouse.position.y = 0; - if (CORE.Input.Mouse.position.y > CORE.Window.screen.height/CORE.Input.Mouse.scale.y) CORE.Input.Mouse.position.y = CORE.Window.screen.height/CORE.Input.Mouse.scale.y; + if (CORE.Input.Mouse.currentPosition.y < 0) CORE.Input.Mouse.currentPosition.y = 0; + if (CORE.Input.Mouse.currentPosition.y > CORE.Window.screen.height/CORE.Input.Mouse.scale.y) CORE.Input.Mouse.currentPosition.y = CORE.Window.screen.height/CORE.Input.Mouse.scale.y; } // Gesture update @@ -5896,12 +6393,12 @@ static void *GamepadThread(void *arg) // Process gamepad events by type if (gamepadEvent.type == JS_EVENT_BUTTON) { - TRACELOGD("RPI: Gamepad button: %i, value: %i", gamepadEvent.number, gamepadEvent.value); + //TRACELOG(LOG_WARNING, "RPI: Gamepad button: %i, value: %i", gamepadEvent.number, gamepadEvent.value); if (gamepadEvent.number < MAX_GAMEPAD_BUTTONS) { // 1 - button pressed, 0 - button released - CORE.Input.Gamepad.currentState[i][gamepadEvent.number] = (int)gamepadEvent.value; + CORE.Input.Gamepad.currentButtonState[i][gamepadEvent.number] = (int)gamepadEvent.value; if ((int)gamepadEvent.value == 1) CORE.Input.Gamepad.lastButtonPressed = gamepadEvent.number; else CORE.Input.Gamepad.lastButtonPressed = -1; @@ -5909,7 +6406,7 @@ static void *GamepadThread(void *arg) } else if (gamepadEvent.type == JS_EVENT_AXIS) { - TRACELOGD("RPI: Gamepad axis: %i, value: %i", gamepadEvent.number, gamepadEvent.value); + //TRACELOG(LOG_WARNING, "RPI: Gamepad axis: %i, value: %i", gamepadEvent.number, gamepadEvent.value); if (gamepadEvent.number < MAX_GAMEPAD_AXIS) { @@ -5924,7 +6421,7 @@ static void *GamepadThread(void *arg) return NULL; } -#endif // PLATFORM_RPI || PLATFORM_DRM +#endif // PLATFORM_RPI || PLATFORM_DRM #if defined(PLATFORM_UWP) // UWP function pointers @@ -5944,21 +6441,21 @@ bool UWPIsConfigured() { bool pass = true; - if (uwpQueryTimeFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetQueryTimeFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpSleepFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetSleepFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpDisplaySizeFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetDisplaySizeFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpMouseLockFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetMouseLockFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpMouseUnlockFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetMouseUnlockFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpMouseShowFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetMouseShowFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpMouseHideFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetMouseHideFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpMouseSetPosFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetMouseSetPosFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpCoreWindow == NULL) { TRACELOG(LOG_ERROR, "UWP: A pointer to the UWP core window must be set before InitWindow()"); pass = false; } + if (uwpQueryTimeFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetQueryTimeFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpSleepFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetSleepFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpDisplaySizeFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetDisplaySizeFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpMouseLockFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetMouseLockFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpMouseUnlockFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetMouseUnlockFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpMouseShowFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetMouseShowFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpMouseHideFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetMouseHideFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpMouseSetPosFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetMouseSetPosFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpCoreWindow == NULL) { TRACELOG(LOG_WARNING, "UWP: A pointer to the UWP core window must be set before InitWindow()"); pass = false; } return pass; } // UWP function handlers get/set -void UWPSetDataPath(const char* path) { CORE.UWP.internalDataPath = path; } +void UWPSetDataPath(const char *path) { CORE.UWP.internalDataPath = path; } UWPQueryTimeFunc UWPGetQueryTimeFunc(void) { return uwpQueryTimeFunc; } void UWPSetQueryTimeFunc(UWPQueryTimeFunc func) { uwpQueryTimeFunc = func; } UWPSleepFunc UWPGetSleepFunc(void) { return uwpSleepFunc; } @@ -5987,6 +6484,7 @@ void UWPKeyDownEvent(int key, bool down, bool controlKey) // Time to close the window. CORE.Window.shouldClose = true; } +#if defined(SUPPORT_SCREEN_CAPTURE) else if (key == KEY_F12 && down) { #if defined(SUPPORT_GIF_RECORDING) @@ -6021,13 +6519,12 @@ void UWPKeyDownEvent(int key, bool down, bool controlKey) } else #endif // SUPPORT_GIF_RECORDING -#if defined(SUPPORT_SCREEN_CAPTURE) { TakeScreenshot(TextFormat("screenshot%03i.png", screenshotCounter)); screenshotCounter++; } -#endif // SUPPORT_SCREEN_CAPTURE } +#endif // SUPPORT_SCREEN_CAPTURE else { CORE.Input.Keyboard.currentKeyState[key] = down; @@ -6078,9 +6575,9 @@ void UWPMouseButtonEvent(int button, bool down) void UWPMousePosEvent(double x, double y) { - CORE.Input.Mouse.position.x = (float)x; - CORE.Input.Mouse.position.y = (float)y; - CORE.Input.Touch.position[0] = CORE.Input.Mouse.position; + CORE.Input.Mouse.currentPosition.x = (float)x; + CORE.Input.Mouse.currentPosition.y = (float)y; + CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition; #if defined(SUPPORT_GESTURES_SYSTEM) && defined(SUPPORT_MOUSE_GESTURES) // Process mouse events as touches to be able to use mouse-gestures @@ -6095,7 +6592,7 @@ void UWPMousePosEvent(double x, double y) gestureEvent.pointCount = 1; // Register touch points position, only one point registered - gestureEvent.position[0] = CORE.Input.Mouse.position; + gestureEvent.position[0] = CORE.Input.Mouse.currentPosition; // Normalize gestureEvent.position[0] for CORE.Window.screen.width and CORE.Window.screen.height gestureEvent.position[0].x /= (float)GetScreenWidth(); @@ -6132,7 +6629,7 @@ void UWPRegisterGamepadButton(int gamepad, int button, bool down) { if (button < MAX_GAMEPAD_BUTTONS) { - CORE.Input.Gamepad.currentState[gamepad][button] = down; + CORE.Input.Gamepad.currentButtonState[gamepad][button] = down; CORE.Input.Gamepad.lastButtonPressed = button; } } @@ -6196,7 +6693,7 @@ void UWPGestureTouch(int pointer, float x, float y, bool touch) #endif } -#endif // PLATFORM_UWP +#endif // PLATFORM_UWP #if defined(PLATFORM_DRM) // Search matching DRM mode in connector's mode list @@ -6293,3 +6790,363 @@ static int FindNearestConnectorMode(const drmModeConnector *connector, uint widt return nearestIndex; } #endif + +#if defined(SUPPORT_EVENTS_AUTOMATION) +// NOTE: Loading happens over AutomationEvent *events +static void LoadAutomationEvents(const char *fileName) +{ + //unsigned char fileId[4] = { 0 }; + + // Load binary + /* + FILE *repFile = fopen(fileName, "rb"); + fread(fileId, 4, 1, repFile); + + if ((fileId[0] == 'r') && (fileId[1] == 'E') && (fileId[2] == 'P') && (fileId[1] == ' ')) + { + fread(&eventCount, sizeof(int), 1, repFile); + TraceLog(LOG_WARNING, "Events loaded: %i\n", eventCount); + fread(events, sizeof(AutomationEvent), eventCount, repFile); + } + + fclose(repFile); + */ + + // Load events (text file) + FILE *repFile = fopen(fileName, "rt"); + + if (repFile != NULL) + { + unsigned int count = 0; + char buffer[256] = { 0 }; + + fgets(buffer, 256, repFile); + + while (!feof(repFile)) + { + if (buffer[0] == 'c') sscanf(buffer, "c %i", &eventCount); + else if (buffer[0] == 'e') + { + sscanf(buffer, "e %d %d %d %d %d", &events[count].frame, &events[count].type, + &events[count].params[0], &events[count].params[1], &events[count].params[2]); + + count++; + } + + fgets(buffer, 256, repFile); + } + + if (count != eventCount) TRACELOG(LOG_WARNING, "Events count provided is different than count"); + + fclose(repFile); + } + + TRACELOG(LOG_WARNING, "Events loaded: %i", eventCount); +} + +// Export recorded events into a file +static void ExportAutomationEvents(const char *fileName) +{ + // TODO: eventCount is required -> header? -> rAEL + unsigned char fileId[4] = "rEP "; + + // Save as binary + /* + FILE *repFile = fopen(fileName, "wb"); + fwrite(fileId, 4, 1, repFile); + fwrite(&eventCount, sizeof(int), 1, repFile); + fwrite(events, sizeof(AutomationEvent), eventCount, repFile); + fclose(repFile); + */ + + // Export events as text + FILE *repFile = fopen(fileName, "wt"); + + if (repFile != NULL) + { + fprintf(repFile, "# Automation events list\n"); + fprintf(repFile, "# c \n"); + fprintf(repFile, "# e // \n"); + + fprintf(repFile, "c %i\n", eventCount); + for (int i = 0; i < eventCount; i++) + { + fprintf(repFile, "e %i %i %i %i %i // %s\n", events[i].frame, events[i].type, + events[i].params[0], events[i].params[1], events[i].params[2], autoEventTypeName[events[i].type]); + } + + fclose(repFile); + } +} + +// EndDrawing() -> After PollInputEvents() +// Check event in current frame and save into the events[i] array +static void RecordAutomationEvent(unsigned int frame) +{ + for (int key = 0; key < 512; key++) + { + // INPUT_KEY_UP (only saved once) + if (CORE.Input.Keyboard.previousKeyState[key] && !CORE.Input.Keyboard.currentKeyState[key]) + { + events[eventCount].frame = frame; + events[eventCount].type = INPUT_KEY_UP; + events[eventCount].params[0] = key; + events[eventCount].params[1] = 0; + events[eventCount].params[2] = 0; + + TRACELOG(LOG_INFO, "[%i] INPUT_KEY_UP: %i, %i, %i", events[eventCount].frame, events[eventCount].params[0], events[eventCount].params[1], events[eventCount].params[2]); + eventCount++; + } + + // INPUT_KEY_DOWN + if (CORE.Input.Keyboard.currentKeyState[key]) + { + events[eventCount].frame = frame; + events[eventCount].type = INPUT_KEY_DOWN; + events[eventCount].params[0] = key; + events[eventCount].params[1] = 0; + events[eventCount].params[2] = 0; + + TRACELOG(LOG_INFO, "[%i] INPUT_KEY_DOWN: %i, %i, %i", events[eventCount].frame, events[eventCount].params[0], events[eventCount].params[1], events[eventCount].params[2]); + eventCount++; + } + } + + for (int button = 0; button < MAX_MOUSE_BUTTONS; button++) + { + // INPUT_MOUSE_BUTTON_UP + if (CORE.Input.Mouse.previousButtonState[button] && !CORE.Input.Mouse.currentButtonState[button]) + { + events[eventCount].frame = frame; + events[eventCount].type = INPUT_MOUSE_BUTTON_UP; + events[eventCount].params[0] = button; + events[eventCount].params[1] = 0; + events[eventCount].params[2] = 0; + + TRACELOG(LOG_INFO, "[%i] INPUT_MOUSE_BUTTON_UP: %i, %i, %i", events[eventCount].frame, events[eventCount].params[0], events[eventCount].params[1], events[eventCount].params[2]); + eventCount++; + } + + // INPUT_MOUSE_BUTTON_DOWN + if (CORE.Input.Mouse.currentButtonState[button]) + { + events[eventCount].frame = frame; + events[eventCount].type = INPUT_MOUSE_BUTTON_DOWN; + events[eventCount].params[0] = button; + events[eventCount].params[1] = 0; + events[eventCount].params[2] = 0; + + TRACELOG(LOG_INFO, "[%i] INPUT_MOUSE_BUTTON_DOWN: %i, %i, %i", events[eventCount].frame, events[eventCount].params[0], events[eventCount].params[1], events[eventCount].params[2]); + eventCount++; + } + } + + // INPUT_MOUSE_POSITION (only saved if changed) + if (((int)CORE.Input.Mouse.currentPosition.x != (int)CORE.Input.Mouse.previousPosition.x) || + ((int)CORE.Input.Mouse.currentPosition.y != (int)CORE.Input.Mouse.previousPosition.y)) + { + events[eventCount].frame = frame; + events[eventCount].type = INPUT_MOUSE_POSITION; + events[eventCount].params[0] = (int)CORE.Input.Mouse.currentPosition.x; + events[eventCount].params[1] = (int)CORE.Input.Mouse.currentPosition.y; + events[eventCount].params[2] = 0; + + TRACELOG(LOG_INFO, "[%i] INPUT_MOUSE_POSITION: %i, %i, %i", events[eventCount].frame, events[eventCount].params[0], events[eventCount].params[1], events[eventCount].params[2]); + eventCount++; + } + + // INPUT_MOUSE_WHEEL_MOTION + if ((int)CORE.Input.Mouse.currentWheelMove != (int)CORE.Input.Mouse.previousWheelMove) + { + events[eventCount].frame = frame; + events[eventCount].type = INPUT_MOUSE_WHEEL_MOTION; + events[eventCount].params[0] = (int)CORE.Input.Mouse.currentWheelMove; + events[eventCount].params[1] = 0; + events[eventCount].params[2] = 0; + + TRACELOG(LOG_INFO, "[%i] INPUT_MOUSE_WHEEL_MOTION: %i, %i, %i", events[eventCount].frame, events[eventCount].params[0], events[eventCount].params[1], events[eventCount].params[2]); + eventCount++; + } + + for (int id = 0; id < MAX_TOUCH_POINTS; id++) + { + // INPUT_TOUCH_UP + if (CORE.Input.Touch.previousTouchState[id] && !CORE.Input.Touch.currentTouchState[id]) + { + events[eventCount].frame = frame; + events[eventCount].type = INPUT_TOUCH_UP; + events[eventCount].params[0] = id; + events[eventCount].params[1] = 0; + events[eventCount].params[2] = 0; + + TRACELOG(LOG_INFO, "[%i] INPUT_TOUCH_UP: %i, %i, %i", events[eventCount].frame, events[eventCount].params[0], events[eventCount].params[1], events[eventCount].params[2]); + eventCount++; + } + + // INPUT_TOUCH_DOWN + if (CORE.Input.Touch.currentTouchState[id]) + { + events[eventCount].frame = frame; + events[eventCount].type = INPUT_TOUCH_DOWN; + events[eventCount].params[0] = id; + events[eventCount].params[1] = 0; + events[eventCount].params[2] = 0; + + TRACELOG(LOG_INFO, "[%i] INPUT_TOUCH_DOWN: %i, %i, %i", events[eventCount].frame, events[eventCount].params[0], events[eventCount].params[1], events[eventCount].params[2]); + eventCount++; + } + + // INPUT_TOUCH_POSITION + // TODO: It requires the id! + /* + if (((int)CORE.Input.Touch.currentPosition[id].x != (int)CORE.Input.Touch.previousPosition[id].x) || + ((int)CORE.Input.Touch.currentPosition[id].y != (int)CORE.Input.Touch.previousPosition[id].y)) + { + events[eventCount].frame = frame; + events[eventCount].type = INPUT_TOUCH_POSITION; + events[eventCount].params[0] = id; + events[eventCount].params[1] = (int)CORE.Input.Touch.currentPosition[id].x; + events[eventCount].params[2] = (int)CORE.Input.Touch.currentPosition[id].y; + + TRACELOG(LOG_INFO, "[%i] INPUT_TOUCH_POSITION: %i, %i, %i", events[eventCount].frame, events[eventCount].params[0], events[eventCount].params[1], events[eventCount].params[2]); + eventCount++; + } + */ + } + + for (int gamepad = 0; gamepad < MAX_GAMEPADS; gamepad++) + { + // INPUT_GAMEPAD_CONNECT + /* + if ((CORE.Input.Gamepad.currentState[gamepad] != CORE.Input.Gamepad.previousState[gamepad]) && + (CORE.Input.Gamepad.currentState[gamepad] == true)) // Check if changed to ready + { + // TODO: Save gamepad connect event + } + */ + + // INPUT_GAMEPAD_DISCONNECT + /* + if ((CORE.Input.Gamepad.currentState[gamepad] != CORE.Input.Gamepad.previousState[gamepad]) && + (CORE.Input.Gamepad.currentState[gamepad] == false)) // Check if changed to not-ready + { + // TODO: Save gamepad disconnect event + } + */ + + for (int button = 0; button < MAX_GAMEPAD_BUTTONS; button++) + { + // INPUT_GAMEPAD_BUTTON_UP + if (CORE.Input.Gamepad.previousButtonState[gamepad][button] && !CORE.Input.Gamepad.currentButtonState[gamepad][button]) + { + events[eventCount].frame = frame; + events[eventCount].type = INPUT_GAMEPAD_BUTTON_UP; + events[eventCount].params[0] = gamepad; + events[eventCount].params[1] = button; + events[eventCount].params[2] = 0; + + TRACELOG(LOG_INFO, "[%i] INPUT_GAMEPAD_BUTTON_UP: %i, %i, %i", events[eventCount].frame, events[eventCount].params[0], events[eventCount].params[1], events[eventCount].params[2]); + eventCount++; + } + + // INPUT_GAMEPAD_BUTTON_DOWN + if (CORE.Input.Gamepad.currentButtonState[gamepad][button]) + { + events[eventCount].frame = frame; + events[eventCount].type = INPUT_GAMEPAD_BUTTON_DOWN; + events[eventCount].params[0] = gamepad; + events[eventCount].params[1] = button; + events[eventCount].params[2] = 0; + + TRACELOG(LOG_INFO, "[%i] INPUT_GAMEPAD_BUTTON_DOWN: %i, %i, %i", events[eventCount].frame, events[eventCount].params[0], events[eventCount].params[1], events[eventCount].params[2]); + eventCount++; + } + } + + for (int axis = 0; axis < MAX_GAMEPAD_AXIS; axis++) + { + // INPUT_GAMEPAD_AXIS_MOTION + if (CORE.Input.Gamepad.axisState[gamepad][axis] > 0.1f) + { + events[eventCount].frame = frame; + events[eventCount].type = INPUT_GAMEPAD_AXIS_MOTION; + events[eventCount].params[0] = gamepad; + events[eventCount].params[1] = axis; + events[eventCount].params[2] = (int)(CORE.Input.Gamepad.axisState[gamepad][axis]*32768.0f); + + TRACELOG(LOG_INFO, "[%i] INPUT_GAMEPAD_AXIS_MOTION: %i, %i, %i", events[eventCount].frame, events[eventCount].params[0], events[eventCount].params[1], events[eventCount].params[2]); + eventCount++; + } + } + } + + // INPUT_GESTURE + if (GESTURES.current != GESTURE_NONE) + { + events[eventCount].frame = frame; + events[eventCount].type = INPUT_GESTURE; + events[eventCount].params[0] = GESTURES.current; + events[eventCount].params[1] = 0; + events[eventCount].params[2] = 0; + + TRACELOG(LOG_INFO, "[%i] INPUT_GESTURE: %i, %i, %i", events[eventCount].frame, events[eventCount].params[0], events[eventCount].params[1], events[eventCount].params[2]); + eventCount++; + } +} + +// Play automation event +static void PlayAutomationEvent(unsigned int frame) +{ + for (unsigned int i = 0; i < eventCount; i++) + { + if (events[i].frame == frame) + { + switch (events[i].type) + { + // Input events + case INPUT_KEY_UP: CORE.Input.Keyboard.currentKeyState[events[i].params[0]] = false; break; // param[0]: key + case INPUT_KEY_DOWN: CORE.Input.Keyboard.currentKeyState[events[i].params[0]] = true; break; // param[0]: key + case INPUT_MOUSE_BUTTON_UP: CORE.Input.Mouse.currentButtonState[events[i].params[0]] = false; break; // param[0]: key + case INPUT_MOUSE_BUTTON_DOWN: CORE.Input.Mouse.currentButtonState[events[i].params[0]] = true; break; // param[0]: key + case INPUT_MOUSE_POSITION: // param[0]: x, param[1]: y + { + CORE.Input.Mouse.currentPosition.x = (float)events[i].params[0]; + CORE.Input.Mouse.currentPosition.y = (float)events[i].params[1]; + } break; + case INPUT_MOUSE_WHEEL_MOTION: CORE.Input.Mouse.currentWheelMove = (float)events[i].params[0]; break; // param[0]: delta + case INPUT_TOUCH_UP: CORE.Input.Touch.currentTouchState[events[i].params[0]] = false; break; // param[0]: id + case INPUT_TOUCH_DOWN: CORE.Input.Touch.currentTouchState[events[i].params[0]] = true; break; // param[0]: id + case INPUT_TOUCH_POSITION: // param[0]: id, param[1]: x, param[2]: y + { + CORE.Input.Touch.position[events[i].params[0]].x = (float)events[i].params[1]; + CORE.Input.Touch.position[events[i].params[0]].y = (float)events[i].params[2]; + } break; + case INPUT_GAMEPAD_CONNECT: CORE.Input.Gamepad.ready[events[i].params[0]] = true; break; // param[0]: gamepad + case INPUT_GAMEPAD_DISCONNECT: CORE.Input.Gamepad.ready[events[i].params[0]] = false; break; // param[0]: gamepad + case INPUT_GAMEPAD_BUTTON_UP: CORE.Input.Gamepad.currentButtonState[events[i].params[0]][events[i].params[1]] = false; break; // param[0]: gamepad, param[1]: button + case INPUT_GAMEPAD_BUTTON_DOWN: CORE.Input.Gamepad.currentButtonState[events[i].params[0]][events[i].params[1]] = true; break; // param[0]: gamepad, param[1]: button + case INPUT_GAMEPAD_AXIS_MOTION: // param[0]: gamepad, param[1]: axis, param[2]: delta + { + CORE.Input.Gamepad.axisState[events[i].params[0]][events[i].params[1]] = ((float)events[i].params[2]/32768.0f); + } break; + case INPUT_GESTURE: GESTURES.current = events[i].params[0]; break; // param[0]: gesture (enum Gesture) -> gestures.h: GESTURES.current + + // Window events + case WINDOW_CLOSE: CORE.Window.shouldClose = true; break; + case WINDOW_MAXIMIZE: MaximizeWindow(); break; + case WINDOW_MINIMIZE: MinimizeWindow(); break; + case WINDOW_RESIZE: SetWindowSize(events[i].params[0], events[i].params[1]); break; + + // Custom events + case ACTION_TAKE_SCREENSHOT: + { + TakeScreenshot(TextFormat("screenshot%03i.png", screenshotCounter)); + screenshotCounter++; + } break; + case ACTION_SETTARGETFPS: SetTargetFPS(events[i].params[0]); break; + default: break; + } + } + } +} +#endif diff --git a/src/external/cgltf.h b/src/external/cgltf.h index 41b75da0b..4cc2d7ec9 100644 --- a/src/external/cgltf.h +++ b/src/external/cgltf.h @@ -1,7 +1,7 @@ /** * cgltf - a single-file glTF 2.0 parser written in C99. * - * Version: 1.8 + * Version: 1.10 * * Website: https://github.com/jkuhlmann/cgltf * @@ -24,7 +24,7 @@ * * `cgltf_options` is the struct passed to `cgltf_parse()` to control * parts of the parsing process. You can use it to force the file type - * and provide memory allocation as well as file operation callbacks. + * and provide memory allocation as well as file operation callbacks. * Should be zero-initialized to trigger default behavior. * * `cgltf_data` is the struct allocated and filled by `cgltf_parse()`. @@ -42,8 +42,8 @@ * * `cgltf_result cgltf_load_buffer_base64(const cgltf_options* options, * cgltf_size size, const char* base64, void** out_data)` decodes - * base64-encoded data content. Used internally by `cgltf_load_buffers()` - * and may be useful if you're not dealing with normal files. + * base64-encoded data content. Used internally by `cgltf_load_buffers()`. + * This is useful when decoding data URIs in images. * * `cgltf_result cgltf_parse_file(const cgltf_options* options, const * char* path, cgltf_data** out_data)` can be used to open the given @@ -246,6 +246,7 @@ typedef struct cgltf_extension { typedef struct cgltf_buffer { + char* name; cgltf_size size; char* uri; void* data; /* loaded by cgltf_load_buffers */ @@ -281,6 +282,7 @@ typedef struct cgltf_meshopt_compression typedef struct cgltf_buffer_view { + char *name; cgltf_buffer* buffer; cgltf_size offset; cgltf_size size; @@ -315,6 +317,7 @@ typedef struct cgltf_accessor_sparse typedef struct cgltf_accessor { + char* name; cgltf_component_type component_type; cgltf_bool normalized; cgltf_type type; @@ -354,6 +357,7 @@ typedef struct cgltf_image typedef struct cgltf_sampler { + char* name; cgltf_int mag_filter; cgltf_int min_filter; cgltf_int wrap_s; @@ -439,10 +443,19 @@ typedef struct cgltf_ior typedef struct cgltf_specular { cgltf_texture_view specular_texture; + cgltf_texture_view specular_color_texture; cgltf_float specular_color_factor[3]; cgltf_float specular_factor; } cgltf_specular; +typedef struct cgltf_volume +{ + cgltf_texture_view thickness_texture; + cgltf_float thickness_factor; + cgltf_float attenuation_color[3]; + cgltf_float attenuation_distance; +} cgltf_volume; + typedef struct cgltf_sheen { cgltf_texture_view sheen_color_texture; @@ -458,6 +471,7 @@ typedef struct cgltf_material cgltf_bool has_pbr_specular_glossiness; cgltf_bool has_clearcoat; cgltf_bool has_transmission; + cgltf_bool has_volume; cgltf_bool has_ior; cgltf_bool has_specular; cgltf_bool has_sheen; @@ -468,6 +482,7 @@ typedef struct cgltf_material cgltf_specular specular; cgltf_sheen sheen; cgltf_transmission transmission; + cgltf_volume volume; cgltf_texture_view normal_texture; cgltf_texture_view occlusion_texture; cgltf_texture_view emissive_texture; @@ -481,6 +496,13 @@ typedef struct cgltf_material cgltf_extension* extensions; } cgltf_material; +typedef struct cgltf_material_mapping +{ + cgltf_size variant; + cgltf_material* material; + cgltf_extras extras; +} cgltf_material_mapping; + typedef struct cgltf_morph_target { cgltf_attribute* attributes; cgltf_size attributes_count; @@ -503,6 +525,8 @@ typedef struct cgltf_primitive { cgltf_extras extras; cgltf_bool has_draco_mesh_compression; cgltf_draco_mesh_compression draco_mesh_compression; + cgltf_material_mapping* mappings; + cgltf_size mappings_count; cgltf_size extensions_count; cgltf_extension* extensions; } cgltf_primitive; @@ -534,8 +558,10 @@ typedef struct cgltf_skin { } cgltf_skin; typedef struct cgltf_camera_perspective { + cgltf_bool has_aspect_ratio; cgltf_float aspect_ratio; cgltf_float yfov; + cgltf_bool has_zfar; cgltf_float zfar; cgltf_float znear; cgltf_extras extras; @@ -633,6 +659,12 @@ typedef struct cgltf_animation { cgltf_extension* extensions; } cgltf_animation; +typedef struct cgltf_material_variant +{ + char* name; + cgltf_extras extras; +} cgltf_material_variant; + typedef struct cgltf_asset { char* copyright; char* generator; @@ -694,6 +726,9 @@ typedef struct cgltf_data cgltf_animation* animations; cgltf_size animations_count; + cgltf_material_variant* variants; + cgltf_size variants_count; + cgltf_extras extras; cgltf_size data_extensions_count; @@ -776,6 +811,7 @@ cgltf_result cgltf_copy_extras_json(const cgltf_data* data, const cgltf_extras* #include /* For strncpy */ #include /* For fopen */ #include /* For UINT_MAX etc */ +#include /* For FLT_MAX */ #if !defined(CGLTF_MALLOC) || !defined(CGLTF_FREE) || !defined(CGLTF_ATOI) || !defined(CGLTF_ATOF) #include /* For malloc, free, atoi, atof */ @@ -847,6 +883,9 @@ static const uint32_t GlbMagicBinChunk = 0x004E4942; #ifndef CGLTF_ATOF #define CGLTF_ATOF(str) atof(str) #endif +#ifndef CGLTF_VALIDATE_ENABLE_ASSERTS +#define CGLTF_VALIDATE_ENABLE_ASSERTS 0 +#endif static void* cgltf_default_alloc(void* user, cgltf_size size) { @@ -1344,6 +1383,12 @@ static cgltf_size cgltf_calc_index_bound(cgltf_buffer_view* buffer_view, cgltf_s return bound; } +#if CGLTF_VALIDATE_ENABLE_ASSERTS +#define CGLTF_ASSERT_IF(cond, result) assert(!(cond)); if (cond) return result; +#else +#define CGLTF_ASSERT_IF(cond, result) if (cond) return result; +#endif + cgltf_result cgltf_validate(cgltf_data* data) { for (cgltf_size i = 0; i < data->accessors_count; ++i) @@ -1356,10 +1401,7 @@ cgltf_result cgltf_validate(cgltf_data* data) { cgltf_size req_size = accessor->offset + accessor->stride * (accessor->count - 1) + element_size; - if (accessor->buffer_view->size < req_size) - { - return cgltf_result_data_too_short; - } + CGLTF_ASSERT_IF(accessor->buffer_view->size < req_size, cgltf_result_data_too_short); } if (accessor->is_sparse) @@ -1370,27 +1412,18 @@ cgltf_result cgltf_validate(cgltf_data* data) cgltf_size indices_req_size = sparse->indices_byte_offset + indices_component_size * sparse->count; cgltf_size values_req_size = sparse->values_byte_offset + element_size * sparse->count; - if (sparse->indices_buffer_view->size < indices_req_size || - sparse->values_buffer_view->size < values_req_size) - { - return cgltf_result_data_too_short; - } + CGLTF_ASSERT_IF(sparse->indices_buffer_view->size < indices_req_size || + sparse->values_buffer_view->size < values_req_size, cgltf_result_data_too_short); - if (sparse->indices_component_type != cgltf_component_type_r_8u && - sparse->indices_component_type != cgltf_component_type_r_16u && - sparse->indices_component_type != cgltf_component_type_r_32u) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(sparse->indices_component_type != cgltf_component_type_r_8u && + sparse->indices_component_type != cgltf_component_type_r_16u && + sparse->indices_component_type != cgltf_component_type_r_32u, cgltf_result_invalid_gltf); if (sparse->indices_buffer_view->buffer->data) { cgltf_size index_bound = cgltf_calc_index_bound(sparse->indices_buffer_view, sparse->indices_byte_offset, sparse->indices_component_type, sparse->count); - if (index_bound >= accessor->count) - { - return cgltf_result_data_too_short; - } + CGLTF_ASSERT_IF(index_bound >= accessor->count, cgltf_result_data_too_short); } } } @@ -1399,64 +1432,31 @@ cgltf_result cgltf_validate(cgltf_data* data) { cgltf_size req_size = data->buffer_views[i].offset + data->buffer_views[i].size; - if (data->buffer_views[i].buffer && data->buffer_views[i].buffer->size < req_size) - { - return cgltf_result_data_too_short; - } + CGLTF_ASSERT_IF(data->buffer_views[i].buffer && data->buffer_views[i].buffer->size < req_size, cgltf_result_data_too_short); if (data->buffer_views[i].has_meshopt_compression) { cgltf_meshopt_compression* mc = &data->buffer_views[i].meshopt_compression; - if (mc->buffer == NULL || mc->buffer->size < mc->offset + mc->size) - { - return cgltf_result_data_too_short; - } + CGLTF_ASSERT_IF(mc->buffer == NULL || mc->buffer->size < mc->offset + mc->size, cgltf_result_data_too_short); - if (data->buffer_views[i].stride && mc->stride != data->buffer_views[i].stride) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(data->buffer_views[i].stride && mc->stride != data->buffer_views[i].stride, cgltf_result_invalid_gltf); - if (data->buffer_views[i].size != mc->stride * mc->count) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(data->buffer_views[i].size != mc->stride * mc->count, cgltf_result_invalid_gltf); - if (mc->mode == cgltf_meshopt_compression_mode_invalid) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(mc->mode == cgltf_meshopt_compression_mode_invalid, cgltf_result_invalid_gltf); - if (mc->mode == cgltf_meshopt_compression_mode_attributes && !(mc->stride % 4 == 0 && mc->stride <= 256)) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(mc->mode == cgltf_meshopt_compression_mode_attributes && !(mc->stride % 4 == 0 && mc->stride <= 256), cgltf_result_invalid_gltf); - if (mc->mode == cgltf_meshopt_compression_mode_triangles && mc->count % 3 != 0) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(mc->mode == cgltf_meshopt_compression_mode_triangles && mc->count % 3 != 0, cgltf_result_invalid_gltf); - if ((mc->mode == cgltf_meshopt_compression_mode_triangles || mc->mode == cgltf_meshopt_compression_mode_indices) && mc->stride != 2 && mc->stride != 4) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF((mc->mode == cgltf_meshopt_compression_mode_triangles || mc->mode == cgltf_meshopt_compression_mode_indices) && mc->stride != 2 && mc->stride != 4, cgltf_result_invalid_gltf); - if ((mc->mode == cgltf_meshopt_compression_mode_triangles || mc->mode == cgltf_meshopt_compression_mode_indices) && mc->filter != cgltf_meshopt_compression_filter_none) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF((mc->mode == cgltf_meshopt_compression_mode_triangles || mc->mode == cgltf_meshopt_compression_mode_indices) && mc->filter != cgltf_meshopt_compression_filter_none, cgltf_result_invalid_gltf); - if (mc->filter == cgltf_meshopt_compression_filter_octahedral && mc->stride != 4 && mc->stride != 8) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(mc->filter == cgltf_meshopt_compression_filter_octahedral && mc->stride != 4 && mc->stride != 8, cgltf_result_invalid_gltf); - if (mc->filter == cgltf_meshopt_compression_filter_quaternion && mc->stride != 8) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(mc->filter == cgltf_meshopt_compression_filter_quaternion && mc->stride != 8, cgltf_result_invalid_gltf); } } @@ -1464,26 +1464,17 @@ cgltf_result cgltf_validate(cgltf_data* data) { if (data->meshes[i].weights) { - if (data->meshes[i].primitives_count && data->meshes[i].primitives[0].targets_count != data->meshes[i].weights_count) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(data->meshes[i].primitives_count && data->meshes[i].primitives[0].targets_count != data->meshes[i].weights_count, cgltf_result_invalid_gltf); } if (data->meshes[i].target_names) { - if (data->meshes[i].primitives_count && data->meshes[i].primitives[0].targets_count != data->meshes[i].target_names_count) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(data->meshes[i].primitives_count && data->meshes[i].primitives[0].targets_count != data->meshes[i].target_names_count, cgltf_result_invalid_gltf); } for (cgltf_size j = 0; j < data->meshes[i].primitives_count; ++j) { - if (data->meshes[i].primitives[j].targets_count != data->meshes[i].primitives[0].targets_count) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(data->meshes[i].primitives[j].targets_count != data->meshes[i].primitives[0].targets_count, cgltf_result_invalid_gltf); if (data->meshes[i].primitives[j].attributes_count) { @@ -1491,41 +1482,34 @@ cgltf_result cgltf_validate(cgltf_data* data) for (cgltf_size k = 0; k < data->meshes[i].primitives[j].attributes_count; ++k) { - if (data->meshes[i].primitives[j].attributes[k].data->count != first->count) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(data->meshes[i].primitives[j].attributes[k].data->count != first->count, cgltf_result_invalid_gltf); } for (cgltf_size k = 0; k < data->meshes[i].primitives[j].targets_count; ++k) { for (cgltf_size m = 0; m < data->meshes[i].primitives[j].targets[k].attributes_count; ++m) { - if (data->meshes[i].primitives[j].targets[k].attributes[m].data->count != first->count) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(data->meshes[i].primitives[j].targets[k].attributes[m].data->count != first->count, cgltf_result_invalid_gltf); } } cgltf_accessor* indices = data->meshes[i].primitives[j].indices; - if (indices && + CGLTF_ASSERT_IF(indices && indices->component_type != cgltf_component_type_r_8u && indices->component_type != cgltf_component_type_r_16u && - indices->component_type != cgltf_component_type_r_32u) - { - return cgltf_result_invalid_gltf; - } + indices->component_type != cgltf_component_type_r_32u, cgltf_result_invalid_gltf); if (indices && indices->buffer_view && indices->buffer_view->buffer->data) { cgltf_size index_bound = cgltf_calc_index_bound(indices->buffer_view, indices->offset, indices->component_type, indices->count); - if (index_bound >= first->count) - { - return cgltf_result_data_too_short; - } + CGLTF_ASSERT_IF(index_bound >= first->count, cgltf_result_data_too_short); + } + + for (cgltf_size k = 0; k < data->meshes[i].primitives[j].mappings_count; ++k) + { + CGLTF_ASSERT_IF(data->meshes[i].primitives[j].mappings[k].variant >= data->variants_count, cgltf_result_invalid_gltf); } } } @@ -1535,10 +1519,7 @@ cgltf_result cgltf_validate(cgltf_data* data) { if (data->nodes[i].weights && data->nodes[i].mesh) { - if (data->nodes[i].mesh->primitives_count && data->nodes[i].mesh->primitives[0].targets_count != data->nodes[i].weights_count) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF (data->nodes[i].mesh->primitives_count && data->nodes[i].mesh->primitives[0].targets_count != data->nodes[i].weights_count, cgltf_result_invalid_gltf); } } @@ -1549,10 +1530,7 @@ cgltf_result cgltf_validate(cgltf_data* data) while (p1 && p2) { - if (p1 == p2) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(p1 == p2, cgltf_result_invalid_gltf); p1 = p1->parent; p2 = p2->parent ? p2->parent->parent : NULL; @@ -1563,10 +1541,7 @@ cgltf_result cgltf_validate(cgltf_data* data) { for (cgltf_size j = 0; j < data->scenes[i].nodes_count; ++j) { - if (data->scenes[i].nodes[j]->parent) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(data->scenes[i].nodes[j]->parent, cgltf_result_invalid_gltf); } } @@ -1585,20 +1560,14 @@ cgltf_result cgltf_validate(cgltf_data* data) if (channel->target_path == cgltf_animation_path_type_weights) { - if (!channel->target_node->mesh || !channel->target_node->mesh->primitives_count) - { - return cgltf_result_invalid_gltf; - } + CGLTF_ASSERT_IF(!channel->target_node->mesh || !channel->target_node->mesh->primitives_count, cgltf_result_invalid_gltf); components = channel->target_node->mesh->primitives[0].targets_count; } cgltf_size values = channel->sampler->interpolation == cgltf_interpolation_type_cubic_spline ? 3 : 1; - if (channel->sampler->input->count * components * values != channel->sampler->output->count) - { - return cgltf_result_data_too_short; - } + CGLTF_ASSERT_IF(channel->sampler->input->count * components * values != channel->sampler->output->count, cgltf_result_data_too_short); } } @@ -1661,6 +1630,8 @@ void cgltf_free(cgltf_data* data) for (cgltf_size i = 0; i < data->accessors_count; ++i) { + data->memory.free(data->memory.user_data, data->accessors[i].name); + if(data->accessors[i].is_sparse) { cgltf_free_extensions(data, data->accessors[i].sparse.extensions, data->accessors[i].sparse.extensions_count); @@ -1673,6 +1644,7 @@ void cgltf_free(cgltf_data* data) for (cgltf_size i = 0; i < data->buffer_views_count; ++i) { + data->memory.free(data->memory.user_data, data->buffer_views[i].name); data->memory.free(data->memory.user_data, data->buffer_views[i].data); cgltf_free_extensions(data, data->buffer_views[i].extensions, data->buffer_views[i].extensions_count); @@ -1681,6 +1653,8 @@ void cgltf_free(cgltf_data* data) for (cgltf_size i = 0; i < data->buffers_count; ++i) { + data->memory.free(data->memory.user_data, data->buffers[i].name); + if (data->buffers[i].data != data->bin) { file_release(&data->memory, &data->file, data->buffers[i].data); @@ -1727,6 +1701,8 @@ void cgltf_free(cgltf_data* data) data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].draco_mesh_compression.attributes); } + data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].mappings); + cgltf_free_extensions(data, data->meshes[i].primitives[j].extensions, data->meshes[i].primitives[j].extensions_count); } @@ -1768,11 +1744,16 @@ void cgltf_free(cgltf_data* data) if(data->materials[i].has_specular) { cgltf_free_extensions(data, data->materials[i].specular.specular_texture.extensions, data->materials[i].specular.specular_texture.extensions_count); + cgltf_free_extensions(data, data->materials[i].specular.specular_color_texture.extensions, data->materials[i].specular.specular_color_texture.extensions_count); } if(data->materials[i].has_transmission) { cgltf_free_extensions(data, data->materials[i].transmission.transmission_texture.extensions, data->materials[i].transmission.transmission_texture.extensions_count); } + if (data->materials[i].has_volume) + { + cgltf_free_extensions(data, data->materials[i].volume.thickness_texture.extensions, data->materials[i].volume.thickness_texture.extensions_count); + } if(data->materials[i].has_sheen) { cgltf_free_extensions(data, data->materials[i].sheen.sheen_color_texture.extensions, data->materials[i].sheen.sheen_color_texture.extensions_count); @@ -1809,6 +1790,7 @@ void cgltf_free(cgltf_data* data) for (cgltf_size i = 0; i < data->samplers_count; ++i) { + data->memory.free(data->memory.user_data, data->samplers[i].name); cgltf_free_extensions(data, data->samplers[i].extensions, data->samplers[i].extensions_count); } @@ -1879,6 +1861,13 @@ void cgltf_free(cgltf_data* data) data->memory.free(data->memory.user_data, data->animations); + for (cgltf_size i = 0; i < data->variants_count; ++i) + { + data->memory.free(data->memory.user_data, data->variants[i].name); + } + + data->memory.free(data->memory.user_data, data->variants); + cgltf_free_extensions(data, data->data_extensions, data->data_extensions_count); for (cgltf_size i = 0; i < data->extensions_used_count; ++i) @@ -2608,6 +2597,136 @@ static int cgltf_parse_json_draco_mesh_compression(cgltf_options* options, jsmnt out_draco_mesh_compression->buffer_view = CGLTF_PTRINDEX(cgltf_buffer_view, cgltf_json_to_int(tokens + i, json_chunk)); ++i; } + + if (i < 0) + { + return i; + } + } + + return i; +} + +static int cgltf_parse_json_material_mapping_data(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_material_mapping* out_mappings, cgltf_size* offset) +{ + (void)options; + CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_ARRAY); + + int size = tokens[i].size; + ++i; + + for (int j = 0; j < size; ++j) + { + CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); + + int obj_size = tokens[i].size; + ++i; + + int material = -1; + int variants_tok = -1; + cgltf_extras extras = {0, 0}; + + for (int k = 0; k < obj_size; ++k) + { + CGLTF_CHECK_KEY(tokens[i]); + + if (cgltf_json_strcmp(tokens + i, json_chunk, "material") == 0) + { + ++i; + material = cgltf_json_to_int(tokens + i, json_chunk); + ++i; + } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "variants") == 0) + { + variants_tok = i+1; + CGLTF_CHECK_TOKTYPE(tokens[variants_tok], JSMN_ARRAY); + + i = cgltf_skip_json(tokens, i+1); + } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) + { + i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &extras); + } + else + { + i = cgltf_skip_json(tokens, i+1); + } + + if (i < 0) + { + return i; + } + } + + if (material < 0 || variants_tok < 0) + { + return CGLTF_ERROR_JSON; + } + + if (out_mappings) + { + for (int k = 0; k < tokens[variants_tok].size; ++k) + { + int variant = cgltf_json_to_int(&tokens[variants_tok + 1 + k], json_chunk); + if (variant < 0) + return variant; + + out_mappings[*offset].material = CGLTF_PTRINDEX(cgltf_material, material); + out_mappings[*offset].variant = variant; + out_mappings[*offset].extras = extras; + + (*offset)++; + } + } + else + { + (*offset) += tokens[variants_tok].size; + } + } + + return i; +} + +static int cgltf_parse_json_material_mappings(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_primitive* out_prim) +{ + CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); + + int size = tokens[i].size; + ++i; + + for (int j = 0; j < size; ++j) + { + CGLTF_CHECK_KEY(tokens[i]); + + if (cgltf_json_strcmp(tokens + i, json_chunk, "mappings") == 0) + { + if (out_prim->mappings) + { + return CGLTF_ERROR_JSON; + } + + cgltf_size mappings_offset = 0; + int k = cgltf_parse_json_material_mapping_data(options, tokens, i + 1, json_chunk, NULL, &mappings_offset); + if (k < 0) + { + return k; + } + + out_prim->mappings_count = mappings_offset; + out_prim->mappings = (cgltf_material_mapping*)cgltf_calloc(options, sizeof(cgltf_material_mapping), out_prim->mappings_count); + + mappings_offset = 0; + i = cgltf_parse_json_material_mapping_data(options, tokens, i + 1, json_chunk, out_prim->mappings, &mappings_offset); + } + else + { + i = cgltf_skip_json(tokens, i+1); + } + + if (i < 0) + { + return i; + } } return i; @@ -2700,6 +2819,10 @@ static int cgltf_parse_json_primitive(cgltf_options* options, jsmntok_t const* t out_prim->has_draco_mesh_compression = 1; i = cgltf_parse_json_draco_mesh_compression(options, tokens, i + 1, json_chunk, &out_prim->draco_mesh_compression); } + else if (cgltf_json_strcmp(tokens+i, json_chunk, "KHR_materials_variants") == 0) + { + i = cgltf_parse_json_material_mappings(options, tokens, i + 1, json_chunk, out_prim); + } else { i = cgltf_parse_json_unprocessed_extension(options, tokens, i, json_chunk, &(out_prim->extensions[out_prim->extensions_count++])); @@ -2783,7 +2906,7 @@ static int cgltf_parse_json_mesh(cgltf_options* options, jsmntok_t const* tokens { CGLTF_CHECK_KEY(tokens[i]); - if (cgltf_json_strcmp(tokens+i, json_chunk, "targetNames") == 0) + if (cgltf_json_strcmp(tokens+i, json_chunk, "targetNames") == 0 && tokens[i+1].type == JSMN_ARRAY) { i = cgltf_parse_json_string_array(options, tokens, i + 1, json_chunk, &out_mesh->target_names, &out_mesh->target_names_count); } @@ -3005,7 +3128,11 @@ static int cgltf_parse_json_accessor(cgltf_options* options, jsmntok_t const* to { CGLTF_CHECK_KEY(tokens[i]); - if (cgltf_json_strcmp(tokens+i, json_chunk, "bufferView") == 0) + if (cgltf_json_strcmp(tokens + i, json_chunk, "name") == 0) + { + i = cgltf_parse_json_string(options, tokens, i + 1, json_chunk, &out_accessor->name); + } + else if (cgltf_json_strcmp(tokens+i, json_chunk, "bufferView") == 0) { ++i; out_accessor->buffer_view = CGLTF_PTRINDEX(cgltf_buffer_view, cgltf_json_to_int(tokens + i, json_chunk)); @@ -3467,6 +3594,10 @@ static int cgltf_parse_json_specular(cgltf_options* options, jsmntok_t const* to { i = cgltf_parse_json_texture_view(options, tokens, i + 1, json_chunk, &out_specular->specular_texture); } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "specularColorTexture") == 0) + { + i = cgltf_parse_json_texture_view(options, tokens, i + 1, json_chunk, &out_specular->specular_color_texture); + } else { i = cgltf_skip_json(tokens, i+1); @@ -3515,6 +3646,50 @@ static int cgltf_parse_json_transmission(cgltf_options* options, jsmntok_t const return i; } +static int cgltf_parse_json_volume(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_volume* out_volume) +{ + CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); + int size = tokens[i].size; + ++i; + + for (int j = 0; j < size; ++j) + { + CGLTF_CHECK_KEY(tokens[i]); + + if (cgltf_json_strcmp(tokens + i, json_chunk, "thicknessFactor") == 0) + { + ++i; + out_volume->thickness_factor = cgltf_json_to_float(tokens + i, json_chunk); + ++i; + } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "thicknessTexture") == 0) + { + i = cgltf_parse_json_texture_view(options, tokens, i + 1, json_chunk, &out_volume->thickness_texture); + } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "attenuationColor") == 0) + { + i = cgltf_parse_json_float_array(tokens, i + 1, json_chunk, out_volume->attenuation_color, 3); + } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "attenuationDistance") == 0) + { + ++i; + out_volume->attenuation_distance = cgltf_json_to_float(tokens + i, json_chunk); + ++i; + } + else + { + i = cgltf_skip_json(tokens, i + 1); + } + + if (i < 0) + { + return i; + } + } + + return i; +} + static int cgltf_parse_json_sheen(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_sheen* out_sheen) { CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); @@ -3623,7 +3798,11 @@ static int cgltf_parse_json_sampler(cgltf_options* options, jsmntok_t const* tok { CGLTF_CHECK_KEY(tokens[i]); - if (cgltf_json_strcmp(tokens + i, json_chunk, "magFilter") == 0) + if (cgltf_json_strcmp(tokens + i, json_chunk, "name") == 0) + { + i = cgltf_parse_json_string(options, tokens, i + 1, json_chunk, &out_sampler->name); + } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "magFilter") == 0) { ++i; out_sampler->mag_filter @@ -3734,6 +3913,9 @@ static int cgltf_parse_json_material(cgltf_options* options, jsmntok_t const* to cgltf_fill_float_array(out_material->pbr_specular_glossiness.specular_factor, 3, 1.0f); out_material->pbr_specular_glossiness.glossiness_factor = 1.0f; + cgltf_fill_float_array(out_material->volume.attenuation_color, 3, 1.0f); + out_material->volume.attenuation_distance = FLT_MAX; + out_material->alpha_cutoff = 0.5f; int size = tokens[i].size; @@ -3859,6 +4041,11 @@ static int cgltf_parse_json_material(cgltf_options* options, jsmntok_t const* to out_material->has_transmission = 1; i = cgltf_parse_json_transmission(options, tokens, i + 1, json_chunk, &out_material->transmission); } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "KHR_materials_volume") == 0) + { + out_material->has_volume = 1; + i = cgltf_parse_json_volume(options, tokens, i + 1, json_chunk, &out_material->volume); + } else if (cgltf_json_strcmp(tokens+i, json_chunk, "KHR_materials_sheen") == 0) { out_material->has_sheen = 1; @@ -4089,7 +4276,11 @@ static int cgltf_parse_json_buffer_view(cgltf_options* options, jsmntok_t const* { CGLTF_CHECK_KEY(tokens[i]); - if (cgltf_json_strcmp(tokens+i, json_chunk, "buffer") == 0) + if (cgltf_json_strcmp(tokens + i, json_chunk, "name") == 0) + { + i = cgltf_parse_json_string(options, tokens, i + 1, json_chunk, &out_buffer_view->name); + } + else if (cgltf_json_strcmp(tokens+i, json_chunk, "buffer") == 0) { ++i; out_buffer_view->buffer = CGLTF_PTRINDEX(cgltf_buffer, cgltf_json_to_int(tokens + i, json_chunk)); @@ -4223,7 +4414,11 @@ static int cgltf_parse_json_buffer(cgltf_options* options, jsmntok_t const* toke { CGLTF_CHECK_KEY(tokens[i]); - if (cgltf_json_strcmp(tokens+i, json_chunk, "byteLength") == 0) + if (cgltf_json_strcmp(tokens + i, json_chunk, "name") == 0) + { + i = cgltf_parse_json_string(options, tokens, i + 1, json_chunk, &out_buffer->name); + } + else if (cgltf_json_strcmp(tokens+i, json_chunk, "byteLength") == 0) { ++i; out_buffer->size = @@ -4405,6 +4600,7 @@ static int cgltf_parse_json_camera(cgltf_options* options, jsmntok_t const* toke if (cgltf_json_strcmp(tokens+i, json_chunk, "aspectRatio") == 0) { ++i; + out_camera->data.perspective.has_aspect_ratio = 1; out_camera->data.perspective.aspect_ratio = cgltf_json_to_float(tokens + i, json_chunk); ++i; } @@ -4417,6 +4613,7 @@ static int cgltf_parse_json_camera(cgltf_options* options, jsmntok_t const* toke else if (cgltf_json_strcmp(tokens+i, json_chunk, "zfar") == 0) { ++i; + out_camera->data.perspective.has_zfar = 1; out_camera->data.perspective.zfar = cgltf_json_to_float(tokens + i, json_chunk); ++i; } @@ -5160,6 +5357,58 @@ static int cgltf_parse_json_animations(cgltf_options* options, jsmntok_t const* return i; } +static int cgltf_parse_json_variant(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_material_variant* out_variant) +{ + CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); + + int size = tokens[i].size; + ++i; + + for (int j = 0; j < size; ++j) + { + CGLTF_CHECK_KEY(tokens[i]); + + if (cgltf_json_strcmp(tokens+i, json_chunk, "name") == 0) + { + i = cgltf_parse_json_string(options, tokens, i + 1, json_chunk, &out_variant->name); + } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) + { + i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_variant->extras); + } + else + { + i = cgltf_skip_json(tokens, i+1); + } + + if (i < 0) + { + return i; + } + } + + return i; +} + +static int cgltf_parse_json_variants(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_data* out_data) +{ + i = cgltf_parse_json_array(options, tokens, i, json_chunk, sizeof(cgltf_material_variant), (void**)&out_data->variants, &out_data->variants_count); + if (i < 0) + { + return i; + } + + for (cgltf_size j = 0; j < out_data->variants_count; ++j) + { + i = cgltf_parse_json_variant(options, tokens, i, json_chunk, &out_data->variants[j]); + if (i < 0) + { + return i; + } + } + return i; +} + static int cgltf_parse_json_asset(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_asset* out_asset) { CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); @@ -5400,6 +5649,34 @@ static int cgltf_parse_json_root(cgltf_options* options, jsmntok_t const* tokens } } } + else if (cgltf_json_strcmp(tokens+i, json_chunk, "KHR_materials_variants") == 0) + { + ++i; + + CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); + + int data_size = tokens[i].size; + ++i; + + for (int m = 0; m < data_size; ++m) + { + CGLTF_CHECK_KEY(tokens[i]); + + if (cgltf_json_strcmp(tokens + i, json_chunk, "variants") == 0) + { + i = cgltf_parse_json_variants(options, tokens, i + 1, json_chunk, out_data); + } + else + { + i = cgltf_skip_json(tokens, i + 1); + } + + if (i < 0) + { + return i; + } + } + } else { i = cgltf_parse_json_unprocessed_extension(options, tokens, i, json_chunk, &(out_data->data_extensions[out_data->data_extensions_count++])); @@ -5542,6 +5819,11 @@ static int cgltf_fixup_pointers(cgltf_data* data) CGLTF_PTRFIXUP_REQ(data->meshes[i].primitives[j].draco_mesh_compression.attributes[m].data, data->accessors, data->accessors_count); } } + + for (cgltf_size k = 0; k < data->meshes[i].primitives[j].mappings_count; ++k) + { + CGLTF_PTRFIXUP_REQ(data->meshes[i].primitives[j].mappings[k].material, data->materials, data->materials_count); + } } } @@ -5594,9 +5876,12 @@ static int cgltf_fixup_pointers(cgltf_data* data) CGLTF_PTRFIXUP(data->materials[i].clearcoat.clearcoat_normal_texture.texture, data->textures, data->textures_count); CGLTF_PTRFIXUP(data->materials[i].specular.specular_texture.texture, data->textures, data->textures_count); + CGLTF_PTRFIXUP(data->materials[i].specular.specular_color_texture.texture, data->textures, data->textures_count); CGLTF_PTRFIXUP(data->materials[i].transmission.transmission_texture.texture, data->textures, data->textures_count); + CGLTF_PTRFIXUP(data->materials[i].volume.thickness_texture.texture, data->textures, data->textures_count); + CGLTF_PTRFIXUP(data->materials[i].sheen.sheen_color_texture.texture, data->textures, data->textures_count); CGLTF_PTRFIXUP(data->materials[i].sheen.sheen_roughness_texture.texture, data->textures, data->textures_count); } diff --git a/src/external/dr_flac.h b/src/external/dr_flac.h index 906af001f..a797350a2 100644 --- a/src/external/dr_flac.h +++ b/src/external/dr_flac.h @@ -1,6 +1,6 @@ /* FLAC audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file. -dr_flac - v0.12.22 - 2020-11-01 +dr_flac - v0.12.29 - 2021-04-02 David Reid - mackron@gmail.com @@ -166,7 +166,7 @@ If you just want to quickly decode an entire FLAC file in one go you can do some ... - drflac_free(pSampleData); + drflac_free(pSampleData, NULL); ``` You can read samples as signed 16-bit integer and 32-bit floating-point PCM with the *_s16() and *_f32() family of APIs respectively, but note that these @@ -232,7 +232,7 @@ extern "C" { #define DRFLAC_VERSION_MAJOR 0 #define DRFLAC_VERSION_MINOR 12 -#define DRFLAC_VERSION_REVISION 22 +#define DRFLAC_VERSION_REVISION 29 #define DRFLAC_VERSION_STRING DRFLAC_XSTRINGIFY(DRFLAC_VERSION_MAJOR) "." DRFLAC_XSTRINGIFY(DRFLAC_VERSION_MINOR) "." DRFLAC_XSTRINGIFY(DRFLAC_VERSION_REVISION) #include /* For size_t. */ @@ -408,7 +408,10 @@ typedef struct typedef struct { - /* The metadata type. Use this to know how to interpret the data below. */ + /* + The metadata type. Use this to know how to interpret the data below. Will be set to one of the + DRFLAC_METADATA_BLOCK_TYPE_* tokens. + */ drflac_uint32 type; /* @@ -552,7 +555,8 @@ pMetadata (in) Remarks ------- -Use pMetadata->type to determine which metadata block is being handled and how to read the data. +Use pMetadata->type to determine which metadata block is being handled and how to read the data. This +will be set to one of the DRFLAC_METADATA_BLOCK_TYPE_* tokens. */ typedef void (* drflac_meta_proc)(void* pUserData, drflac_metadata* pMetadata); @@ -797,6 +801,8 @@ from a block of memory respectively. The STREAMINFO block must be present for this to succeed. Use `drflac_open_relaxed()` to open a FLAC stream where the header may not be present. +Use `drflac_open_with_metadata()` if you need access to metadata. + Seek Also --------- @@ -843,6 +849,8 @@ as that is for internal use only. Opening in relaxed mode will continue reading data from onRead until it finds a valid frame. If a frame is never found it will continue forever. To abort, force your `onRead` callback to return 0, which dr_flac will use as an indicator that the end of the stream was found. + +Use `drflac_open_with_metadata_relaxed()` if you need access to metadata. */ DRFLAC_API drflac* drflac_open_relaxed(drflac_read_proc onRead, drflac_seek_proc onSeek, drflac_container container, void* pUserData, const drflac_allocation_callbacks* pAllocationCallbacks); @@ -882,7 +890,9 @@ Close the decoder with `drflac_close()`. This is slower than `drflac_open()`, so avoid this one if you don't need metadata. Internally, this will allocate and free memory on the heap for every metadata block except for STREAMINFO and PADDING blocks. -The caller is notified of the metadata via the `onMeta` callback. All metadata blocks will be handled before the function returns. +The caller is notified of the metadata via the `onMeta` callback. All metadata blocks will be handled before the function returns. This callback takes a +pointer to a `drflac_metadata` object which is a union containing the data of all relevant metadata blocks. Use the `type` member to discriminate against +the different metadata types. The STREAMINFO block must be present for this to succeed. Use `drflac_open_with_metadata_relaxed()` to open a FLAC stream where the header may not be present. @@ -1330,6 +1340,9 @@ DRFLAC_API drflac_bool32 drflac_next_cuesheet_track(drflac_cuesheet_track_iterat #ifndef _BSD_SOURCE #define _BSD_SOURCE #endif + #ifndef _DEFAULT_SOURCE + #define _DEFAULT_SOURCE + #endif #ifndef __USE_BSD #define __USE_BSD #endif @@ -1354,6 +1367,8 @@ DRFLAC_API drflac_bool32 drflac_next_cuesheet_track(drflac_cuesheet_track_iterat #else #define DRFLAC_INLINE inline __attribute__((always_inline)) #endif +#elif defined(__WATCOMC__) + #define DRFLAC_INLINE __inline #else #define DRFLAC_INLINE #endif @@ -1363,7 +1378,7 @@ DRFLAC_API drflac_bool32 drflac_next_cuesheet_track(drflac_cuesheet_track_iterat #define DRFLAC_X64 #elif defined(__i386) || defined(_M_IX86) #define DRFLAC_X86 -#elif defined(__arm__) || defined(_M_ARM) +#elif defined(__arm__) || defined(_M_ARM) || defined(_M_ARM64) #define DRFLAC_ARM #endif @@ -1562,6 +1577,27 @@ static DRFLAC_INLINE drflac_bool32 drflac_has_sse41(void) #if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) #define DRFLAC_HAS_BYTESWAP16_INTRINSIC #endif +#elif defined(__WATCOMC__) && defined(__386__) + #define DRFLAC_HAS_BYTESWAP16_INTRINSIC + #define DRFLAC_HAS_BYTESWAP32_INTRINSIC + #define DRFLAC_HAS_BYTESWAP64_INTRINSIC + extern __inline drflac_uint16 _watcom_bswap16(drflac_uint16); + extern __inline drflac_uint32 _watcom_bswap32(drflac_uint32); + extern __inline drflac_uint64 _watcom_bswap64(drflac_uint64); +#pragma aux _watcom_bswap16 = \ + "xchg al, ah" \ + parm [ax] \ + modify [ax]; +#pragma aux _watcom_bswap32 = \ + "bswap eax" \ + parm [eax] \ + modify [eax]; +#pragma aux _watcom_bswap64 = \ + "bswap eax" \ + "bswap edx" \ + "xchg eax,edx" \ + parm [eax edx] \ + modify [eax edx]; #endif @@ -1785,6 +1821,8 @@ static DRFLAC_INLINE drflac_uint16 drflac__swap_endian_uint16(drflac_uint16 n) return _byteswap_ushort(n); #elif defined(__GNUC__) || defined(__clang__) return __builtin_bswap16(n); + #elif defined(__WATCOMC__) && defined(__386__) + return _watcom_bswap16(n); #else #error "This compiler does not support the byte swap intrinsic." #endif @@ -1814,6 +1852,8 @@ static DRFLAC_INLINE drflac_uint32 drflac__swap_endian_uint32(drflac_uint32 n) #else return __builtin_bswap32(n); #endif + #elif defined(__WATCOMC__) && defined(__386__) + return _watcom_bswap32(n); #else #error "This compiler does not support the byte swap intrinsic." #endif @@ -1832,6 +1872,8 @@ static DRFLAC_INLINE drflac_uint64 drflac__swap_endian_uint64(drflac_uint64 n) return _byteswap_uint64(n); #elif defined(__GNUC__) || defined(__clang__) return __builtin_bswap64(n); + #elif defined(__WATCOMC__) && defined(__386__) + return _watcom_bswap64(n); #else #error "This compiler does not support the byte swap intrinsic." #endif @@ -2639,6 +2681,9 @@ static drflac_bool32 drflac__find_and_seek_to_next_sync_code(drflac_bs* bs) #if defined(_MSC_VER) && _MSC_VER >= 1400 && (defined(DRFLAC_X64) || defined(DRFLAC_X86)) && !defined(__clang__) #define DRFLAC_IMPLEMENT_CLZ_MSVC #endif +#if defined(__WATCOMC__) && defined(__386__) +#define DRFLAC_IMPLEMENT_CLZ_WATCOM +#endif static DRFLAC_INLINE drflac_uint32 drflac__clz_software(drflac_cache_t x) { @@ -2786,6 +2831,16 @@ static DRFLAC_INLINE drflac_uint32 drflac__clz_msvc(drflac_cache_t x) } #endif +#ifdef DRFLAC_IMPLEMENT_CLZ_WATCOM +static __inline drflac_uint32 drflac__clz_watcom (drflac_uint32); +#pragma aux drflac__clz_watcom = \ + "bsr eax, eax" \ + "xor eax, 31" \ + parm [eax] nomemory \ + value [eax] \ + modify exact [eax] nomemory; +#endif + static DRFLAC_INLINE drflac_uint32 drflac__clz(drflac_cache_t x) { #ifdef DRFLAC_IMPLEMENT_CLZ_LZCNT @@ -2796,6 +2851,8 @@ static DRFLAC_INLINE drflac_uint32 drflac__clz(drflac_cache_t x) { #ifdef DRFLAC_IMPLEMENT_CLZ_MSVC return drflac__clz_msvc(x); +#elif defined(DRFLAC_IMPLEMENT_CLZ_WATCOM) + return (x == 0) ? sizeof(x)*8 : drflac__clz_watcom(x); #else return drflac__clz_software(x); #endif @@ -3179,7 +3236,6 @@ static drflac_bool32 drflac__decode_samples_with_residual__rice__reference(drfla drflac_uint32 i; DRFLAC_ASSERT(bs != NULL); - DRFLAC_ASSERT(count > 0); DRFLAC_ASSERT(pSamplesOut != NULL); for (i = 0; i < count; ++i) { @@ -3561,7 +3617,6 @@ static drflac_bool32 drflac__decode_samples_with_residual__rice__scalar_zeroorde drflac_uint32 i; DRFLAC_ASSERT(bs != NULL); - DRFLAC_ASSERT(count > 0); DRFLAC_ASSERT(pSamplesOut != NULL); (void)bitsPerSample; @@ -3607,7 +3662,6 @@ static drflac_bool32 drflac__decode_samples_with_residual__rice__scalar(drflac_b drflac_uint32 i; DRFLAC_ASSERT(bs != NULL); - DRFLAC_ASSERT(count > 0); DRFLAC_ASSERT(pSamplesOut != NULL); if (order == 0) { @@ -4161,7 +4215,6 @@ static drflac_bool32 drflac__decode_samples_with_residual__rice__sse41_64(drflac static drflac_bool32 drflac__decode_samples_with_residual__rice__sse41(drflac_bs* bs, drflac_uint32 bitsPerSample, drflac_uint32 count, drflac_uint8 riceParam, drflac_uint32 order, drflac_int32 shift, const drflac_int32* coefficients, drflac_int32* pSamplesOut) { DRFLAC_ASSERT(bs != NULL); - DRFLAC_ASSERT(count > 0); DRFLAC_ASSERT(pSamplesOut != NULL); /* In my testing the order is rarely > 12, so in this case I'm going to simplify the SSE implementation by only handling order <= 12. */ @@ -4660,7 +4713,6 @@ static drflac_bool32 drflac__decode_samples_with_residual__rice__neon_64(drflac_ static drflac_bool32 drflac__decode_samples_with_residual__rice__neon(drflac_bs* bs, drflac_uint32 bitsPerSample, drflac_uint32 count, drflac_uint8 riceParam, drflac_uint32 order, drflac_int32 shift, const drflac_int32* coefficients, drflac_int32* pSamplesOut) { DRFLAC_ASSERT(bs != NULL); - DRFLAC_ASSERT(count > 0); DRFLAC_ASSERT(pSamplesOut != NULL); /* In my testing the order is rarely > 12, so in this case I'm going to simplify the NEON implementation by only handling order <= 12. */ @@ -4703,7 +4755,6 @@ static drflac_bool32 drflac__read_and_seek_residual__rice(drflac_bs* bs, drflac_ drflac_uint32 i; DRFLAC_ASSERT(bs != NULL); - DRFLAC_ASSERT(count > 0); for (i = 0; i < count; ++i) { if (!drflac__seek_rice_parts(bs, riceParam)) { @@ -4719,7 +4770,6 @@ static drflac_bool32 drflac__decode_samples_with_residual__unencoded(drflac_bs* drflac_uint32 i; DRFLAC_ASSERT(bs != NULL); - DRFLAC_ASSERT(count > 0); DRFLAC_ASSERT(unencodedBitsPerSample <= 31); /* <-- unencodedBitsPerSample is a 5 bit number, so cannot exceed 31. */ DRFLAC_ASSERT(pSamplesOut != NULL); @@ -4783,7 +4833,7 @@ static drflac_bool32 drflac__decode_samples_with_residual(drflac_bs* bs, drflac_ } /* Validation check. */ - if ((blockSize / (1 << partitionOrder)) <= order) { + if ((blockSize / (1 << partitionOrder)) < order) { return DRFLAC_FALSE; } @@ -5155,7 +5205,8 @@ static drflac_bool32 drflac__read_next_flac_frame_header(drflac_bs* bs, drflac_u DRFLAC_ASSERT(blockSize > 0); if (blockSize == 1) { header->blockSizeInPCMFrames = 192; - } else if (blockSize >= 2 && blockSize <= 5) { + } else if (blockSize <= 5) { + DRFLAC_ASSERT(blockSize >= 2); header->blockSizeInPCMFrames = 576 * (1 << (blockSize - 2)); } else if (blockSize == 6) { if (!drflac__read_uint16(bs, 8, &header->blockSizeInPCMFrames)) { @@ -8309,7 +8360,7 @@ static drflac_result drflac_result_from_errno(int e) static drflac_result drflac_fopen(FILE** ppFile, const char* pFilePath, const char* pOpenMode) { -#if _MSC_VER && _MSC_VER >= 1400 +#if defined(_MSC_VER) && _MSC_VER >= 1400 errno_t err; #endif @@ -8321,7 +8372,7 @@ static drflac_result drflac_fopen(FILE** ppFile, const char* pFilePath, const ch return DRFLAC_INVALID_ARGS; } -#if _MSC_VER && _MSC_VER >= 1400 +#if defined(_MSC_VER) && _MSC_VER >= 1400 err = fopen_s(ppFile, pFilePath, pOpenMode); if (err != 0) { return drflac_result_from_errno(err); @@ -8356,12 +8407,13 @@ _wfopen() isn't always available in all compilation environments. * MSVC seems to support it universally as far back as VC6 from what I can tell (haven't checked further back). * MinGW-64 (both 32- and 64-bit) seems to support it. * MinGW wraps it in !defined(__STRICT_ANSI__). + * OpenWatcom wraps it in !defined(_NO_EXT_KEYS). This can be reviewed as compatibility issues arise. The preference is to use _wfopen_s() and _wfopen() as opposed to the wcsrtombs() fallback, so if you notice your compiler not detecting this properly I'm happy to look at adding support. */ #if defined(_WIN32) - #if defined(_MSC_VER) || defined(__MINGW64__) || !defined(__STRICT_ANSI__) + #if defined(_MSC_VER) || defined(__MINGW64__) || (!defined(__STRICT_ANSI__) && !defined(_NO_EXT_KEYS)) #define DRFLAC_HAS_WFOPEN #endif #endif @@ -11331,6 +11383,7 @@ DRFLAC_API drflac_bool32 drflac_seek_to_pcm_frame(drflac* pFlac, drflac_uint64 p return drflac__seek_to_first_frame(pFlac); } else { drflac_bool32 wasSuccessful = DRFLAC_FALSE; + drflac_uint64 originalPCMFrame = pFlac->currentPCMFrame; /* Clamp the sample to the end. */ if (pcmFrameIndex > pFlac->totalPCMFrameCount) { @@ -11388,7 +11441,16 @@ DRFLAC_API drflac_bool32 drflac_seek_to_pcm_frame(drflac* pFlac, drflac_uint64 p } } - pFlac->currentPCMFrame = pcmFrameIndex; + if (wasSuccessful) { + pFlac->currentPCMFrame = pcmFrameIndex; + } else { + /* Seek failed. Try putting the decoder back to it's original state. */ + if (drflac_seek_to_pcm_frame(pFlac, originalPCMFrame) == DRFLAC_FALSE) { + /* Failed to seek back to the original PCM frame. Fall back to 0. */ + drflac_seek_to_pcm_frame(pFlac, 0); + } + } + return wasSuccessful; } } @@ -11789,6 +11851,28 @@ DRFLAC_API drflac_bool32 drflac_next_cuesheet_track(drflac_cuesheet_track_iterat /* REVISION HISTORY ================ +v0.12.29 - 2021-04-02 + - Fix a bug where the running PCM frame index is set to an invalid value when over-seeking. + - Fix a decoding error due to an incorrect validation check. + +v0.12.28 - 2021-02-21 + - Fix a warning due to referencing _MSC_VER when it is undefined. + +v0.12.27 - 2021-01-31 + - Fix a static analysis warning. + +v0.12.26 - 2021-01-17 + - Fix a compilation warning due to _BSD_SOURCE being deprecated. + +v0.12.25 - 2020-12-26 + - Update documentation. + +v0.12.24 - 2020-11-29 + - Fix ARM64/NEON detection when compiling with MSVC. + +v0.12.23 - 2020-11-21 + - Fix compilation with OpenWatcom. + v0.12.22 - 2020-11-01 - Fix an error with the previous release. diff --git a/src/external/dr_mp3.h b/src/external/dr_mp3.h index 57311649c..e28f318bc 100644 --- a/src/external/dr_mp3.h +++ b/src/external/dr_mp3.h @@ -1,6 +1,6 @@ /* MP3 audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file. -dr_mp3 - v0.6.19 - 2020-11-13 +dr_mp3 - v0.6.27 - 2021-02-21 David Reid - mackron@gmail.com @@ -95,7 +95,7 @@ extern "C" { #define DRMP3_VERSION_MAJOR 0 #define DRMP3_VERSION_MINOR 6 -#define DRMP3_VERSION_REVISION 19 +#define DRMP3_VERSION_REVISION 27 #define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION) #include /* For size_t. */ @@ -239,6 +239,8 @@ typedef drmp3_int32 drmp3_result; #else #define DRMP3_INLINE inline __attribute__((always_inline)) #endif +#elif defined(__WATCOMC__) + #define DRMP3_INLINE __inline #else #define DRMP3_INLINE #endif @@ -279,14 +281,6 @@ DRMP3_API void drmp3dec_f32_to_s16(const float *in, drmp3_int16 *out, size_t num Main API (Pull API) =================== */ -#ifndef DRMP3_DEFAULT_CHANNELS -#define DRMP3_DEFAULT_CHANNELS 2 -#endif -#ifndef DRMP3_DEFAULT_SAMPLE_RATE -#define DRMP3_DEFAULT_SAMPLE_RATE 44100 -#endif - - typedef enum { drmp3_seek_origin_start, @@ -596,7 +590,7 @@ DRMP3_API const char* drmp3_version_string(void) #if !defined(DR_MP3_NO_SIMD) -#if !defined(DR_MP3_ONLY_SIMD) && (defined(_M_X64) || defined(_M_ARM64) || defined(__x86_64__) || defined(__aarch64__)) +#if !defined(DR_MP3_ONLY_SIMD) && (defined(_M_X64) || defined(__x86_64__) || defined(__aarch64__) || defined(_M_ARM64)) /* x64 always have SSE2, arm64 always have neon, no need for generic code */ #define DR_MP3_ONLY_SIMD #endif @@ -672,7 +666,7 @@ end: return g_have_simd - 1; #endif } -#elif defined(__ARM_NEON) || defined(__aarch64__) +#elif defined(__ARM_NEON) || defined(__aarch64__) || defined(_M_ARM64) #include #define DRMP3_HAVE_SSE 0 #define DRMP3_HAVE_SIMD 1 @@ -705,7 +699,7 @@ static int drmp3_have_simd(void) #endif -#if defined(__ARM_ARCH) && (__ARM_ARCH >= 6) && !defined(__aarch64__) +#if defined(__ARM_ARCH) && (__ARM_ARCH >= 6) && !defined(__aarch64__) && !defined(_M_ARM64) #define DRMP3_HAVE_ARMV6 1 static __inline__ __attribute__((always_inline)) drmp3_int32 drmp3_clip_int16_arm(int32_t a) { @@ -1868,7 +1862,7 @@ static void drmp3d_DCT_II(float *grbuf, int n) } else #endif #ifdef DR_MP3_ONLY_SIMD - {} + {} /* for HAVE_SIMD=1, MINIMP3_ONLY_SIMD=1 case we do not need non-intrinsic "else" branch */ #else for (; k < n; k++) { @@ -2101,7 +2095,7 @@ static void drmp3d_synth(float *xl, drmp3d_sample_t *dstl, int nch, float *lins) } else #endif #ifdef DR_MP3_ONLY_SIMD - {} + {} /* for HAVE_SIMD=1, MINIMP3_ONLY_SIMD=1 case we do not need non-intrinsic "else" branch */ #else for (i = 14; i >= 0; i--) { @@ -2829,7 +2823,7 @@ static drmp3_bool32 drmp3_init_internal(drmp3* pMP3, drmp3_read_proc onRead, drm /* Decode the first frame to confirm that it is indeed a valid MP3 stream. */ if (!drmp3_decode_next_frame(pMP3)) { - drmp3_uninit(pMP3); + drmp3__free_from_callbacks(pMP3->pData, &pMP3->allocationCallbacks); /* The call above may have allocated memory. Need to make sure it's freed before aborting. */ return DRMP3_FALSE; /* Not a valid MP3 stream. */ } @@ -3331,7 +3325,7 @@ static drmp3_result drmp3_result_from_errno(int e) static drmp3_result drmp3_fopen(FILE** ppFile, const char* pFilePath, const char* pOpenMode) { -#if _MSC_VER && _MSC_VER >= 1400 +#if defined(_MSC_VER) && _MSC_VER >= 1400 errno_t err; #endif @@ -3343,7 +3337,7 @@ static drmp3_result drmp3_fopen(FILE** ppFile, const char* pFilePath, const char return DRMP3_INVALID_ARGS; } -#if _MSC_VER && _MSC_VER >= 1400 +#if defined(_MSC_VER) && _MSC_VER >= 1400 err = fopen_s(ppFile, pFilePath, pOpenMode); if (err != 0) { return drmp3_result_from_errno(err); @@ -3378,12 +3372,13 @@ _wfopen() isn't always available in all compilation environments. * MSVC seems to support it universally as far back as VC6 from what I can tell (haven't checked further back). * MinGW-64 (both 32- and 64-bit) seems to support it. * MinGW wraps it in !defined(__STRICT_ANSI__). + * OpenWatcom wraps it in !defined(_NO_EXT_KEYS). This can be reviewed as compatibility issues arise. The preference is to use _wfopen_s() and _wfopen() as opposed to the wcsrtombs() fallback, so if you notice your compiler not detecting this properly I'm happy to look at adding support. */ #if defined(_WIN32) - #if defined(_MSC_VER) || defined(__MINGW64__) || !defined(__STRICT_ANSI__) + #if defined(_MSC_VER) || defined(__MINGW64__) || (!defined(__STRICT_ANSI__) && !defined(_NO_EXT_KEYS)) #define DRMP3_HAS_WFOPEN #endif #endif @@ -3484,22 +3479,38 @@ static drmp3_bool32 drmp3__on_seek_stdio(void* pUserData, int offset, drmp3_seek DRMP3_API drmp3_bool32 drmp3_init_file(drmp3* pMP3, const char* pFilePath, const drmp3_allocation_callbacks* pAllocationCallbacks) { + drmp3_bool32 result; FILE* pFile; + if (drmp3_fopen(&pFile, pFilePath, "rb") != DRMP3_SUCCESS) { return DRMP3_FALSE; } - return drmp3_init(pMP3, drmp3__on_read_stdio, drmp3__on_seek_stdio, (void*)pFile, pAllocationCallbacks); + result = drmp3_init(pMP3, drmp3__on_read_stdio, drmp3__on_seek_stdio, (void*)pFile, pAllocationCallbacks); + if (result != DRMP3_TRUE) { + fclose(pFile); + return result; + } + + return DRMP3_TRUE; } DRMP3_API drmp3_bool32 drmp3_init_file_w(drmp3* pMP3, const wchar_t* pFilePath, const drmp3_allocation_callbacks* pAllocationCallbacks) { + drmp3_bool32 result; FILE* pFile; + if (drmp3_wfopen(&pFile, pFilePath, L"rb", pAllocationCallbacks) != DRMP3_SUCCESS) { return DRMP3_FALSE; } - return drmp3_init(pMP3, drmp3__on_read_stdio, drmp3__on_seek_stdio, (void*)pFile, pAllocationCallbacks); + result = drmp3_init(pMP3, drmp3__on_read_stdio, drmp3__on_seek_stdio, (void*)pFile, pAllocationCallbacks); + if (result != DRMP3_TRUE) { + fclose(pFile); + return result; + } + + return DRMP3_TRUE; } #endif @@ -3511,7 +3522,11 @@ DRMP3_API void drmp3_uninit(drmp3* pMP3) #ifndef DR_MP3_NO_STDIO if (pMP3->onRead == drmp3__on_read_stdio) { - fclose((FILE*)pMP3->pUserData); + FILE* pFile = (FILE*)pMP3->pUserData; + if (pFile != NULL) { + fclose(pFile); + pMP3->pUserData = NULL; /* Make sure the file handle is cleared to NULL to we don't attempt to close it a second time. */ + } } #endif @@ -4435,6 +4450,30 @@ counts rather than sample counts. /* REVISION HISTORY ================ +v0.6.27 - 2021-02-21 + - Fix a warning due to referencing _MSC_VER when it is undefined. + +v0.6.26 - 2021-01-31 + - Bring up to date with minimp3. + +v0.6.25 - 2020-12-26 + - Remove DRMP3_DEFAULT_CHANNELS and DRMP3_DEFAULT_SAMPLE_RATE which are leftovers from some removed APIs. + +v0.6.24 - 2020-12-07 + - Fix a typo in version date for 0.6.23. + +v0.6.23 - 2020-12-03 + - Fix an error where a file can be closed twice when initialization of the decoder fails. + +v0.6.22 - 2020-12-02 + - Fix an error where it's possible for a file handle to be left open when initialization of the decoder fails. + +v0.6.21 - 2020-11-28 + - Bring up to date with minimp3. + +v0.6.20 - 2020-11-21 + - Fix compilation with OpenWatcom. + v0.6.19 - 2020-11-13 - Minor code clean up. diff --git a/src/external/dr_wav.h b/src/external/dr_wav.h index 0156fa9a1..be1438bde 100644 --- a/src/external/dr_wav.h +++ b/src/external/dr_wav.h @@ -1,6 +1,6 @@ /* WAV audio loader and writer. Choice of public domain or MIT-0. See license statements at the end of this file. -dr_wav - v0.12.14 - 2020-11-13 +dr_wav - v0.12.19 - 2021-02-21 David Reid - mackron@gmail.com @@ -65,7 +65,7 @@ If you just want to quickly open and read the audio data in a single operation y ... - drwav_free(pSampleData); + drwav_free(pSampleData, NULL); ``` The examples above use versions of the API that convert the audio data to a consistent format (32-bit signed PCM, in this case), but you can still output the @@ -144,7 +144,7 @@ extern "C" { #define DRWAV_VERSION_MAJOR 0 #define DRWAV_VERSION_MINOR 12 -#define DRWAV_VERSION_REVISION 14 +#define DRWAV_VERSION_REVISION 19 #define DRWAV_VERSION_STRING DRWAV_XSTRINGIFY(DRWAV_VERSION_MAJOR) "." DRWAV_XSTRINGIFY(DRWAV_VERSION_MINOR) "." DRWAV_XSTRINGIFY(DRWAV_VERSION_REVISION) #include /* For size_t. */ @@ -535,7 +535,7 @@ typedef struct /* The size in bytes of the data chunk. */ drwav_uint64 dataChunkDataSize; - /* The position in the stream of the first byte of the data chunk. This is used for seeking. */ + /* The position in the stream of the first data byte of the data chunk. This is used for seeking. */ drwav_uint64 dataChunkDataPos; /* The number of bytes remaining in the data chunk. */ @@ -1021,6 +1021,8 @@ DRWAV_API drwav_bool32 drwav_fourcc_equal(const drwav_uint8* a, const char* b); #else #define DRWAV_INLINE inline __attribute__((always_inline)) #endif +#elif defined(__WATCOMC__) + #define DRWAV_INLINE __inline #else #define DRWAV_INLINE #endif @@ -1097,34 +1099,12 @@ you doing?! (Let me know, I'd be curious!) Second, you can adjust these by #defi static const drwav_uint8 drwavGUID_W64_RIFF[16] = {0x72,0x69,0x66,0x66, 0x2E,0x91, 0xCF,0x11, 0xA5,0xD6, 0x28,0xDB,0x04,0xC1,0x00,0x00}; /* 66666972-912E-11CF-A5D6-28DB04C10000 */ static const drwav_uint8 drwavGUID_W64_WAVE[16] = {0x77,0x61,0x76,0x65, 0xF3,0xAC, 0xD3,0x11, 0x8C,0xD1, 0x00,0xC0,0x4F,0x8E,0xDB,0x8A}; /* 65766177-ACF3-11D3-8CD1-00C04F8EDB8A */ -static const drwav_uint8 drwavGUID_W64_JUNK[16] = {0x6A,0x75,0x6E,0x6B, 0xF3,0xAC, 0xD3,0x11, 0x8C,0xD1, 0x00,0xC0,0x4F,0x8E,0xDB,0x8A}; /* 6B6E756A-ACF3-11D3-8CD1-00C04F8EDB8A */ +/*static const drwav_uint8 drwavGUID_W64_JUNK[16] = {0x6A,0x75,0x6E,0x6B, 0xF3,0xAC, 0xD3,0x11, 0x8C,0xD1, 0x00,0xC0,0x4F,0x8E,0xDB,0x8A};*/ /* 6B6E756A-ACF3-11D3-8CD1-00C04F8EDB8A */ static const drwav_uint8 drwavGUID_W64_FMT [16] = {0x66,0x6D,0x74,0x20, 0xF3,0xAC, 0xD3,0x11, 0x8C,0xD1, 0x00,0xC0,0x4F,0x8E,0xDB,0x8A}; /* 20746D66-ACF3-11D3-8CD1-00C04F8EDB8A */ static const drwav_uint8 drwavGUID_W64_FACT[16] = {0x66,0x61,0x63,0x74, 0xF3,0xAC, 0xD3,0x11, 0x8C,0xD1, 0x00,0xC0,0x4F,0x8E,0xDB,0x8A}; /* 74636166-ACF3-11D3-8CD1-00C04F8EDB8A */ static const drwav_uint8 drwavGUID_W64_DATA[16] = {0x64,0x61,0x74,0x61, 0xF3,0xAC, 0xD3,0x11, 0x8C,0xD1, 0x00,0xC0,0x4F,0x8E,0xDB,0x8A}; /* 61746164-ACF3-11D3-8CD1-00C04F8EDB8A */ static const drwav_uint8 drwavGUID_W64_SMPL[16] = {0x73,0x6D,0x70,0x6C, 0xF3,0xAC, 0xD3,0x11, 0x8C,0xD1, 0x00,0xC0,0x4F,0x8E,0xDB,0x8A}; /* 6C706D73-ACF3-11D3-8CD1-00C04F8EDB8A */ -static DRWAV_INLINE drwav_bool32 drwav__guid_equal(const drwav_uint8 a[16], const drwav_uint8 b[16]) -{ - int i; - for (i = 0; i < 16; i += 1) { - if (a[i] != b[i]) { - return DRWAV_FALSE; - } - } - - return DRWAV_TRUE; -} - -static DRWAV_INLINE drwav_bool32 drwav__fourcc_equal(const drwav_uint8* a, const char* b) -{ - return - a[0] == b[0] && - a[1] == b[1] && - a[2] == b[2] && - a[3] == b[3]; -} - - static DRWAV_INLINE int drwav__is_little_endian(void) { @@ -1138,37 +1118,6 @@ static DRWAV_INLINE int drwav__is_little_endian(void) #endif } -static DRWAV_INLINE drwav_uint16 drwav__bytes_to_u16(const drwav_uint8* data) -{ - return (data[0] << 0) | (data[1] << 8); -} - -static DRWAV_INLINE drwav_int16 drwav__bytes_to_s16(const drwav_uint8* data) -{ - return (short)drwav__bytes_to_u16(data); -} - -static DRWAV_INLINE drwav_uint32 drwav__bytes_to_u32(const drwav_uint8* data) -{ - return (data[0] << 0) | (data[1] << 8) | (data[2] << 16) | (data[3] << 24); -} - -static DRWAV_INLINE drwav_int32 drwav__bytes_to_s32(const drwav_uint8* data) -{ - return (drwav_int32)drwav__bytes_to_u32(data); -} - -static DRWAV_INLINE drwav_uint64 drwav__bytes_to_u64(const drwav_uint8* data) -{ - return - ((drwav_uint64)data[0] << 0) | ((drwav_uint64)data[1] << 8) | ((drwav_uint64)data[2] << 16) | ((drwav_uint64)data[3] << 24) | - ((drwav_uint64)data[4] << 32) | ((drwav_uint64)data[5] << 40) | ((drwav_uint64)data[6] << 48) | ((drwav_uint64)data[7] << 56); -} - -static DRWAV_INLINE drwav_int64 drwav__bytes_to_s64(const drwav_uint8* data) -{ - return (drwav_int64)drwav__bytes_to_u64(data); -} static DRWAV_INLINE void drwav__bytes_to_guid(const drwav_uint8* data, drwav_uint8* guid) { @@ -1420,26 +1369,26 @@ static DRWAV_INLINE void drwav__bswap_samples(void* pSamples, drwav_uint64 sampl } -static void* drwav__malloc_default(size_t sz, void* pUserData) +DRWAV_PRIVATE void* drwav__malloc_default(size_t sz, void* pUserData) { (void)pUserData; return DRWAV_MALLOC(sz); } -static void* drwav__realloc_default(void* p, size_t sz, void* pUserData) +DRWAV_PRIVATE void* drwav__realloc_default(void* p, size_t sz, void* pUserData) { (void)pUserData; return DRWAV_REALLOC(p, sz); } -static void drwav__free_default(void* p, void* pUserData) +DRWAV_PRIVATE void drwav__free_default(void* p, void* pUserData) { (void)pUserData; DRWAV_FREE(p); } -static void* drwav__malloc_from_callbacks(size_t sz, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE void* drwav__malloc_from_callbacks(size_t sz, const drwav_allocation_callbacks* pAllocationCallbacks) { if (pAllocationCallbacks == NULL) { return NULL; @@ -1457,7 +1406,7 @@ static void* drwav__malloc_from_callbacks(size_t sz, const drwav_allocation_call return NULL; } -static void* drwav__realloc_from_callbacks(void* p, size_t szNew, size_t szOld, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE void* drwav__realloc_from_callbacks(void* p, size_t szNew, size_t szOld, const drwav_allocation_callbacks* pAllocationCallbacks) { if (pAllocationCallbacks == NULL) { return NULL; @@ -1487,7 +1436,7 @@ static void* drwav__realloc_from_callbacks(void* p, size_t szNew, size_t szOld, return NULL; } -static void drwav__free_from_callbacks(void* p, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE void drwav__free_from_callbacks(void* p, const drwav_allocation_callbacks* pAllocationCallbacks) { if (p == NULL || pAllocationCallbacks == NULL) { return; @@ -1499,7 +1448,7 @@ static void drwav__free_from_callbacks(void* p, const drwav_allocation_callbacks } -static drwav_allocation_callbacks drwav_copy_allocation_callbacks_or_defaults(const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_allocation_callbacks drwav_copy_allocation_callbacks_or_defaults(const drwav_allocation_callbacks* pAllocationCallbacks) { if (pAllocationCallbacks != NULL) { /* Copy. */ @@ -1523,21 +1472,21 @@ static DRWAV_INLINE drwav_bool32 drwav__is_compressed_format_tag(drwav_uint16 fo formatTag == DR_WAVE_FORMAT_DVI_ADPCM; } -static unsigned int drwav__chunk_padding_size_riff(drwav_uint64 chunkSize) +DRWAV_PRIVATE unsigned int drwav__chunk_padding_size_riff(drwav_uint64 chunkSize) { return (unsigned int)(chunkSize % 2); } -static unsigned int drwav__chunk_padding_size_w64(drwav_uint64 chunkSize) +DRWAV_PRIVATE unsigned int drwav__chunk_padding_size_w64(drwav_uint64 chunkSize) { return (unsigned int)(chunkSize % 8); } -static drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 samplesToRead, drwav_int16* pBufferOut); -static drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 samplesToRead, drwav_int16* pBufferOut); -static drwav_bool32 drwav_init_write__internal(drwav* pWav, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount); +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 samplesToRead, drwav_int16* pBufferOut); +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 samplesToRead, drwav_int16* pBufferOut); +DRWAV_PRIVATE drwav_bool32 drwav_init_write__internal(drwav* pWav, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount); -static drwav_result drwav__read_chunk_header(drwav_read_proc onRead, void* pUserData, drwav_container container, drwav_uint64* pRunningBytesReadOut, drwav_chunk_header* pHeaderOut) +DRWAV_PRIVATE drwav_result drwav__read_chunk_header(drwav_read_proc onRead, void* pUserData, drwav_container container, drwav_uint64* pRunningBytesReadOut, drwav_chunk_header* pHeaderOut) { if (container == drwav_container_riff || container == drwav_container_rf64) { drwav_uint8 sizeInBytes[4]; @@ -1550,7 +1499,7 @@ static drwav_result drwav__read_chunk_header(drwav_read_proc onRead, void* pUser return DRWAV_INVALID_FILE; } - pHeaderOut->sizeInBytes = drwav__bytes_to_u32(sizeInBytes); + pHeaderOut->sizeInBytes = drwav_bytes_to_u32(sizeInBytes); pHeaderOut->paddingSize = drwav__chunk_padding_size_riff(pHeaderOut->sizeInBytes); *pRunningBytesReadOut += 8; } else { @@ -1564,7 +1513,7 @@ static drwav_result drwav__read_chunk_header(drwav_read_proc onRead, void* pUser return DRWAV_INVALID_FILE; } - pHeaderOut->sizeInBytes = drwav__bytes_to_u64(sizeInBytes) - 24; /* <-- Subtract 24 because w64 includes the size of the header. */ + pHeaderOut->sizeInBytes = drwav_bytes_to_u64(sizeInBytes) - 24; /* <-- Subtract 24 because w64 includes the size of the header. */ pHeaderOut->paddingSize = drwav__chunk_padding_size_w64(pHeaderOut->sizeInBytes); *pRunningBytesReadOut += 24; } @@ -1572,7 +1521,7 @@ static drwav_result drwav__read_chunk_header(drwav_read_proc onRead, void* pUser return DRWAV_SUCCESS; } -static drwav_bool32 drwav__seek_forward(drwav_seek_proc onSeek, drwav_uint64 offset, void* pUserData) +DRWAV_PRIVATE drwav_bool32 drwav__seek_forward(drwav_seek_proc onSeek, drwav_uint64 offset, void* pUserData) { drwav_uint64 bytesRemainingToSeek = offset; while (bytesRemainingToSeek > 0) { @@ -1592,7 +1541,7 @@ static drwav_bool32 drwav__seek_forward(drwav_seek_proc onSeek, drwav_uint64 off return DRWAV_TRUE; } -static drwav_bool32 drwav__seek_from_start(drwav_seek_proc onSeek, drwav_uint64 offset, void* pUserData) +DRWAV_PRIVATE drwav_bool32 drwav__seek_from_start(drwav_seek_proc onSeek, drwav_uint64 offset, void* pUserData) { if (offset <= 0x7FFFFFFF) { return onSeek(pUserData, (int)offset, drwav_seek_origin_start); @@ -1620,7 +1569,7 @@ static drwav_bool32 drwav__seek_from_start(drwav_seek_proc onSeek, drwav_uint64 } -static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSeek, void* pUserData, drwav_container container, drwav_uint64* pRunningBytesReadOut, drwav_fmt* fmtOut) +DRWAV_PRIVATE drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSeek, void* pUserData, drwav_container container, drwav_uint64* pRunningBytesReadOut, drwav_fmt* fmtOut) { drwav_chunk_header header; drwav_uint8 fmt[16]; @@ -1631,7 +1580,7 @@ static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSe /* Skip non-fmt chunks. */ - while (((container == drwav_container_riff || container == drwav_container_rf64) && !drwav__fourcc_equal(header.id.fourcc, "fmt ")) || (container == drwav_container_w64 && !drwav__guid_equal(header.id.guid, drwavGUID_W64_FMT))) { + while (((container == drwav_container_riff || container == drwav_container_rf64) && !drwav_fourcc_equal(header.id.fourcc, "fmt ")) || (container == drwav_container_w64 && !drwav_guid_equal(header.id.guid, drwavGUID_W64_FMT))) { if (!drwav__seek_forward(onSeek, header.sizeInBytes + header.paddingSize, pUserData)) { return DRWAV_FALSE; } @@ -1646,11 +1595,11 @@ static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSe /* Validation. */ if (container == drwav_container_riff || container == drwav_container_rf64) { - if (!drwav__fourcc_equal(header.id.fourcc, "fmt ")) { + if (!drwav_fourcc_equal(header.id.fourcc, "fmt ")) { return DRWAV_FALSE; } } else { - if (!drwav__guid_equal(header.id.guid, drwavGUID_W64_FMT)) { + if (!drwav_guid_equal(header.id.guid, drwavGUID_W64_FMT)) { return DRWAV_FALSE; } } @@ -1661,12 +1610,12 @@ static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSe } *pRunningBytesReadOut += sizeof(fmt); - fmtOut->formatTag = drwav__bytes_to_u16(fmt + 0); - fmtOut->channels = drwav__bytes_to_u16(fmt + 2); - fmtOut->sampleRate = drwav__bytes_to_u32(fmt + 4); - fmtOut->avgBytesPerSec = drwav__bytes_to_u32(fmt + 8); - fmtOut->blockAlign = drwav__bytes_to_u16(fmt + 12); - fmtOut->bitsPerSample = drwav__bytes_to_u16(fmt + 14); + fmtOut->formatTag = drwav_bytes_to_u16(fmt + 0); + fmtOut->channels = drwav_bytes_to_u16(fmt + 2); + fmtOut->sampleRate = drwav_bytes_to_u32(fmt + 4); + fmtOut->avgBytesPerSec = drwav_bytes_to_u32(fmt + 8); + fmtOut->blockAlign = drwav_bytes_to_u16(fmt + 12); + fmtOut->bitsPerSample = drwav_bytes_to_u16(fmt + 14); fmtOut->extendedSize = 0; fmtOut->validBitsPerSample = 0; @@ -1684,7 +1633,7 @@ static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSe bytesReadSoFar = 18; - fmtOut->extendedSize = drwav__bytes_to_u16(fmt_cbSize); + fmtOut->extendedSize = drwav_bytes_to_u16(fmt_cbSize); if (fmtOut->extendedSize > 0) { /* Simple validation. */ if (fmtOut->formatTag == DR_WAVE_FORMAT_EXTENSIBLE) { @@ -1699,8 +1648,8 @@ static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSe return DRWAV_FALSE; /* Expecting more data. */ } - fmtOut->validBitsPerSample = drwav__bytes_to_u16(fmtext + 0); - fmtOut->channelMask = drwav__bytes_to_u32(fmtext + 2); + fmtOut->validBitsPerSample = drwav_bytes_to_u16(fmtext + 0); + fmtOut->channelMask = drwav_bytes_to_u32(fmtext + 2); drwav__bytes_to_guid(fmtext + 6, fmtOut->subFormat); } else { if (!onSeek(pUserData, fmtOut->extendedSize, drwav_seek_origin_current)) { @@ -1730,7 +1679,7 @@ static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSe } -static size_t drwav__on_read(drwav_read_proc onRead, void* pUserData, void* pBufferOut, size_t bytesToRead, drwav_uint64* pCursor) +DRWAV_PRIVATE size_t drwav__on_read(drwav_read_proc onRead, void* pUserData, void* pBufferOut, size_t bytesToRead, drwav_uint64* pCursor) { size_t bytesRead; @@ -1743,7 +1692,7 @@ static size_t drwav__on_read(drwav_read_proc onRead, void* pUserData, void* pBuf } #if 0 -static drwav_bool32 drwav__on_seek(drwav_seek_proc onSeek, void* pUserData, int offset, drwav_seek_origin origin, drwav_uint64* pCursor) +DRWAV_PRIVATE drwav_bool32 drwav__on_seek(drwav_seek_proc onSeek, void* pUserData, int offset, drwav_seek_origin origin, drwav_uint64* pCursor) { DRWAV_ASSERT(onSeek != NULL); DRWAV_ASSERT(pCursor != NULL); @@ -1764,7 +1713,7 @@ static drwav_bool32 drwav__on_seek(drwav_seek_proc onSeek, void* pUserData, int -static drwav_uint32 drwav_get_bytes_per_pcm_frame(drwav* pWav) +DRWAV_PRIVATE drwav_uint32 drwav_get_bytes_per_pcm_frame(drwav* pWav) { /* The bytes per frame is a bit ambiguous. It can be either be based on the bits per sample, or the block align. The way I'm doing it here @@ -1787,11 +1736,11 @@ DRWAV_API drwav_uint16 drwav_fmt_get_format(const drwav_fmt* pFMT) if (pFMT->formatTag != DR_WAVE_FORMAT_EXTENSIBLE) { return pFMT->formatTag; } else { - return drwav__bytes_to_u16(pFMT->subFormat); /* Only the first two bytes are required. */ + return drwav_bytes_to_u16(pFMT->subFormat); /* Only the first two bytes are required. */ } } -static drwav_bool32 drwav_preinit(drwav* pWav, drwav_read_proc onRead, drwav_seek_proc onSeek, void* pReadSeekUserData, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_bool32 drwav_preinit(drwav* pWav, drwav_read_proc onRead, drwav_seek_proc onSeek, void* pReadSeekUserData, const drwav_allocation_callbacks* pAllocationCallbacks) { if (pWav == NULL || onRead == NULL || onSeek == NULL) { return DRWAV_FALSE; @@ -1810,7 +1759,7 @@ static drwav_bool32 drwav_preinit(drwav* pWav, drwav_read_proc onRead, drwav_see return DRWAV_TRUE; } -static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, void* pChunkUserData, drwav_uint32 flags) +DRWAV_PRIVATE drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, void* pChunkUserData, drwav_uint32 flags) { /* This function assumes drwav_preinit() has been called beforehand. */ @@ -1836,9 +1785,9 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, The first 4 bytes can be used to identify the container. For RIFF files it will start with "RIFF" and for w64 it will start with "riff". */ - if (drwav__fourcc_equal(riff, "RIFF")) { + if (drwav_fourcc_equal(riff, "RIFF")) { pWav->container = drwav_container_riff; - } else if (drwav__fourcc_equal(riff, "riff")) { + } else if (drwav_fourcc_equal(riff, "riff")) { int i; drwav_uint8 riff2[12]; @@ -1854,7 +1803,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, return DRWAV_FALSE; } } - } else if (drwav__fourcc_equal(riff, "RF64")) { + } else if (drwav_fourcc_equal(riff, "RF64")) { pWav->container = drwav_container_rf64; } else { return DRWAV_FALSE; /* Unknown or unsupported container. */ @@ -1871,11 +1820,11 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, } if (pWav->container == drwav_container_riff) { - if (drwav__bytes_to_u32(chunkSizeBytes) < 36) { + if (drwav_bytes_to_u32(chunkSizeBytes) < 36) { return DRWAV_FALSE; /* Chunk size should always be at least 36 bytes. */ } } else { - if (drwav__bytes_to_u32(chunkSizeBytes) != 0xFFFFFFFF) { + if (drwav_bytes_to_u32(chunkSizeBytes) != 0xFFFFFFFF) { return DRWAV_FALSE; /* Chunk size should always be set to -1/0xFFFFFFFF for RF64. The actual size is retrieved later. */ } } @@ -1884,7 +1833,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, return DRWAV_FALSE; } - if (!drwav__fourcc_equal(wave, "WAVE")) { + if (!drwav_fourcc_equal(wave, "WAVE")) { return DRWAV_FALSE; /* Expecting "WAVE". */ } } else { @@ -1896,7 +1845,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, return DRWAV_FALSE; } - if (drwav__bytes_to_u64(chunkSizeBytes) < 80) { + if (drwav_bytes_to_u64(chunkSizeBytes) < 80) { return DRWAV_FALSE; } @@ -1904,7 +1853,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, return DRWAV_FALSE; } - if (!drwav__guid_equal(wave, drwavGUID_W64_WAVE)) { + if (!drwav_guid_equal(wave, drwavGUID_W64_WAVE)) { return DRWAV_FALSE; } } @@ -1920,7 +1869,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, return DRWAV_FALSE; } - if (!drwav__fourcc_equal(header.id.fourcc, "ds64")) { + if (!drwav_fourcc_equal(header.id.fourcc, "ds64")) { return DRWAV_FALSE; /* Expecting "ds64". */ } @@ -1939,7 +1888,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, return DRWAV_FALSE; } bytesRemainingInChunk -= 8; - dataChunkSize = drwav__bytes_to_u64(sizeBytes); + dataChunkSize = drwav_bytes_to_u64(sizeBytes); /* Next 8 bytes is the same count which we would usually derived from the FACT chunk if it was available. */ @@ -1947,7 +1896,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, return DRWAV_FALSE; } bytesRemainingInChunk -= 8; - sampleCountFromFactChunk = drwav__bytes_to_u64(sizeBytes); + sampleCountFromFactChunk = drwav_bytes_to_u64(sizeBytes); /* Skip over everything else. */ @@ -1975,7 +1924,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, /* Translate the internal format. */ translatedFormatTag = fmt.formatTag; if (translatedFormatTag == DR_WAVE_FORMAT_EXTENSIBLE) { - translatedFormatTag = drwav__bytes_to_u16(fmt.subFormat + 0); + translatedFormatTag = drwav_bytes_to_u16(fmt.subFormat + 0); } @@ -2023,14 +1972,14 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, chunkSize = header.sizeInBytes; if (pWav->container == drwav_container_riff || pWav->container == drwav_container_rf64) { - if (drwav__fourcc_equal(header.id.fourcc, "data")) { + if (drwav_fourcc_equal(header.id.fourcc, "data")) { foundDataChunk = DRWAV_TRUE; if (pWav->container != drwav_container_rf64) { /* The data chunk size for RF64 will always be set to 0xFFFFFFFF here. It was set to it's true value earlier. */ dataChunkSize = chunkSize; } } } else { - if (drwav__guid_equal(header.id.guid, drwavGUID_W64_DATA)) { + if (drwav_guid_equal(header.id.guid, drwavGUID_W64_DATA)) { foundDataChunk = DRWAV_TRUE; dataChunkSize = chunkSize; } @@ -2046,7 +1995,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, /* Optional. Get the total sample count from the FACT chunk. This is useful for compressed formats. */ if (pWav->container == drwav_container_riff) { - if (drwav__fourcc_equal(header.id.fourcc, "fact")) { + if (drwav_fourcc_equal(header.id.fourcc, "fact")) { drwav_uint32 sampleCount; if (drwav__on_read(pWav->onRead, pWav->pUserData, &sampleCount, 4, &cursor) != 4) { return DRWAV_FALSE; @@ -2068,7 +2017,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, } } } else if (pWav->container == drwav_container_w64) { - if (drwav__guid_equal(header.id.guid, drwavGUID_W64_FACT)) { + if (drwav_guid_equal(header.id.guid, drwavGUID_W64_FACT)) { if (drwav__on_read(pWav->onRead, pWav->pUserData, &sampleCountFromFactChunk, 8, &cursor) != 8) { return DRWAV_FALSE; } @@ -2084,7 +2033,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, /* "smpl" chunk. */ if (pWav->container == drwav_container_riff || pWav->container == drwav_container_rf64) { - if (drwav__fourcc_equal(header.id.fourcc, "smpl")) { + if (drwav_fourcc_equal(header.id.fourcc, "smpl")) { drwav_uint8 smplHeaderData[36]; /* 36 = size of the smpl header section, not including the loop data. */ if (chunkSize >= sizeof(smplHeaderData)) { drwav_uint64 bytesJustRead = drwav__on_read(pWav->onRead, pWav->pUserData, smplHeaderData, sizeof(smplHeaderData), &cursor); @@ -2093,15 +2042,15 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, if (bytesJustRead == sizeof(smplHeaderData)) { drwav_uint32 iLoop; - pWav->smpl.manufacturer = drwav__bytes_to_u32(smplHeaderData+0); - pWav->smpl.product = drwav__bytes_to_u32(smplHeaderData+4); - pWav->smpl.samplePeriod = drwav__bytes_to_u32(smplHeaderData+8); - pWav->smpl.midiUnityNotes = drwav__bytes_to_u32(smplHeaderData+12); - pWav->smpl.midiPitchFraction = drwav__bytes_to_u32(smplHeaderData+16); - pWav->smpl.smpteFormat = drwav__bytes_to_u32(smplHeaderData+20); - pWav->smpl.smpteOffset = drwav__bytes_to_u32(smplHeaderData+24); - pWav->smpl.numSampleLoops = drwav__bytes_to_u32(smplHeaderData+28); - pWav->smpl.samplerData = drwav__bytes_to_u32(smplHeaderData+32); + pWav->smpl.manufacturer = drwav_bytes_to_u32(smplHeaderData+0); + pWav->smpl.product = drwav_bytes_to_u32(smplHeaderData+4); + pWav->smpl.samplePeriod = drwav_bytes_to_u32(smplHeaderData+8); + pWav->smpl.midiUnityNotes = drwav_bytes_to_u32(smplHeaderData+12); + pWav->smpl.midiPitchFraction = drwav_bytes_to_u32(smplHeaderData+16); + pWav->smpl.smpteFormat = drwav_bytes_to_u32(smplHeaderData+20); + pWav->smpl.smpteOffset = drwav_bytes_to_u32(smplHeaderData+24); + pWav->smpl.numSampleLoops = drwav_bytes_to_u32(smplHeaderData+28); + pWav->smpl.samplerData = drwav_bytes_to_u32(smplHeaderData+32); for (iLoop = 0; iLoop < pWav->smpl.numSampleLoops && iLoop < drwav_countof(pWav->smpl.loops); ++iLoop) { drwav_uint8 smplLoopData[24]; /* 24 = size of a loop section in the smpl chunk. */ @@ -2109,12 +2058,12 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, chunkSize -= bytesJustRead; if (bytesJustRead == sizeof(smplLoopData)) { - pWav->smpl.loops[iLoop].cuePointId = drwav__bytes_to_u32(smplLoopData+0); - pWav->smpl.loops[iLoop].type = drwav__bytes_to_u32(smplLoopData+4); - pWav->smpl.loops[iLoop].start = drwav__bytes_to_u32(smplLoopData+8); - pWav->smpl.loops[iLoop].end = drwav__bytes_to_u32(smplLoopData+12); - pWav->smpl.loops[iLoop].fraction = drwav__bytes_to_u32(smplLoopData+16); - pWav->smpl.loops[iLoop].playCount = drwav__bytes_to_u32(smplLoopData+20); + pWav->smpl.loops[iLoop].cuePointId = drwav_bytes_to_u32(smplLoopData+0); + pWav->smpl.loops[iLoop].type = drwav_bytes_to_u32(smplLoopData+4); + pWav->smpl.loops[iLoop].start = drwav_bytes_to_u32(smplLoopData+8); + pWav->smpl.loops[iLoop].end = drwav_bytes_to_u32(smplLoopData+12); + pWav->smpl.loops[iLoop].fraction = drwav_bytes_to_u32(smplLoopData+16); + pWav->smpl.loops[iLoop].playCount = drwav_bytes_to_u32(smplLoopData+20); } else { break; /* Break from the smpl loop for loop. */ } @@ -2125,7 +2074,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, } } } else { - if (drwav__guid_equal(header.id.guid, drwavGUID_W64_SMPL)) { + if (drwav_guid_equal(header.id.guid, drwavGUID_W64_SMPL)) { /* This path will be hit when a W64 WAV file contains a smpl chunk. I don't have a sample file to test this path, so a contribution is welcome to add support for this. @@ -2249,7 +2198,7 @@ DRWAV_API drwav_bool32 drwav_init_ex(drwav* pWav, drwav_read_proc onRead, drwav_ } -static drwav_uint32 drwav__riff_chunk_size_riff(drwav_uint64 dataChunkSize) +DRWAV_PRIVATE drwav_uint32 drwav__riff_chunk_size_riff(drwav_uint64 dataChunkSize) { drwav_uint64 chunkSize = 4 + 24 + dataChunkSize + drwav__chunk_padding_size_riff(dataChunkSize); /* 4 = "WAVE". 24 = "fmt " chunk. */ if (chunkSize > 0xFFFFFFFFUL) { @@ -2259,7 +2208,7 @@ static drwav_uint32 drwav__riff_chunk_size_riff(drwav_uint64 dataChunkSize) return (drwav_uint32)chunkSize; /* Safe cast due to the clamp above. */ } -static drwav_uint32 drwav__data_chunk_size_riff(drwav_uint64 dataChunkSize) +DRWAV_PRIVATE drwav_uint32 drwav__data_chunk_size_riff(drwav_uint64 dataChunkSize) { if (dataChunkSize <= 0xFFFFFFFFUL) { return (drwav_uint32)dataChunkSize; @@ -2268,19 +2217,19 @@ static drwav_uint32 drwav__data_chunk_size_riff(drwav_uint64 dataChunkSize) } } -static drwav_uint64 drwav__riff_chunk_size_w64(drwav_uint64 dataChunkSize) +DRWAV_PRIVATE drwav_uint64 drwav__riff_chunk_size_w64(drwav_uint64 dataChunkSize) { drwav_uint64 dataSubchunkPaddingSize = drwav__chunk_padding_size_w64(dataChunkSize); return 80 + 24 + dataChunkSize + dataSubchunkPaddingSize; /* +24 because W64 includes the size of the GUID and size fields. */ } -static drwav_uint64 drwav__data_chunk_size_w64(drwav_uint64 dataChunkSize) +DRWAV_PRIVATE drwav_uint64 drwav__data_chunk_size_w64(drwav_uint64 dataChunkSize) { return 24 + dataChunkSize; /* +24 because W64 includes the size of the GUID and size fields. */ } -static drwav_uint64 drwav__riff_chunk_size_rf64(drwav_uint64 dataChunkSize) +DRWAV_PRIVATE drwav_uint64 drwav__riff_chunk_size_rf64(drwav_uint64 dataChunkSize) { drwav_uint64 chunkSize = 4 + 36 + 24 + dataChunkSize + drwav__chunk_padding_size_riff(dataChunkSize); /* 4 = "WAVE". 36 = "ds64" chunk. 24 = "fmt " chunk. */ if (chunkSize > 0xFFFFFFFFUL) { @@ -2290,13 +2239,13 @@ static drwav_uint64 drwav__riff_chunk_size_rf64(drwav_uint64 dataChunkSize) return chunkSize; } -static drwav_uint64 drwav__data_chunk_size_rf64(drwav_uint64 dataChunkSize) +DRWAV_PRIVATE drwav_uint64 drwav__data_chunk_size_rf64(drwav_uint64 dataChunkSize) { return dataChunkSize; } -static size_t drwav__write(drwav* pWav, const void* pData, size_t dataSize) +DRWAV_PRIVATE size_t drwav__write(drwav* pWav, const void* pData, size_t dataSize) { DRWAV_ASSERT(pWav != NULL); DRWAV_ASSERT(pWav->onWrite != NULL); @@ -2305,7 +2254,7 @@ static size_t drwav__write(drwav* pWav, const void* pData, size_t dataSize) return pWav->onWrite(pWav->pUserData, pData, dataSize); } -static size_t drwav__write_u16ne_to_le(drwav* pWav, drwav_uint16 value) +DRWAV_PRIVATE size_t drwav__write_u16ne_to_le(drwav* pWav, drwav_uint16 value) { DRWAV_ASSERT(pWav != NULL); DRWAV_ASSERT(pWav->onWrite != NULL); @@ -2317,7 +2266,7 @@ static size_t drwav__write_u16ne_to_le(drwav* pWav, drwav_uint16 value) return drwav__write(pWav, &value, 2); } -static size_t drwav__write_u32ne_to_le(drwav* pWav, drwav_uint32 value) +DRWAV_PRIVATE size_t drwav__write_u32ne_to_le(drwav* pWav, drwav_uint32 value) { DRWAV_ASSERT(pWav != NULL); DRWAV_ASSERT(pWav->onWrite != NULL); @@ -2329,7 +2278,7 @@ static size_t drwav__write_u32ne_to_le(drwav* pWav, drwav_uint32 value) return drwav__write(pWav, &value, 4); } -static size_t drwav__write_u64ne_to_le(drwav* pWav, drwav_uint64 value) +DRWAV_PRIVATE size_t drwav__write_u64ne_to_le(drwav* pWav, drwav_uint64 value) { DRWAV_ASSERT(pWav != NULL); DRWAV_ASSERT(pWav->onWrite != NULL); @@ -2342,7 +2291,7 @@ static size_t drwav__write_u64ne_to_le(drwav* pWav, drwav_uint64 value) } -static drwav_bool32 drwav_preinit_write(drwav* pWav, const drwav_data_format* pFormat, drwav_bool32 isSequential, drwav_write_proc onWrite, drwav_seek_proc onSeek, void* pUserData, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_bool32 drwav_preinit_write(drwav* pWav, const drwav_data_format* pFormat, drwav_bool32 isSequential, drwav_write_proc onWrite, drwav_seek_proc onSeek, void* pUserData, const drwav_allocation_callbacks* pAllocationCallbacks) { if (pWav == NULL || onWrite == NULL) { return DRWAV_FALSE; @@ -2382,7 +2331,7 @@ static drwav_bool32 drwav_preinit_write(drwav* pWav, const drwav_data_format* pF return DRWAV_TRUE; } -static drwav_bool32 drwav_init_write__internal(drwav* pWav, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount) +DRWAV_PRIVATE drwav_bool32 drwav_init_write__internal(drwav* pWav, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount) { /* The function assumes drwav_preinit_write() was called beforehand. */ @@ -2462,8 +2411,6 @@ static drwav_bool32 drwav_init_write__internal(drwav* pWav, const drwav_data_for runningPos += drwav__write_u16ne_to_le(pWav, pWav->fmt.blockAlign); runningPos += drwav__write_u16ne_to_le(pWav, pWav->fmt.bitsPerSample); - pWav->dataChunkDataPos = runningPos; - /* "data" chunk. */ if (pFormat->container == drwav_container_riff) { drwav_uint32 chunkSizeDATA = (drwav_uint32)initialDataChunkSize; @@ -2478,19 +2425,13 @@ static drwav_bool32 drwav_init_write__internal(drwav* pWav, const drwav_data_for runningPos += drwav__write_u32ne_to_le(pWav, 0xFFFFFFFF); /* Always set to 0xFFFFFFFF for RF64. The true size of the data chunk is specified in the ds64 chunk. */ } - /* - The runningPos variable is incremented in the section above but is left unused which is causing some static analysis tools to detect it - as a dead store. I'm leaving this as-is for safety just in case I want to expand this function later to include other tags and want to - keep track of the running position for whatever reason. The line below should silence the static analysis tools. - */ - (void)runningPos; - /* Set some properties for the client's convenience. */ pWav->container = pFormat->container; pWav->channels = (drwav_uint16)pFormat->channels; pWav->sampleRate = pFormat->sampleRate; pWav->bitsPerSample = (drwav_uint16)pFormat->bitsPerSample; pWav->translatedFormatTag = (drwav_uint16)pFormat->format; + pWav->dataChunkDataPos = runningPos; return DRWAV_TRUE; } @@ -2549,7 +2490,7 @@ DRWAV_API drwav_uint64 drwav_target_write_size_bytes(const drwav_data_format* pF /* drwav_result_from_errno() is only used for fopen() and wfopen() so putting it inside DR_WAV_NO_STDIO for now. If something else needs this later we can move it out. */ #include -static drwav_result drwav_result_from_errno(int e) +DRWAV_PRIVATE drwav_result drwav_result_from_errno(int e) { switch (e) { @@ -2951,9 +2892,9 @@ static drwav_result drwav_result_from_errno(int e) } } -static drwav_result drwav_fopen(FILE** ppFile, const char* pFilePath, const char* pOpenMode) +DRWAV_PRIVATE drwav_result drwav_fopen(FILE** ppFile, const char* pFilePath, const char* pOpenMode) { -#if _MSC_VER && _MSC_VER >= 1400 +#if defined(_MSC_VER) && _MSC_VER >= 1400 errno_t err; #endif @@ -2965,7 +2906,7 @@ static drwav_result drwav_fopen(FILE** ppFile, const char* pFilePath, const char return DRWAV_INVALID_ARGS; } -#if _MSC_VER && _MSC_VER >= 1400 +#if defined(_MSC_VER) && _MSC_VER >= 1400 err = fopen_s(ppFile, pFilePath, pOpenMode); if (err != 0) { return drwav_result_from_errno(err); @@ -3000,17 +2941,18 @@ _wfopen() isn't always available in all compilation environments. * MSVC seems to support it universally as far back as VC6 from what I can tell (haven't checked further back). * MinGW-64 (both 32- and 64-bit) seems to support it. * MinGW wraps it in !defined(__STRICT_ANSI__). + * OpenWatcom wraps it in !defined(_NO_EXT_KEYS). This can be reviewed as compatibility issues arise. The preference is to use _wfopen_s() and _wfopen() as opposed to the wcsrtombs() fallback, so if you notice your compiler not detecting this properly I'm happy to look at adding support. */ #if defined(_WIN32) - #if defined(_MSC_VER) || defined(__MINGW64__) || !defined(__STRICT_ANSI__) + #if defined(_MSC_VER) || defined(__MINGW64__) || (!defined(__STRICT_ANSI__) && !defined(_NO_EXT_KEYS)) #define DRWAV_HAS_WFOPEN #endif #endif -static drwav_result drwav_wfopen(FILE** ppFile, const wchar_t* pFilePath, const wchar_t* pOpenMode, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_result drwav_wfopen(FILE** ppFile, const wchar_t* pFilePath, const wchar_t* pOpenMode, const drwav_allocation_callbacks* pAllocationCallbacks) { if (ppFile != NULL) { *ppFile = NULL; /* Safety. */ @@ -3093,17 +3035,17 @@ static drwav_result drwav_wfopen(FILE** ppFile, const wchar_t* pFilePath, const } -static size_t drwav__on_read_stdio(void* pUserData, void* pBufferOut, size_t bytesToRead) +DRWAV_PRIVATE size_t drwav__on_read_stdio(void* pUserData, void* pBufferOut, size_t bytesToRead) { return fread(pBufferOut, 1, bytesToRead, (FILE*)pUserData); } -static size_t drwav__on_write_stdio(void* pUserData, const void* pData, size_t bytesToWrite) +DRWAV_PRIVATE size_t drwav__on_write_stdio(void* pUserData, const void* pData, size_t bytesToWrite) { return fwrite(pData, 1, bytesToWrite, (FILE*)pUserData); } -static drwav_bool32 drwav__on_seek_stdio(void* pUserData, int offset, drwav_seek_origin origin) +DRWAV_PRIVATE drwav_bool32 drwav__on_seek_stdio(void* pUserData, int offset, drwav_seek_origin origin) { return fseek((FILE*)pUserData, offset, (origin == drwav_seek_origin_current) ? SEEK_CUR : SEEK_SET) == 0; } @@ -3114,7 +3056,7 @@ DRWAV_API drwav_bool32 drwav_init_file(drwav* pWav, const char* filename, const } -static drwav_bool32 drwav_init_file__internal_FILE(drwav* pWav, FILE* pFile, drwav_chunk_proc onChunk, void* pChunkUserData, drwav_uint32 flags, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_bool32 drwav_init_file__internal_FILE(drwav* pWav, FILE* pFile, drwav_chunk_proc onChunk, void* pChunkUserData, drwav_uint32 flags, const drwav_allocation_callbacks* pAllocationCallbacks) { drwav_bool32 result; @@ -3161,7 +3103,7 @@ DRWAV_API drwav_bool32 drwav_init_file_ex_w(drwav* pWav, const wchar_t* filename } -static drwav_bool32 drwav_init_file_write__internal_FILE(drwav* pWav, FILE* pFile, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_bool32 drwav_init_file_write__internal_FILE(drwav* pWav, FILE* pFile, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) { drwav_bool32 result; @@ -3180,7 +3122,7 @@ static drwav_bool32 drwav_init_file_write__internal_FILE(drwav* pWav, FILE* pFil return DRWAV_TRUE; } -static drwav_bool32 drwav_init_file_write__internal(drwav* pWav, const char* filename, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_bool32 drwav_init_file_write__internal(drwav* pWav, const char* filename, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) { FILE* pFile; if (drwav_fopen(&pFile, filename, "wb") != DRWAV_SUCCESS) { @@ -3191,7 +3133,7 @@ static drwav_bool32 drwav_init_file_write__internal(drwav* pWav, const char* fil return drwav_init_file_write__internal_FILE(pWav, pFile, pFormat, totalSampleCount, isSequential, pAllocationCallbacks); } -static drwav_bool32 drwav_init_file_write_w__internal(drwav* pWav, const wchar_t* filename, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_bool32 drwav_init_file_write_w__internal(drwav* pWav, const wchar_t* filename, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) { FILE* pFile; if (drwav_wfopen(&pFile, filename, L"wb", pAllocationCallbacks) != DRWAV_SUCCESS) { @@ -3242,7 +3184,7 @@ DRWAV_API drwav_bool32 drwav_init_file_write_sequential_pcm_frames_w(drwav* pWav #endif /* DR_WAV_NO_STDIO */ -static size_t drwav__on_read_memory(void* pUserData, void* pBufferOut, size_t bytesToRead) +DRWAV_PRIVATE size_t drwav__on_read_memory(void* pUserData, void* pBufferOut, size_t bytesToRead) { drwav* pWav = (drwav*)pUserData; size_t bytesRemaining; @@ -3263,7 +3205,7 @@ static size_t drwav__on_read_memory(void* pUserData, void* pBufferOut, size_t by return bytesToRead; } -static drwav_bool32 drwav__on_seek_memory(void* pUserData, int offset, drwav_seek_origin origin) +DRWAV_PRIVATE drwav_bool32 drwav__on_seek_memory(void* pUserData, int offset, drwav_seek_origin origin) { drwav* pWav = (drwav*)pUserData; DRWAV_ASSERT(pWav != NULL); @@ -3292,7 +3234,7 @@ static drwav_bool32 drwav__on_seek_memory(void* pUserData, int offset, drwav_see return DRWAV_TRUE; } -static size_t drwav__on_write_memory(void* pUserData, const void* pDataIn, size_t bytesToWrite) +DRWAV_PRIVATE size_t drwav__on_write_memory(void* pUserData, const void* pDataIn, size_t bytesToWrite) { drwav* pWav = (drwav*)pUserData; size_t bytesRemaining; @@ -3332,7 +3274,7 @@ static size_t drwav__on_write_memory(void* pUserData, const void* pDataIn, size_ return bytesToWrite; } -static drwav_bool32 drwav__on_seek_memory_write(void* pUserData, int offset, drwav_seek_origin origin) +DRWAV_PRIVATE drwav_bool32 drwav__on_seek_memory_write(void* pUserData, int offset, drwav_seek_origin origin) { drwav* pWav = (drwav*)pUserData; DRWAV_ASSERT(pWav != NULL); @@ -3384,7 +3326,7 @@ DRWAV_API drwav_bool32 drwav_init_memory_ex(drwav* pWav, const void* data, size_ } -static drwav_bool32 drwav_init_memory_write__internal(drwav* pWav, void** ppData, size_t* pDataSize, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_bool32 drwav_init_memory_write__internal(drwav* pWav, void** ppData, size_t* pDataSize, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) { if (ppData == NULL || pDataSize == NULL) { return DRWAV_FALSE; @@ -3467,8 +3409,8 @@ DRWAV_API drwav_result drwav_uninit(drwav* pWav) drwav__write_u32ne_to_le(pWav, riffChunkSize); } - /* the "data" chunk size. */ - if (pWav->onSeek(pWav->pUserData, (int)pWav->dataChunkDataPos + 4, drwav_seek_origin_start)) { + /* The "data" chunk size. */ + if (pWav->onSeek(pWav->pUserData, (int)pWav->dataChunkDataPos - 4, drwav_seek_origin_start)) { drwav_uint32 dataChunkSize = drwav__data_chunk_size_riff(pWav->dataChunkDataSize); drwav__write_u32ne_to_le(pWav, dataChunkSize); } @@ -3480,7 +3422,7 @@ DRWAV_API drwav_result drwav_uninit(drwav* pWav) } /* The "data" chunk size. */ - if (pWav->onSeek(pWav->pUserData, (int)pWav->dataChunkDataPos + 16, drwav_seek_origin_start)) { + if (pWav->onSeek(pWav->pUserData, (int)pWav->dataChunkDataPos - 8, drwav_seek_origin_start)) { drwav_uint64 dataChunkSize = drwav__data_chunk_size_w64(pWav->dataChunkDataSize); drwav__write_u64ne_to_le(pWav, dataChunkSize); } @@ -3601,7 +3543,7 @@ DRWAV_API drwav_uint64 drwav_read_pcm_frames_le(drwav* pWav, drwav_uint64 frames /* Don't try to read more samples than can potentially fit in the output buffer. */ bytesToRead = framesToRead * bytesPerFrame; if (bytesToRead > DRWAV_SIZE_MAX) { - framesToRead = DRWAV_SIZE_MAX / bytesPerFrame; + bytesToRead = (DRWAV_SIZE_MAX / bytesPerFrame) * bytesPerFrame; /* Round the number of bytes to read to a clean frame boundary. */ } /* @@ -3637,7 +3579,7 @@ DRWAV_API drwav_uint64 drwav_read_pcm_frames(drwav* pWav, drwav_uint64 framesToR -DRWAV_API drwav_bool32 drwav_seek_to_first_pcm_frame(drwav* pWav) +DRWAV_PRIVATE drwav_bool32 drwav_seek_to_first_pcm_frame(drwav* pWav) { if (pWav->onWrite != NULL) { return DRWAV_FALSE; /* No seeking in write mode. */ @@ -3887,7 +3829,7 @@ DRWAV_API drwav_uint64 drwav_write_pcm_frames(drwav* pWav, drwav_uint64 framesTo } -static drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) { drwav_uint64 totalFramesRead = 0; @@ -3896,7 +3838,9 @@ static drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 /* TODO: Lots of room for optimization here. */ - while (framesToRead > 0 && pWav->compressed.iCurrentPCMFrame < pWav->totalPCMFrameCount) { + while (pWav->compressed.iCurrentPCMFrame < pWav->totalPCMFrameCount) { + DRWAV_ASSERT(framesToRead > 0); /* This loop iteration will never get hit with framesToRead == 0 because it's asserted at the top, and we check for 0 inside the loop just below. */ + /* If there are no cached frames we need to load a new block. */ if (pWav->msadpcm.cachedFrameCount == 0 && pWav->msadpcm.bytesRemainingInBlock == 0) { if (pWav->channels == 1) { @@ -3908,9 +3852,9 @@ static drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 pWav->msadpcm.bytesRemainingInBlock = pWav->fmt.blockAlign - sizeof(header); pWav->msadpcm.predictor[0] = header[0]; - pWav->msadpcm.delta[0] = drwav__bytes_to_s16(header + 1); - pWav->msadpcm.prevFrames[0][1] = (drwav_int32)drwav__bytes_to_s16(header + 3); - pWav->msadpcm.prevFrames[0][0] = (drwav_int32)drwav__bytes_to_s16(header + 5); + pWav->msadpcm.delta[0] = drwav_bytes_to_s16(header + 1); + pWav->msadpcm.prevFrames[0][1] = (drwav_int32)drwav_bytes_to_s16(header + 3); + pWav->msadpcm.prevFrames[0][0] = (drwav_int32)drwav_bytes_to_s16(header + 5); pWav->msadpcm.cachedFrames[2] = pWav->msadpcm.prevFrames[0][0]; pWav->msadpcm.cachedFrames[3] = pWav->msadpcm.prevFrames[0][1]; pWav->msadpcm.cachedFrameCount = 2; @@ -3924,12 +3868,12 @@ static drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 pWav->msadpcm.predictor[0] = header[0]; pWav->msadpcm.predictor[1] = header[1]; - pWav->msadpcm.delta[0] = drwav__bytes_to_s16(header + 2); - pWav->msadpcm.delta[1] = drwav__bytes_to_s16(header + 4); - pWav->msadpcm.prevFrames[0][1] = (drwav_int32)drwav__bytes_to_s16(header + 6); - pWav->msadpcm.prevFrames[1][1] = (drwav_int32)drwav__bytes_to_s16(header + 8); - pWav->msadpcm.prevFrames[0][0] = (drwav_int32)drwav__bytes_to_s16(header + 10); - pWav->msadpcm.prevFrames[1][0] = (drwav_int32)drwav__bytes_to_s16(header + 12); + pWav->msadpcm.delta[0] = drwav_bytes_to_s16(header + 2); + pWav->msadpcm.delta[1] = drwav_bytes_to_s16(header + 4); + pWav->msadpcm.prevFrames[0][1] = (drwav_int32)drwav_bytes_to_s16(header + 6); + pWav->msadpcm.prevFrames[1][1] = (drwav_int32)drwav_bytes_to_s16(header + 8); + pWav->msadpcm.prevFrames[0][0] = (drwav_int32)drwav_bytes_to_s16(header + 10); + pWav->msadpcm.prevFrames[1][0] = (drwav_int32)drwav_bytes_to_s16(header + 12); pWav->msadpcm.cachedFrames[0] = pWav->msadpcm.prevFrames[0][0]; pWav->msadpcm.cachedFrames[1] = pWav->msadpcm.prevFrames[1][0]; @@ -3957,7 +3901,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 } if (framesToRead == 0) { - return totalFramesRead; + break; } @@ -4067,7 +4011,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 } -static drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) { drwav_uint64 totalFramesRead = 0; drwav_uint32 iChannel; @@ -4094,7 +4038,9 @@ static drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 fra /* TODO: Lots of room for optimization here. */ - while (framesToRead > 0 && pWav->compressed.iCurrentPCMFrame < pWav->totalPCMFrameCount) { + while (pWav->compressed.iCurrentPCMFrame < pWav->totalPCMFrameCount) { + DRWAV_ASSERT(framesToRead > 0); /* This loop iteration will never get hit with framesToRead == 0 because it's asserted at the top, and we check for 0 inside the loop just below. */ + /* If there are no cached samples we need to load a new block. */ if (pWav->ima.cachedFrameCount == 0 && pWav->ima.bytesRemainingInBlock == 0) { if (pWav->channels == 1) { @@ -4111,7 +4057,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 fra return totalFramesRead; /* Invalid data. */ } - pWav->ima.predictor[0] = drwav__bytes_to_s16(header + 0); + pWav->ima.predictor[0] = drwav_bytes_to_s16(header + 0); pWav->ima.stepIndex[0] = header[2]; pWav->ima.cachedFrames[drwav_countof(pWav->ima.cachedFrames) - 1] = pWav->ima.predictor[0]; pWav->ima.cachedFrameCount = 1; @@ -4129,9 +4075,9 @@ static drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 fra return totalFramesRead; /* Invalid data. */ } - pWav->ima.predictor[0] = drwav__bytes_to_s16(header + 0); + pWav->ima.predictor[0] = drwav_bytes_to_s16(header + 0); pWav->ima.stepIndex[0] = header[2]; - pWav->ima.predictor[1] = drwav__bytes_to_s16(header + 4); + pWav->ima.predictor[1] = drwav_bytes_to_s16(header + 4); pWav->ima.stepIndex[1] = header[6]; pWav->ima.cachedFrames[drwav_countof(pWav->ima.cachedFrames) - 2] = pWav->ima.predictor[0]; @@ -4157,7 +4103,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 fra } if (framesToRead == 0) { - return totalFramesRead; + break; } /* @@ -4275,7 +4221,7 @@ static DRWAV_INLINE drwav_int16 drwav__mulaw_to_s16(drwav_uint8 sampleIn) -static void drwav__pcm_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) +DRWAV_PRIVATE void drwav__pcm_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) { unsigned int i; @@ -4327,7 +4273,7 @@ static void drwav__pcm_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_t } } -static void drwav__ieee_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) +DRWAV_PRIVATE void drwav__ieee_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) { if (bytesPerSample == 4) { drwav_f32_to_s16(pOut, (const float*)pIn, totalSampleCount); @@ -4342,11 +4288,11 @@ static void drwav__ieee_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_t } } -static drwav_uint64 drwav_read_pcm_frames_s16__pcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__pcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) { - drwav_uint32 bytesPerFrame; drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; + drwav_uint32 bytesPerFrame; /* Fast path. */ if ((pWav->translatedFormatTag == DR_WAVE_FORMAT_PCM && pWav->bitsPerSample == 16) || pBufferOut == NULL) { @@ -4376,7 +4322,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__pcm(drwav* pWav, drwav_uint64 fra return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s16__ieee(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__ieee(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -4409,7 +4355,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__ieee(drwav* pWav, drwav_uint64 fr return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s16__alaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__alaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -4442,7 +4388,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__alaw(drwav* pWav, drwav_uint64 fr return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s16__mulaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__mulaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -4620,7 +4566,7 @@ DRWAV_API void drwav_mulaw_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, siz -static void drwav__pcm_to_f32(float* pOut, const drwav_uint8* pIn, size_t sampleCount, unsigned int bytesPerSample) +DRWAV_PRIVATE void drwav__pcm_to_f32(float* pOut, const drwav_uint8* pIn, size_t sampleCount, unsigned int bytesPerSample) { unsigned int i; @@ -4669,7 +4615,7 @@ static void drwav__pcm_to_f32(float* pOut, const drwav_uint8* pIn, size_t sample } } -static void drwav__ieee_to_f32(float* pOut, const drwav_uint8* pIn, size_t sampleCount, unsigned int bytesPerSample) +DRWAV_PRIVATE void drwav__ieee_to_f32(float* pOut, const drwav_uint8* pIn, size_t sampleCount, unsigned int bytesPerSample) { if (bytesPerSample == 4) { unsigned int i; @@ -4688,12 +4634,12 @@ static void drwav__ieee_to_f32(float* pOut, const drwav_uint8* pIn, size_t sampl } -static drwav_uint64 drwav_read_pcm_frames_f32__pcm(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_f32__pcm(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; - drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav); + if (bytesPerFrame == 0) { return 0; } @@ -4716,7 +4662,7 @@ static drwav_uint64 drwav_read_pcm_frames_f32__pcm(drwav* pWav, drwav_uint64 fra return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_f32__msadpcm(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_f32__msadpcm(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) { /* We're just going to borrow the implementation from the drwav_read_s16() since ADPCM is a little bit more complicated than other formats and I don't @@ -4724,6 +4670,7 @@ static drwav_uint64 drwav_read_pcm_frames_f32__msadpcm(drwav* pWav, drwav_uint64 */ drwav_uint64 totalFramesRead = 0; drwav_int16 samples16[2048]; + while (framesToRead > 0) { drwav_uint64 framesRead = drwav_read_pcm_frames_s16(pWav, drwav_min(framesToRead, drwav_countof(samples16)/pWav->channels), samples16); if (framesRead == 0) { @@ -4740,7 +4687,7 @@ static drwav_uint64 drwav_read_pcm_frames_f32__msadpcm(drwav* pWav, drwav_uint64 return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_f32__ima(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_f32__ima(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) { /* We're just going to borrow the implementation from the drwav_read_s16() since IMA-ADPCM is a little bit more complicated than other formats and I don't @@ -4748,6 +4695,7 @@ static drwav_uint64 drwav_read_pcm_frames_f32__ima(drwav* pWav, drwav_uint64 fra */ drwav_uint64 totalFramesRead = 0; drwav_int16 samples16[2048]; + while (framesToRead > 0) { drwav_uint64 framesRead = drwav_read_pcm_frames_s16(pWav, drwav_min(framesToRead, drwav_countof(samples16)/pWav->channels), samples16); if (framesRead == 0) { @@ -4764,7 +4712,7 @@ static drwav_uint64 drwav_read_pcm_frames_f32__ima(drwav* pWav, drwav_uint64 fra return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_f32__ieee(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_f32__ieee(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -4798,11 +4746,12 @@ static drwav_uint64 drwav_read_pcm_frames_f32__ieee(drwav* pWav, drwav_uint64 fr return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_f32__alaw(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_f32__alaw(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav); + if (bytesPerFrame == 0) { return 0; } @@ -4825,12 +4774,12 @@ static drwav_uint64 drwav_read_pcm_frames_f32__alaw(drwav* pWav, drwav_uint64 fr return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_f32__mulaw(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_f32__mulaw(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; - drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav); + if (bytesPerFrame == 0) { return 0; } @@ -5030,7 +4979,7 @@ DRWAV_API void drwav_mulaw_to_f32(float* pOut, const drwav_uint8* pIn, size_t sa -static void drwav__pcm_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) +DRWAV_PRIVATE void drwav__pcm_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) { unsigned int i; @@ -5081,7 +5030,7 @@ static void drwav__pcm_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, size_t } } -static void drwav__ieee_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) +DRWAV_PRIVATE void drwav__ieee_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) { if (bytesPerSample == 4) { drwav_f32_to_s32(pOut, (const float*)pIn, totalSampleCount); @@ -5097,7 +5046,7 @@ static void drwav__ieee_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, size_t } -static drwav_uint64 drwav_read_pcm_frames_s32__pcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s32__pcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -5131,7 +5080,7 @@ static drwav_uint64 drwav_read_pcm_frames_s32__pcm(drwav* pWav, drwav_uint64 fra return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s32__msadpcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s32__msadpcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) { /* We're just going to borrow the implementation from the drwav_read_s16() since ADPCM is a little bit more complicated than other formats and I don't @@ -5139,6 +5088,7 @@ static drwav_uint64 drwav_read_pcm_frames_s32__msadpcm(drwav* pWav, drwav_uint64 */ drwav_uint64 totalFramesRead = 0; drwav_int16 samples16[2048]; + while (framesToRead > 0) { drwav_uint64 framesRead = drwav_read_pcm_frames_s16(pWav, drwav_min(framesToRead, drwav_countof(samples16)/pWav->channels), samples16); if (framesRead == 0) { @@ -5155,7 +5105,7 @@ static drwav_uint64 drwav_read_pcm_frames_s32__msadpcm(drwav* pWav, drwav_uint64 return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s32__ima(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s32__ima(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) { /* We're just going to borrow the implementation from the drwav_read_s16() since IMA-ADPCM is a little bit more complicated than other formats and I don't @@ -5163,6 +5113,7 @@ static drwav_uint64 drwav_read_pcm_frames_s32__ima(drwav* pWav, drwav_uint64 fra */ drwav_uint64 totalFramesRead = 0; drwav_int16 samples16[2048]; + while (framesToRead > 0) { drwav_uint64 framesRead = drwav_read_pcm_frames_s16(pWav, drwav_min(framesToRead, drwav_countof(samples16)/pWav->channels), samples16); if (framesRead == 0) { @@ -5179,12 +5130,12 @@ static drwav_uint64 drwav_read_pcm_frames_s32__ima(drwav* pWav, drwav_uint64 fra return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s32__ieee(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s32__ieee(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; - drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav); + if (bytesPerFrame == 0) { return 0; } @@ -5207,12 +5158,12 @@ static drwav_uint64 drwav_read_pcm_frames_s32__ieee(drwav* pWav, drwav_uint64 fr return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s32__alaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s32__alaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; - drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav); + if (bytesPerFrame == 0) { return 0; } @@ -5235,12 +5186,12 @@ static drwav_uint64 drwav_read_pcm_frames_s32__alaw(drwav* pWav, drwav_uint64 fr return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s32__mulaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s32__mulaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; - drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav); + if (bytesPerFrame == 0) { return 0; } @@ -5424,7 +5375,7 @@ DRWAV_API void drwav_mulaw_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, siz -static drwav_int16* drwav__read_pcm_frames_and_close_s16(drwav* pWav, unsigned int* channels, unsigned int* sampleRate, drwav_uint64* totalFrameCount) +DRWAV_PRIVATE drwav_int16* drwav__read_pcm_frames_and_close_s16(drwav* pWav, unsigned int* channels, unsigned int* sampleRate, drwav_uint64* totalFrameCount) { drwav_uint64 sampleDataSize; drwav_int16* pSampleData; @@ -5466,7 +5417,7 @@ static drwav_int16* drwav__read_pcm_frames_and_close_s16(drwav* pWav, unsigned i return pSampleData; } -static float* drwav__read_pcm_frames_and_close_f32(drwav* pWav, unsigned int* channels, unsigned int* sampleRate, drwav_uint64* totalFrameCount) +DRWAV_PRIVATE float* drwav__read_pcm_frames_and_close_f32(drwav* pWav, unsigned int* channels, unsigned int* sampleRate, drwav_uint64* totalFrameCount) { drwav_uint64 sampleDataSize; float* pSampleData; @@ -5508,7 +5459,7 @@ static float* drwav__read_pcm_frames_and_close_f32(drwav* pWav, unsigned int* ch return pSampleData; } -static drwav_int32* drwav__read_pcm_frames_and_close_s32(drwav* pWav, unsigned int* channels, unsigned int* sampleRate, drwav_uint64* totalFrameCount) +DRWAV_PRIVATE drwav_int32* drwav__read_pcm_frames_and_close_s32(drwav* pWav, unsigned int* channels, unsigned int* sampleRate, drwav_uint64* totalFrameCount) { drwav_uint64 sampleDataSize; drwav_int32* pSampleData; @@ -5820,43 +5771,56 @@ DRWAV_API void drwav_free(void* p, const drwav_allocation_callbacks* pAllocation DRWAV_API drwav_uint16 drwav_bytes_to_u16(const drwav_uint8* data) { - return drwav__bytes_to_u16(data); + return (data[0] << 0) | (data[1] << 8); } DRWAV_API drwav_int16 drwav_bytes_to_s16(const drwav_uint8* data) { - return drwav__bytes_to_s16(data); + return (short)drwav_bytes_to_u16(data); } DRWAV_API drwav_uint32 drwav_bytes_to_u32(const drwav_uint8* data) { - return drwav__bytes_to_u32(data); + return (data[0] << 0) | (data[1] << 8) | (data[2] << 16) | (data[3] << 24); } DRWAV_API drwav_int32 drwav_bytes_to_s32(const drwav_uint8* data) { - return drwav__bytes_to_s32(data); + return (drwav_int32)drwav_bytes_to_u32(data); } DRWAV_API drwav_uint64 drwav_bytes_to_u64(const drwav_uint8* data) { - return drwav__bytes_to_u64(data); + return + ((drwav_uint64)data[0] << 0) | ((drwav_uint64)data[1] << 8) | ((drwav_uint64)data[2] << 16) | ((drwav_uint64)data[3] << 24) | + ((drwav_uint64)data[4] << 32) | ((drwav_uint64)data[5] << 40) | ((drwav_uint64)data[6] << 48) | ((drwav_uint64)data[7] << 56); } DRWAV_API drwav_int64 drwav_bytes_to_s64(const drwav_uint8* data) { - return drwav__bytes_to_s64(data); + return (drwav_int64)drwav_bytes_to_u64(data); } DRWAV_API drwav_bool32 drwav_guid_equal(const drwav_uint8 a[16], const drwav_uint8 b[16]) { - return drwav__guid_equal(a, b); + int i; + for (i = 0; i < 16; i += 1) { + if (a[i] != b[i]) { + return DRWAV_FALSE; + } + } + + return DRWAV_TRUE; } DRWAV_API drwav_bool32 drwav_fourcc_equal(const drwav_uint8* a, const char* b) { - return drwav__fourcc_equal(a, b); + return + a[0] == b[0] && + a[1] == b[1] && + a[2] == b[2] && + a[3] == b[3]; } #endif /* dr_wav_c */ @@ -6050,6 +6014,24 @@ two different ways to initialize a drwav object. /* REVISION HISTORY ================ +v0.12.19 - 2021-02-21 + - Fix a warning due to referencing _MSC_VER when it is undefined. + - Minor improvements to the management of some internal state concerning the data chunk cursor. + +v0.12.18 - 2021-01-31 + - Clean up some static analysis warnings. + +v0.12.17 - 2021-01-17 + - Minor fix to sample code in documentation. + - Correctly qualify a private API as private rather than public. + - Code cleanup. + +v0.12.16 - 2020-12-02 + - Fix a bug when trying to read more bytes than can fit in a size_t. + +v0.12.15 - 2020-11-21 + - Fix compilation with OpenWatcom. + v0.12.14 - 2020-11-13 - Minor code clean up. diff --git a/src/external/glfw/CMakeLists.txt b/src/external/glfw/CMakeLists.txt index 59ba5a600..59ab473c9 100644 --- a/src/external/glfw/CMakeLists.txt +++ b/src/external/glfw/CMakeLists.txt @@ -41,10 +41,6 @@ cmake_dependent_option(GLFW_USE_WAYLAND "Use Wayland for window creation" OFF cmake_dependent_option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON "MSVC" OFF) -if (BUILD_SHARED_LIBS) - set(_GLFW_BUILD_DLL 1) -endif() - if (BUILD_SHARED_LIBS AND UNIX) # On Unix-like systems, shared libraries can use the soname system. set(GLFW_LIB_NAME glfw) @@ -73,19 +69,8 @@ endif() #-------------------------------------------------------------------- # Set compiler specific flags #-------------------------------------------------------------------- -if (MSVC) - if (MSVC90) - # Workaround for VS 2008 not shipping with the DirectX 9 SDK - include(CheckIncludeFile) - check_include_file(dinput.h DINPUT_H_FOUND) - if (NOT DINPUT_H_FOUND) - message(FATAL_ERROR "DirectX 9 headers not found; install DirectX 9 SDK") - endif() - # Workaround for VS 2008 not shipping with stdint.h - list(APPEND glfw_INCLUDE_DIRS "${GLFW_SOURCE_DIR}/deps/vs2008") - endif() - - if (NOT USE_MSVC_RUNTIME_LIBRARY_DLL) +if (MSVC AND NOT USE_MSVC_RUNTIME_LIBRARY_DLL) + if (${CMAKE_VERSION} VERSION_LESS 3.15) foreach (flag CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE @@ -100,41 +85,8 @@ if (MSVC) endif() endforeach() - endif() -endif() - -if (MINGW) - # Workaround for legacy MinGW not providing XInput and DirectInput - include(CheckIncludeFile) - - check_include_file(dinput.h DINPUT_H_FOUND) - check_include_file(xinput.h XINPUT_H_FOUND) - if (NOT DINPUT_H_FOUND OR NOT XINPUT_H_FOUND) - list(APPEND glfw_INCLUDE_DIRS "${GLFW_SOURCE_DIR}/deps/mingw") - endif() - - # Enable link-time exploit mitigation features enabled by default on MSVC - include(CheckCCompilerFlag) - - # Compatibility with data execution prevention (DEP) - set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat") - check_c_compiler_flag("" _GLFW_HAS_DEP) - if (_GLFW_HAS_DEP) - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--nxcompat ${CMAKE_SHARED_LINKER_FLAGS}") - endif() - - # Compatibility with address space layout randomization (ASLR) - set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase") - check_c_compiler_flag("" _GLFW_HAS_ASLR) - if (_GLFW_HAS_ASLR) - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--dynamicbase ${CMAKE_SHARED_LINKER_FLAGS}") - endif() - - # Compatibility with 64-bit address space layout randomization (ASLR) - set(CMAKE_REQUIRED_FLAGS "-Wl,--high-entropy-va") - check_c_compiler_flag("" _GLFW_HAS_64ASLR) - if (_GLFW_HAS_64ASLR) - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}") + else() + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") endif() endif() @@ -203,11 +155,8 @@ if (_GLFW_X11) find_package(X11 REQUIRED) - list(APPEND glfw_PKG_DEPS "x11") - # Set up library and include paths list(APPEND glfw_INCLUDE_DIRS "${X11_X11_INCLUDE_PATH}") - list(APPEND glfw_LIBRARIES "${X11_X11_LIB}" "${CMAKE_THREAD_LIBS_INIT}") # Check for XRandR (modern resolution switching and gamma control) if (NOT X11_Xrandr_INCLUDE_PATH) @@ -233,37 +182,29 @@ if (_GLFW_X11) if (NOT X11_Xi_INCLUDE_PATH) message(FATAL_ERROR "XInput headers not found; install libxi development package") endif() - + # Check for X Shape (custom window input shape) if (NOT X11_Xshape_INCLUDE_PATH) message(FATAL_ERROR "X Shape headers not found; install libxext development package") endif() - - list(APPEND glfw_INCLUDE_DIRS "${X11_Xrandr_INCLUDE_PATH}" - "${X11_Xinerama_INCLUDE_PATH}" - "${X11_Xkb_INCLUDE_PATH}" - "${X11_Xcursor_INCLUDE_PATH}" - "${X11_Xi_INCLUDE_PATH}") endif() #-------------------------------------------------------------------- # Use Wayland for window creation #-------------------------------------------------------------------- if (_GLFW_WAYLAND) - find_package(ECM REQUIRED NO_MODULE) - list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}") - find_package(Wayland REQUIRED Client Cursor Egl) - find_package(WaylandScanner REQUIRED) - find_package(WaylandProtocols 1.15 REQUIRED) + include(FindPkgConfig) + pkg_check_modules(Wayland REQUIRED + wayland-client>=0.2.7 + wayland-cursor>=0.2.7 + wayland-egl>=0.2.7 + xkbcommon) - list(APPEND glfw_PKG_DEPS "wayland-egl") + list(APPEND glfw_PKG_DEPS "wayland-client") list(APPEND glfw_INCLUDE_DIRS "${Wayland_INCLUDE_DIRS}") - list(APPEND glfw_LIBRARIES "${Wayland_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}") - - find_package(XKBCommon REQUIRED) - list(APPEND glfw_INCLUDE_DIRS "${XKBCOMMON_INCLUDE_DIRS}") + list(APPEND glfw_LIBRARIES "${Wayland_LINK_LIBRARIES}") include(CheckIncludeFiles) include(CheckFunctionExists) @@ -279,14 +220,6 @@ if (_GLFW_WAYLAND) endif() endif() -#-------------------------------------------------------------------- -# Use OSMesa for offscreen context creation -#-------------------------------------------------------------------- -if (_GLFW_OSMESA) - find_package(OSMesa REQUIRED) - list(APPEND glfw_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}") -endif() - #-------------------------------------------------------------------- # Use Cocoa for window creation and NSOpenGL for context creation #-------------------------------------------------------------------- @@ -312,12 +245,10 @@ endif() # Export GLFW library dependencies #-------------------------------------------------------------------- foreach(arg ${glfw_PKG_DEPS}) - set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} ${arg}" CACHE INTERNAL - "GLFW pkg-config Requires.private") + set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} ${arg}") endforeach() foreach(arg ${glfw_PKG_LIBS}) - set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} ${arg}" CACHE INTERNAL - "GLFW pkg-config Libs.private") + set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} ${arg}") endforeach() #-------------------------------------------------------------------- @@ -336,9 +267,7 @@ write_basic_package_version_file(src/glfw3ConfigVersion.cmake VERSION ${GLFW_VERSION} COMPATIBILITY SameMajorVersion) -configure_file(src/glfw_config.h.in src/glfw_config.h @ONLY) - -configure_file(CMake/glfw3.pc.in CMake/glfw3.pc @ONLY) +configure_file(CMake/glfw3.pc.in src/glfw3.pc @ONLY) #-------------------------------------------------------------------- # Add subdirectories diff --git a/src/external/glfw/README.md b/src/external/glfw/README.md index 7488e6d09..b5b4f7ea4 100644 --- a/src/external/glfw/README.md +++ b/src/external/glfw/README.md @@ -99,7 +99,7 @@ located in the `deps/` directory. functions - [linmath.h](https://github.com/datenwolf/linmath.h) for linear algebra in examples - - [Nuklear](https://github.com/vurtun/nuklear) for test and example UI + - [Nuklear](https://github.com/Immediate-Mode-UI/Nuklear) for test and example UI - [stb\_image\_write](https://github.com/nothings/stb) for writing images to disk The documentation is generated with [Doxygen](http://doxygen.org/) if CMake can @@ -127,7 +127,10 @@ information on what to include when reporting a bug. - Added `GLFW_FEATURE_UNIMPLEMENTED` error for incomplete backends (#1692) - Added `GLFW_ANGLE_PLATFORM_TYPE` init hint and `GLFW_ANGLE_PLATFORM_TYPE_*` values to select ANGLE backend (#1380) + - Added `GLFW_X11_XCB_VULKAN_SURFACE` init hint for selecting X11 Vulkan + surface extension (#1793) - Made joystick subsystem initialize at first use (#1284,#1646) + - Made `GLFW_DOUBLEBUFFER` a read-only window attribute - Updated the minimum required CMake version to 3.1 - Disabled tests and examples by default when built as a CMake subdirectory - Bugfix: The CMake config-file package used an absolute path and was not @@ -137,6 +140,7 @@ information on what to include when reporting a bug. - Bugfix: Built-in mappings failed because some OEMs re-used VID/PID (#1583) - Bugfix: Some extension loader headers did not prevent default OpenGL header inclusion (#1695) + - Bugfix: Buffers were swapped at creation on single-buffered windows (#1873) - [Win32] Added the `GLFW_WIN32_KEYBOARD_MENU` window hint for enabling access to the window menu - [Win32] Added a version info resource to the GLFW DLL @@ -158,10 +162,20 @@ information on what to include when reporting a bug. - [Win32] Bugfix: Monitor functions could return invalid values after configuration change (#1761) - [Win32] Bugfix: Initialization would segfault on Windows 8 (not 8.1) (#1775) + - [Win32] Bugfix: Duplicate size events were not filtered (#1610) + - [Win32] Bugfix: Full screen windows were incorrectly resized by DPI changes + (#1582) + - [Win32] Bugfix: `GLFW_SCALE_TO_MONITOR` had no effect on systems older than + Windows 10 version 1703 (#1511) + - [Win32] Bugfix: `USE_MSVC_RUNTIME_LIBRARY_DLL` had no effect on CMake 3.15 or + later (#1783,#1796) + - [Win32] Bugfix: Compilation with LLVM for Windows failed (#1807,#1824,#1874) - [Cocoa] Added support for `VK_EXT_metal_surface` (#1619) - [Cocoa] Added locating the Vulkan loader at runtime in an application bundle - [Cocoa] Moved main menu creation to GLFW initialization time (#1649) - [Cocoa] Changed `EGLNativeWindowType` from `NSView` to `CALayer` (#1169) + - [Cocoa] Changed F13 key to report Print Screen for cross-platform consistency + (#1786) - [Cocoa] Removed dependency on the CoreVideo framework - [Cocoa] Bugfix: `glfwSetWindowSize` used a bottom-left anchor point (#1553) - [Cocoa] Bugfix: Window remained on screen after destruction until event poll @@ -174,6 +188,12 @@ information on what to include when reporting a bug. (#1635) - [Cocoa] Bugfix: Failing to retrieve the refresh rate of built-in displays could leak memory + - [Cocoa] Bugfix: Objective-C files were compiled as C with CMake 3.19 (#1787) + - [Cocoa] Bugfix: Duplicate video modes were not filtered out (#1830) + - [Cocoa] Bugfix: Menubar was not clickable on macOS 10.15+ until it lost and + regained focus (#1648,#1802) + - [Cocoa] Bugfix: Monitor name query could segfault on macOS 11 (#1809,#1833) + - [Cocoa] Bugfix: The install name of the installed dylib was relative (#1504) - [X11] Bugfix: The CMake files did not check for the XInput headers (#1480) - [X11] Bugfix: Key names were not updated when the keyboard layout changed (#1462,#1528) @@ -199,6 +219,8 @@ information on what to include when reporting a bug. combinaitons (#1598) - [X11] Bugfix: Keys pressed simultaneously with others were not always reported (#1112,#1415,#1472,#1616) + - [X11] Bugfix: Some window attributes were not applied on leaving fullscreen + (#1863) - [Wayland] Removed support for `wl_shell` (#1443) - [Wayland] Bugfix: The `GLFW_HAND_CURSOR` shape used the wrong image (#1432) - [Wayland] Bugfix: `CLOCK_MONOTONIC` was not correctly enabled @@ -206,6 +228,9 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: Retrieving partial framebuffer size would segfault - [Wayland] Bugfix: Scrolling offsets were inverted compared to other platforms (#1463) + - [Wayland] Bugfix: Client-Side Decorations were destroyed in the wrong worder + (#1798) + - [Wayland] Bugfix: Monitors physical size could report zero (#1784,#1792) - [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled - [NSGL] Removed enforcement of forward-compatible flag for core contexts - [NSGL] Bugfix: `GLFW_COCOA_RETINA_FRAMEBUFFER` had no effect on newer @@ -240,13 +265,16 @@ GLFW exists because people around the world donated their time and lent their skills. - Bobyshev Alexander + - Laurent Aphecetche - Matt Arsenault + - ashishgamedev - David Avedissian - Keith Bauer - John Bartholomew - Coşku Baş - Niklas Behrens - Andrew Belt + - Nevyn Bengtsson - Niklas Bergström - Denis Bernard - Doug Binks @@ -268,6 +296,7 @@ skills. - Andrew Corrigan - Bailey Cosier - Noel Cower + - CuriouserThing - Jason Daly - Jarrod Davis - Olivier Delannoy @@ -294,6 +323,7 @@ skills. - Eloi Marín Gratacós - Stefan Gustavson - Jonathan Hale + - hdf89shfdfs - Sylvain Hellegouarch - Matthew Henry - heromyth @@ -318,11 +348,13 @@ skills. - Konstantin Käfer - Eric Larson - Francis Lecavalier + - Jong Won Lee - Robin Leffmann - Glenn Lewis - Shane Liesegang - Anders Lindqvist - Leon Linhart + - Marco Lizza - Eyal Lotem - Aaron Loucks - Luflosi @@ -428,6 +460,9 @@ skills. - Waris - Jay Weisskopf - Frank Wille + - Andy Williams + - Joel Winarske + - Richard A. Wilkes - Tatsuya Yatagawa - Ryogo Yoshimura - Lukas Zanner @@ -436,6 +471,7 @@ skills. - Santi Zupancic - Jonas Ådahl - Lasse Öörni + - Leonard König - All the unmentioned and anonymous contributors in the GLFW community, for bug reports, patches, feedback, testing and encouragement diff --git a/src/external/glfw/include/GLFW/glfw3.h b/src/external/glfw/include/GLFW/glfw3.h index 7d9dee02b..7728dad10 100644 --- a/src/external/glfw/include/GLFW/glfw3.h +++ b/src/external/glfw/include/GLFW/glfw3.h @@ -276,23 +276,24 @@ extern "C" { /*! @name GLFW version macros * @{ */ -/*! @brief The major version number of the GLFW library. +/*! @brief The major version number of the GLFW header. * - * This is incremented when the API is changed in non-compatible ways. + * The major version number of the GLFW header. This is incremented when the + * API is changed in non-compatible ways. * @ingroup init */ #define GLFW_VERSION_MAJOR 3 -/*! @brief The minor version number of the GLFW library. +/*! @brief The minor version number of the GLFW header. * - * This is incremented when features are added to the API but it remains - * backward-compatible. + * The minor version number of the GLFW header. This is incremented when + * features are added to the API but it remains backward-compatible. * @ingroup init */ #define GLFW_VERSION_MINOR 4 -/*! @brief The revision number of the GLFW library. +/*! @brief The revision number of the GLFW header. * - * This is incremented when a bug fix release is made that does not contain any - * API changes. + * The revision number of the GLFW header. This is incremented when a bug fix + * release is made that does not contain any API changes. * @ingroup init */ #define GLFW_VERSION_REVISION 0 @@ -977,9 +978,10 @@ extern "C" { * Monitor refresh rate [hint](@ref GLFW_REFRESH_RATE). */ #define GLFW_REFRESH_RATE 0x0002100F -/*! @brief Framebuffer double buffering hint. +/*! @brief Framebuffer double buffering hint and attribute. * - * Framebuffer double buffering [hint](@ref GLFW_DOUBLEBUFFER). + * Framebuffer double buffering [hint](@ref GLFW_DOUBLEBUFFER_hint) and + * [attribute](@ref GLFW_DOUBLEBUFFER_attrib). */ #define GLFW_DOUBLEBUFFER 0x00021010 @@ -1250,6 +1252,11 @@ extern "C" { * macOS specific [init hint](@ref GLFW_COCOA_MENUBAR_hint). */ #define GLFW_COCOA_MENUBAR 0x00051002 +/*! @brief X11 specific init hint. + * + * X11 specific [init hint](@ref GLFW_X11_XCB_VULKAN_SURFACE_hint). + */ +#define GLFW_X11_XCB_VULKAN_SURFACE 0x00052001 /*! @} */ #define GLFW_DONT_CARE -1 @@ -2417,8 +2424,9 @@ GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback); * * This function returns an array of all video modes supported by the specified * monitor. The returned array is sorted in ascending order, first by color - * bit depth (the sum of all channel depths) and then by resolution area (the - * product of width and height). + * bit depth (the sum of all channel depths), then by resolution area (the + * product of width and height), then resolution width and finally by refresh + * rate. * * @param[in] monitor The monitor to query. * @param[out] count Where to store the number of video modes in the returned @@ -5865,9 +5873,8 @@ GLFWAPI int glfwVulkanSupported(void); * returned array, as it is an error to specify an extension more than once in * the `VkInstanceCreateInfo` struct. * - * @remark @macos This function currently supports either the - * `VK_MVK_macos_surface` extension from MoltenVK or `VK_EXT_metal_surface` - * extension. + * @remark @macos GLFW currently supports both the `VK_MVK_macos_surface` and + * the newer `VK_EXT_metal_surface` extensions. * * @pointer_lifetime The returned array is allocated and freed by GLFW. You * should not free it yourself. It is guaranteed to be valid only until the @@ -5950,7 +5957,7 @@ GLFWAPI GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, const char* p * GLFW_API_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR. * * @remark @macos This function currently always returns `GLFW_TRUE`, as the - * `VK_MVK_macos_surface` extension does not provide + * `VK_MVK_macos_surface` and `VK_EXT_metal_surface` extensions do not provide * a `vkGetPhysicalDevice*PresentationSupport` type function. * * @thread_safety This function may be called from any thread. For @@ -6013,6 +6020,12 @@ GLFWAPI int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhys * @remark @macos This function creates and sets a `CAMetalLayer` instance for * the window content view, which is required for MoltenVK to function. * + * @remark @x11 GLFW by default attempts to use the `VK_KHR_xcb_surface` + * extension, if available. You can make it prefer the `VK_KHR_xlib_surface` + * extension by setting the + * [GLFW_X11_XCB_VULKAN_SURFACE](@ref GLFW_X11_XCB_VULKAN_SURFACE_hint) init + * hint. + * * @thread_safety This function may be called from any thread. For * synchronization details of Vulkan objects, see the Vulkan specification. * diff --git a/src/external/glfw/include/GLFW/glfw3native.h b/src/external/glfw/include/GLFW/glfw3native.h index ba6a16bbf..f67f54025 100644 --- a/src/external/glfw/include/GLFW/glfw3native.h +++ b/src/external/glfw/include/GLFW/glfw3native.h @@ -83,8 +83,8 @@ extern "C" { #if defined(GLFW_EXPOSE_NATIVE_WIN32) || defined(GLFW_EXPOSE_NATIVE_WGL) // This is a workaround for the fact that glfw3.h needs to export APIENTRY (for - // example to allow applications to correctly declare a GL_ARB_debug_output - // callback) but windows.h assumes no one will define APIENTRY before it does + // example to allow applications to correctly declare a GL_KHR_debug callback) + // but windows.h assumes no one will define APIENTRY before it does #if defined(GLFW_APIENTRY_DEFINED) #undef APIENTRY #undef GLFW_APIENTRY_DEFINED @@ -96,7 +96,6 @@ extern "C" { typedef PVOID HANDLE; typedef HANDLE HWND; #elif defined(GLFW_EXPOSE_NATIVE_COCOA) || defined(GLFW_EXPOSE_NATIVE_NSGL) - #include #if defined(__OBJC__) #import #else diff --git a/src/external/glfw/src/CMakeLists.txt b/src/external/glfw/src/CMakeLists.txt index 8db786eaf..f6e404f2b 100644 --- a/src/external/glfw/src/CMakeLists.txt +++ b/src/external/glfw/src/CMakeLists.txt @@ -1,149 +1,192 @@ -set(common_HEADERS internal.h mappings.h - "${GLFW_BINARY_DIR}/src/glfw_config.h" - "${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h" - "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h") -set(common_SOURCES context.c init.c input.c monitor.c vulkan.c window.c) +add_library(glfw "${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h" + "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h" + internal.h mappings.h context.c init.c input.c monitor.c + vulkan.c window.c) if (_GLFW_COCOA) - set(glfw_HEADERS ${common_HEADERS} cocoa_platform.h cocoa_joystick.h - posix_thread.h nsgl_context.h egl_context.h osmesa_context.h) - set(glfw_SOURCES ${common_SOURCES} cocoa_init.m cocoa_joystick.m - cocoa_monitor.m cocoa_window.m cocoa_time.c posix_thread.c - nsgl_context.m egl_context.c osmesa_context.c) + target_sources(glfw PRIVATE cocoa_platform.h cocoa_joystick.h posix_thread.h + nsgl_context.h egl_context.h osmesa_context.h + cocoa_init.m cocoa_joystick.m cocoa_monitor.m + cocoa_window.m cocoa_time.c posix_thread.c + nsgl_context.m egl_context.c osmesa_context.c) elseif (_GLFW_WIN32) - set(glfw_HEADERS ${common_HEADERS} win32_platform.h win32_joystick.h - wgl_context.h egl_context.h osmesa_context.h) - set(glfw_SOURCES ${common_SOURCES} win32_init.c win32_joystick.c - win32_monitor.c win32_time.c win32_thread.c win32_window.c - wgl_context.c egl_context.c osmesa_context.c) + target_sources(glfw PRIVATE win32_platform.h win32_joystick.h wgl_context.h + egl_context.h osmesa_context.h win32_init.c + win32_joystick.c win32_monitor.c win32_time.c + win32_thread.c win32_window.c wgl_context.c + egl_context.c osmesa_context.c) elseif (_GLFW_X11) - set(glfw_HEADERS ${common_HEADERS} x11_platform.h xkb_unicode.h posix_time.h - posix_thread.h glx_context.h egl_context.h osmesa_context.h) - set(glfw_SOURCES ${common_SOURCES} x11_init.c x11_monitor.c x11_window.c - xkb_unicode.c posix_time.c posix_thread.c glx_context.c - egl_context.c osmesa_context.c) + target_sources(glfw PRIVATE x11_platform.h xkb_unicode.h posix_time.h + posix_thread.h glx_context.h egl_context.h + osmesa_context.h x11_init.c x11_monitor.c + x11_window.c xkb_unicode.c posix_time.c + posix_thread.c glx_context.c egl_context.c + osmesa_context.c) elseif (_GLFW_WAYLAND) - set(glfw_HEADERS ${common_HEADERS} wl_platform.h - posix_time.h posix_thread.h xkb_unicode.h egl_context.h - osmesa_context.h) - set(glfw_SOURCES ${common_SOURCES} wl_init.c wl_monitor.c wl_window.c - posix_time.c posix_thread.c xkb_unicode.c - egl_context.c osmesa_context.c) - - ecm_add_wayland_client_protocol(glfw_SOURCES - PROTOCOL - "${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/xdg-shell/xdg-shell.xml" - BASENAME xdg-shell) - ecm_add_wayland_client_protocol(glfw_SOURCES - PROTOCOL - "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml" - BASENAME xdg-decoration) - ecm_add_wayland_client_protocol(glfw_SOURCES - PROTOCOL - "${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/viewporter/viewporter.xml" - BASENAME viewporter) - ecm_add_wayland_client_protocol(glfw_SOURCES - PROTOCOL - "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/relative-pointer/relative-pointer-unstable-v1.xml" - BASENAME relative-pointer-unstable-v1) - ecm_add_wayland_client_protocol(glfw_SOURCES - PROTOCOL - "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml" - BASENAME pointer-constraints-unstable-v1) - ecm_add_wayland_client_protocol(glfw_SOURCES - PROTOCOL - "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml" - BASENAME idle-inhibit-unstable-v1) + target_sources(glfw PRIVATE wl_platform.h posix_time.h posix_thread.h + xkb_unicode.h egl_context.h osmesa_context.h + wl_init.c wl_monitor.c wl_window.c posix_time.c + posix_thread.c xkb_unicode.c egl_context.c + osmesa_context.c) elseif (_GLFW_OSMESA) - set(glfw_HEADERS ${common_HEADERS} null_platform.h null_joystick.h - posix_time.h posix_thread.h osmesa_context.h) - set(glfw_SOURCES ${common_SOURCES} null_init.c null_monitor.c null_window.c - null_joystick.c posix_time.c posix_thread.c osmesa_context.c) + target_sources(glfw PRIVATE null_platform.h null_joystick.h posix_time.h + posix_thread.h osmesa_context.h null_init.c + null_monitor.c null_window.c null_joystick.c + posix_time.c posix_thread.c osmesa_context.c) endif() if (_GLFW_X11 OR _GLFW_WAYLAND) - if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") - set(glfw_HEADERS ${glfw_HEADERS} linux_joystick.h) - set(glfw_SOURCES ${glfw_SOURCES} linux_joystick.c) + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + target_sources(glfw PRIVATE linux_joystick.h linux_joystick.c) else() - set(glfw_HEADERS ${glfw_HEADERS} null_joystick.h) - set(glfw_SOURCES ${glfw_SOURCES} null_joystick.c) + target_sources(glfw PRIVATE null_joystick.h null_joystick.c) endif() endif() -if (APPLE) - # For some reason, CMake doesn't know about .m - set_source_files_properties(${glfw_SOURCES} PROPERTIES LANGUAGE C) +if (_GLFW_WAYLAND) + find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) + pkg_check_modules(WAYLAND_PROTOCOLS REQUIRED wayland-protocols>=1.15) + pkg_get_variable(WAYLAND_PROTOCOLS_BASE wayland-protocols pkgdatadir) + + macro(wayland_generate protocol_file output_file) + add_custom_command(OUTPUT "${output_file}.h" + COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" client-header "${protocol_file}" "${output_file}.h" + DEPENDS "${protocol_file}" + VERBATIM) + + add_custom_command(OUTPUT "${output_file}.c" + COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" private-code "${protocol_file}" "${output_file}.c" + DEPENDS "${protocol_file}" + VERBATIM) + + target_sources(glfw PRIVATE "${output_file}.h" "${output_file}.c") + endmacro() + + wayland_generate( + "${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml" + "${GLFW_BINARY_DIR}/src/wayland-xdg-shell-client-protocol") + wayland_generate( + "${WAYLAND_PROTOCOLS_BASE}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml" + "${GLFW_BINARY_DIR}/src/wayland-xdg-decoration-client-protocol") + wayland_generate( + "${WAYLAND_PROTOCOLS_BASE}/stable/viewporter/viewporter.xml" + "${GLFW_BINARY_DIR}/src/wayland-viewporter-client-protocol") + wayland_generate( + "${WAYLAND_PROTOCOLS_BASE}/unstable/relative-pointer/relative-pointer-unstable-v1.xml" + "${GLFW_BINARY_DIR}/src/wayland-relative-pointer-unstable-v1-client-protocol") + wayland_generate( + "${WAYLAND_PROTOCOLS_BASE}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml" + "${GLFW_BINARY_DIR}/src/wayland-pointer-constraints-unstable-v1-client-protocol") + wayland_generate( + "${WAYLAND_PROTOCOLS_BASE}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml" + "${GLFW_BINARY_DIR}/src/wayland-idle-inhibit-unstable-v1-client-protocol") endif() -# Make GCC and Clang warn about declarations that VS 2010 and 2012 won't accept -# for all source files that VS will build -if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR - "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR - "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") - - if (WIN32) - set(windows_SOURCES ${glfw_SOURCES}) - else() - set(windows_SOURCES ${common_SOURCES}) - endif() - set_source_files_properties(${windows_SOURCES} PROPERTIES - COMPILE_FLAGS -Wdeclaration-after-statement) +if (WIN32 AND BUILD_SHARED_LIBS) + configure_file(glfw.rc.in glfw.rc @ONLY) + target_sources(glfw PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/glfw.rc") endif() -add_library(glfw_objlib OBJECT ${glfw_SOURCES} ${glfw_HEADERS}) -add_library(glfw $) -set_target_properties(glfw_objlib PROPERTIES POSITION_INDEPENDENT_CODE ON) +configure_file(glfw_config.h.in glfw_config.h @ONLY) +target_compile_definitions(glfw PRIVATE _GLFW_USE_CONFIG_H) +target_sources(glfw PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/glfw_config.h") + set_target_properties(glfw PROPERTIES OUTPUT_NAME ${GLFW_LIB_NAME} VERSION ${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR} SOVERSION ${GLFW_VERSION_MAJOR} + POSITION_INDEPENDENT_CODE ON + C_STANDARD 99 + C_EXTENSIONS OFF + DEFINE_SYMBOL _GLFW_BUILD_DLL FOLDER "GLFW3") -if (${CMAKE_VERSION} VERSION_EQUAL "3.1.0" OR - ${CMAKE_VERSION} VERSION_GREATER "3.1.0") - - set_target_properties(glfw_objlib PROPERTIES C_STANDARD 99) -else() - # Remove this fallback when removing support for CMake version less than 3.1 - target_compile_options(glfw_objlib PRIVATE - "$<$:-std=c99>" - "$<$:-std=c99>" - "$<$:-std=c99>") -endif() - -target_compile_definitions(glfw_objlib PRIVATE _GLFW_USE_CONFIG_H) -target_include_directories(glfw_objlib PUBLIC - "$" - "$") target_include_directories(glfw PUBLIC "$" - "$") -target_include_directories(glfw_objlib PRIVATE + "$") +target_include_directories(glfw PRIVATE "${GLFW_SOURCE_DIR}/src" "${GLFW_BINARY_DIR}/src" ${glfw_INCLUDE_DIRS}) +target_link_libraries(glfw PRIVATE Threads::Threads ${glfw_LIBRARIES}) + +# Workaround for CMake not knowing about .m files before version 3.16 +if ("${CMAKE_VERSION}" VERSION_LESS "3.16" AND APPLE) + set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m + cocoa_window.m nsgl_context.m PROPERTIES + LANGUAGE C) +endif() + +# Make GCC warn about declarations that VS 2010 and 2012 won't accept for all +# source files that VS will build (Clang ignores this because we set -std=c99) +if (CMAKE_C_COMPILER_ID STREQUAL "GNU") + set_source_files_properties(context.c init.c input.c monitor.c vulkan.c + window.c win32_init.c win32_joystick.c + win32_monitor.c win32_time.c win32_thread.c + win32_window.c wgl_context.c egl_context.c + osmesa_context.c PROPERTIES + COMPILE_FLAGS -Wdeclaration-after-statement) +endif() + +# Enable a reasonable set of warnings +# NOTE: The order matters here, Clang-CL matches both MSVC and Clang +if (MSVC) + target_compile_options(glfw PRIVATE "/W3") +elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR + CMAKE_C_COMPILER_ID STREQUAL "Clang" OR + CMAKE_C_COMPILER_ID STREQUAL "AppleClang") + + target_compile_options(glfw PRIVATE "-Wall") +endif() + +if (_GLFW_WIN32) + target_compile_definitions(glfw PRIVATE UNICODE _UNICODE) +endif() # HACK: When building on MinGW, WINVER and UNICODE need to be defined before # the inclusion of stddef.h (by glfw3.h), which is itself included before # win32_platform.h. We define them here until a saner solution can be found # NOTE: MinGW-w64 and Visual C++ do /not/ need this hack. -target_compile_definitions(glfw_objlib PRIVATE - "$<$:UNICODE;WINVER=0x0501>") +if (MINGW) + target_compile_definitions(glfw PRIVATE WINVER=0x0501) +endif() -# Enable a reasonable set of warnings (no, -Wextra is not reasonable) -target_compile_options(glfw_objlib PRIVATE - "$<$:-Wall>" - "$<$:-Wall>" - "$<$:-Wall>") +# Workaround for legacy MinGW not providing XInput and DirectInput +if (MINGW) + include(CheckIncludeFile) + check_include_file(dinput.h DINPUT_H_FOUND) + check_include_file(xinput.h XINPUT_H_FOUND) + if (NOT DINPUT_H_FOUND OR NOT XINPUT_H_FOUND) + target_include_directories(glfw PRIVATE "${GLFW_SOURCE_DIR}/deps/mingw") + endif() +endif() + +# Workaround for the MS CRT deprecating parts of the standard library +if (MSVC OR CMAKE_C_SIMULATE_ID STREQUAL "MSVC") + target_compile_definitions(glfw PRIVATE _CRT_SECURE_NO_WARNINGS) +endif() + +# Workaround for VS 2008 not shipping with stdint.h +if (MSVC90) + target_include_directories(glfw PUBLIC "${GLFW_SOURCE_DIR}/deps/vs2008") +endif() + +# Check for the DirectX 9 SDK as it is not included with VS 2008 +if (MSVC90) + include(CheckIncludeFile) + check_include_file(dinput.h DINPUT_H_FOUND) + if (NOT DINPUT_H_FOUND) + message(FATAL_ERROR "DirectX 9 headers not found; install DirectX 9 SDK") + endif() +endif() if (BUILD_SHARED_LIBS) if (WIN32) if (MINGW) # Remove the dependency on the shared version of libgcc # NOTE: MinGW-w64 has the correct default but MinGW needs this - target_link_options(glfw PRIVATE "-static-libgcc") + target_link_libraries(glfw PRIVATE "-static-libgcc") # Remove the lib prefix on the DLL (but not the import library) set_target_properties(glfw PROPERTIES PREFIX "") @@ -155,33 +198,48 @@ if (BUILD_SHARED_LIBS) set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.lib") endif() - target_compile_definitions(glfw_objlib INTERFACE GLFW_DLL) - elseif (APPLE) - # Add -fno-common to work around a bug in Apple's GCC - target_compile_options(glfw_objlib PRIVATE "-fno-common") + target_compile_definitions(glfw INTERFACE GLFW_DLL) + endif() - set_target_properties(glfw PROPERTIES - INSTALL_NAME_DIR "${CMAKE_INSTALL_LIBDIR}") + if (MINGW) + # Enable link-time exploit mitigation features enabled by default on MSVC + include(CheckCCompilerFlag) + + # Compatibility with data execution prevention (DEP) + set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat") + check_c_compiler_flag("" _GLFW_HAS_DEP) + if (_GLFW_HAS_DEP) + target_link_libraries(glfw PRIVATE "-Wl,--nxcompat") + endif() + + # Compatibility with address space layout randomization (ASLR) + set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase") + check_c_compiler_flag("" _GLFW_HAS_ASLR) + if (_GLFW_HAS_ASLR) + target_link_libraries(glfw PRIVATE "-Wl,--dynamicbase") + endif() + + # Compatibility with 64-bit address space layout randomization (ASLR) + set(CMAKE_REQUIRED_FLAGS "-Wl,--high-entropy-va") + check_c_compiler_flag("" _GLFW_HAS_64ASLR) + if (_GLFW_HAS_64ASLR) + target_link_libraries(glfw PRIVATE "-Wl,--high-entropy-va") + endif() + + # Clear flags again to avoid breaking later tests + set(CMAKE_REQUIRED_FLAGS) endif() if (UNIX) # Hide symbols not explicitly tagged for export from the shared library - target_compile_options(glfw_objlib PRIVATE "-fvisibility=hidden") + target_compile_options(glfw PRIVATE "-fvisibility=hidden") endif() - - target_link_libraries(glfw PRIVATE ${glfw_LIBRARIES}) -else() - target_link_libraries(glfw INTERFACE ${glfw_LIBRARIES}) -endif() - -if (MSVC) - target_compile_definitions(glfw_objlib PRIVATE _CRT_SECURE_NO_WARNINGS) endif() if (GLFW_INSTALL) install(TARGETS glfw EXPORT glfwTargets - RUNTIME DESTINATION "bin" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") endif() diff --git a/src/external/glfw/src/cocoa_init.m b/src/external/glfw/src/cocoa_init.m index 7cad8b8e8..626d95c23 100644 --- a/src/external/glfw/src/cocoa_init.m +++ b/src/external/glfw/src/cocoa_init.m @@ -251,7 +251,7 @@ static void createKeyTables(void) _glfw.ns.keycodes[0x6D] = GLFW_KEY_F10; _glfw.ns.keycodes[0x67] = GLFW_KEY_F11; _glfw.ns.keycodes[0x6F] = GLFW_KEY_F12; - _glfw.ns.keycodes[0x69] = GLFW_KEY_F13; + _glfw.ns.keycodes[0x69] = GLFW_KEY_PRINT_SCREEN; _glfw.ns.keycodes[0x6B] = GLFW_KEY_F14; _glfw.ns.keycodes[0x71] = GLFW_KEY_F15; _glfw.ns.keycodes[0x6A] = GLFW_KEY_F16; @@ -428,9 +428,6 @@ static GLFWbool initializeTIS(void) { if (_glfw.hints.init.ns.menubar) { - // In case we are unbundled, make us a proper UI application - [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; - // Menu bar setup must go between sharedApplication and finishLaunching // in order to properly emulate the behavior of NSApplicationMain @@ -557,6 +554,10 @@ int _glfwPlatformInit(void) if (![[NSRunningApplication currentApplication] isFinishedLaunching]) [NSApp run]; + // In case we are unbundled, make us a proper UI application + if (_glfw.hints.init.ns.menubar) + [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; + return GLFW_TRUE; } // autoreleasepool diff --git a/src/external/glfw/src/cocoa_monitor.m b/src/external/glfw/src/cocoa_monitor.m index 2bb83738c..31bf04349 100644 --- a/src/external/glfw/src/cocoa_monitor.m +++ b/src/external/glfw/src/cocoa_monitor.m @@ -39,8 +39,21 @@ // Get the name of the specified display, or NULL // -static char* getDisplayName(CGDirectDisplayID displayID) +static char* getMonitorName(CGDirectDisplayID displayID, NSScreen* screen) { + // IOKit doesn't work on Apple Silicon anymore + // Luckily, 10.15 introduced -[NSScreen localizedName]. + // Use it if available, and fall back to IOKit otherwise. + if (screen) + { + if ([screen respondsToSelector:@selector(localizedName)]) + { + NSString* name = [screen valueForKey:@"localizedName"]; + if (name) + return _glfw_strdup([name UTF8String]); + } + } + io_iterator_t it; io_service_t service; CFDictionaryRef info; @@ -50,7 +63,7 @@ static char* getDisplayName(CGDirectDisplayID displayID) &it) != 0) { // This may happen if a desktop Mac is running headless - return NULL; + return _glfw_strdup("Display"); } while ((service = IOIteratorNext(it)) != 0) @@ -88,7 +101,7 @@ static char* getDisplayName(CGDirectDisplayID displayID) { _glfwInputError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to find service port for display"); - return NULL; + return _glfw_strdup("Display"); } CFDictionaryRef names = @@ -101,7 +114,7 @@ static char* getDisplayName(CGDirectDisplayID displayID) { // This may happen if a desktop Mac is running headless CFRelease(info); - return NULL; + return _glfw_strdup("Display"); } const CFIndex size = @@ -209,31 +222,6 @@ static void endFadeReservation(CGDisplayFadeReservationToken token) } } -// Finds and caches the NSScreen corresponding to the specified monitor -// -static GLFWbool refreshMonitorScreen(_GLFWmonitor* monitor) -{ - if (monitor->ns.screen) - return GLFW_TRUE; - - for (NSScreen* screen in [NSScreen screens]) - { - NSNumber* displayID = [screen deviceDescription][@"NSScreenNumber"]; - - // HACK: Compare unit numbers instead of display IDs to work around - // display replacement on machines with automatic graphics - // switching - if (monitor->ns.unitNumber == CGDisplayUnitNumber([displayID unsignedIntValue])) - { - monitor->ns.screen = screen; - return GLFW_TRUE; - } - } - - _glfwInputError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to find a screen for monitor"); - return GLFW_FALSE; -} - // Returns the display refresh rate queried from the I/O registry // static double getFallbackRefreshRate(CGDirectDisplayID displayID) @@ -334,27 +322,46 @@ void _glfwPollMonitorsNS(void) if (CGDisplayIsAsleep(displays[i])) continue; + const uint32_t unitNumber = CGDisplayUnitNumber(displays[i]); + NSScreen* screen = nil; + + for (screen in [NSScreen screens]) + { + NSNumber* screenNumber = [screen deviceDescription][@"NSScreenNumber"]; + + // HACK: Compare unit numbers instead of display IDs to work around + // display replacement on machines with automatic graphics + // switching + if (CGDisplayUnitNumber([screenNumber unsignedIntValue]) == unitNumber) + break; + } + // HACK: Compare unit numbers instead of display IDs to work around // display replacement on machines with automatic graphics // switching - const uint32_t unitNumber = CGDisplayUnitNumber(displays[i]); - for (uint32_t j = 0; j < disconnectedCount; j++) + uint32_t j; + for (j = 0; j < disconnectedCount; j++) { if (disconnected[j] && disconnected[j]->ns.unitNumber == unitNumber) { + disconnected[j]->ns.screen = screen; disconnected[j] = NULL; break; } } + if (j < disconnectedCount) + continue; + const CGSize size = CGDisplayScreenSize(displays[i]); - char* name = getDisplayName(displays[i]); + char* name = getMonitorName(displays[i], screen); if (!name) - name = _glfw_strdup("Unknown"); + continue; _GLFWmonitor* monitor = _glfwAllocMonitor(name, size.width, size.height); monitor->ns.displayID = displays[i]; monitor->ns.unitNumber = unitNumber; + monitor->ns.screen = screen; free(name); @@ -463,8 +470,11 @@ void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor, { @autoreleasepool { - if (!refreshMonitorScreen(monitor)) - return; + if (!monitor->ns.screen) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Cocoa: Cannot query content scale without screen"); + } const NSRect points = [monitor->ns.screen frame]; const NSRect pixels = [monitor->ns.screen convertRectToBacking:points]; @@ -483,8 +493,11 @@ void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, { @autoreleasepool { - if (!refreshMonitorScreen(monitor)) - return; + if (!monitor->ns.screen) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Cocoa: Cannot query workarea without screen"); + } const NSRect frameRect = [monitor->ns.screen visibleFrame]; @@ -527,7 +540,7 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count) } // Skip duplicate modes - if (i < *count) + if (j < *count) continue; (*count)++; diff --git a/src/external/glfw/src/cocoa_window.m b/src/external/glfw/src/cocoa_window.m index 81b22e2f9..b618dccc8 100644 --- a/src/external/glfw/src/cocoa_window.m +++ b/src/external/glfw/src/cocoa_window.m @@ -1635,14 +1635,21 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) SEL cursorSelector = NULL; // HACK: Try to use a private message - if (shape == GLFW_RESIZE_EW_CURSOR) - cursorSelector = NSSelectorFromString(@"_windowResizeEastWestCursor"); - else if (shape == GLFW_RESIZE_NS_CURSOR) - cursorSelector = NSSelectorFromString(@"_windowResizeNorthSouthCursor"); - else if (shape == GLFW_RESIZE_NWSE_CURSOR) - cursorSelector = NSSelectorFromString(@"_windowResizeNorthWestSouthEastCursor"); - else if (shape == GLFW_RESIZE_NESW_CURSOR) - cursorSelector = NSSelectorFromString(@"_windowResizeNorthEastSouthWestCursor"); + switch (shape) + { + case GLFW_RESIZE_EW_CURSOR: + cursorSelector = NSSelectorFromString(@"_windowResizeEastWestCursor"); + break; + case GLFW_RESIZE_NS_CURSOR: + cursorSelector = NSSelectorFromString(@"_windowResizeNorthSouthCursor"); + break; + case GLFW_RESIZE_NWSE_CURSOR: + cursorSelector = NSSelectorFromString(@"_windowResizeNorthWestSouthEastCursor"); + break; + case GLFW_RESIZE_NESW_CURSOR: + cursorSelector = NSSelectorFromString(@"_windowResizeNorthEastSouthWestCursor"); + break; + } if (cursorSelector && [NSCursor respondsToSelector:cursorSelector]) { @@ -1653,22 +1660,33 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) if (!cursor->ns.object) { - if (shape == GLFW_ARROW_CURSOR) - cursor->ns.object = [NSCursor arrowCursor]; - else if (shape == GLFW_IBEAM_CURSOR) - cursor->ns.object = [NSCursor IBeamCursor]; - else if (shape == GLFW_CROSSHAIR_CURSOR) - cursor->ns.object = [NSCursor crosshairCursor]; - else if (shape == GLFW_POINTING_HAND_CURSOR) - cursor->ns.object = [NSCursor pointingHandCursor]; - else if (shape == GLFW_RESIZE_EW_CURSOR) - cursor->ns.object = [NSCursor resizeLeftRightCursor]; - else if (shape == GLFW_RESIZE_NS_CURSOR) - cursor->ns.object = [NSCursor resizeUpDownCursor]; - else if (shape == GLFW_RESIZE_ALL_CURSOR) - cursor->ns.object = [NSCursor closedHandCursor]; - else if (shape == GLFW_NOT_ALLOWED_CURSOR) - cursor->ns.object = [NSCursor operationNotAllowedCursor]; + switch (shape) + { + case GLFW_ARROW_CURSOR: + cursor->ns.object = [NSCursor arrowCursor]; + break; + case GLFW_IBEAM_CURSOR: + cursor->ns.object = [NSCursor IBeamCursor]; + break; + case GLFW_CROSSHAIR_CURSOR: + cursor->ns.object = [NSCursor crosshairCursor]; + break; + case GLFW_POINTING_HAND_CURSOR: + cursor->ns.object = [NSCursor pointingHandCursor]; + break; + case GLFW_RESIZE_EW_CURSOR: + cursor->ns.object = [NSCursor resizeLeftRightCursor]; + break; + case GLFW_RESIZE_NS_CURSOR: + cursor->ns.object = [NSCursor resizeUpDownCursor]; + break; + case GLFW_RESIZE_ALL_CURSOR: + cursor->ns.object = [NSCursor closedHandCursor]; + break; + case GLFW_NOT_ALLOWED_CURSOR: + cursor->ns.object = [NSCursor operationNotAllowedCursor]; + break; + } } if (!cursor->ns.object) diff --git a/src/external/glfw/src/context.c b/src/external/glfw/src/context.c index 48311e5fd..f6629f554 100644 --- a/src/external/glfw/src/context.c +++ b/src/external/glfw/src/context.c @@ -196,12 +196,6 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired, continue; } - if (desired->doublebuffer != current->doublebuffer) - { - // Double buffering is a hard constraint - continue; - } - // Count number of missing buffers { missing = 0; @@ -570,7 +564,9 @@ GLFWbool _glfwRefreshContextAttribs(_GLFWwindow* window, PFNGLCLEARPROC glClear = (PFNGLCLEARPROC) window->context.getProcAddress("glClear"); glClear(GL_COLOR_BUFFER_BIT); - window->context.swapBuffers(window); + + if (window->doublebuffer) + window->context.swapBuffers(window); } glfwMakeContextCurrent((GLFWwindow*) previous); diff --git a/src/external/glfw/src/egl_context.c b/src/external/glfw/src/egl_context.c index 533ed8e72..975c67be2 100644 --- a/src/external/glfw/src/egl_context.c +++ b/src/external/glfw/src/egl_context.c @@ -173,7 +173,7 @@ static GLFWbool chooseEGLConfig(const _GLFWctxconfig* ctxconfig, u->stencilBits = getEGLConfigAttrib(n, EGL_STENCIL_SIZE); u->samples = getEGLConfigAttrib(n, EGL_SAMPLES); - u->doublebuffer = GLFW_TRUE; + u->doublebuffer = desired->doublebuffer; u->handle = (uintptr_t) n; usableCount++; @@ -643,6 +643,9 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window, setAttrib(EGL_GL_COLORSPACE_KHR, EGL_GL_COLORSPACE_SRGB_KHR); } + if (!fbconfig->doublebuffer) + setAttrib(EGL_RENDER_BUFFER, EGL_SINGLE_BUFFER); + setAttrib(EGL_NONE, EGL_NONE); native = _glfwPlatformGetEGLNativeWindow(window); diff --git a/src/external/glfw/src/egl_context.h b/src/external/glfw/src/egl_context.h index 9de424c93..4c84072ee 100644 --- a/src/external/glfw/src/egl_context.h +++ b/src/external/glfw/src/egl_context.h @@ -64,6 +64,8 @@ #define EGL_OPENGL_ES_API 0x30a0 #define EGL_OPENGL_API 0x30a2 #define EGL_NONE 0x3038 +#define EGL_RENDER_BUFFER 0x3086 +#define EGL_SINGLE_BUFFER 0x3085 #define EGL_EXTENSIONS 0x3055 #define EGL_CONTEXT_CLIENT_VERSION 0x3098 #define EGL_NATIVE_VISUAL_ID 0x302e diff --git a/src/external/glfw/src/glx_context.c b/src/external/glfw/src/glx_context.c index 7ccd13747..374c15e06 100644 --- a/src/external/glfw/src/glx_context.c +++ b/src/external/glfw/src/glx_context.c @@ -92,6 +92,9 @@ static GLFWbool chooseGLXFBConfig(const _GLFWfbconfig* desired, continue; } + if (getGLXFBConfigAttrib(n, GLX_DOUBLEBUFFER) != desired->doublebuffer) + continue; + if (desired->transparent) { XVisualInfo* vi = glXGetVisualFromFBConfig(_glfw.x11.display, n); @@ -119,8 +122,6 @@ static GLFWbool chooseGLXFBConfig(const _GLFWfbconfig* desired, if (getGLXFBConfigAttrib(n, GLX_STEREO)) u->stereo = GLFW_TRUE; - if (getGLXFBConfigAttrib(n, GLX_DOUBLEBUFFER)) - u->doublebuffer = GLFW_TRUE; if (_glfw.glx.ARB_multisample) u->samples = getGLXFBConfigAttrib(n, GLX_SAMPLES); diff --git a/src/external/glfw/src/init.c b/src/external/glfw/src/init.c index a7b5af634..bca59baab 100644 --- a/src/external/glfw/src/init.c +++ b/src/external/glfw/src/init.c @@ -57,7 +57,10 @@ static _GLFWinitconfig _glfwInitHints = { GLFW_TRUE, // macOS menu bar GLFW_TRUE // macOS bundle chdir - } + }, + { + GLFW_TRUE, // X11 XCB Vulkan surface + }, }; // Terminate the library @@ -298,6 +301,9 @@ GLFWAPI void glfwInitHint(int hint, int value) case GLFW_COCOA_MENUBAR: _glfwInitHints.ns.menubar = value; return; + case GLFW_X11_XCB_VULKAN_SURFACE: + _glfwInitHints.x11.xcbVulkanSurface = value; + return; } _glfwInputError(GLFW_INVALID_ENUM, diff --git a/src/external/glfw/src/input.c b/src/external/glfw/src/input.c index 226f835dc..9cc0c366f 100644 --- a/src/external/glfw/src/input.c +++ b/src/external/glfw/src/input.c @@ -446,7 +446,6 @@ _GLFWjoystick* _glfwAllocJoystick(const char* name, js = _glfw.joysticks + jid; js->present = GLFW_TRUE; - js->name = _glfw_strdup(name); js->axes = calloc(axisCount, sizeof(float)); js->buttons = calloc(buttonCount + (size_t) hatCount * 4, 1); js->hats = calloc(hatCount, 1); @@ -454,6 +453,7 @@ _GLFWjoystick* _glfwAllocJoystick(const char* name, js->buttonCount = buttonCount; js->hatCount = hatCount; + strncpy(js->name, name, sizeof(js->name) - 1); strncpy(js->guid, guid, sizeof(js->guid) - 1); js->mapping = findValidMapping(js); @@ -464,7 +464,6 @@ _GLFWjoystick* _glfwAllocJoystick(const char* name, // void _glfwFreeJoystick(_GLFWjoystick* js) { - free(js->name); free(js->axes); free(js->buttons); free(js->hats); diff --git a/src/external/glfw/src/internal.h b/src/external/glfw/src/internal.h index 48053cdee..ce9783f9e 100644 --- a/src/external/glfw/src/internal.h +++ b/src/external/glfw/src/internal.h @@ -248,6 +248,9 @@ struct _GLFWinitconfig GLFWbool menubar; GLFWbool chdir; } ns; + struct { + GLFWbool xcbVulkanSurface; + } x11; }; // Window configuration @@ -350,9 +353,9 @@ struct _GLFWcontext int robustness; int release; - PFNGLGETSTRINGIPROC GetStringi; + PFNGLGETSTRINGIPROC GetStringi; PFNGLGETINTEGERVPROC GetIntegerv; - PFNGLGETSTRINGPROC GetString; + PFNGLGETSTRINGPROC GetString; _GLFWmakecontextcurrentfun makeCurrent; _GLFWswapbuffersfun swapBuffers; @@ -384,6 +387,7 @@ struct _GLFWwindow GLFWbool mousePassthrough; GLFWbool shouldClose; void* userPointer; + GLFWbool doublebuffer; GLFWvidmode videoMode; _GLFWmonitor* monitor; _GLFWcursor* cursor; @@ -405,23 +409,23 @@ struct _GLFWwindow _GLFWcontext context; struct { - GLFWwindowposfun pos; - GLFWwindowsizefun size; - GLFWwindowclosefun close; - GLFWwindowrefreshfun refresh; - GLFWwindowfocusfun focus; - GLFWwindowiconifyfun iconify; - GLFWwindowmaximizefun maximize; - GLFWframebuffersizefun fbsize; + GLFWwindowposfun pos; + GLFWwindowsizefun size; + GLFWwindowclosefun close; + GLFWwindowrefreshfun refresh; + GLFWwindowfocusfun focus; + GLFWwindowiconifyfun iconify; + GLFWwindowmaximizefun maximize; + GLFWframebuffersizefun fbsize; GLFWwindowcontentscalefun scale; - GLFWmousebuttonfun mouseButton; - GLFWcursorposfun cursorPos; - GLFWcursorenterfun cursorEnter; - GLFWscrollfun scroll; - GLFWkeyfun key; - GLFWcharfun character; - GLFWcharmodsfun charmods; - GLFWdropfun drop; + GLFWmousebuttonfun mouseButton; + GLFWcursorposfun cursorPos; + GLFWcursorenterfun cursorEnter; + GLFWscrollfun scroll; + GLFWkeyfun key; + GLFWcharfun character; + GLFWcharmodsfun charmods; + GLFWdropfun drop; } callbacks; // This is defined in the window API's platform.h @@ -432,7 +436,7 @@ struct _GLFWwindow // struct _GLFWmonitor { - char* name; + char name[128]; void* userPointer; // Physical dimensions in millimeters. @@ -493,7 +497,7 @@ struct _GLFWjoystick int buttonCount; unsigned char* hats; int hatCount; - char* name; + char name[128]; void* userPointer; char guid[33]; _GLFWmapping* mapping; diff --git a/src/external/glfw/src/mappings.h b/src/external/glfw/src/mappings.h index 4c3f02f2c..eda9a5496 100644 --- a/src/external/glfw/src/mappings.h +++ b/src/external/glfw/src/mappings.h @@ -61,244 +61,94 @@ const char* _glfwDefaultMappings[] = { "03000000fa2d00000100000000000000,3DRUDDER,leftx:a0,lefty:a1,rightx:a5,righty:a2,platform:Windows,", -"03000000c82d00002038000000000000,8bitdo,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d000011ab000000000000,8BitDo F30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00001038000000000000,8BitDo F30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00000090000000000000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00000650000000000000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:a4,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Windows,", -"03000000c82d00005106000000000000,8BitDo M30 Gamepad,a:b1,b:b0,back:b10,guide:b2,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00000310000000000000,8BitDo N30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows,", -"03000000c82d00002028000000000000,8BitDo N30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00008010000000000000,8BitDo N30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows,", -"03000000c82d00000190000000000000,8BitDo N30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00001590000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00006528000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00015900000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00065280000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,", "03000000022000000090000000000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,", "03000000203800000900000000000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00000130000000000000,8BitDo SF30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00000060000000000000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00000061000000000000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d000021ab000000000000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,", "03000000102800000900000000000000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00003028000000000000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00000030000000000000,8BitDo SN30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00000351000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00001290000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d000020ab000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00004028000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00006228000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00000160000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00000161000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00000260000000000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00000261000000000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00000031000000000000,8BitDo Wireless Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00001890000000000000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,", -"03000000c82d00003032000000000000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows,", "03000000a00500003232000000000000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows,", -"030000008f0e00001200000000000000,Acme GA-02,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Windows,", -"03000000fa190000f0ff000000000000,Acteck AGJ-3200,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"030000006f0e00001413000000000000,Afterglow,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", +"030000008f0e00001200000000000000,Acme,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Windows,", "03000000341a00003608000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000006f0e00000263000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000006f0e00001101000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000006f0e00001401000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000006f0e00001402000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000006f0e00001901000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000006f0e00001a01000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000d62000001d57000000000000,Airflo PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000869800002400000000007801,Astro C40 TR,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,", -"03000000d6200000e557000000000000,Batarang,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "03000000c01100001352000000000000,Battalife Joystick,a:b6,b:b7,back:b2,leftshoulder:b0,leftx:a0,lefty:a1,rightshoulder:b1,start:b3,x:b4,y:b5,platform:Windows,", -"030000006f0e00003201000000000000,Battlefield 4 PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000d62000002a79000000000000,BDA PS4 Fightpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"03000000bc2000006012000000000000,Betop 2126F,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000bc2000000055000000000000,Betop BFM Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", -"03000000bc2000006312000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000bc2000006321000000000000,BETOP CONTROLLER,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000bc2000006412000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000c01100000555000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000c01100000655000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000790000000700000000000000,Betop Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows,", -"03000000808300000300000000000000,Betop Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows,", -"030000006b1400000055000000000000,Bigben PS3 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", -"030000006b1400000103000000000000,Bigben PS3 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows,", +"030000006b1400000055000000000000,bigben ps3padstreetnew,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", "0300000066f700000500000000000000,BrutalLegendTest,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows,", "03000000d81d00000b00000000000000,BUFFALO BSGP1601 Series ,a:b5,b:b3,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b13,x:b4,y:b2,platform:Windows,", "03000000e82000006058000000000000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000457500000401000000000000,Cobra,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"030000005e0400008e02000000000000,Controller (XBOX 360 For Windows),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,", -"030000005e040000a102000000000000,Controller (Xbox 360 Wireless Receiver for Windows),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,", -"030000005e040000ff02000000000000,Controller (Xbox One For Windows) - Wired,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,", -"030000005e040000ea02000000000000,Controller (Xbox One For Windows) - Wireless,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,", +"030000005e0400008e02000000000000,Controller (XBOX 360 For Windows),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,", "03000000260900008888000000000000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a4,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Windows,", "03000000a306000022f6000000000000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows,", -"03000000451300000830000000000000,Defender Game Racer X7,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", -"030000007d0400000840000000000000,Destroyer Tiltpad,+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b1,b:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,x:b0,y:b3,platform:Windows,", "03000000791d00000103000000000000,Dual Box WII,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000bd12000002e0000000000000,Dual USB Vibration Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Windows,", -"030000008f0e00000910000000000000,DualShock 2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Windows,", -"030000006f0e00003001000000000000,EA SPORTS PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000b80500000410000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows,", -"03000000b80500000610000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows,", -"03000000120c0000f61c000000000000,Elite,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"030000008f0e00000f31000000000000,EXEQ,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows,", +"030000004f04000023b3000000000000,Dual Trigger 3-in-1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", "03000000341a00000108000000000000,EXEQ RF USB Gamepad 8206,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", -"030000006f0e00008401000000000000,Faceoff Deluxe+ Audio Wired Controller for Nintendo Switch,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000006f0e00008001000000000000,Faceoff Wired Pro Controller for Nintendo Switch,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000852100000201000000000000,FF-GP1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f00008500000000000000,Fighting Commander 2016 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f00008400000000000000,Fighting Commander 5,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"030000000d0f00008700000000000000,Fighting Stick mini 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f00008800000000000000,Fighting Stick mini 4,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b8,x:b0,y:b3,platform:Windows,", +"030000000d0f00008700000000000000,Fighting Stick mini 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f00002700000000000000,FIGHTING STICK V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", "78696e70757403000000000000000000,Fightstick TES,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,start:b7,x:b2,y:b3,platform:Windows,", -"03000000790000002201000000000000,Game Controller for PC,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"0300000066f700000100000000000000,Game VIB Joystick,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Windows,", "03000000260900002625000000000000,Gamecube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,lefttrigger:a4,leftx:a0,lefty:a1,righttrigger:a5,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Windows,", -"03000000790000004618000000000000,GameCube Controller Adapter,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Windows,", "030000008f0e00000d31000000000000,GAMEPAD 3 TURBO,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "03000000280400000140000000000000,GamePad Pro USB,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", -"03000000ac0500003d03000000000000,GameSir,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", -"03000000ac0500004d04000000000000,GameSir,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", "03000000ffff00000000000000000000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", -"03000000c01100000140000000000000,GameStop PS4 Fun Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"030000006f0e00000102000000007801,GameStop Xbox 360 Wired Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,", -"030000009b2800003200000000000000,GC/N64 to USB v3.4,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:+a5,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:+a2,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Windows,", -"030000009b2800006000000000000000,GC/N64 to USB v3.6,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:+a5,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:+a2,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Windows,", -"030000008305000009a0000000000000,Genius,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", -"030000008305000031b0000000000000,Genius Maxfire Blaze 3,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", -"03000000451300000010000000000000,Genius Maxfire Grandias 12,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", -"030000005c1a00003330000000000000,Genius MaxFire Grandias 12V,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Windows,", -"03000000300f00000b01000000000000,GGE909 Recoil Pad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,", -"03000000f0250000c283000000000000,Gioteck,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000f025000021c1000000000000,Gioteck PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000f0250000c383000000000000,Gioteck VX2 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000f0250000c483000000000000,Gioteck VX2 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"030000007d0400000540000000000000,Gravis Eliminator GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", +"03000000451300000010000000000000,Generic USB Joystick,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", "03000000341a00000302000000000000,Hama Scorpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f00004900000000000000,Hatsune Miku Sho Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000001008000001e1000000000000,Havit HV-G60,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b0,platform:Windows,", "03000000d81400000862000000000000,HitBox Edition Cthulhu+,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b4,rightshoulder:b7,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows,", -"03000000632500002605000000000000,HJD-X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", -"030000000d0f00002d00000000000000,Hori Fighting Commander 3 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f00005f00000000000000,Hori Fighting Commander 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f00005e00000000000000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f00004000000000000000,Hori Fighting Stick Mini 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b4,rightshoulder:b7,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows,", -"030000000d0f00005400000000000000,Hori Pad 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000000d0f00000900000000000000,Hori Pad 3 Turbo,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000000d0f00004d00000000000000,Hori Pad A,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000000d0f00009200000000000000,Hori Pokken Tournament DX Pro Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", -"030000000d0f00001600000000007803,HORI Real Arcade Pro EX-SE (Xbox 360),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,start:b7,x:b2,y:b3,platform:Windows,", -"030000000d0f00009c00000000000000,Hori TAC Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"030000000d0f0000c100000000000000,Horipad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f00006e00000000000000,HORIPAD 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f00006600000000000000,HORIPAD 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"030000000d0f00005500000000000000,Horipad 4 FPS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f0000ee00000000000000,HORIPAD mini4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", +"030000000d0f00004d00000000000000,HORIPAD3 A,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "03000000250900000017000000000000,HRAP2 on PS/SS/N64 Joypad to USB BOX,a:b2,b:b1,back:b9,leftshoulder:b5,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b6,start:b8,x:b3,y:b0,platform:Windows,", "030000008f0e00001330000000000000,HuiJia SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b9,x:b3,y:b0,platform:Windows,", "03000000d81d00000f00000000000000,iBUFFALO BSGP1204 Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", "03000000d81d00001000000000000000,iBUFFALO BSGP1204P Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", "03000000830500006020000000000000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Windows,", -"03000000b50700001403000000000000,Impact Black,a:b2,b:b3,back:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,", -"030000006f0e00002401000000000000,INJUSTICE FightStick PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", -"03000000ac0500002c02000000000000,IPEGA,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", +"03000000b50700001403000000000000,IMPACT BLACK,a:b2,b:b3,back:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,", +"030000006f0e00002401000000000000,INJUSTICE FightStick for PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", "03000000491900000204000000000000,Ipega PG-9023,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", -"03000000491900000304000000000000,Ipega PG-9087 - Bluetooth Gamepad,+righty:+a5,-righty:-a4,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,start:b11,x:b3,y:b4,platform:Windows,", -"030000006e0500000a20000000000000,JC-DUX60 ELECOM MMO Gamepad,a:b2,b:b3,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b14,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b15,righttrigger:b13,rightx:a3,righty:a4,start:b20,x:b0,y:b1,platform:Windows,", -"030000006e0500000520000000000000,JC-P301U,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows,", -"030000006e0500000320000000000000,JC-U3613M (DInput),a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows,", -"030000006e0500000720000000000000,JC-W01U,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows,", -"030000007e0500000620000000000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Windows,", -"030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Windows,", -"030000007e0500000720000000000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows,", -"030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows,", -"03000000bd12000003c0000000000000,JY-P70UR,a:b1,b:b0,back:b5,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b8,rightstick:b11,righttrigger:b9,rightx:a3,righty:a2,start:b4,x:b3,y:b2,platform:Windows,", -"03000000242f00002d00000000000000,JYS Wireless Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000242f00008a00000000000000,JYS Wireless Adapter,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows,", -"03000000790000000200000000000000,King PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows,", -"030000006d040000d1ca000000000000,Logitech ChillStream,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000006d040000d2ca000000000000,Logitech Cordless Precision,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "030000006d04000011c2000000000000,Logitech Cordless Wingman,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b5,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b2,righttrigger:b7,rightx:a3,righty:a4,x:b4,platform:Windows,", "030000006d04000016c2000000000000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "030000006d04000018c2000000000000,Logitech F510 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "030000006d04000019c2000000000000,Logitech F710 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000006d0400001ac2000000000000,Logitech Precision Gamepad,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", -"030000006d0400000ac2000000000000,Logitech WingMan RumblePad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,rightx:a3,righty:a4,x:b3,y:b4,platform:Windows,", -"03000000380700006652000000000000,Mad Catz C.T.R.L.R,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows,", "03000000380700005032000000000000,Mad Catz FightPad PRO (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "03000000380700005082000000000000,Mad Catz FightPad PRO (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"03000000380700008433000000000000,Mad Catz FightStick TE S+ (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000380700008483000000000000,Mad Catz FightStick TE S+ (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", +"03000000380700008433000000000000,Mad Catz FightStick TE S+ PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", +"03000000380700008483000000000000,Mad Catz FightStick TE S+ PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b6,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", "03000000380700008134000000000000,Mad Catz FightStick TE2+ PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b7,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b4,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "03000000380700008184000000000000,Mad Catz FightStick TE2+ PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,leftstick:b10,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"03000000380700006252000000000000,Mad Catz Micro C.T.R.L.R,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows,", "03000000380700008034000000000000,Mad Catz TE2 PS3 Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "03000000380700008084000000000000,Mad Catz TE2 PS4 Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", "03000000380700008532000000000000,Madcatz Arcade Fightstick TE S PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "03000000380700003888000000000000,Madcatz Arcade Fightstick TE S+ PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "03000000380700001888000000000000,MadCatz SFIV FightStick PS3,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b4,righttrigger:b6,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", "03000000380700008081000000000000,MADCATZ SFV Arcade FightStick Alpha PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"030000002a0600001024000000000000,Matricom,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:Windows,", +"030000008305000031b0000000000000,MaxfireBlaze3,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", "03000000250900000128000000000000,Mayflash Arcade Stick,a:b1,b:b2,back:b8,leftshoulder:b0,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b3,righttrigger:b7,start:b9,x:b5,y:b6,platform:Windows,", "03000000790000004418000000000000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Windows,", "03000000790000004318000000000000,Mayflash GameCube Controller Adapter,a:b1,b:b2,back:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b0,leftshoulder:b4,leftstick:b0,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b0,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Windows,", -"03000000242f00007300000000000000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows,", -"0300000079000000d218000000000000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000d620000010a7000000000000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "030000008f0e00001030000000000000,Mayflash USB Adapter for original Sega Saturn controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b5,rightshoulder:b2,righttrigger:b7,start:b9,x:b3,y:b4,platform:Windows,", "0300000025090000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:b13,dpleft:b12,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows,", "03000000790000000018000000000000,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000790000002418000000000000,Mega Drive,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,rightshoulder:b2,start:b9,x:b3,y:b4,platform:Windows,", -"03000000380700006382000000000000,MLG GamePad PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000c62400002a89000000000000,MOGA XP5-A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", -"03000000c62400002b89000000000000,MOGA XP5-A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", -"03000000c62400001a89000000000000,MOGA XP5-X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", -"03000000c62400001b89000000000000,MOGA XP5-X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", -"03000000efbe0000edfe000000000000,Monect Virtual Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Windows,", -"03000000250900006688000000000000,MP-8866 Super Dual Box,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows,", -"030000006b140000010c000000000000,NACON GC-400ES,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", "030000001008000001e5000000000000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Windows,", -"03000000152000000182000000000000,NGDS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Windows,", "03000000bd12000015d0000000000000,Nintendo Retrolink USB Super SNES Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Windows,", "030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", -"030000000d0500000308000000000000,Nostromo N45,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Windows,", -"03000000550900001472000000000000,NVIDIA Controller v01.04,a:b11,b:b10,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b7,leftstick:b5,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b4,righttrigger:a5,rightx:a3,righty:a6,start:b3,x:b9,y:b8,platform:Windows,", -"030000004b120000014d000000000000,NYKO AIRFLO,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:a3,leftstick:a0,lefttrigger:b6,rightshoulder:b5,rightstick:a2,righttrigger:b7,start:b9,x:b2,y:b3,platform:Windows,", -"03000000782300000a10000000000000,Onlive Wireless Controller,a:b15,b:b14,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b11,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b13,y:b12,platform:Windows,", -"03000000d62000006d57000000000000,OPP PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000006b14000001a1000000000000,Orange Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Windows,", +"030000004b120000014d000000000000,NYKO AIRFLO,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:a3,leftstick:a0,lefttrigger:b6,leftx:h0.6,lefty:h0.12,rightshoulder:b5,rightstick:a2,righttrigger:b7,rightx:h0.9,righty:h0.4,start:b9,x:b2,y:b3,platform:Windows,", "03000000362800000100000000000000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:b13,rightx:a3,righty:a4,x:b1,y:b2,platform:Windows,", "03000000120c0000f60e000000000000,P4 Wired Gamepad,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b5,lefttrigger:b7,rightshoulder:b4,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows,", -"030000006f0e00000901000000000000,PDP Versus Fighting Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", "030000008f0e00000300000000000000,Piranha xtreme,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,", -"030000004c050000da0c000000000000,PlayStation Classic Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Windows,", "03000000d62000006dca000000000000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000d62000009557000000000000,Pro Elite PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000d62000009f31000000000000,Pro Ex mini PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000d6200000c757000000000000,Pro Ex mini PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000632500002306000000000000,PS Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows,", +"030000008f0e00007530000000000000,PS (R) Gamepad,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b1,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "03000000e30500009605000000000000,PS to USB convert cable,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows,", -"03000000100800000100000000000000,PS1 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,", -"030000008f0e00007530000000000000,PS1 Controller,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b1,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000100800000300000000000000,PS2 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a2,start:b9,x:b3,y:b0,platform:Windows,", -"03000000250900008888000000000000,PS2 Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows,", -"03000000666600006706000000000000,PS2 Controller,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Windows,", -"030000006b1400000303000000000000,PS2 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", -"030000009d0d00001330000000000000,PS2 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", -"03000000250900000500000000000000,PS3 Controller,a:b2,b:b1,back:b9,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b0,y:b3,platform:Windows,", -"030000004c0500006802000000000000,PS3 Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b10,lefttrigger:a3~,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:a4~,rightx:a2,righty:a5,start:b8,x:b3,y:b0,platform:Windows,", -"03000000632500007505000000000000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", +"03000000100800000100000000000000,PS1 USB,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,", +"03000000100800000300000000000000,PS2 USB,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a2,start:b9,x:b3,y:b0,platform:Windows,", "03000000888800000803000000000000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b9,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows,", -"030000008f0e00001431000000000000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000003807000056a8000000000000,PS3 RF pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", +"030000004c0500006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Windows,", +"03000000250900000500000000000000,PS3 DualShock,a:b2,b:b1,back:b9,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b0,y:b3,platform:Windows,", "03000000100000008200000000000000,PS360+ v1.66,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:h0.4,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", "030000004c050000a00b000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", "030000004c050000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", "030000004c050000cc09000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"030000004c050000e60c000000000000,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", "03000000300f00000011000000000000,QanBa Arcade JoyStick 1008,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b10,x:b0,y:b3,platform:Windows,", "03000000300f00001611000000000000,QanBa Arcade JoyStick 4018,a:b1,b:b2,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b8,x:b0,y:b3,platform:Windows,", "03000000222c00000020000000000000,QANBA DRONE ARCADE JOYSTICK,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,rightshoulder:b5,righttrigger:a4,start:b9,x:b0,y:b3,platform:Windows,", @@ -307,375 +157,185 @@ const char* _glfwDefaultMappings[] = "03000000222c00000223000000000000,Qanba Obsidian Arcade Joystick PS3 Mode,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "03000000222c00000023000000000000,Qanba Obsidian Arcade Joystick PS4 Mode,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", "03000000321500000003000000000000,Razer Hydra,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,", -"03000000321500000204000000000000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000321500000104000000000000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"03000000321500000507000000000000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", -"03000000321500000707000000000000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", -"03000000321500000011000000000000,Razer Raion Fightpad for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"03000000321500000009000000000000,Razer Serval,+lefty:+a2,-lefty:-a1,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,leftx:a0,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,", "030000000d0f00001100000000000000,REAL ARCADE PRO.3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", -"030000000d0f00006a00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"030000000d0f00006b00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000000d0f00008a00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f00008b00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", +"030000000d0f00008a00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", +"030000000d0f00006b00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", +"030000000d0f00006a00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f00007000000000000000,REAL ARCADE PRO.4 VLX,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f00002200000000000000,REAL ARCADE Pro.V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000000d0f00005b00000000000000,Real Arcade Pro.V4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", "030000000d0f00005c00000000000000,Real Arcade Pro.V4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", +"030000000d0f00005b00000000000000,Real Arcade Pro.V4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", "03000000790000001100000000000000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Windows,", -"03000000bd12000013d0000000000000,Retrolink USB SEGA Saturn Classic,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b5,lefttrigger:b6,rightshoulder:b2,righttrigger:b7,start:b8,x:b3,y:b4,platform:Windows,", "0300000000f000000300000000000000,RetroUSB.com RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Windows,", "0300000000f00000f100000000000000,RetroUSB.com Super RetroPort,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Windows,", "030000006b140000010d000000000000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"030000006b140000020d000000000000,Revolution Pro Controller 2(1/2),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"030000006b140000130d000000000000,Revolution Pro Controller 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"030000006f0e00001e01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000006f0e00002801000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000006f0e00002f01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", +"030000006f0e00001e01000000000000,Rock Candy Gamepad for PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "030000004f04000003d0000000000000,run'n'drive,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b7,leftshoulder:a3,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:a4,rightstick:b11,righttrigger:b5,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", "03000000a30600001af5000000000000,Saitek Cyborg,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows,", "03000000a306000023f6000000000000,Saitek Cyborg V.1 Game pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows,", "03000000300f00001201000000000000,Saitek Dual Analog Pad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,", -"03000000a30600000701000000000000,Saitek P220,a:b2,b:b3,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b5,x:b0,y:b1,platform:Windows,", -"03000000a30600000cff000000000000,Saitek P2500 Force Rumble Pad,a:b2,b:b3,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b0,y:b1,platform:Windows,", +"03000000a30600000cff000000000000,Saitek P2500 Force Rumble Pad,a:b2,b:b3,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,x:b0,y:b1,platform:Windows,", "03000000a30600000c04000000000000,Saitek P2900,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows,", "03000000300f00001001000000000000,Saitek P480 Rumble Pad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,", "03000000a30600000b04000000000000,Saitek P990,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows,", "03000000a30600000b04000000010000,Saitek P990 Dual Analog Pad,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b8,x:b0,y:b3,platform:Windows,", -"03000000a30600002106000000000000,Saitek PS1000,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows,", -"03000000a306000020f6000000000000,Saitek PS2700,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows,", -"03000000300f00001101000000000000,Saitek Rumble Pad,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,", -"03000000730700000401000000000000,Sanwa PlayOnline Mobile,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Windows,", +"03000000300f00001101000000000000,saitek rumble pad,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,", "0300000000050000289b000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows,", "030000009b2800000500000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows,", -"030000005e0400008e02000000007801,ShanWan PS3/PC Wired GamePad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,", "03000000341a00000208000000000000,SL-6555-SBK,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:-a4,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a3,righty:a2,start:b7,x:b2,y:b3,platform:Windows,", -"03000000341a00000908000000000000,SL-6566,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", -"030000008f0e00000800000000000000,SpeedLink Strike FX,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000c01100000591000000000000,Speedlink Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000d11800000094000000000000,Stadia Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:b11,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:Windows,", -"03000000110100001914000000000000,SteelSeries,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", -"03000000381000001214000000000000,SteelSeries Free,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows,", -"03000000110100003114000000000000,SteelSeries Stratus Duo,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", -"03000000381000001814000000000000,SteelSeries Stratus XL,a:b0,b:b1,back:b18,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b19,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b2,y:b3,platform:Windows,", -"03000000790000001c18000000000000,STK-7024X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", +"030000008f0e00000800000000000000,SpeedLink Strike FX Wireless,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", "03000000ff1100003133000000000000,SVEN X-PAD,a:b2,b:b3,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a4,start:b5,x:b0,y:b1,platform:Windows,", -"03000000d620000011a7000000000000,Switch,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000457500002211000000000000,SZMY-POWER PC Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000004f04000007d0000000000000,T Mini Wireless,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000004f0400000ab1000000000000,T.16000M,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b10,x:b2,y:b3,platform:Windows,", "03000000fa1900000706000000000000,Team 5,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", "03000000b50700001203000000000000,Techmobility X6-38V,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,", -"030000004f04000015b3000000000000,Thrustmaster Dual Analog 4,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows,", -"030000004f04000023b3000000000000,Thrustmaster Dual Trigger 3-in-1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"030000004f0400000ed0000000000000,ThrustMaster eSwap PRO Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", +"030000004f04000015b3000000000000,Thrustmaster Dual Analog 2,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows,", "030000004f04000000b3000000000000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Windows,", "030000004f04000004b3000000000000,Thrustmaster Firestorm Dual Power 3,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows,", "03000000666600000488000000000000,TigerGame PS/PS2 Game Controller Adapter,a:b2,b:b1,back:b9,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows,", -"03000000d62000006000000000000000,Tournament PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"030000005f140000c501000000000000,Trust Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000b80500000210000000000000,Trust Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"030000004f04000087b6000000000000,TWCS Throttle,dpdown:b8,dpleft:b9,dpright:b7,dpup:b6,leftstick:b5,lefttrigger:-a5,leftx:a0,lefty:a1,righttrigger:+a5,platform:Windows,", "03000000d90400000200000000000000,TwinShock PS2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,", -"030000006e0500001320000000000000,U4113,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000101c0000171c000000000000,uRage Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000300f00000701000000000000,USB 4-Axis 12-Button Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,", -"03000000341a00002308000000000000,USB gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", -"030000005509000000b4000000000000,USB gamepad,a:b10,b:b11,back:b5,dpdown:b1,dpleft:b2,dpright:b3,dpup:b0,guide:b14,leftshoulder:b8,leftstick:b6,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b7,righttrigger:a5,rightx:a2,righty:a3,start:b4,x:b12,y:b13,platform:Windows,", -"030000006b1400000203000000000000,USB gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", -"03000000790000000a00000000000000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows,", -"03000000f0250000c183000000000000,USB gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", -"03000000ff1100004133000000000000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a2,start:b9,x:b3,y:b0,platform:Windows,", +"03000000380700006652000000000000,UnKnown,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows,", "03000000632500002305000000000000,USB Vibration Joystick (BM),a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", -"03000000790000001a18000000000000,Venom,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,", "03000000790000001b18000000000000,Venom Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", -"030000006f0e00000302000000000000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", -"030000006f0e00000702000000000000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", -"0300000034120000adbe000000000000,vJoy Device,a:b0,b:b1,back:b15,dpdown:b6,dpleft:b7,dpright:b8,dpup:b5,guide:b16,leftshoulder:b9,leftstick:b13,lefttrigger:b11,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b14,righttrigger:b12,rightx:+a3,righty:+a4,start:b4,x:b2,y:b3,platform:Windows,", -"030000005e0400000a0b000000000000,Xbox Adaptive Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,", -"030000005e040000ff02000000007801,Xbox One Elite Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,", -"030000005e040000130b000000000000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,", -"03000000341a00000608000000000000,Xeox,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", "03000000450c00002043000000000000,XEOX Gamepad SL-6556-BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,", -"03000000ac0500005b05000000000000,Xiaoji Gamesir-G3w,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", "03000000172700004431000000000000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a7,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows,", "03000000786901006e70000000000000,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,", -"03000000790000004f18000000000000,ZD-T Android,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", -"03000000120c0000101e000000000000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,", -"030000008f0e00000300000009010000,2In1 USB Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,", -"03000000c82d00000090000001000000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,", -"03000000c82d00001038000000010000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,", -"03000000c82d00000650000001000000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Mac OS X,", -"03000000c82d00005106000000010000,8BitDo M30 Gamepad,a:b1,b:b0,back:b10,guide:b2,leftshoulder:b6,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,start:b11,x:b4,y:b3,platform:Mac OS X,", -"03000000c82d00001590000001000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,", -"03000000c82d00006528000000010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,", -"030000003512000012ab000001000000,8BitDo NES30 Gamepad,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X,", -"03000000022000000090000001000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,", "03000000203800000900000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,", -"03000000c82d00000190000001000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,", +"03000000022000000090000001000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,", "03000000102800000900000000000000,8Bitdo SFC30 GamePad Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X,", -"03000000c82d00001290000001000000,8BitDo SN30 Gamepad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X,", -"03000000c82d00000160000001000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,", -"03000000c82d00000161000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Mac OS X,", -"03000000c82d00000260000001000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,", -"03000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,", -"03000000c82d00000031000001000000,8BitDo Wireless Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,", -"03000000c82d00001890000001000000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X,", -"03000000c82d00003032000000010000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a31,start:b11,x:b4,y:b3,platform:Mac OS X,", "03000000a00500003232000008010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X,", -"03000000a00500003232000009010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X,", -"03000000050b00000045000031000000,ASUS Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,", -"03000000c62400001a89000000010000,BDA MOGA XP5-X Plus,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b14,leftshoulder:b6,leftstick:b15,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b16,righttrigger:a4,rightx:a2,righty:a3,start:b13,x:b3,y:b4,platform:Mac OS X,", -"03000000c62400001b89000000010000,BDA MOGA XP5-X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,", -"03000000d62000002a79000000010000,BDA PS4 Fightpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000008305000031b0000000000000,Cideko AK08b,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "03000000260900008888000088020000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a5,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Mac OS X,", "03000000a306000022f6000001030000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Mac OS X,", "03000000ad1b000001f9000000000000,Gamestop BB-070 X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", "0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,", -"03000000c01100000140000000010000,GameStop PS4 Fun Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", -"030000006f0e00000102000000000000,GameStop Xbox 360 Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", -"030000007d0400000540000001010000,Gravis Eliminator GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,", -"030000000d0f00002d00000000100000,Hori Fighting Commander 3 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000000d0f00005f00000000010000,Hori Fighting Commander 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000000d0f00005e00000000010000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000000d0f00005f00000000000000,HORI Fighting Commander 4 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000000d0f00005e00000000000000,HORI Fighting Commander 4 PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000000d0f00004d00000000000000,HORI Gem Pad 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", -"030000000d0f00009200000000010000,Hori Pokken Tournament DX Pro Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000000d0f00006e00000000010000,HORIPAD 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000000d0f00006600000000010000,HORIPAD 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000000d0f00006600000000000000,HORIPAD FPS PLUS 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", -"030000000d0f0000ee00000000010000,HORIPAD mini4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000008f0e00001330000011010000,HuiJia SNES Controller,a:b4,b:b2,back:b16,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b12,rightshoulder:b14,start:b18,x:b6,y:b0,platform:Mac OS X,", "03000000830500006020000000010000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Mac OS X,", "03000000830500006020000000000000,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Mac OS X,", -"030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Mac OS X,", -"030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Mac OS X,", -"03000000242f00002d00000007010000,JYS Wireless Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,", "030000006d04000016c2000000020000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000006d04000016c2000000030000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000006d04000016c2000014040000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000006d04000016c2000000000000,Logitech F310 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000006d04000018c2000000000000,Logitech F510 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", -"030000006d04000019c2000005030000,Logitech F710,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000006d0400001fc2000000000000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", -"030000006d04000018c2000000010000,Logitech RumblePad 2 USB,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3~,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000006d04000019c2000000000000,Logitech Wireless Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "03000000380700005032000000010000,Mad Catz FightPad PRO (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "03000000380700005082000000010000,Mad Catz FightPad PRO (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", -"03000000380700008433000000010000,Mad Catz FightStick TE S+ (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", -"03000000380700008483000000010000,Mad Catz FightStick TE S+ (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", "03000000790000004418000000010000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Mac OS X,", -"03000000242f00007300000000020000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Mac OS X,", -"0300000079000000d218000026010000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,", -"03000000d620000010a7000003010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "0300000025090000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:b13,dpleft:b12,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Mac OS X,", "03000000790000000018000000000000,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b4,b:b8,back:b32,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b16,leftstick:b40,lefttrigger:b24,leftx:a0,lefty:a4,rightshoulder:b20,rightstick:b44,righttrigger:b28,rightx:a8,righty:a12,start:b36,x:b0,y:b12,platform:Mac OS X,", "03000000d8140000cecf000000000000,MC Cthulhu,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,", -"030000005e0400002700000001010000,Microsoft SideWinder Plug & Play Game Pad,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,lefttrigger:b4,leftx:a0,lefty:a1,righttrigger:b5,x:b2,y:b3,platform:Mac OS X,", -"03000000d62000007162000001000000,Moga Pro 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Mac OS X,", -"03000000c62400002a89000000010000,MOGA XP5-A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,", -"03000000c62400002b89000000010000,MOGA XP5-A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,", -"03000000632500007505000000020000,NEOGEO mini PAD Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,x:b2,y:b3,platform:Mac OS X,", "030000001008000001e5000006010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Mac OS X,", -"03000000d620000011a7000000020000,Nintendo Switch Core (Plus) Wired Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,", -"030000007e0500000920000001000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,", -"03000000550900001472000025050000,NVIDIA Controller v01.04,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Mac OS X,", -"030000006f0e00000901000002010000,PDP Versus Fighting Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000008f0e00000300000000000000,Piranha xtreme,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Mac OS X,", -"030000004c050000da0c000000010000,Playstation Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Mac OS X,", -"03000000d62000006dca000000010000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", -"030000004c0500006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Mac OS X,", "030000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Mac OS X,", +"030000004c0500006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Mac OS X,", "030000004c050000a00b000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", +"030000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000004c050000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", -"030000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", -"050000004c050000e60c000000010000,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000008916000000fd000000000000,Razer Onza TE,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", -"03000000321500000204000000010000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", -"03000000321500000104000000010000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", "03000000321500000010000000010000,Razer RAIJU,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", -"03000000321500000507000001010000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,", -"03000000321500000011000000010000,Razer Raion Fightpad for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", -"03000000321500000009000000020000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X,", -"030000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X,", "0300000032150000030a000000000000,Razer Wildcat,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", "03000000790000001100000000000000,Retrolink Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a3,lefty:a4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X,", "03000000790000001100000006010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X,", "030000006b140000010d000000010000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", -"030000006b140000130d000000010000,Revolution Pro Controller 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", -"03000000c6240000fefa000000000000,Rock Candy Gamepad for PS3,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", -"03000000730700000401000000010000,Sanwa PlayOnline Mobile,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Mac OS X,", "03000000811700007e05000000000000,Sega Saturn,a:b2,b:b4,dpdown:b16,dpleft:b15,dpright:b14,dpup:b17,leftshoulder:b8,lefttrigger:a5,leftx:a0,lefty:a2,rightshoulder:b9,righttrigger:a4,start:b13,x:b0,y:b6,platform:Mac OS X,", "03000000b40400000a01000000000000,Sega Saturn USB Gamepad,a:b0,b:b1,back:b5,guide:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Mac OS X,", "030000003512000021ab000000000000,SFC30 Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X,", -"0300000000f00000f100000000000000,SNES RetroPort,a:b2,b:b3,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b5,rightshoulder:b7,start:b6,x:b0,y:b1,platform:Mac OS X,", -"30000004c050000e60c0000000100000,Sony DualSense,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000004c050000cc09000000000000,Sony DualShock 4 V2,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000004c050000a00b000000000000,Sony DualShock 4 Wireless Adaptor,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", -"03000000d11800000094000000010000,Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X,", -"030000005e0400008e02000001000000,Steam Virtual Gamepad,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", +"030000005e0400008e02000001000000,Steam Virtual GamePad,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", "03000000110100002014000000000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b12,x:b2,y:b3,platform:Mac OS X,", "03000000110100002014000001000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,x:b2,y:b3,platform:Mac OS X,", "03000000381000002014000001000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,x:b2,y:b3,platform:Mac OS X,", "03000000110100001714000000000000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,start:b12,x:b2,y:b3,platform:Mac OS X,", "03000000110100001714000020010000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,start:b12,x:b2,y:b3,platform:Mac OS X,", -"03000000457500002211000000010000,SZMY-POWER PC Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000004f04000015b3000000000000,Thrustmaster Dual Analog 3.2,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Mac OS X,", -"030000004f0400000ed0000000020000,ThrustMaster eSwap PRO Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", "030000004f04000000b3000000000000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Mac OS X,", -"03000000bd12000015d0000000000000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X,", "03000000bd12000015d0000000010000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X,", +"03000000bd12000015d0000000000000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X,", "03000000100800000100000000000000,Twin USB Joystick,a:b4,b:b2,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b12,leftstick:b20,lefttrigger:b8,leftx:a0,lefty:a2,rightshoulder:b14,rightstick:b22,righttrigger:b10,rightx:a6,righty:a4,start:b18,x:b6,y:b0,platform:Mac OS X,", -"030000006f0e00000302000025040000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,", -"030000006f0e00000702000003060000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,", -"03000000791d00000103000009010000,Wii Classic Controller,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,", "050000005769696d6f74652028303000,Wii Remote,a:b4,b:b5,back:b7,dpdown:b3,dpleft:b0,dpright:b1,dpup:b2,guide:b8,leftshoulder:b11,lefttrigger:b12,leftx:a0,lefty:a1,start:b6,x:b10,y:b9,platform:Mac OS X,", "050000005769696d6f74652028313800,Wii U Pro Controller,a:b16,b:b15,back:b7,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b8,leftshoulder:b19,leftstick:b23,lefttrigger:b21,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b24,righttrigger:b22,rightx:a2,righty:a3,start:b6,x:b18,y:b17,platform:Mac OS X,", "030000005e0400008e02000000000000,X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", "03000000c6240000045d000000000000,Xbox 360 Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", -"030000005e0400000a0b000000000000,Xbox Adaptive Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", -"030000005e040000050b000003090000,Xbox Elite Wireless Controller Series 2,a:b0,b:b1,back:b31,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b53,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,", +"030000005e040000e302000000000000,Xbox One Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", "030000005e040000d102000000000000,Xbox One Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", "030000005e040000dd02000000000000,Xbox One Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", -"030000005e040000e302000000000000,Xbox One Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", -"030000005e040000130b000001050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,", -"030000005e040000130b000005050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,", "030000005e040000e002000000000000,Xbox Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Mac OS X,", -"030000005e040000e002000003090000,Xbox Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Mac OS X,", -"030000005e040000ea02000000000000,Xbox Wireless Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", "030000005e040000fd02000003090000,Xbox Wireless Controller,a:b0,b:b1,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,", +"030000005e040000ea02000000000000,Xbox Wireless Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,", +"030000005e040000e002000003090000,Xbox Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Mac OS X,", "03000000172700004431000029010000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Mac OS X,", "03000000120c0000100e000000010000,ZEROPLUS P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", -"03000000120c0000101e000000010000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,", -"03000000c82d00000090000011010000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", -"05000000c82d00001038000000010000,8Bitdo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", -"05000000c82d00005106000000010000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Linux,", -"03000000c82d00001590000011010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", -"05000000c82d00006528000000010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", -"03000000c82d00000310000011010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b9,righttrigger:b8,start:b11,x:b3,y:b4,platform:Linux,", -"05000000c82d00008010000000010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b9,righttrigger:b8,start:b11,x:b3,y:b4,platform:Linux,", -"03000000022000000090000011010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", "05000000203800000900000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", +"03000000022000000090000011010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", "05000000c82d00002038000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", "03000000c82d00000190000011010000,8Bitdo NES30 Pro 8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", -"05000000c82d00000060000000010000,8BitDo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", -"05000000c82d00000061000000010000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", -"03000000c82d000021ab000010010000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,", -"030000003512000012ab000010010000,8Bitdo SFC30 GamePad,a:b2,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b0,platform:Linux,", -"05000000102800000900000000010000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,", "05000000c82d00003028000000010000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,", -"03000000c82d00000160000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux,", -"03000000c82d00000160000011010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", -"03000000c82d00000161000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux,", -"03000000c82d00001290000011010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux,", -"05000000c82d00000161000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", -"05000000c82d00006228000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", -"03000000c82d00000260000011010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", -"05000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", -"05000000202800000900000000010000,8BitDo SNES30 Gamepad,a:b1,b:b0,back:b10,dpdown:b122,dpleft:b119,dpright:b120,dpup:b117,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,", -"030000005e0400008e02000020010000,8BitDo Wireless Adapter,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"03000000c82d00000031000011010000,8BitDo Wireless Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", -"03000000c82d00001890000011010000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,", -"05000000c82d00003032000000010000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,", -"05000000a00500003232000001000000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux,", +"05000000102800000900000000010000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,", "05000000a00500003232000008010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux,", -"030000006f0e00001302000000010000,Afterglow,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000006f0e00003901000020060000,Afterglow Controller for Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000006f0e00003901000000430000,Afterglow Prismatic Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000006f0e00003901000013020000,Afterglow Prismatic Wired Controller 048-007-NA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", +"05000000a00500003232000001000000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux,", +"030000006f0e00003901000020060000,Afterglow Wired Controller for Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "03000000100000008200000011010000,Akishop Customs PS360+ v1.66,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,", -"030000007c1800000006000010010000,Alienware Dual Compatible Game Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Linux,", -"05000000491900000204000021000000,Amazon Fire Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b17,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b12,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"03000000790000003018000011010000,Arcade Fightstick F300,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,", "05000000050b00000045000031000000,ASUS Gamepad,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Linux,", -"05000000050b00000045000040000000,ASUS Gamepad,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Linux,", -"03000000120c00000500000010010000,AxisPad,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Linux,", -"03000000c62400001b89000011010000,BDA MOGA XP5-X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"03000000d62000002a79000011010000,BDA PS4 Fightpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"03000000c21100000791000011010000,Be1 GC101 Controller 1.03 mode,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", -"03000000c31100000791000011010000,Be1 GC101 GAMEPAD 1.03 mode,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"030000005e0400008e02000003030000,Be1 GC101 Xbox 360 Controller mode,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "03000000666600006706000000010000,boom PSX to PC Converter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Linux,", -"03000000ffff0000ffff000000010000,Chinese-made Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux,", "03000000e82000006058000001010000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", -"030000000b0400003365000000010000,Competition Pro,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Linux,", "03000000260900008888000000010000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a5,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Linux,", "03000000a306000022f6000011010000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux,", "03000000b40400000a01000000010000,CYPRESS USB Gamepad,a:b0,b:b1,back:b5,guide:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Linux,", "03000000790000000600000010010000,DragonRise Inc. Generic USB Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Linux,", -"030000004f04000004b3000010010000,Dual Power 2,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux,", "030000006f0e00003001000001010000,EA Sports PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "03000000341a000005f7000010010000,GameCube {HuiJia USB box},a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Linux,", -"03000000bc2000000055000011010000,GameSir G3w,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", "0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,", "030000006f0e00000104000000010000,Gamestop Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000008f0e00000800000010010000,Gasia Co. Ltd PS(R) Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", -"030000006f0e00001304000000010000,Generic X-Box pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", +"030000006f0e00001304000000010000,Generic X-Box pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:a0,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:a3,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", +"030000006f0e00001f01000000010000,Generic X-Box pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "03000000f0250000c183000010010000,Goodbetterbest Ltd USB Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", -"0300000079000000d418000000010000,GPD Win 2 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000007d0400000540000000010000,Gravis Eliminator GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,", "03000000280400000140000000010000,Gravis GamePad Pro USB ,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,", "030000008f0e00000610000000010000,GreenAsia Electronics 4Axes 12Keys GamePad ,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Linux,", "030000008f0e00001200000010010000,GreenAsia Inc. USB Joystick,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux,", +"030000008f0e00000300000010010000,GreenAsia Inc. USB Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,", "0500000047532067616d657061640000,GS gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,", -"03000000f0250000c383000010010000,GT VX2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", "06000000adde0000efbe000002010000,Hidromancer Game Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "03000000d81400000862000011010000,HitBox (PS3/PC) Analog Mode,a:b1,b:b2,back:b8,guide:b9,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b12,x:b0,y:b3,platform:Linux,", "03000000c9110000f055000011010000,HJC Game GAMEPAD,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,", -"03000000632500002605000010010000,HJD-X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", "030000000d0f00000d00000000010000,hori,a:b0,b:b6,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b3,leftx:b4,lefty:b5,rightshoulder:b7,start:b9,x:b1,y:b2,platform:Linux,", "030000000d0f00001000000011010000,HORI CO. LTD. FIGHTING STICK 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,", -"030000000d0f0000c100000011010000,HORI CO. LTD. HORIPAD S,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "030000000d0f00006a00000011010000,HORI CO. LTD. Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", "030000000d0f00006b00000011010000,HORI CO. LTD. Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "030000000d0f00002200000011010000,HORI CO. LTD. REAL ARCADE Pro.V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,", -"030000000d0f00008500000010010000,HORI Fighting Commander,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", -"030000000d0f00008600000002010000,Hori Fighting Commander,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,", "030000000d0f00005f00000011010000,Hori Fighting Commander 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "030000000d0f00005e00000011010000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", "03000000ad1b000001f5000033050000,Hori Pad EX Turbo 2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000000d0f00009200000011010000,Hori Pokken Tournament DX Pro Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,", -"030000000d0f0000aa00000011010000,HORI Real Arcade Pro,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", -"030000000d0f0000d800000072056800,HORI Real Arcade Pro S,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux,", -"030000000d0f00001600000000010000,Hori Real Arcade Pro.EX-SE (Xbox 360),a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b2,y:b3,platform:Linux,", "030000000d0f00006e00000011010000,HORIPAD 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "030000000d0f00006600000011010000,HORIPAD 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"030000000d0f0000ee00000011010000,HORIPAD mini4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", "030000000d0f00006700000001010000,HORIPAD ONE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "030000008f0e00001330000010010000,HuiJia SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b9,x:b3,y:b0,platform:Linux,", -"03000000242e00008816000001010000,Hyperkin X91,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "03000000830500006020000010010000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux,", "050000006964726f69643a636f6e0000,idroid:con,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "03000000b50700001503000010010000,impact,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux,", -"03000000d80400008200000003000000,IMS PCU#0 Gamepad Interface,a:b1,b:b0,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b5,x:b3,y:b2,platform:Linux,", "03000000fd0500000030000000010000,InterAct GoPad I-73000 (Fighting Game Layout),a:b3,b:b4,back:b6,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,start:b7,x:b0,y:b1,platform:Linux,", -"0500000049190000020400001b010000,Ipega PG-9069 - Bluetooth Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b161,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"03000000632500007505000011010000,Ipega PG-9099 - Bluetooth Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", "030000006e0500000320000010010000,JC-U3613M - DirectInput Mode,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Linux,", "03000000300f00001001000010010000,Jess Tech Dual Analog Rumble Pad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux,", -"03000000300f00000b01000010010000,Jess Tech GGE909 PC Recoil Pad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,", "03000000ba2200002010000001010000,Jess Technology USB Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,", -"030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Linux,", -"050000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Linux,", -"030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Linux,", -"050000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Linux,", -"03000000242f00002d00000011010000,JYS Wireless Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", -"03000000242f00008a00000011010000,JYS Wireless Adapter,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Linux,", "030000006f0e00000103000000020000,Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000006d040000d1ca000000000000,Logitech ChillStream,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "030000006d04000019c2000010010000,Logitech Cordless RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", -"030000006d04000016c2000010010000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "030000006d04000016c2000011010000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", +"030000006d04000016c2000010010000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "030000006d0400001dc2000014400000,Logitech F310 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000006d0400001ec2000019200000,Logitech F510 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "030000006d0400001ec2000020200000,Logitech F510 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "030000006d04000019c2000011010000,Logitech F710 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "030000006d0400001fc2000005030000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000006d0400000ac2000010010000,Logitech Inc. WingMan RumblePad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,rightx:a3,righty:a4,x:b3,y:b4,platform:Linux,", +"030000006d04000015c2000010010000,Logitech Logitech Extreme 3D,a:b0,b:b4,back:b6,guide:b8,leftshoulder:b9,leftstick:h0.8,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:h0.2,start:b7,x:b2,y:b5,platform:Linux,", "030000006d04000018c2000010010000,Logitech RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "030000006d04000011c2000010010000,Logitech WingMan Cordless RumblePad,a:b0,b:b1,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b6,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b10,rightx:a3,righty:a4,start:b8,x:b3,y:b4,platform:Linux,", "05000000380700006652000025010000,Mad Catz C.T.R.L.R ,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", @@ -684,307 +344,125 @@ const char* _glfwDefaultMappings[] = "03000000ad1b00002ef0000090040000,Mad Catz Fightpad SFxT,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,start:b7,x:b2,y:b3,platform:Linux,", "03000000380700008034000011010000,Mad Catz fightstick (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "03000000380700008084000011010000,Mad Catz fightstick (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"03000000380700008433000011010000,Mad Catz FightStick TE S+ (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", -"03000000380700008483000011010000,Mad Catz FightStick TE S+ (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", +"03000000380700008433000011010000,Mad Catz FightStick TE S+ PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", +"03000000380700008483000011010000,Mad Catz FightStick TE S+ PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", "03000000380700001647000010040000,Mad Catz Wired Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "03000000380700003847000090040000,Mad Catz Wired Xbox 360 Controller (SFIV),a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,", "03000000ad1b000016f0000090040000,Mad Catz Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "03000000380700001888000010010000,MadCatz PC USB Wired Stick 8818,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "03000000380700003888000010010000,MadCatz PC USB Wired Stick 8838,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:a0,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", -"03000000120c00000500000000010000,Manta Dualshock 2,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux,", "03000000790000004418000010010000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Linux,", -"03000000790000004318000010010000,Mayflash GameCube Controller Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Linux,", -"03000000242f00007300000011010000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Linux,", -"0300000079000000d218000011010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", -"03000000d620000010a7000011010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", -"0300000025090000e803000001010000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:a4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:a5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux,", "03000000780000000600000010010000,Microntek USB Joystick,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,", -"030000005e0400000e00000000010000,Microsoft SideWinder,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Linux,", "030000005e0400008e02000004010000,Microsoft X-Box 360 pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "030000005e0400008e02000062230000,Microsoft X-Box 360 pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"050000005e040000050b000003090000,Microsoft X-Box One Elite 2 pad,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"030000005e040000e302000003020000,Microsoft X-Box One Elite pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "030000005e040000d102000001010000,Microsoft X-Box One pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000005e040000dd02000003020000,Microsoft X-Box One pad (Firmware 2015),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "030000005e040000d102000003020000,Microsoft X-Box One pad v2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "030000005e0400008502000000010000,Microsoft X-Box pad (Japan),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux,", "030000005e0400008902000021010000,Microsoft X-Box pad v2 (US),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux,", -"030000005e040000000b000008040000,Microsoft Xbox One Elite 2 pad - Wired,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000005e040000ea02000008040000,Microsoft Xbox One S pad - Wired,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"03000000c62400001a53000000010000,Mini PE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"03000000030000000300000002000000,Miroof,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux,", -"05000000d6200000e589000001000000,Moga 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux,", "05000000d6200000ad0d000001000000,Moga Pro,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux,", -"05000000d62000007162000001000000,Moga Pro 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux,", -"03000000c62400002b89000011010000,MOGA XP5-A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"05000000c62400002a89000000010000,MOGA XP5-A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b22,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"05000000c62400001a89000000010000,MOGA XP5-X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"03000000250900006688000000010000,MP-8866 Super Dual Box,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux,", -"030000006b140000010c000010010000,NACON GC-400ES,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,", -"030000000d0f00000900000010010000,Natec Genesis P44,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "030000001008000001e5000010010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Linux,", -"060000007e0500000820000000000000,Nintendo Combined Joy-Cons (joycond),a:b0,b:b1,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux,", -"030000007e0500003703000000016800,Nintendo GameCube Controller,a:b0,b:b2,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1~,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3~,start:b8,x:b1,y:b3,platform:Linux,", -"03000000790000004618000010010000,Nintendo GameCube Controller Adapter,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a5~,righty:a2~,start:b9,x:b0,y:b3,platform:Linux,", "050000007e0500000920000001000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,", -"050000007e0500000920000001800000,Nintendo Switch Pro Controller (joycond),a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux,", -"030000007e0500000920000011810000,Nintendo Switch Pro Controller Wired (joycond),a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux,", "050000007e0500003003000001000000,Nintendo Wii Remote Pro Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux,", "05000000010000000100000003000000,Nintendo Wiimote,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,", "030000000d0500000308000010010000,Nostromo n45 Dual Analog Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Linux,", "03000000550900001072000011010000,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b8,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,", -"03000000550900001472000011010000,NVIDIA Controller v01.04,a:b0,b:b1,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux,", -"05000000550900001472000001000000,NVIDIA Controller v01.04,a:b0,b:b1,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux,", "03000000451300000830000010010000,NYKO CORE,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"19000000010000000100000001010000,odroidgo2_joypad,a:b1,b:b0,dpdown:b7,dpleft:b8,dpright:b9,dpup:b6,guide:b10,leftshoulder:b4,leftstick:b12,lefttrigger:b11,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b13,righttrigger:b14,start:b15,x:b2,y:b3,platform:Linux,", -"19000000010000000200000011000000,odroidgo2_joypad_v11,a:b1,b:b0,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b12,leftshoulder:b4,leftstick:b14,lefttrigger:b13,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b15,righttrigger:b16,start:b17,x:b2,y:b3,platform:Linux,", "030000005e0400000202000000010000,Old Xbox pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux,", "05000000362800000100000002010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,platform:Linux,", "05000000362800000100000003010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,platform:Linux,", -"03000000830500005020000010010000,Padix Co. Ltd. Rockfire PSX/USB Bridge,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b2,y:b3,platform:Linux,", -"03000000790000001c18000011010000,PC Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", "03000000ff1100003133000010010000,PC Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", -"030000006f0e0000b802000001010000,PDP AFTERGLOW Wired Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000006f0e0000b802000013020000,PDP AFTERGLOW Wired Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "030000006f0e00006401000001010000,PDP Battlefield One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000006f0e00008001000011010000,PDP CO. LTD. Faceoff Wired Pro Controller for Nintendo Switch,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", -"030000006f0e00003101000000010000,PDP EA Sports Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000006f0e0000c802000012010000,PDP Kingdom Hearts Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000006f0e00008701000011010000,PDP Rock Candy Wired Controller for Nintendo Switch,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", -"030000006f0e00000901000011010000,PDP Versus Fighting Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,", -"030000006f0e0000a802000023020000,PDP Wired Controller for Xbox One,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,", -"030000006f0e00008501000011010000,PDP Wired Fight Pad Pro for Nintendo Switch,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", -"05000000491900000204000000000000,PG-9118,x:b76,a:b73,b:b74,y:b77,back:b83,start:b84,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b79,lefttrigger:b81,rightshoulder:b80,righttrigger:b82,leftstick:b86,rightstick:b87,leftx:a0,lefty:a1,rightx:a2,righty:a3,platform:Linux,", -"0500000049190000030400001b010000,PG-9099,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"030000004c050000da0c000011010000,Playstation Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,", -"03000000c62400000053000000010000,PowerA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"03000000c62400003a54000001010000,PowerA 1428124-01,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"03000000d62000006dca000011010000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", -"03000000c62400001a58000001010000,PowerA Xbox One Cabled,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000006d040000d2ca000011010000,Precision Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "03000000ff1100004133000010010000,PS2 Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,", -"03000000341a00003608000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "030000004c0500006802000010010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,", +"050000004c0500006802000000810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", +"03000000341a00003608000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", +"030000004c0500006802000011810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", +"050000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:a12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:a13,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,", "030000004c0500006802000010810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", "030000004c0500006802000011010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,", -"030000004c0500006802000011810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", -"030000006f0e00001402000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", -"030000008f0e00000300000010010000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", -"050000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:a12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:a13,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,", -"050000004c0500006802000000800000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", -"050000004c0500006802000000810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", -"05000000504c415953544154494f4e00,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,", -"060000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,", -"030000004c050000a00b000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"030000004c050000a00b000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", -"030000004c050000c405000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"030000004c050000c405000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", -"030000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"030000004c050000cc09000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"030000004c050000cc09000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", -"03000000c01100000140000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", +"060000004c0500006802000000010000,PS3 Controller (Bluetooth),a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,", +"05000000504c415953544154494f4e00,PS3 Controller (Bluetooth),a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,", "050000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"050000004c050000c405000000810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", -"050000004c050000c405000001800000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", -"050000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", +"030000004c050000a00b000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", "050000004c050000cc09000000810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", -"050000004c050000cc09000001800000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", -"030000004c050000e60c000011010000,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"050000004c050000e60c000000010000,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", +"050000004c050000c405000000810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", +"030000004c050000c405000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", +"050000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", +"030000004c050000cc09000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", +"030000004c050000a00b000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", +"030000004c050000cc09000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,", +"030000004c050000c405000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", "03000000300f00001211000011010000,QanBa Arcade JoyStick,a:b2,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b5,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b6,start:b9,x:b1,y:b3,platform:Linux,", -"030000009b2800003200000001010000,Raphnet Technologies GC/N64 to USB v3.4,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux,", -"030000009b2800006000000001010000,Raphnet Technologies GC/N64 to USB v3.6,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux,", "030000009b2800000300000001010000,raphnet.net 4nes4snes v1.5,a:b0,b:b4,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b1,y:b5,platform:Linux,", "030000008916000001fd000024010000,Razer Onza Classic Edition,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000008916000000fd000024010000,Razer Onza Tournament Edition,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"03000000321500000204000011010000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", -"03000000321500000104000011010000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"03000000321500000810000011010000,Razer Panthera Evo Arcade Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", +"030000008916000000fd000024010000,Razer Onza Tournament,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "03000000321500000010000011010000,Razer RAIJU,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"03000000321500000507000000010000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"03000000321500000011000011010000,Razer Raion Fightpad for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"030000008916000000fe000024010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"03000000c6240000045d000024010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "03000000c6240000045d000025010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "03000000321500000009000011010000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,", "050000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,", "0300000032150000030a000001010000,Razer Wildcat,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "03000000790000001100000010010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Linux,", -"0300000081170000990a000001010000,Retronic Adapter,a:b0,leftx:a0,lefty:a1,platform:Linux,", -"0300000000f000000300000000010000,RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Linux,", +"0300000000f000000300000000010000,RetroUSB.com RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Linux,", +"0300000000f00000f100000000010000,RetroUSB.com Super RetroPort,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Linux,", "030000006b140000010d000011010000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"030000006b140000130d000011010000,Revolution Pro Controller 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"030000006f0e00001f01000000010000,Rock Candy,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000006f0e00001e01000011010000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", -"030000006f0e00004601000001010000,Rock Candy Xbox One Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", +"030000006f0e00001e01000011010000,Rock Candy Gamepad for PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", +"030000006f0e00004601000001010000,Rock Candy Wired Controller for Xbox One,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "03000000a306000023f6000011010000,Saitek Cyborg V.1 Game Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux,", -"03000000a30600000cff000010010000,Saitek P2500 Force Rumble Pad,a:b2,b:b3,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b0,y:b1,platform:Linux,", +"03000000a30600000cff000010010000,Saitek P2500 Force Rumble Pad,a:b2,b:b3,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,x:b0,y:b1,platform:Linux,", "03000000a30600000c04000011010000,Saitek P2900 Wireless Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b12,x:b0,y:b3,platform:Linux,", -"03000000300f00001201000010010000,Saitek P380,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux,", "03000000a30600000901000000010000,Saitek P880,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,x:b0,y:b1,platform:Linux,", "03000000a30600000b04000000010000,Saitek P990 Dual Analog Pad,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b8,x:b0,y:b3,platform:Linux,", "03000000a306000018f5000010010000,Saitek PLC Saitek P3200 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Linux,", -"03000000a306000020f6000011010000,Saitek PS2700 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux,", -"03000000a30600001005000000010000,Saitek Saitek P150,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b2,righttrigger:b5,x:b3,y:b4,platform:Linux,", -"03000000d81d00000e00000010010000,Savior,a:b0,b:b1,back:b8,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b11,righttrigger:b3,start:b9,x:b4,y:b5,platform:Linux,", "03000000c01600008704000011010000,Serial/Keyboard/Mouse/Joystick,a:b12,b:b10,back:b4,dpdown:b2,dpleft:b3,dpright:b1,dpup:b0,leftshoulder:b9,leftstick:b14,lefttrigger:b6,leftx:a1,lefty:a0,rightshoulder:b8,rightstick:b15,righttrigger:b7,rightx:a2,righty:a3,start:b5,x:b13,y:b11,platform:Linux,", "03000000f025000021c1000010010000,ShanWan Gioteck PS3 Wired Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", -"03000000632500007505000010010000,SHANWAN PS3/PC Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", -"03000000bc2000000055000010010000,ShanWan PS3/PC Wired GamePad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"03000000632500002305000010010000,ShanWan USB Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", -"03000000341a00000908000010010000,SL-6566,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,", "03000000250900000500000000010000,Sony PS2 pad with SmartJoy adapter,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux,", "030000005e0400008e02000073050000,Speedlink TORID Wireless Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "030000005e0400008e02000020200000,SpeedLink XEOX Pro Analog Gamepad pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"03000000d11800000094000011010000,Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,", -"03000000de2800000112000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,", "03000000de2800000211000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,", -"03000000de2800000211000011010000,Steam Controller,a:b2,b:b3,back:b10,dpdown:b18,dpleft:b19,dpright:b20,dpup:b17,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b5,platform:Linux,", -"03000000de2800004211000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,", -"03000000de2800004211000011010000,Steam Controller,a:b2,b:b3,back:b10,dpdown:b18,dpleft:b19,dpright:b20,dpup:b17,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b5,platform:Linux,", -"03000000de280000fc11000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"05000000de2800000212000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,", "05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,", -"05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,", +"03000000de2800000112000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,", +"05000000de2800000212000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,", +"03000000de280000fc11000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", +"03000000de2800004211000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,", "03000000de280000ff11000001000000,Steam Virtual Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"03000000381000003014000075010000,SteelSeries Stratus Duo,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"03000000381000003114000075010000,SteelSeries Stratus Duo,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"0500000011010000311400001b010000,SteelSeries Stratus Duo,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b32,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"05000000110100001914000009010000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"03000000ad1b000038f0000090040000,Street Fighter IV FightStick TE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000003b07000004a1000000010000,Suncom SFX Plus for USB,a:b0,b:b2,back:b7,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:b5,start:b8,x:b1,y:b3,platform:Linux,", "03000000666600000488000000010000,Super Joy Box 5 Pro,a:b2,b:b1,back:b9,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux,", -"0300000000f00000f100000000010000,Super RetroPort,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Linux,", -"03000000457500002211000010010000,SZMY-POWER CO. LTD. GAMEPAD,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", -"030000008f0e00000d31000010010000,SZMY-POWER CO. LTD. GAMEPAD 3 TURBO,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", "030000004f04000020b3000010010000,Thrustmaster 2 in 1 DT,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux,", "030000004f04000015b3000010010000,Thrustmaster Dual Analog 4,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux,", "030000004f04000023b3000000010000,Thrustmaster Dual Trigger 3-in-1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"030000004f0400000ed0000011010000,ThrustMaster eSwap PRO Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"03000000b50700000399000000010000,Thrustmaster Firestorm Digital 2,a:b2,b:b4,back:b11,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b8,rightstick:b0,righttrigger:b9,start:b1,x:b3,y:b5,platform:Linux,", -"030000004f04000003b3000010010000,Thrustmaster Firestorm Dual Analog 2,a:b0,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b9,rightx:a2,righty:a3,x:b1,y:b3,platform:Linux,", "030000004f04000000b3000010010000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Linux,", -"030000004f04000026b3000002040000,Thrustmaster Gamepad GP XID,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"03000000c6240000025b000002020000,Thrustmaster GPX Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "030000004f04000008d0000000010000,Thrustmaster Run N Drive Wireless,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", "030000004f04000009d0000000010000,Thrustmaster Run N Drive Wireless PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", -"030000004f04000007d0000000010000,Thrustmaster T Mini Wireless,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,", -"030000004f04000012b3000010010000,Thrustmaster vibrating gamepad,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux,", "03000000bd12000015d0000010010000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Linux,", "03000000d814000007cd000011010000,Toodles 2008 Chimp PC/PS3,a:b0,b:b1,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b2,platform:Linux,", -"030000005e0400008e02000070050000,Torid,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"03000000c01100000591000011010000,Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", "03000000100800000100000010010000,Twin USB PS2 Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,", "03000000100800000300000010010000,USB Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,", -"03000000790000000600000007010000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Linux,", "03000000790000001100000000010000,USB Gamepad1,a:b2,b:b1,back:b8,dpdown:a0,dpleft:a1,dpright:a2,dpup:a4,start:b9,platform:Linux,", -"030000006f0e00000302000011010000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,", -"030000006f0e00000702000011010000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,", "05000000ac0500003232000001000000,VR-BOX,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux,", -"03000000791d00000103000010010000,Wii Classic Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", -"050000000d0f0000f600000001000000,Wireless HORIPAD Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,", -"030000005e0400008e02000010010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "030000005e0400008e02000014010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", +"030000005e0400008e02000010010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "030000005e0400001907000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "030000005e0400009102000007010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000005e040000a102000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "030000005e040000a102000007010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", +"030000005e040000a102000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "0000000058626f782033363020576900,Xbox 360 Wireless Controller,a:b0,b:b1,back:b14,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,guide:b7,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Linux,", -"030000005e040000a102000014010000,Xbox 360 Wireless Receiver (XBOX),a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "0000000058626f782047616d65706100,Xbox Gamepad (userspace driver),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,", -"030000005e040000d102000002010000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"050000005e040000fd02000030110000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"050000005e040000050b000002090000,Xbox One Elite Series 2,a:b0,b:b1,back:b136,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"030000005e040000ea02000000000000,Xbox One Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "050000005e040000e002000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "050000005e040000fd02000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"030000005e040000ea02000001030000,Xbox One Wireless Controller (Model 1708),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000005e040000120b000001050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", -"030000005e040000130b000005050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"050000005e040000130b000001050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"050000005e040000130b000005050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,", -"030000005e0400008e02000000010000,xbox360 Wireless EasySMX,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,", "03000000450c00002043000010010000,XEOX Gamepad SL-6556-BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,", -"03000000ac0500005b05000010010000,Xiaoji Gamesir-G3w,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,", "05000000172700004431000029010000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Linux,", "03000000c0160000e105000001010000,Xin-Mo Xin-Mo Dual Arcade,a:b4,b:b3,back:b6,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b9,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b1,y:b0,platform:Linux,", "03000000120c0000100e000011010000,ZEROPLUS P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"03000000120c0000101e000011010000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,", -"05000000c82d000006500000ffff3f00,8BitDo M30 Gamepad,a:b1,b:b0,back:b4,guide:b17,leftshoulder:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a4,start:b6,x:b3,y:b2,platform:Android,", -"05000000c82d000051060000ffff3f00,8BitDo M30 Gamepad,a:b1,b:b0,back:b4,guide:b17,leftshoulder:b9,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,start:b6,x:b3,y:b2,platform:Android,", -"05000000c82d000015900000ffff3f00,8BitDo N30 Pro 2,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,", -"05000000c82d000065280000ffff3f00,8BitDo N30 Pro 2,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b17,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,", -"050000000220000000900000ffff3f00,8BitDo NES30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,", -"050000002038000009000000ffff3f00,8BitDo NES30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,", -"05000000c82d000000600000ffff3f00,8BitDo SF30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,", -"05000000c82d000000610000ffff3f00,8BitDo SF30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,", -"05000000c82d000012900000ffff3f00,8BitDo SN30 Gamepad,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android,", -"05000000c82d000062280000ffff3f00,8BitDo SN30 Gamepad,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android,", -"05000000c82d000001600000ffff3f00,8BitDo SN30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,", -"05000000c82d000002600000ffff0f00,8BitDo SN30 Pro+,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b17,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,", -"050000002028000009000000ffff3f00,8BitDo SNES30 Gamepad,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,", -"050000003512000020ab000000780f00,8BitDo SNES30 Gamepad,a:b21,b:b20,back:b30,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b26,rightshoulder:b27,start:b31,x:b24,y:b23,platform:Android,", -"05000000c82d000018900000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android,", -"05000000c82d000030320000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android,", -"05000000bc20000000550000ffff3f00,GameSir G3w,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"05000000d6020000e5890000dfff3f00,GPD XD Plus,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Android,", -"0500000031366332860c44aadfff0f00,GS Gamepad,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"0500000083050000602000000ffe0000,iBuffalo SNES Controller,a:b1,b:b0,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b15,rightshoulder:b16,start:b10,x:b3,y:b2,platform:Android,", "64633436313965656664373634323364,Microsoft X-Box 360 pad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b2,y:b3,platform:Android,", -"7573622067616d657061642020202020,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Android,", -"050000007e05000009200000ffff0f00,Nintendo Switch Pro Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b16,x:b17,y:b2,platform:Android,", -"37336435666338653565313731303834,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"4e564944494120436f72706f72617469,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", "61363931656135336130663561616264,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"050000005509000003720000cf7f3f00,NVIDIA Controller v01.01,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"050000005509000010720000ffff3f00,NVIDIA Controller v01.03,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"050000005509000014720000df7f3f00,NVIDIA Controller v01.04,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Android,", -"050000004c05000068020000dfff3f00,PS3 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"030000004c050000cc09000000006800,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"050000004c050000c4050000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android,", -"050000004c050000c4050000ffff3f00,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"050000004c050000cc090000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android,", -"050000004c050000cc090000ffff3f00,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", +"4e564944494120436f72706f72617469,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", +"37336435666338653565313731303834,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", "35643031303033326130316330353564,PS4 Controller,a:b1,b:b17,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android,", -"050000004c050000e60c0000fffe3f00,PS5 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android,", -"62653861643333663663383332396665,Razer Kishi,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"050000003215000005070000ffff3f00,Razer Raiju Mobile,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"050000003215000007070000ffff3f00,Razer Raiju Mobile,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"050000003215000000090000bf7f3f00,Razer Serval,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b2,y:b3,platform:Android,", -"32633532643734376632656664383733,Sony DualSense,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a5,start:b18,x:b0,y:b2,platform:Android,", -"61303162353165316365336436343139,Sony DualSense,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a5,start:b18,x:b0,y:b2,platform:Android,", "05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Android,", -"05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Android,", -"050000004f0400000ed00000fffe3f00,ThrustMaster eSwap PRO Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", "5477696e20555342204a6f7973746963,Twin USB Joystick,a:b22,b:b21,back:b28,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b26,leftstick:b30,lefttrigger:b24,leftx:a0,lefty:a1,rightshoulder:b27,rightstick:b31,righttrigger:b25,rightx:a3,righty:a2,start:b29,x:b23,y:b20,platform:Android,", -"30306539356238653637313730656134,Wireless HORIPAD Switch Pro Controller,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b19,y:b2,platform:Android,", -"050000005e040000fd020000ff7f3f00,Xbox One S Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"050000005e040000e00200000ffe3f00,Xbox One Wireless Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b17,y:b2,platform:Android,", -"050000005e040000fd020000ffff3f00,Xbox One Wireless Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"050000005e040000130b0000ffff3f00,Xbox Series Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"65633038363832353634653836396239,Xbox Series Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,", -"050000005e04000091020000ff073f00,Xbox Wireless Controller,a:b0,b:b1,back:b4,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Android,", "34356136633366613530316338376136,Xbox Wireless Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,x:b17,y:b2,platform:Android,", -"050000001727000044310000ffff3f00,XiaoMi Game Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a6,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Android,", -"05000000ac0500000100000000006d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS,", -"05000000ac050000010000004f066d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS,", -"05000000ac05000001000000cf076d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS,", -"05000000ac05000001000000df076d01,*,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,", -"05000000ac05000001000000ff076d01,*,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,", -"05000000ac0500000200000000006d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS,", -"05000000ac050000020000004f066d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS,", "4d466947616d65706164010000000000,MFi Extended Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:iOS,", "4d466947616d65706164020000000000,MFi Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,platform:iOS,", -"050000004c050000cc090000df070000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,", -"050000004c050000cc090000ff070000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,", -"050000004c050000cc090000ff870001,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,touchpad:b11,x:b2,y:b3,platform:iOS,", -"05000000ac0500000300000000006d03,Remote,a:b0,b:b2,leftx:a0,lefty:a1,platform:iOS,", -"05000000ac0500000300000043006d03,Remote,a:b0,b:b2,leftx:a0,lefty:a1,platform:iOS,", "05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS,", -"05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS,", -"050000005e040000050b0000ff070001,Xbox Elite Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b13,paddle3:b12,paddle4:b14,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,", -"050000005e040000e0020000df070000,Xbox Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,", -"050000005e040000e0020000ff070000,Xbox Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,", "78696e70757401000000000000000000,XInput Gamepad (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", "78696e70757402000000000000000000,XInput Wheel (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", diff --git a/src/external/glfw/src/monitor.c b/src/external/glfw/src/monitor.c index 394026f5a..bde930102 100644 --- a/src/external/glfw/src/monitor.c +++ b/src/external/glfw/src/monitor.c @@ -170,8 +170,7 @@ _GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM) monitor->widthMM = widthMM; monitor->heightMM = heightMM; - if (name) - monitor->name = _glfw_strdup(name); + strncpy(monitor->name, name, sizeof(monitor->name) - 1); return monitor; } @@ -189,7 +188,6 @@ void _glfwFreeMonitor(_GLFWmonitor* monitor) _glfwFreeGammaArrays(&monitor->currentRamp); free(monitor->modes); - free(monitor->name); free(monitor); } diff --git a/src/external/glfw/src/wgl_context.c b/src/external/glfw/src/wgl_context.c index 4f9a6ffe3..5b69f8bce 100644 --- a/src/external/glfw/src/wgl_context.c +++ b/src/external/glfw/src/wgl_context.c @@ -165,6 +165,9 @@ static int choosePixelFormat(_GLFWwindow* window, if (findAttribValue(WGL_ACCELERATION_ARB) == WGL_NO_ACCELERATION_ARB) continue; + if (findAttribValue(WGL_DOUBLE_BUFFER_ARB) != fbconfig->doublebuffer) + continue; + u->redBits = findAttribValue(WGL_RED_BITS_ARB); u->greenBits = findAttribValue(WGL_GREEN_BITS_ARB); u->blueBits = findAttribValue(WGL_BLUE_BITS_ARB); @@ -182,8 +185,6 @@ static int choosePixelFormat(_GLFWwindow* window, if (findAttribValue(WGL_STEREO_ARB)) u->stereo = GLFW_TRUE; - if (findAttribValue(WGL_DOUBLE_BUFFER_ARB)) - u->doublebuffer = GLFW_TRUE; if (_glfw.wgl.ARB_multisample) u->samples = findAttribValue(WGL_SAMPLES_ARB); @@ -239,6 +240,9 @@ static int choosePixelFormat(_GLFWwindow* window, if (pfd.iPixelType != PFD_TYPE_RGBA) continue; + if (!!(pfd.dwFlags & PFD_DOUBLEBUFFER) != fbconfig->doublebuffer) + continue; + u->redBits = pfd.cRedBits; u->greenBits = pfd.cGreenBits; u->blueBits = pfd.cBlueBits; @@ -256,8 +260,6 @@ static int choosePixelFormat(_GLFWwindow* window, if (pfd.dwFlags & PFD_STEREO) u->stereo = GLFW_TRUE; - if (pfd.dwFlags & PFD_DOUBLEBUFFER) - u->doublebuffer = GLFW_TRUE; } u->handle = pixelFormat; diff --git a/src/external/glfw/src/win32_init.c b/src/external/glfw/src/win32_init.c index f6995e512..970da06ea 100644 --- a/src/external/glfw/src/win32_init.c +++ b/src/external/glfw/src/win32_init.c @@ -39,6 +39,10 @@ static const GUID _glfw_GUID_DEVINTERFACE_HID = #if defined(_GLFW_USE_HYBRID_HPG) || defined(_GLFW_USE_OPTIMUS_HPG) +#if defined(_GLFW_BUILD_DLL) + #warning "These symbols must be exported by the executable and have no effect in a DLL" +#endif + // Executables (but not DLLs) exporting this symbol with this value will be // automatically directed to the high-performance GPU on Nvidia Optimus systems // with up-to-date drivers @@ -614,7 +618,9 @@ void _glfwPlatformTerminate(void) const char* _glfwPlatformGetVersionString(void) { return _GLFW_VERSION_NUMBER " Win32 WGL EGL OSMesa" -#if defined(__MINGW32__) +#if defined(__MINGW64_VERSION_MAJOR) + " MinGW-w64" +#elif defined(__MINGW32__) " MinGW" #elif defined(_MSC_VER) " VisualC" diff --git a/src/external/glfw/src/win32_platform.h b/src/external/glfw/src/win32_platform.h index 4f5205147..6449a7119 100644 --- a/src/external/glfw/src/win32_platform.h +++ b/src/external/glfw/src/win32_platform.h @@ -39,8 +39,8 @@ #endif // This is a workaround for the fact that glfw3.h needs to export APIENTRY (for -// example to allow applications to correctly declare a GL_ARB_debug_output -// callback) but windows.h assumes no one will define APIENTRY before it does +// example to allow applications to correctly declare a GL_KHR_debug callback) +// but windows.h assumes no one will define APIENTRY before it does #undef APIENTRY // GLFW on Windows is Unicode only and does not work in MBCS mode @@ -314,6 +314,9 @@ typedef struct _GLFWwindowWin32 GLFWbool scaleToMonitor; GLFWbool keymenu; + // Cached size used to filter out duplicate events + int width, height; + // The last received cursor position, regardless of source int lastCursorPosX, lastCursorPosY; // The last recevied high surrogate when decoding pairs of UTF-16 messages diff --git a/src/external/glfw/src/win32_window.c b/src/external/glfw/src/win32_window.c index 8cb505004..52a9c6803 100644 --- a/src/external/glfw/src/win32_window.c +++ b/src/external/glfw/src/win32_window.c @@ -501,7 +501,17 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_NCCREATE: { if (_glfwIsWindows10AnniversaryUpdateOrGreaterWin32()) - EnableNonClientDpiScaling(hWnd); + { + const CREATESTRUCTW* cs = (const CREATESTRUCTW*) lParam; + const _GLFWwndconfig* wndconfig = cs->lpCreateParams; + + // On per-monitor DPI aware V1 systems, only enable + // non-client scaling for windows that scale the client area + // We need WM_GETDPISCALEDSIZE from V2 to keep the client + // area static when the non-client area is scaled + if (wndconfig && wndconfig->scaleToMonitor) + EnableNonClientDpiScaling(hWnd); + } break; } @@ -961,6 +971,8 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_SIZE: { + const int width = LOWORD(lParam); + const int height = HIWORD(lParam); const GLFWbool iconified = wParam == SIZE_MINIMIZED; const GLFWbool maximized = wParam == SIZE_MAXIMIZED || (window->win32.maximized && @@ -975,8 +987,14 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, if (window->win32.maximized != maximized) _glfwInputWindowMaximize(window, maximized); - _glfwInputFramebufferSize(window, LOWORD(lParam), HIWORD(lParam)); - _glfwInputWindowSize(window, LOWORD(lParam), HIWORD(lParam)); + if (width != window->win32.width || height != window->win32.height) + { + window->win32.width = width; + window->win32.height = height; + + _glfwInputFramebufferSize(window, width, height); + _glfwInputWindowSize(window, width, height); + } if (window->monitor && window->win32.iconified != iconified) { @@ -1130,9 +1148,11 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, const float xscale = HIWORD(wParam) / (float) USER_DEFAULT_SCREEN_DPI; const float yscale = LOWORD(wParam) / (float) USER_DEFAULT_SCREEN_DPI; - // Only apply the suggested size if the OS is new enough to have - // sent a WM_GETDPISCALEDSIZE before this - if (_glfwIsWindows10CreatorsUpdateOrGreaterWin32()) + // Resize windowed mode windows that either permit rescaling or that + // need it to compensate for non-client area scaling + if (!window->monitor && + (window->win32.scaleToMonitor || + _glfwIsWindows10CreatorsUpdateOrGreaterWin32())) { RECT* suggested = (RECT*) lParam; SetWindowPos(window->win32.handle, HWND_TOP, @@ -1247,7 +1267,7 @@ static int createNativeWindow(_GLFWwindow* window, NULL, // No parent window NULL, // No window menu GetModuleHandleW(NULL), - NULL); + (LPVOID) wndconfig); free(wideTitle); @@ -1315,6 +1335,8 @@ static int createNativeWindow(_GLFWwindow* window, window->win32.transparent = GLFW_TRUE; } + _glfwPlatformGetWindowSize(window, &window->win32.width, &window->win32.height); + return GLFW_TRUE; } @@ -2113,30 +2135,41 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) { int id = 0; - if (shape == GLFW_ARROW_CURSOR) - id = OCR_NORMAL; - else if (shape == GLFW_IBEAM_CURSOR) - id = OCR_IBEAM; - else if (shape == GLFW_CROSSHAIR_CURSOR) - id = OCR_CROSS; - else if (shape == GLFW_POINTING_HAND_CURSOR) - id = OCR_HAND; - else if (shape == GLFW_RESIZE_EW_CURSOR) - id = OCR_SIZEWE; - else if (shape == GLFW_RESIZE_NS_CURSOR) - id = OCR_SIZENS; - else if (shape == GLFW_RESIZE_NWSE_CURSOR) - id = OCR_SIZENWSE; - else if (shape == GLFW_RESIZE_NESW_CURSOR) - id = OCR_SIZENESW; - else if (shape == GLFW_RESIZE_ALL_CURSOR) - id = OCR_SIZEALL; - else if (shape == GLFW_NOT_ALLOWED_CURSOR) - id = OCR_NO; - else + switch (shape) { - _glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Unknown standard cursor"); - return GLFW_FALSE; + case GLFW_ARROW_CURSOR: + id = OCR_NORMAL; + break; + case GLFW_IBEAM_CURSOR: + id = OCR_IBEAM; + break; + case GLFW_CROSSHAIR_CURSOR: + id = OCR_CROSS; + break; + case GLFW_POINTING_HAND_CURSOR: + id = OCR_HAND; + break; + case GLFW_RESIZE_EW_CURSOR: + id = OCR_SIZEWE; + break; + case GLFW_RESIZE_NS_CURSOR: + id = OCR_SIZENS; + break; + case GLFW_RESIZE_NWSE_CURSOR: + id = OCR_SIZENWSE; + break; + case GLFW_RESIZE_NESW_CURSOR: + id = OCR_SIZENESW; + break; + case GLFW_RESIZE_ALL_CURSOR: + id = OCR_SIZEALL; + break; + case GLFW_NOT_ALLOWED_CURSOR: + id = OCR_NO; + break; + default: + _glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Unknown standard cursor"); + return GLFW_FALSE; } cursor->win32.handle = LoadImageW(NULL, diff --git a/src/external/glfw/src/window.c b/src/external/glfw/src/window.c index efcb4125e..518b27fd5 100644 --- a/src/external/glfw/src/window.c +++ b/src/external/glfw/src/window.c @@ -206,6 +206,8 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, window->mousePassthrough = wndconfig.mousePassthrough; window->cursorMode = GLFW_CURSOR_NORMAL; + window->doublebuffer = fbconfig.doublebuffer; + window->minwidth = GLFW_DONT_CARE; window->minheight = GLFW_DONT_CARE; window->maxwidth = GLFW_DONT_CARE; @@ -841,6 +843,8 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib) return window->floating; case GLFW_AUTO_ICONIFY: return window->autoIconify; + case GLFW_DOUBLEBUFFER: + return window->doublebuffer; case GLFW_CLIENT_API: return window->context.client; case GLFW_CONTEXT_CREATION_API: @@ -882,27 +886,18 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value) window->autoIconify = value; else if (attrib == GLFW_RESIZABLE) { - if (window->resizable == value) - return; - window->resizable = value; if (!window->monitor) _glfwPlatformSetWindowResizable(window, value); } else if (attrib == GLFW_DECORATED) { - if (window->decorated == value) - return; - window->decorated = value; if (!window->monitor) _glfwPlatformSetWindowDecorated(window, value); } else if (attrib == GLFW_FLOATING) { - if (window->floating == value) - return; - window->floating = value; if (!window->monitor) _glfwPlatformSetWindowFloating(window, value); @@ -911,9 +906,6 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value) window->focusOnShow = value; else if (attrib == GLFW_MOUSE_PASSTHROUGH) { - if (window->mousePassthrough == value) - return; - window->mousePassthrough = value; _glfwPlatformSetWindowMousePassthrough(window, value); } diff --git a/src/external/glfw/src/wl_init.c b/src/external/glfw/src/wl_init.c index d3e777d48..21a808aac 100644 --- a/src/external/glfw/src/wl_init.c +++ b/src/external/glfw/src/wl_init.c @@ -1038,8 +1038,6 @@ int _glfwPlatformInit(void) char *cursorSizeEnd; long cursorSizeLong; int cursorSize; - int i; - _GLFWmonitor* monitor; _glfw.wl.cursor.handle = _glfw_dlopen("libwayland-cursor.so.0"); if (!_glfw.wl.cursor.handle) @@ -1148,17 +1146,6 @@ int _glfwPlatformInit(void) // Sync so we got all initial output events wl_display_roundtrip(_glfw.wl.display); - for (i = 0; i < _glfw.monitorCount; ++i) - { - monitor = _glfw.monitors[i]; - if (monitor->widthMM <= 0 || monitor->heightMM <= 0) - { - // If Wayland does not provide a physical size, assume the default 96 DPI - monitor->widthMM = (int) (monitor->modes[monitor->wl.currentMode].width * 25.4f / 96.f); - monitor->heightMM = (int) (monitor->modes[monitor->wl.currentMode].height * 25.4f / 96.f); - } - } - _glfwInitTimerPOSIX(); _glfw.wl.timerfd = -1; diff --git a/src/external/glfw/src/wl_monitor.c b/src/external/glfw/src/wl_monitor.c index a6356de09..620376188 100644 --- a/src/external/glfw/src/wl_monitor.c +++ b/src/external/glfw/src/wl_monitor.c @@ -47,15 +47,13 @@ static void outputHandleGeometry(void* data, int32_t transform) { struct _GLFWmonitor *monitor = data; - char name[1024]; monitor->wl.x = x; monitor->wl.y = y; monitor->widthMM = physicalWidth; monitor->heightMM = physicalHeight; - snprintf(name, sizeof(name), "%s %s", make, model); - monitor->name = _glfw_strdup(name); + snprintf(monitor->name, sizeof(monitor->name), "%s %s", make, model); } static void outputHandleMode(void* data, @@ -88,6 +86,14 @@ static void outputHandleDone(void* data, struct wl_output* output) { struct _GLFWmonitor *monitor = data; + if (monitor->widthMM <= 0 || monitor->heightMM <= 0) + { + // If Wayland does not provide a physical size, assume the default 96 DPI + const GLFWvidmode* mode = &monitor->modes[monitor->wl.currentMode]; + monitor->widthMM = (int) (mode->width * 25.4f / 96.f); + monitor->heightMM = (int) (mode->height * 25.4f / 96.f); + } + _glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST); } @@ -125,7 +131,7 @@ void _glfwAddOutputWayland(uint32_t name, uint32_t version) } // The actual name of this output will be set in the geometry handler. - monitor = _glfwAllocMonitor(NULL, 0, 0); + monitor = _glfwAllocMonitor("", 0, 0); output = wl_registry_bind(_glfw.wl.registry, name, diff --git a/src/external/glfw/src/wl_window.c b/src/external/glfw/src/wl_window.c index 7b315d70f..939f9c196 100644 --- a/src/external/glfw/src/wl_window.c +++ b/src/external/glfw/src/wl_window.c @@ -246,10 +246,10 @@ static void createDecorations(_GLFWwindow* window) static void destroyDecoration(_GLFWdecorationWayland* decoration) { - if (decoration->surface) - wl_surface_destroy(decoration->surface); if (decoration->subsurface) wl_subsurface_destroy(decoration->subsurface); + if (decoration->surface) + wl_surface_destroy(decoration->surface); if (decoration->viewport) wp_viewport_destroy(decoration->viewport); decoration->surface = NULL; @@ -1242,26 +1242,39 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) const char* name = NULL; // Try the XDG names first - if (shape == GLFW_ARROW_CURSOR) - name = "default"; - else if (shape == GLFW_IBEAM_CURSOR) - name = "text"; - else if (shape == GLFW_CROSSHAIR_CURSOR) - name = "crosshair"; - else if (shape == GLFW_POINTING_HAND_CURSOR) - name = "pointer"; - else if (shape == GLFW_RESIZE_EW_CURSOR) - name = "ew-resize"; - else if (shape == GLFW_RESIZE_NS_CURSOR) - name = "ns-resize"; - else if (shape == GLFW_RESIZE_NWSE_CURSOR) - name = "nwse-resize"; - else if (shape == GLFW_RESIZE_NESW_CURSOR) - name = "nesw-resize"; - else if (shape == GLFW_RESIZE_ALL_CURSOR) - name = "all-scroll"; - else if (shape == GLFW_NOT_ALLOWED_CURSOR) - name = "not-allowed"; + switch (shape) + { + case GLFW_ARROW_CURSOR: + name = "default"; + break; + case GLFW_IBEAM_CURSOR: + name = "text"; + break; + case GLFW_CROSSHAIR_CURSOR: + name = "crosshair"; + break; + case GLFW_POINTING_HAND_CURSOR: + name = "pointer"; + break; + case GLFW_RESIZE_EW_CURSOR: + name = "ew-resize"; + break; + case GLFW_RESIZE_NS_CURSOR: + name = "ns-resize"; + break; + case GLFW_RESIZE_NWSE_CURSOR: + name = "nwse-resize"; + break; + case GLFW_RESIZE_NESW_CURSOR: + name = "nesw-resize"; + break; + case GLFW_RESIZE_ALL_CURSOR: + name = "all-scroll"; + break; + case GLFW_NOT_ALLOWED_CURSOR: + name = "not-allowed"; + break; + } cursor->wl.cursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, name); @@ -1274,25 +1287,26 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) if (!cursor->wl.cursor) { // Fall back to the core X11 names - if (shape == GLFW_ARROW_CURSOR) - name = "left_ptr"; - else if (shape == GLFW_IBEAM_CURSOR) - name = "xterm"; - else if (shape == GLFW_CROSSHAIR_CURSOR) - name = "crosshair"; - else if (shape == GLFW_POINTING_HAND_CURSOR) - name = "hand2"; - else if (shape == GLFW_RESIZE_EW_CURSOR) - name = "sb_h_double_arrow"; - else if (shape == GLFW_RESIZE_NS_CURSOR) - name = "sb_v_double_arrow"; - else if (shape == GLFW_RESIZE_ALL_CURSOR) - name = "fleur"; - else + switch (shape) { - _glfwInputError(GLFW_CURSOR_UNAVAILABLE, - "Wayland: Standard cursor shape unavailable"); - return GLFW_FALSE; + case GLFW_ARROW_CURSOR: + name = "left_ptr"; + case GLFW_IBEAM_CURSOR: + name = "xterm"; + case GLFW_CROSSHAIR_CURSOR: + name = "crosshair"; + case GLFW_POINTING_HAND_CURSOR: + name = "hand2"; + case GLFW_RESIZE_EW_CURSOR: + name = "sb_h_double_arrow"; + case GLFW_RESIZE_NS_CURSOR: + name = "sb_v_double_arrow"; + case GLFW_RESIZE_ALL_CURSOR: + name = "fleur"; + default: + _glfwInputError(GLFW_CURSOR_UNAVAILABLE, + "Wayland: Standard cursor shape unavailable"); + return GLFW_FALSE; } cursor->wl.cursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, name); diff --git a/src/external/glfw/src/x11_init.c b/src/external/glfw/src/x11_init.c index dd24f1123..fc9ac427b 100644 --- a/src/external/glfw/src/x11_init.c +++ b/src/external/glfw/src/x11_init.c @@ -813,11 +813,15 @@ static GLFWbool initExtensions(void) XkbGroupStateMask, XkbGroupStateMask); } + if (_glfw.hints.init.x11.xcbVulkanSurface) + { #if defined(__CYGWIN__) - _glfw.x11.x11xcb.handle = _glfw_dlopen("libX11-xcb-1.so"); + _glfw.x11.x11xcb.handle = _glfw_dlopen("libX11-xcb-1.so"); #else - _glfw.x11.x11xcb.handle = _glfw_dlopen("libX11-xcb.so.1"); + _glfw.x11.x11xcb.handle = _glfw_dlopen("libX11-xcb.so.1"); #endif + } + if (_glfw.x11.x11xcb.handle) { _glfw.x11.x11xcb.GetXCBConnection = (PFN_XGetXCBConnection) diff --git a/src/external/glfw/src/x11_window.c b/src/external/glfw/src/x11_window.c index 4cd32940d..3f2277d60 100644 --- a/src/external/glfw/src/x11_window.c +++ b/src/external/glfw/src/x11_window.c @@ -2485,7 +2485,11 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, } if (window->monitor) + { + _glfwPlatformSetWindowDecorated(window, window->decorated); + _glfwPlatformSetWindowFloating(window, window->floating); releaseMonitor(window); + } _glfwInputWindowMonitor(window, monitor); updateNormalHints(window, width, height); @@ -2935,26 +2939,39 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) const int size = XcursorGetDefaultSize(_glfw.x11.display); const char* name = NULL; - if (shape == GLFW_ARROW_CURSOR) - name = "default"; - else if (shape == GLFW_IBEAM_CURSOR) - name = "text"; - else if (shape == GLFW_CROSSHAIR_CURSOR) - name = "crosshair"; - else if (shape == GLFW_POINTING_HAND_CURSOR) - name = "pointer"; - else if (shape == GLFW_RESIZE_EW_CURSOR) - name = "ew-resize"; - else if (shape == GLFW_RESIZE_NS_CURSOR) - name = "ns-resize"; - else if (shape == GLFW_RESIZE_NWSE_CURSOR) - name = "nwse-resize"; - else if (shape == GLFW_RESIZE_NESW_CURSOR) - name = "nesw-resize"; - else if (shape == GLFW_RESIZE_ALL_CURSOR) - name = "all-scroll"; - else if (shape == GLFW_NOT_ALLOWED_CURSOR) - name = "not-allowed"; + switch (shape) + { + case GLFW_ARROW_CURSOR: + name = "default"; + break; + case GLFW_IBEAM_CURSOR: + name = "text"; + break; + case GLFW_CROSSHAIR_CURSOR: + name = "crosshair"; + break; + case GLFW_POINTING_HAND_CURSOR: + name = "pointer"; + break; + case GLFW_RESIZE_EW_CURSOR: + name = "ew-resize"; + break; + case GLFW_RESIZE_NS_CURSOR: + name = "ns-resize"; + break; + case GLFW_RESIZE_NWSE_CURSOR: + name = "nwse-resize"; + break; + case GLFW_RESIZE_NESW_CURSOR: + name = "nesw-resize"; + break; + case GLFW_RESIZE_ALL_CURSOR: + name = "all-scroll"; + break; + case GLFW_NOT_ALLOWED_CURSOR: + name = "not-allowed"; + break; + } XcursorImage* image = XcursorLibraryLoadImage(name, theme, size); if (image) @@ -2969,25 +2986,33 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) { unsigned int native = 0; - if (shape == GLFW_ARROW_CURSOR) - native = XC_left_ptr; - else if (shape == GLFW_IBEAM_CURSOR) - native = XC_xterm; - else if (shape == GLFW_CROSSHAIR_CURSOR) - native = XC_crosshair; - else if (shape == GLFW_POINTING_HAND_CURSOR) - native = XC_hand2; - else if (shape == GLFW_RESIZE_EW_CURSOR) - native = XC_sb_h_double_arrow; - else if (shape == GLFW_RESIZE_NS_CURSOR) - native = XC_sb_v_double_arrow; - else if (shape == GLFW_RESIZE_ALL_CURSOR) - native = XC_fleur; - else + switch (shape) { - _glfwInputError(GLFW_CURSOR_UNAVAILABLE, - "X11: Standard cursor shape unavailable"); - return GLFW_FALSE; + case GLFW_ARROW_CURSOR: + native = XC_left_ptr; + break; + case GLFW_IBEAM_CURSOR: + native = XC_xterm; + break; + case GLFW_CROSSHAIR_CURSOR: + native = XC_crosshair; + break; + case GLFW_POINTING_HAND_CURSOR: + native = XC_hand2; + break; + case GLFW_RESIZE_EW_CURSOR: + native = XC_sb_h_double_arrow; + break; + case GLFW_RESIZE_NS_CURSOR: + native = XC_sb_v_double_arrow; + break; + case GLFW_RESIZE_ALL_CURSOR: + native = XC_fleur; + break; + default: + _glfwInputError(GLFW_CURSOR_UNAVAILABLE, + "X11: Standard cursor shape unavailable"); + return GLFW_FALSE; } cursor->x11.handle = XCreateFontCursor(_glfw.x11.display, native); diff --git a/src/external/jar_xm.h b/src/external/jar_xm.h index 1839e619c..ea7a32831 100644 --- a/src/external/jar_xm.h +++ b/src/external/jar_xm.h @@ -1,9 +1,26 @@ -// jar_xm.h - v0.01 - public domain - Joshua Reisenauer, MAR 2016 +// jar_xm.h +// +// ORIGINAL LICENSE - FOR LIBXM: +// +// Author: Romain "Artefact2" Dalmaso +// Contributor: Dan Spencer +// Repackaged into jar_xm.h By: Joshua Adam Reisenauer +// This program is free software. It comes without any warranty, to the +// extent permitted by applicable law. You can redistribute it and/or +// modify it under the terms of the Do What The Fuck You Want To Public +// License, Version 2, as published by Sam Hocevar. See +// http://sam.zoy.org/wtfpl/COPYING for more details. // // HISTORY: -// -// v0.01 2016-02-22 Setup -// +// v0.1.0 2016-02-22 jar_xm.h - development by Joshua Reisenauer, MAR 2016 +// v0.2.1 2021-03-07 m4ntr0n1c: Fix clipping noise for "bad" xm's (they will always clip), avoid clip noise and just put a ceiling) +// v0.2.2 2021-03-09 m4ntr0n1c: Add complete debug solution (raylib.h must be included) +// v0.2.3 2021-03-11 m4ntr0n1c: Fix tempo, bpm and volume on song stop / start / restart / loop +// v0.2.4 2021-03-17 m4ntr0n1c: Sanitize code for readability +// v0.2.5 2021-03-22 m4ntr0n1c: Minor adjustments +// v0.2.6 2021-04-01 m4ntr0n1c: Minor fixes and optimisation +// v0.3.0 2021-04-03 m4ntr0n1c: Addition of Stereo sample support, Linear Interpolation and Ramping now addressable options in code +// v0.3.1 2021-04-04 m4ntr0n1c: Volume effects column adjustments, sample offset handling adjustments // // USAGE: // @@ -36,27 +53,14 @@ // return 0; // } // -// -// LISCENSE - FOR LIBXM: -// -// Author: Romain "Artefact2" Dalmaso -// Contributor: Dan Spencer -// Repackaged into jar_xm.h By: Joshua Adam Reisenauer -// This program is free software. It comes without any warranty, to the -// extent permitted by applicable law. You can redistribute it and/or -// modify it under the terms of the Do What The Fuck You Want To Public -// License, Version 2, as published by Sam Hocevar. See -// http://sam.zoy.org/wtfpl/COPYING for more details. - #ifndef INCLUDE_JAR_XM_H #define INCLUDE_JAR_XM_H #include #define JAR_XM_DEBUG 0 -#define JAR_XM_LINEAR_INTERPOLATION 1 // speed increase with decrease in quality #define JAR_XM_DEFENSIVE 1 -#define JAR_XM_RAMPING 1 +//#define JAR_XM_RAYLIB 0 // set to 0 to disable the RayLib visualizer extension // Allow custom memory allocators #ifndef JARXM_MALLOC @@ -74,224 +78,145 @@ typedef struct jar_xm_context_s jar_xm_context_t; extern "C" { #endif -/** Create a XM context. - * - * @param moddata the contents of the module - * @param rate play rate in Hz, recommended value of 48000 - * - * @returns 0 on success - * @returns 1 if module data is not sane - * @returns 2 if memory allocation failed - * @returns 3 unable to open input file - * @returns 4 fseek() failed - * @returns 5 fread() failed - * @returns 6 unkown error - * - * @deprecated This function is unsafe! - * @see jar_xm_create_context_safe() - */ +//** Create a XM context. +// * @param moddata the contents of the module +// * @param rate play rate in Hz, recommended value of 48000 +// * @returns 0 on success +// * @returns 1 if module data is not sane +// * @returns 2 if memory allocation failed +// * @returns 3 unable to open input file +// * @returns 4 fseek() failed +// * @returns 5 fread() failed +// * @returns 6 unkown error +// * @deprecated This function is unsafe! +// * @see jar_xm_create_context_safe() int jar_xm_create_context_from_file(jar_xm_context_t** ctx, uint32_t rate, const char* filename); -/** Create a XM context. - * - * @param moddata the contents of the module - * @param rate play rate in Hz, recommended value of 48000 - * - * @returns 0 on success - * @returns 1 if module data is not sane - * @returns 2 if memory allocation failed - * - * @deprecated This function is unsafe! - * @see jar_xm_create_context_safe() - */ +//** Create a XM context. +// * @param moddata the contents of the module +// * @param rate play rate in Hz, recommended value of 48000 +// * @returns 0 on success +// * @returns 1 if module data is not sane +// * @returns 2 if memory allocation failed +// * @deprecated This function is unsafe! +// * @see jar_xm_create_context_safe() int jar_xm_create_context(jar_xm_context_t** ctx, const char* moddata, uint32_t rate); -/** Create a XM context. - * - * @param moddata the contents of the module - * @param moddata_length the length of the contents of the module, in bytes - * @param rate play rate in Hz, recommended value of 48000 - * - * @returns 0 on success - * @returns 1 if module data is not sane - * @returns 2 if memory allocation failed - */ +//** Create a XM context. +// * @param moddata the contents of the module +// * @param moddata_length the length of the contents of the module, in bytes +// * @param rate play rate in Hz, recommended value of 48000 +// * @returns 0 on success +// * @returns 1 if module data is not sane +// * @returns 2 if memory allocation failed int jar_xm_create_context_safe(jar_xm_context_t** ctx, const char* moddata, size_t moddata_length, uint32_t rate); -/** Free a XM context created by jar_xm_create_context(). */ +//** Free a XM context created by jar_xm_create_context(). */ void jar_xm_free_context(jar_xm_context_t* ctx); -/** Play the module and put the sound samples in an output buffer. - * - * @param output buffer of 2*numsamples elements (A left and right value for each sample) - * @param numsamples number of samples to generate - */ +//** Play the module and put the sound samples in an output buffer. +// * @param output buffer of 2*numsamples elements (A left and right value for each sample) +// * @param numsamples number of samples to generate void jar_xm_generate_samples(jar_xm_context_t* ctx, float* output, size_t numsamples); -/** Play the module, resample from 32 bit to 16 bit, and put the sound samples in an output buffer. - * - * @param output buffer of 2*numsamples elements (A left and right value for each sample) - * @param numsamples number of samples to generate - */ -void jar_xm_generate_samples_16bit(jar_xm_context_t* ctx, short* output, size_t numsamples) -{ +//** Play the module, resample from float to 16 bit, and put the sound samples in an output buffer. +// * @param output buffer of 2*numsamples elements (A left and right value for each sample) +// * @param numsamples number of samples to generate +void jar_xm_generate_samples_16bit(jar_xm_context_t* ctx, short* output, size_t numsamples) { float* musicBuffer = JARXM_MALLOC((2*numsamples)*sizeof(float)); jar_xm_generate_samples(ctx, musicBuffer, numsamples); if(output){ - int x; - for(x=0;x<2*numsamples;x++) - output[x] = musicBuffer[x] * SHRT_MAX; + for(int x=0;x<2*numsamples;x++) output[x] = (musicBuffer[x] * 32767.0f); // scale sample to signed small int } - JARXM_FREE(musicBuffer); } -/** Play the module, resample from 32 bit to 8 bit, and put the sound samples in an output buffer. - * - * @param output buffer of 2*numsamples elements (A left and right value for each sample) - * @param numsamples number of samples to generate - */ -void jar_xm_generate_samples_8bit(jar_xm_context_t* ctx, char* output, size_t numsamples) -{ +//** Play the module, resample from float to 8 bit, and put the sound samples in an output buffer. +// * @param output buffer of 2*numsamples elements (A left and right value for each sample) +// * @param numsamples number of samples to generate +void jar_xm_generate_samples_8bit(jar_xm_context_t* ctx, char* output, size_t numsamples) { float* musicBuffer = JARXM_MALLOC((2*numsamples)*sizeof(float)); jar_xm_generate_samples(ctx, musicBuffer, numsamples); if(output){ - int x; - for(x=0;x<2*numsamples;x++) - output[x] = musicBuffer[x] * CHAR_MAX; + for(int x=0;x<2*numsamples;x++) output[x] = (musicBuffer[x] * 127.0f); // scale sample to signed 8 bit } - JARXM_FREE(musicBuffer); } - - -/** Set the maximum number of times a module can loop. After the - * specified number of loops, calls to jar_xm_generate_samples will only - * generate silence. You can control the current number of loops with - * jar_xm_get_loop_count(). - * - * @param loopcnt maximum number of loops. Use 0 to loop - * indefinitely. */ +//** Set the maximum number of times a module can loop. After the specified number of loops, calls to jar_xm_generate_samples will only generate silence. You can control the current number of loops with jar_xm_get_loop_count(). +// * @param loopcnt maximum number of loops. Use 0 to loop indefinitely. void jar_xm_set_max_loop_count(jar_xm_context_t* ctx, uint8_t loopcnt); -/** Get the loop count of the currently playing module. This value is - * 0 when the module is still playing, 1 when the module has looped - * once, etc. */ +//** Get the loop count of the currently playing module. This value is 0 when the module is still playing, 1 when the module has looped once, etc. uint8_t jar_xm_get_loop_count(jar_xm_context_t* ctx); - - -/** Mute or unmute a channel. - * - * @note Channel numbers go from 1 to jar_xm_get_number_of_channels(...). - * - * @return whether the channel was muted. - */ +//** Mute or unmute a channel. +// * @note Channel numbers go from 1 to jar_xm_get_number_of_channels(...). +// * @return whether the channel was muted. bool jar_xm_mute_channel(jar_xm_context_t* ctx, uint16_t, bool); -/** Mute or unmute an instrument. - * - * @note Instrument numbers go from 1 to - * jar_xm_get_number_of_instruments(...). - * - * @return whether the instrument was muted. - */ +//** Mute or unmute an instrument. +// * @note Instrument numbers go from 1 to jar_xm_get_number_of_instruments(...). +// * @return whether the instrument was muted. bool jar_xm_mute_instrument(jar_xm_context_t* ctx, uint16_t, bool); - - -/** Get the module name as a NUL-terminated string. */ +//** Get the module name as a NUL-terminated string. const char* jar_xm_get_module_name(jar_xm_context_t* ctx); -/** Get the tracker name as a NUL-terminated string. */ +//** Get the tracker name as a NUL-terminated string. const char* jar_xm_get_tracker_name(jar_xm_context_t* ctx); - - -/** Get the number of channels. */ +//** Get the number of channels. uint16_t jar_xm_get_number_of_channels(jar_xm_context_t* ctx); -/** Get the module length (in patterns). */ +//** Get the module length (in patterns). uint16_t jar_xm_get_module_length(jar_xm_context_t*); -/** Get the number of patterns. */ +//** Get the number of patterns. uint16_t jar_xm_get_number_of_patterns(jar_xm_context_t* ctx); -/** Get the number of rows of a pattern. - * - * @note Pattern numbers go from 0 to - * jar_xm_get_number_of_patterns(...)-1. - */ +//** Get the number of rows of a pattern. +// * @note Pattern numbers go from 0 to jar_xm_get_number_of_patterns(...)-1. uint16_t jar_xm_get_number_of_rows(jar_xm_context_t* ctx, uint16_t); -/** Get the number of instruments. */ +//** Get the number of instruments. uint16_t jar_xm_get_number_of_instruments(jar_xm_context_t* ctx); -/** Get the number of samples of an instrument. - * - * @note Instrument numbers go from 1 to - * jar_xm_get_number_of_instruments(...). - */ +//** Get the number of samples of an instrument. +// * @note Instrument numbers go from 1 to jar_xm_get_number_of_instruments(...). uint16_t jar_xm_get_number_of_samples(jar_xm_context_t* ctx, uint16_t); - - -/** Get the current module speed. - * - * @param bpm will receive the current BPM - * @param tempo will receive the current tempo (ticks per line) - */ +//** Get the current module speed. +// * @param bpm will receive the current BPM +// * @param tempo will receive the current tempo (ticks per line) void jar_xm_get_playing_speed(jar_xm_context_t* ctx, uint16_t* bpm, uint16_t* tempo); -/** Get the current position in the module being played. - * - * @param pattern_index if not NULL, will receive the current pattern - * index in the POT (pattern order table) - * - * @param pattern if not NULL, will receive the current pattern number - * - * @param row if not NULL, will receive the current row - * - * @param samples if not NULL, will receive the total number of - * generated samples (divide by sample rate to get seconds of - * generated audio) - */ +//** Get the current position in the module being played. +// * @param pattern_index if not NULL, will receive the current pattern index in the POT (pattern order table) +// * @param pattern if not NULL, will receive the current pattern number +// * @param row if not NULL, will receive the current row +// * @param samples if not NULL, will receive the total number of +// * generated samples (divide by sample rate to get seconds of generated audio) void jar_xm_get_position(jar_xm_context_t* ctx, uint8_t* pattern_index, uint8_t* pattern, uint8_t* row, uint64_t* samples); -/** Get the latest time (in number of generated samples) when a - * particular instrument was triggered in any channel. - * - * @note Instrument numbers go from 1 to - * jar_xm_get_number_of_instruments(...). - */ +//** Get the latest time (in number of generated samples) when a particular instrument was triggered in any channel. +// * @note Instrument numbers go from 1 to jar_xm_get_number_of_instruments(...). uint64_t jar_xm_get_latest_trigger_of_instrument(jar_xm_context_t* ctx, uint16_t); -/** Get the latest time (in number of generated samples) when a - * particular sample was triggered in any channel. - * - * @note Instrument numbers go from 1 to - * jar_xm_get_number_of_instruments(...). - * - * @note Sample numbers go from 0 to - * jar_xm_get_nubmer_of_samples(...,instr)-1. - */ +//** Get the latest time (in number of generated samples) when a particular sample was triggered in any channel. +// * @note Instrument numbers go from 1 to jar_xm_get_number_of_instruments(...). +// * @note Sample numbers go from 0 to jar_xm_get_nubmer_of_samples(...,instr)-1. uint64_t jar_xm_get_latest_trigger_of_sample(jar_xm_context_t* ctx, uint16_t instr, uint16_t sample); -/** Get the latest time (in number of generated samples) when any - * instrument was triggered in a given channel. - * - * @note Channel numbers go from 1 to jar_xm_get_number_of_channels(...). - */ +//** Get the latest time (in number of generated samples) when any instrument was triggered in a given channel. +// * @note Channel numbers go from 1 to jar_xm_get_number_of_channels(...). uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t* ctx, uint16_t); -/** Get the number of remaining samples. Divide by 2 to get the number of individual LR data samples. - * - * @note This is the remaining number of samples before the loop starts module again, or halts if on last pass. - * @note This function is very slow and should only be run once, if at all. - */ +//** Get the number of remaining samples. Divide by 2 to get the number of individual LR data samples. +// * @note This is the remaining number of samples before the loop starts module again, or halts if on last pass. +// * @note This function is very slow and should only be run once, if at all. uint64_t jar_xm_get_remaining_samples(jar_xm_context_t* ctx); #ifdef __cplusplus @@ -299,12 +224,6 @@ uint64_t jar_xm_get_remaining_samples(jar_xm_context_t* ctx); #endif //------------------------------------------------------------------------------- - - - - - -//Function Definitions----------------------------------------------------------- #ifdef JAR_XM_IMPLEMENTATION #include @@ -330,19 +249,16 @@ extern int __fail[-1]; #endif /* ----- XM constants ----- */ - #define SAMPLE_NAME_LENGTH 22 #define INSTRUMENT_NAME_LENGTH 22 #define MODULE_NAME_LENGTH 20 #define TRACKER_NAME_LENGTH 20 #define PATTERN_ORDER_TABLE_LENGTH 256 -#define NUM_NOTES 96 -#define NUM_ENVELOPE_POINTS 12 +#define NUM_NOTES 96 // from 1 to 96, where 1 = C-0 +#define NUM_ENVELOPE_POINTS 12 // to be verified if 12 is the max #define MAX_NUM_ROWS 256 -#if JAR_XM_RAMPING -#define jar_xm_SAMPLE_RAMPING_POINTS 0x20 -#endif +#define jar_xm_SAMPLE_RAMPING_POINTS 8 /* ----- Data types ----- */ @@ -389,7 +305,7 @@ typedef struct jar_xm_envelope_s jar_xm_envelope_t; struct jar_xm_sample_s { char name[SAMPLE_NAME_LENGTH + 1]; int8_t bits; /* Either 8 or 16 */ - + int8_t stereo; uint32_t length; uint32_t loop_start; uint32_t loop_length; @@ -446,12 +362,13 @@ struct jar_xm_sample_s { uint16_t num_channels; uint16_t num_patterns; uint16_t num_instruments; + uint16_t linear_interpolation; + uint16_t ramping; jar_xm_frequency_type_t frequency_type; uint8_t pattern_table[PATTERN_ORDER_TABLE_LENGTH]; jar_xm_pattern_t* patterns; - jar_xm_instrument_t* instruments; /* Instrument 1 has index 0, - * instrument 2 has index 1, etc. */ + jar_xm_instrument_t* instruments; /* Instrument 1 has index 0, instrument 2 has index 1, etc. */ }; typedef struct jar_xm_module_s jar_xm_module_t; @@ -517,15 +434,15 @@ struct jar_xm_sample_s { uint64_t latest_trigger; bool muted; -#if JAR_XM_RAMPING - /* These values are updated at the end of each tick, to save - * a couple of float operations on every generated sample. */ + //* These values are updated at the end of each tick, to save a couple of float operations on every generated sample. float target_panning; float target_volume; unsigned long frame_count; - float end_of_previous_sample[jar_xm_SAMPLE_RAMPING_POINTS]; -#endif + float end_of_previous_sample_left[jar_xm_SAMPLE_RAMPING_POINTS]; + float end_of_previous_sample_right[jar_xm_SAMPLE_RAMPING_POINTS]; + float curr_left; + float curr_right; float actual_panning; float actual_volume; @@ -537,18 +454,16 @@ struct jar_xm_sample_s { jar_xm_module_t module; uint32_t rate; - uint16_t tempo; + uint16_t default_tempo; // Number of ticks per row + uint16_t default_bpm; + float default_global_volume; + + uint16_t tempo; // Number of ticks per row uint16_t bpm; float global_volume; - float amplification; -#if JAR_XM_RAMPING - /* How much is a channel final volume allowed to change per - * sample; this is used to avoid abrubt volume changes which - * manifest as "clicks" in the generated sound. */ - float volume_ramp; + float volume_ramp; /* How much is a channel final volume allowed to change per sample; this is used to avoid abrubt volume changes which manifest as "clicks" in the generated sound. */ float panning_ramp; /* Same for panning. */ -#endif uint8_t current_table_index; uint8_t current_row; @@ -561,9 +476,7 @@ struct jar_xm_sample_s { uint8_t jump_dest; uint8_t jump_row; - /* Extra ticks to be played before going to the next row - - * Used for EEy effect */ - uint16_t extra_ticks; + uint16_t extra_ticks; /* Extra ticks to be played before going to the next row - Used for EEy effect */ uint8_t* row_loop_count; /* Array of size MAX_NUM_ROWS * module_length */ uint8_t loop_count; @@ -572,45 +485,33 @@ struct jar_xm_sample_s { jar_xm_channel_context_t* channels; }; -/* ----- Internal API ----- */ - #if JAR_XM_DEFENSIVE -/** Check the module data for errors/inconsistencies. - * - * @returns 0 if everything looks OK. Module should be safe to load. - */ +//** Check the module data for errors/inconsistencies. +// * @returns 0 if everything looks OK. Module should be safe to load. int jar_xm_check_sanity_preload(const char*, size_t); -/** Check a loaded module for errors/inconsistencies. - * - * @returns 0 if everything looks OK. - */ +//** Check a loaded module for errors/inconsistencies. +// * @returns 0 if everything looks OK. int jar_xm_check_sanity_postload(jar_xm_context_t*); #endif -/** Get the number of bytes needed to store the module data in a - * dynamically allocated blank context. - * - * Things that are dynamically allocated: - * - sample data - * - sample structures in instruments - * - pattern data - * - row loop count arrays - * - pattern structures in module - * - instrument structures in module - * - channel contexts - * - context structure itself - - * @returns 0 if everything looks OK. - */ +//** Get the number of bytes needed to store the module data in a dynamically allocated blank context. +// * Things that are dynamically allocated: +// * - sample data +// * - sample structures in instruments +// * - pattern data +// * - row loop count arrays +// * - pattern structures in module +// * - instrument structures in module +// * - channel contexts +// * - context structure itself +// * @returns 0 if everything looks OK. size_t jar_xm_get_memory_needed_for_context(const char*, size_t); -/** Populate the context from module data. - * - * @returns pointer to the memory pool - */ +//** Populate the context from module data. +// * @returns pointer to the memory pool char* jar_xm_load_module(jar_xm_context_t*, const char*, size_t, char*); int jar_xm_create_context(jar_xm_context_t** ctxp, const char* moddata, uint32_t rate) { @@ -636,8 +537,7 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz bytes_needed = jar_xm_get_memory_needed_for_context(moddata, moddata_length); mempool = JARXM_MALLOC(bytes_needed); - if(mempool == NULL && bytes_needed > 0) { - /* JARXM_MALLOC() failed, trouble ahead */ + if(mempool == NULL && bytes_needed > 0) { /* JARXM_MALLOC() failed, trouble ahead */ DEBUG("call to JARXM_MALLOC() failed, returned %p", (void*)mempool); return 2; } @@ -657,23 +557,19 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz mempool += ctx->module.num_channels * sizeof(jar_xm_channel_context_t); mempool = ALIGN_PTR(mempool, 16); - ctx->global_volume = 1.f; - ctx->amplification = .25f; /* XXX: some bad modules may still clip. Find out something better. */ + ctx->default_global_volume = 1.f; + ctx->global_volume = ctx->default_global_volume; -#if JAR_XM_RAMPING ctx->volume_ramp = (1.f / 128.f); ctx->panning_ramp = (1.f / 128.f); -#endif for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { - jar_xm_channel_context_t* ch = ctx->channels + i; - + jar_xm_channel_context_t *ch = ctx->channels + i; ch->ping = true; ch->vibrato_waveform = jar_xm_SINE_WAVEFORM; ch->vibrato_waveform_retrigger = true; ch->tremolo_waveform = jar_xm_SINE_WAVEFORM; ch->tremolo_waveform_retrigger = true; - ch->volume = ch->volume_envelope_volume = ch->fadeout_volume = 1.0f; ch->panning = ch->panning_envelope_panning = .5f; ch->actual_volume = .0f; @@ -681,12 +577,11 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz } mempool = ALIGN_PTR(mempool, 16); - ctx->row_loop_count = (uint8_t*)mempool; + ctx->row_loop_count = (uint8_t *)mempool; mempool += MAX_NUM_ROWS * sizeof(uint8_t); #if JAR_XM_DEFENSIVE - if((ret = jar_xm_check_sanity_postload(ctx))) { - DEBUG("jar_xm_check_sanity_postload() returned %i, module is not safe to play", ret); + if((ret = jar_xm_check_sanity_postload(ctx))) { DEBUG("jar_xm_check_sanity_postload() returned %i, module is not safe to play", ret); jar_xm_free_context(ctx); return 1; } @@ -695,106 +590,98 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz return 0; } -void jar_xm_free_context(jar_xm_context_t* ctx) { - JARXM_FREE(ctx->allocated_memory); +void jar_xm_free_context(jar_xm_context_t *ctx) { + if (ctx != NULL) { JARXM_FREE(ctx->allocated_memory); } } -void jar_xm_set_max_loop_count(jar_xm_context_t* ctx, uint8_t loopcnt) { +void jar_xm_set_max_loop_count(jar_xm_context_t *ctx, uint8_t loopcnt) { ctx->max_loop_count = loopcnt; } -uint8_t jar_xm_get_loop_count(jar_xm_context_t* ctx) { +uint8_t jar_xm_get_loop_count(jar_xm_context_t *ctx) { return ctx->loop_count; } -bool jar_xm_mute_channel(jar_xm_context_t* ctx, uint16_t channel, bool mute) { +bool jar_xm_mute_channel(jar_xm_context_t *ctx, uint16_t channel, bool mute) { bool old = ctx->channels[channel - 1].muted; ctx->channels[channel - 1].muted = mute; return old; } -bool jar_xm_mute_instrument(jar_xm_context_t* ctx, uint16_t instr, bool mute) { +bool jar_xm_mute_instrument(jar_xm_context_t *ctx, uint16_t instr, bool mute) { bool old = ctx->module.instruments[instr - 1].muted; ctx->module.instruments[instr - 1].muted = mute; return old; } - - -const char* jar_xm_get_module_name(jar_xm_context_t* ctx) { +const char* jar_xm_get_module_name(jar_xm_context_t *ctx) { return ctx->module.name; } -const char* jar_xm_get_tracker_name(jar_xm_context_t* ctx) { +const char* jar_xm_get_tracker_name(jar_xm_context_t *ctx) { return ctx->module.trackername; } - - -uint16_t jar_xm_get_number_of_channels(jar_xm_context_t* ctx) { +uint16_t jar_xm_get_number_of_channels(jar_xm_context_t *ctx) { return ctx->module.num_channels; } -uint16_t jar_xm_get_module_length(jar_xm_context_t* ctx) { +uint16_t jar_xm_get_module_length(jar_xm_context_t *ctx) { return ctx->module.length; } -uint16_t jar_xm_get_number_of_patterns(jar_xm_context_t* ctx) { +uint16_t jar_xm_get_number_of_patterns(jar_xm_context_t *ctx) { return ctx->module.num_patterns; } -uint16_t jar_xm_get_number_of_rows(jar_xm_context_t* ctx, uint16_t pattern) { +uint16_t jar_xm_get_number_of_rows(jar_xm_context_t *ctx, uint16_t pattern) { return ctx->module.patterns[pattern].num_rows; } -uint16_t jar_xm_get_number_of_instruments(jar_xm_context_t* ctx) { +uint16_t jar_xm_get_number_of_instruments(jar_xm_context_t *ctx) { return ctx->module.num_instruments; } -uint16_t jar_xm_get_number_of_samples(jar_xm_context_t* ctx, uint16_t instrument) { +uint16_t jar_xm_get_number_of_samples(jar_xm_context_t *ctx, uint16_t instrument) { return ctx->module.instruments[instrument - 1].num_samples; } - - -void jar_xm_get_playing_speed(jar_xm_context_t* ctx, uint16_t* bpm, uint16_t* tempo) { +void jar_xm_get_playing_speed(jar_xm_context_t *ctx, uint16_t *bpm, uint16_t *tempo) { if(bpm) *bpm = ctx->bpm; if(tempo) *tempo = ctx->tempo; } -void jar_xm_get_position(jar_xm_context_t* ctx, uint8_t* pattern_index, uint8_t* pattern, uint8_t* row, uint64_t* samples) { +void jar_xm_get_position(jar_xm_context_t *ctx, uint8_t *pattern_index, uint8_t *pattern, uint8_t *row, uint64_t *samples) { if(pattern_index) *pattern_index = ctx->current_table_index; if(pattern) *pattern = ctx->module.pattern_table[ctx->current_table_index]; if(row) *row = ctx->current_row; if(samples) *samples = ctx->generated_samples; } -uint64_t jar_xm_get_latest_trigger_of_instrument(jar_xm_context_t* ctx, uint16_t instr) { +uint64_t jar_xm_get_latest_trigger_of_instrument(jar_xm_context_t *ctx, uint16_t instr) { return ctx->module.instruments[instr - 1].latest_trigger; } -uint64_t jar_xm_get_latest_trigger_of_sample(jar_xm_context_t* ctx, uint16_t instr, uint16_t sample) { +uint64_t jar_xm_get_latest_trigger_of_sample(jar_xm_context_t *ctx, uint16_t instr, uint16_t sample) { return ctx->module.instruments[instr - 1].samples[sample].latest_trigger; } -uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t* ctx, uint16_t chn) { +uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t *ctx, uint16_t chn) { return ctx->channels[chn - 1].latest_trigger; } -/* .xm files are little-endian. (XXX: Are they really?) */ +//* .xm files are little-endian. (XXX: Are they really?) -/* Bounded reader macros. - * If we attempt to read the buffer out-of-bounds, pretend that the buffer is - * infinitely padded with zeroes. - */ +//* Bound reader macros. +//* If we attempt to read the buffer out-of-bounds, pretend that the buffer is infinitely padded with zeroes. #define READ_U8(offset) (((offset) < moddata_length) ? (*(uint8_t*)(moddata + (offset))) : 0) #define READ_U16(offset) ((uint16_t)READ_U8(offset) | ((uint16_t)READ_U8((offset) + 1) << 8)) #define READ_U32(offset) ((uint32_t)READ_U16(offset) | ((uint32_t)READ_U16((offset) + 2) << 16)) #define READ_MEMCPY(ptr, offset, length) memcpy_pad(ptr, length, moddata, moddata_length, offset) -static void memcpy_pad(void* dst, size_t dst_len, const void* src, size_t src_len, size_t offset) { - uint8_t* dst_c = dst; - const uint8_t* src_c = src; +static void memcpy_pad(void *dst, size_t dst_len, const void *src, size_t src_len, size_t offset) { + uint8_t *dst_c = dst; + const uint8_t *src_c = src; /* how many bytes can be copied without overrunning `src` */ size_t copy_bytes = (src_len >= offset) ? (src_len - offset) : 0; @@ -808,40 +695,22 @@ static void memcpy_pad(void* dst, size_t dst_len, const void* src, size_t src_le #if JAR_XM_DEFENSIVE int jar_xm_check_sanity_preload(const char* module, size_t module_length) { - if(module_length < 60) { - return 4; - } - - if(memcmp("Extended Module: ", module, 17) != 0) { - return 1; - } - - if(module[37] != 0x1A) { - return 2; - } - - if(module[59] != 0x01 || module[58] != 0x04) { - /* Not XM 1.04 */ - return 3; - } - + if(module_length < 60) { return 4; } + if(memcmp("Extended Module: ", module, 17) != 0) { return 1; } + if(module[37] != 0x1A) { return 2; } + if(module[59] != 0x01 || module[58] != 0x04) { return 3; } /* Not XM 1.04 */ return 0; } int jar_xm_check_sanity_postload(jar_xm_context_t* ctx) { - /* @todo: plenty of stuff to do here… */ - /* Check the POT */ for(uint8_t i = 0; i < ctx->module.length; ++i) { if(ctx->module.pattern_table[i] >= ctx->module.num_patterns) { if(i+1 == ctx->module.length && ctx->module.length > 1) { - /* Cheap fix */ - --ctx->module.length; DEBUG("trimming invalid POT at pos %X", i); + --ctx->module.length; } else { - DEBUG("module has invalid POT, pos %X references nonexistent pattern %X", - i, - ctx->module.pattern_table[i]); + DEBUG("module has invalid POT, pos %X references nonexistent pattern %X", i, ctx->module.pattern_table[i]); return 1; } } @@ -854,36 +723,29 @@ int jar_xm_check_sanity_postload(jar_xm_context_t* ctx) { size_t jar_xm_get_memory_needed_for_context(const char* moddata, size_t moddata_length) { size_t memory_needed = 0; - size_t offset = 60; /* Skip the first header */ + size_t offset = 60; /* 60 = Skip the first header */ uint16_t num_channels; uint16_t num_patterns; uint16_t num_instruments; /* Read the module header */ num_channels = READ_U16(offset + 8); - num_patterns = READ_U16(offset + 10); memory_needed += num_patterns * sizeof(jar_xm_pattern_t); memory_needed = ALIGN(memory_needed, 16); - num_instruments = READ_U16(offset + 12); memory_needed += num_instruments * sizeof(jar_xm_instrument_t); memory_needed = ALIGN(memory_needed, 16); - memory_needed += MAX_NUM_ROWS * READ_U16(offset + 4) * sizeof(uint8_t); /* Module length */ - /* Header size */ - offset += READ_U32(offset); + offset += READ_U32(offset); /* Header size */ /* Read pattern headers */ for(uint16_t i = 0; i < num_patterns; ++i) { uint16_t num_rows; - num_rows = READ_U16(offset + 5); memory_needed += num_rows * num_channels * sizeof(jar_xm_pattern_slot_t); - - /* Pattern header length + packed pattern data size */ - offset += READ_U32(offset) + READ_U16(offset + 7); + offset += READ_U32(offset) + READ_U16(offset + 7); /* Pattern header length + packed pattern data size */ } memory_needed = ALIGN(memory_needed, 16); @@ -892,42 +754,30 @@ size_t jar_xm_get_memory_needed_for_context(const char* moddata, size_t moddata_ uint16_t num_samples; uint32_t sample_header_size = 0; uint32_t sample_size_aggregate = 0; - num_samples = READ_U16(offset + 27); memory_needed += num_samples * sizeof(jar_xm_sample_t); + if(num_samples > 0) { sample_header_size = READ_U32(offset + 29); } - if(num_samples > 0) { - sample_header_size = READ_U32(offset + 29); - } - - /* Instrument header size */ - offset += READ_U32(offset); - + offset += READ_U32(offset); /* Instrument header size */ for(uint16_t j = 0; j < num_samples; ++j) { uint32_t sample_size; uint8_t flags; - sample_size = READ_U32(offset); flags = READ_U8(offset + 14); sample_size_aggregate += sample_size; - if(flags & (1 << 4)) { - /* 16 bit sample */ + if(flags & (1 << 4)) { /* 16 bit sample */ memory_needed += sample_size * (sizeof(float) >> 1); - } else { - /* 8 bit sample */ + } else { /* 8 bit sample */ memory_needed += sample_size * sizeof(float); } - offset += sample_header_size; } - offset += sample_size_aggregate; } memory_needed += num_channels * sizeof(jar_xm_channel_context_t); memory_needed += sizeof(jar_xm_context_t); - return memory_needed; } @@ -942,26 +792,25 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd /* Read module header */ uint32_t header_size = READ_U32(offset); - mod->length = READ_U16(offset + 4); mod->restart_position = READ_U16(offset + 6); mod->num_channels = READ_U16(offset + 8); mod->num_patterns = READ_U16(offset + 10); mod->num_instruments = READ_U16(offset + 12); - mod->patterns = (jar_xm_pattern_t*)mempool; + mod->linear_interpolation = 0; // Linear interpolation can be set after loading + mod->ramping = 1; // ramping can be set after loading mempool += mod->num_patterns * sizeof(jar_xm_pattern_t); mempool = ALIGN_PTR(mempool, 16); - mod->instruments = (jar_xm_instrument_t*)mempool; mempool += mod->num_instruments * sizeof(jar_xm_instrument_t); mempool = ALIGN_PTR(mempool, 16); - uint16_t flags = READ_U32(offset + 14); mod->frequency_type = (flags & (1 << 0)) ? jar_xm_LINEAR_FREQUENCIES : jar_xm_AMIGA_FREQUENCIES; - - ctx->tempo = READ_U16(offset + 16); - ctx->bpm = READ_U16(offset + 18); + ctx->default_tempo = READ_U16(offset + 16); + ctx->default_bpm = READ_U16(offset + 18); + ctx->tempo =ctx->default_tempo; + ctx->bpm = ctx->default_bpm; READ_MEMCPY(mod->pattern_table, offset + 20, PATTERN_ORDER_TABLE_LENGTH); offset += header_size; @@ -970,69 +819,52 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd for(uint16_t i = 0; i < mod->num_patterns; ++i) { uint16_t packed_patterndata_size = READ_U16(offset + 7); jar_xm_pattern_t* pat = mod->patterns + i; - pat->num_rows = READ_U16(offset + 5); - pat->slots = (jar_xm_pattern_slot_t*)mempool; mempool += mod->num_channels * pat->num_rows * sizeof(jar_xm_pattern_slot_t); - - /* Pattern header length */ - offset += READ_U32(offset); - - if(packed_patterndata_size == 0) { - /* No pattern data is present */ + offset += READ_U32(offset); /* Pattern header length */ + + if(packed_patterndata_size == 0) { /* No pattern data is present */ memset(pat->slots, 0, sizeof(jar_xm_pattern_slot_t) * pat->num_rows * mod->num_channels); } else { /* This isn't your typical for loop */ for(uint16_t j = 0, k = 0; j < packed_patterndata_size; ++k) { uint8_t note = READ_U8(offset + j); jar_xm_pattern_slot_t* slot = pat->slots + k; - if(note & (1 << 7)) { /* MSB is set, this is a compressed packet */ ++j; - - if(note & (1 << 0)) { - /* Note follows */ + if(note & (1 << 0)) { /* Note follows */ slot->note = READ_U8(offset + j); ++j; } else { slot->note = 0; } - - if(note & (1 << 1)) { - /* Instrument follows */ + if(note & (1 << 1)) { /* Instrument follows */ slot->instrument = READ_U8(offset + j); ++j; } else { slot->instrument = 0; } - - if(note & (1 << 2)) { - /* Volume column follows */ + if(note & (1 << 2)) { /* Volume column follows */ slot->volume_column = READ_U8(offset + j); ++j; } else { slot->volume_column = 0; } - - if(note & (1 << 3)) { - /* Effect follows */ + if(note & (1 << 3)) { /* Effect follows */ slot->effect_type = READ_U8(offset + j); ++j; } else { slot->effect_type = 0; } - - if(note & (1 << 4)) { - /* Effect parameter follows */ + if(note & (1 << 4)) { /* Effect parameter follows */ slot->effect_param = READ_U8(offset + j); ++j; } else { slot->effect_param = 0; } - } else { - /* Uncompressed packet */ + } else { /* Uncompressed packet */ slot->note = note; slot->instrument = READ_U8(offset + j + 1); slot->volume_column = READ_U8(offset + j + 2); @@ -1076,7 +908,6 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd instr->volume_envelope.sustain_point = READ_U8(offset + 227); instr->volume_envelope.loop_start_point = READ_U8(offset + 228); instr->volume_envelope.loop_end_point = READ_U8(offset + 229); - instr->panning_envelope.sustain_point = READ_U8(offset + 230); instr->panning_envelope.loop_start_point = READ_U8(offset + 231); instr->panning_envelope.loop_end_point = READ_U8(offset + 232); @@ -1090,7 +921,6 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd instr->panning_envelope.enabled = flags & (1 << 0); instr->panning_envelope.sustain_enabled = flags & (1 << 1); instr->panning_envelope.loop_enabled = flags & (1 << 2); - instr->vibrato_type = READ_U8(offset + 235); if(instr->vibrato_type == 2) { instr->vibrato_type = 1; @@ -1101,7 +931,6 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd instr->vibrato_depth = READ_U8(offset + 237); instr->vibrato_rate = READ_U8(offset + 238); instr->volume_fadeout = READ_U16(offset + 239); - instr->samples = (jar_xm_sample_t*)mempool; mempool += instr->num_samples * sizeof(jar_xm_sample_t); } else { @@ -1111,7 +940,7 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd /* Instrument header size */ offset += READ_U32(offset); - for(uint16_t j = 0; j < instr->num_samples; ++j) { + for(int j = 0; j < instr->num_samples; ++j) { /* Read sample header */ jar_xm_sample_t* sample = instr->samples + j; @@ -1119,25 +948,28 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd sample->loop_start = READ_U32(offset + 4); sample->loop_length = READ_U32(offset + 8); sample->loop_end = sample->loop_start + sample->loop_length; - sample->volume = (float)READ_U8(offset + 12) / (float)0x40; + sample->volume = (float)(READ_U8(offset + 12) << 2) / 256.f; + if (sample->volume > 1.0f) {sample->volume = 1.f;}; sample->finetune = (int8_t)READ_U8(offset + 13); uint8_t flags = READ_U8(offset + 14); - if((flags & 3) == 0) { - sample->loop_type = jar_xm_NO_LOOP; - } else if((flags & 3) == 1) { - sample->loop_type = jar_xm_FORWARD_LOOP; - } else { + switch (flags & 3) { + case 2: + case 3: sample->loop_type = jar_xm_PING_PONG_LOOP; - } - - sample->bits = (flags & (1 << 4)) ? 16 : 8; - - sample->panning = (float)READ_U8(offset + 15) / (float)0xFF; + case 1: + sample->loop_type = jar_xm_FORWARD_LOOP; + break; + default: + sample->loop_type = jar_xm_NO_LOOP; + break; + }; + sample->bits = (flags & 0x10) ? 16 : 8; + sample->stereo = (flags & 0x20) ? 1 : 0; + sample->panning = (float)READ_U8(offset + 15) / 255.f; sample->relative_note = (int8_t)READ_U8(offset + 16); READ_MEMCPY(sample->name, 18, SAMPLE_NAME_LENGTH); sample->data = (float*)mempool; - if(sample->bits == 16) { /* 16 bit sample */ mempool += sample->length * (sizeof(float) >> 1); @@ -1149,42 +981,72 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd /* 8 bit sample */ mempool += sample->length * sizeof(float); } + // Adjust loop points to reflect half of the reported length (stereo) + if (sample->stereo && sample->loop_type != jar_xm_NO_LOOP) { + div_t lstart = div(READ_U32(offset + 4), 2); + sample->loop_start = lstart.quot; + div_t llength = div(READ_U32(offset + 8), 2); + sample->loop_length = llength.quot; + sample->loop_end = sample->loop_start + sample->loop_length; + }; offset += sample_header_size; } - for(uint16_t j = 0; j < instr->num_samples; ++j) { + // Read all samples and convert them to float values + for(int j = 0; j < instr->num_samples; ++j) { /* Read sample data */ jar_xm_sample_t* sample = instr->samples + j; - uint32_t length = sample->length; - - if(sample->bits == 16) { - int16_t v = 0; - for(uint32_t k = 0; k < length; ++k) { - v = v + (int16_t)READ_U16(offset + (k << 1)); - sample->data[k] = (float)v / (float)(1 << 15); - } - offset += sample->length << 1; + int length = sample->length; + if (sample->stereo) { + // Since it is stereo, we cut the sample in half (treated as single channel) + div_t result = div(sample->length, 2); + if(sample->bits == 16) { + int16_t v = 0; + for(int k = 0; k < length; ++k) { + if (k == result.quot) { v = 0;}; + v = v + (int16_t)READ_U16(offset + (k << 1)); + sample->data[k] = (float) v / 32768.f ;//* sign; + if(sample->data[k] < -1.0) {sample->data[k] = -1.0;} else if(sample->data[k] > 1.0) {sample->data[k] = 1.0;}; + } + offset += sample->length << 1; + } else { + int8_t v = 0; + for(int k = 0; k < length; ++k) { + if (k == result.quot) { v = 0;}; + v = v + (int8_t)READ_U8(offset + k); + sample->data[k] = (float)v / 128.f ;//* sign; + if(sample->data[k] < -1.0) {sample->data[k] = -1.0;} else if(sample->data[k] > 1.0) {sample->data[k] = 1.0;}; + } + offset += sample->length; + }; + sample->length = result.quot; } else { - int8_t v = 0; - for(uint32_t k = 0; k < length; ++k) { - v = v + (int8_t)READ_U8(offset + k); - sample->data[k] = (float)v / (float)(1 << 7); + if(sample->bits == 16) { + int16_t v = 0; + for(int k = 0; k < length; ++k) { + v = v + (int16_t)READ_U16(offset + (k << 1)); + sample->data[k] = (float) v / 32768.f ;//* sign; + if(sample->data[k] < -1.0) {sample->data[k] = -1.0;} else if(sample->data[k] > 1.0) {sample->data[k] = 1.0;}; + } + offset += sample->length << 1; + } else { + int8_t v = 0; + for(int k = 0; k < length; ++k) { + v = v + (int8_t)READ_U8(offset + k); + sample->data[k] = (float)v / 128.f ;//* sign; + if(sample->data[k] < -1.0) {sample->data[k] = -1.0;} else if(sample->data[k] > 1.0) {sample->data[k] = 1.0;}; + } + offset += sample->length; } - offset += sample->length; } - } - } - + }; + }; return mempool; -} +}; //------------------------------------------------------------------------------- //THE FOLLOWING IS FOR PLAYING -//------------------------------------------------------------------------------- - -/* ----- Static functions ----- */ - static float jar_xm_waveform(jar_xm_waveform_type_t, uint8_t); static void jar_xm_autovibrato(jar_xm_context_t*, jar_xm_channel_context_t*); static void jar_xm_vibrato(jar_xm_context_t*, jar_xm_channel_context_t*, uint8_t, uint16_t); @@ -1216,35 +1078,21 @@ static void jar_xm_post_pattern_change(jar_xm_context_t*); static void jar_xm_row(jar_xm_context_t*); static void jar_xm_tick(jar_xm_context_t*); -static float jar_xm_next_of_sample(jar_xm_channel_context_t*); -static void jar_xm_sample(jar_xm_context_t*, float*, float*); - -/* ----- Other oddities ----- */ +static void jar_xm_next_of_sample(jar_xm_context_t*, jar_xm_channel_context_t*, int); +static void jar_xm_mixdown(jar_xm_context_t*, float*, float*); #define jar_xm_TRIGGER_KEEP_VOLUME (1 << 0) #define jar_xm_TRIGGER_KEEP_PERIOD (1 << 1) #define jar_xm_TRIGGER_KEEP_SAMPLE_POSITION (1 << 2) -static const uint16_t amiga_frequencies[] = { - 1712, 1616, 1525, 1440, /* C-2, C#2, D-2, D#2 */ - 1357, 1281, 1209, 1141, /* E-2, F-2, F#2, G-2 */ - 1077, 1017, 961, 907, /* G#2, A-2, A#2, B-2 */ - 856, /* C-3 */ -}; + // C-2, C#2, D-2, D#2, E-2, F-2, F#2, G-2, G#2, A-2, A#2, B-2, C-3 +static const uint16_t amiga_frequencies[] = { 1712, 1616, 1525, 1440, 1357, 1281, 1209, 1141, 1077, 1017, 961, 907, 856 }; -static const float multi_retrig_add[] = { - 0.f, -1.f, -2.f, -4.f, /* 0, 1, 2, 3 */ - -8.f, -16.f, 0.f, 0.f, /* 4, 5, 6, 7 */ - 0.f, 1.f, 2.f, 4.f, /* 8, 9, A, B */ - 8.f, 16.f, 0.f, 0.f /* C, D, E, F */ -}; + // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f +static const float multi_retrig_add[] = { 0.f, -1.f, -2.f, -4.f, -8.f, -16.f, 0.f, 0.f, 0.f, 1.f, 2.f, 4.f, 8.f, 16.f, 0.f, 0.f }; -static const float multi_retrig_multiply[] = { - 1.f, 1.f, 1.f, 1.f, /* 0, 1, 2, 3 */ - 1.f, 1.f, .6666667f, .5f, /* 4, 5, 6, 7 */ - 1.f, 1.f, 1.f, 1.f, /* 8, 9, A, B */ - 1.f, 1.f, 1.5f, 2.f /* C, D, E, F */ -}; + // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f +static const float multi_retrig_multiply[] = { 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, .6666667f, .5f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.5f, 2.f }; #define jar_xm_CLAMP_UP1F(vol, limit) do { \ if((vol) > (limit)) (vol) = (limit); \ @@ -1284,43 +1132,26 @@ static const float multi_retrig_multiply[] = { || (s)->effect_param == 6 \ || ((s)->volume_column >> 4) == 0xB) #define NOTE_IS_VALID(n) ((n) > 0 && (n) < 97) - -/* ----- Function definitions ----- */ +#define NOTE_OFF 97 static float jar_xm_waveform(jar_xm_waveform_type_t waveform, uint8_t step) { static unsigned int next_rand = 24492; step %= 0x40; - switch(waveform) { - - case jar_xm_SINE_WAVEFORM: - /* Why not use a table? For saving space, and because there's - * very very little actual performance gain. */ + case jar_xm_SINE_WAVEFORM: /* No SIN() table used, direct calculation. */ return -sinf(2.f * 3.141592f * (float)step / (float)0x40); - - case jar_xm_RAMP_DOWN_WAVEFORM: - /* Ramp down: 1.0f when step = 0; -1.0f when step = 0x40 */ + case jar_xm_RAMP_DOWN_WAVEFORM: /* Ramp down: 1.0f when step = 0; -1.0f when step = 0x40 */ return (float)(0x20 - step) / 0x20; - - case jar_xm_SQUARE_WAVEFORM: - /* Square with a 50% duty */ + case jar_xm_SQUARE_WAVEFORM: /* Square with a 50% duty */ return (step >= 0x20) ? 1.f : -1.f; - - case jar_xm_RANDOM_WAVEFORM: - /* Use the POSIX.1-2001 example, just to be deterministic - * across different machines */ + case jar_xm_RANDOM_WAVEFORM: /* Use the POSIX.1-2001 example, just to be deterministic across different machines */ next_rand = next_rand * 1103515245 + 12345; return (float)((next_rand >> 16) & 0x7FFF) / (float)0x4000 - 1.f; - - case jar_xm_RAMP_UP_WAVEFORM: - /* Ramp up: -1.f when step = 0; 1.f when step = 0x40 */ + case jar_xm_RAMP_UP_WAVEFORM: /* Ramp up: -1.f when step = 0; 1.f when step = 0x40 */ return (float)(step - 0x20) / 0x20; - default: break; - } - return .0f; } @@ -1328,33 +1159,21 @@ static void jar_xm_autovibrato(jar_xm_context_t* ctx, jar_xm_channel_context_t* if(ch->instrument == NULL || ch->instrument->vibrato_depth == 0) return; jar_xm_instrument_t* instr = ch->instrument; float sweep = 1.f; - - if(ch->autovibrato_ticks < instr->vibrato_sweep) { - /* No idea if this is correct, but it sounds close enough… */ - sweep = jar_xm_LERP(0.f, 1.f, (float)ch->autovibrato_ticks / (float)instr->vibrato_sweep); - } - + if(ch->autovibrato_ticks < instr->vibrato_sweep) { sweep = jar_xm_LERP(0.f, 1.f, (float)ch->autovibrato_ticks / (float)instr->vibrato_sweep); } unsigned int step = ((ch->autovibrato_ticks++) * instr->vibrato_rate) >> 2; - ch->autovibrato_note_offset = .25f * jar_xm_waveform(instr->vibrato_type, step) - * (float)instr->vibrato_depth / (float)0xF * sweep; + ch->autovibrato_note_offset = .25f * jar_xm_waveform(instr->vibrato_type, step) * (float)instr->vibrato_depth / (float)0xF * sweep; jar_xm_update_frequency(ctx, ch); } static void jar_xm_vibrato(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, uint8_t param, uint16_t pos) { unsigned int step = pos * (param >> 4); - ch->vibrato_note_offset = - 2.f - * jar_xm_waveform(ch->vibrato_waveform, step) - * (float)(param & 0x0F) / (float)0xF; + ch->vibrato_note_offset = 2.f * jar_xm_waveform(ch->vibrato_waveform, step) * (float)(param & 0x0F) / (float)0xF; jar_xm_update_frequency(ctx, ch); } static void jar_xm_tremolo(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, uint8_t param, uint16_t pos) { unsigned int step = pos * (param >> 4); - /* Not so sure about this, it sounds correct by ear compared with - * MilkyTracker, but it could come from other bugs */ - ch->tremolo_volume = -1.f * jar_xm_waveform(ch->tremolo_waveform, step) - * (float)(param & 0x0F) / (float)0xF; + ch->tremolo_volume = -1.f * jar_xm_waveform(ch->tremolo_waveform, step) * (float)(param & 0x0F) / (float)0xF; } static void jar_xm_arpeggio(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, uint8_t param, uint16_t tick) { @@ -1372,80 +1191,36 @@ static void jar_xm_arpeggio(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, ch->arp_note_offset = param & 0x0F; break; } - jar_xm_update_frequency(ctx, ch); } static void jar_xm_tone_portamento(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch) { - /* 3xx called without a note, wait until we get an actual - * target note. */ - if(ch->tone_portamento_target_period == 0.f) return; - + /* 3xx called without a note, wait until we get an actual target note. */ + if(ch->tone_portamento_target_period == 0.f) return; /* no value, exit */ if(ch->period != ch->tone_portamento_target_period) { - jar_xm_SLIDE_TOWARDS(ch->period, - ch->tone_portamento_target_period, - (ctx->module.frequency_type == jar_xm_LINEAR_FREQUENCIES ? - 4.f : 1.f) * ch->tone_portamento_param - ); + jar_xm_SLIDE_TOWARDS(ch->period, ch->tone_portamento_target_period, (ctx->module.frequency_type == jar_xm_LINEAR_FREQUENCIES ? 4.f : 1.f) * ch->tone_portamento_param); jar_xm_update_frequency(ctx, ch); } } static void jar_xm_pitch_slide(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, float period_offset) { - /* Don't ask about the 4.f coefficient. I found mention of it - * nowhere. Found by ear™. */ - if(ctx->module.frequency_type == jar_xm_LINEAR_FREQUENCIES) { - period_offset *= 4.f; - } - + /* Don't ask about the 4.f coefficient. I found mention of it nowhere. Found by ear™. */ + if(ctx->module.frequency_type == jar_xm_LINEAR_FREQUENCIES) {period_offset *= 4.f; } ch->period += period_offset; jar_xm_CLAMP_DOWN(ch->period); /* XXX: upper bound of period ? */ - jar_xm_update_frequency(ctx, ch); } static void jar_xm_panning_slide(jar_xm_channel_context_t* ch, uint8_t rawval) { - float f; - - if((rawval & 0xF0) && (rawval & 0x0F)) { - /* Illegal state */ - return; - } - - if(rawval & 0xF0) { - /* Slide right */ - f = (float)(rawval >> 4) / (float)0xFF; - ch->panning += f; - jar_xm_CLAMP_UP(ch->panning); - } else { - /* Slide left */ - f = (float)(rawval & 0x0F) / (float)0xFF; - ch->panning -= f; - jar_xm_CLAMP_DOWN(ch->panning); - } -} + if (rawval & 0xF0) {ch->panning += (float)((rawval & 0xF0 )>> 4) / (float)0xFF;}; + if (rawval & 0x0F) {ch->panning -= (float)(rawval & 0x0F) / (float)0xFF;}; +}; static void jar_xm_volume_slide(jar_xm_channel_context_t* ch, uint8_t rawval) { - float f; - - if((rawval & 0xF0) && (rawval & 0x0F)) { - /* Illegal state */ - return; - } - - if(rawval & 0xF0) { - /* Slide up */ - f = (float)(rawval >> 4) / (float)0x40; - ch->volume += f; - jar_xm_CLAMP_UP(ch->volume); - } else { - /* Slide down */ - f = (float)(rawval & 0x0F) / (float)0x40; - ch->volume -= f; - jar_xm_CLAMP_DOWN(ch->volume); - } -} + if (rawval & 0xF0) {ch->volume += (float)((rawval & 0xF0) >> 4) / (float)0x40;}; + if (rawval & 0x0F) {ch->volume -= (float)(rawval & 0x0F) / (float)0x40;}; +}; static float jar_xm_envelope_lerp(jar_xm_envelope_point_t* a, jar_xm_envelope_point_t* b, uint16_t pos) { /* Linear interpolation between two envelope points */ @@ -1461,6 +1236,9 @@ static void jar_xm_post_pattern_change(jar_xm_context_t* ctx) { /* Loop if necessary */ if(ctx->current_table_index >= ctx->module.length) { ctx->current_table_index = ctx->module.restart_position; + ctx->tempo =ctx->default_tempo; // reset to file default value + ctx->bpm = ctx->default_bpm; // reset to file default value + ctx->global_volume = ctx->default_global_volume; // reset to file default value } } @@ -1477,24 +1255,19 @@ static float jar_xm_amiga_period(float note) { uint8_t a = intnote % 12; int8_t octave = note / 12.f - 2; uint16_t p1 = amiga_frequencies[a], p2 = amiga_frequencies[a + 1]; - if(octave > 0) { p1 >>= octave; p2 >>= octave; } else if(octave < 0) { - p1 <<= (-octave); - p2 <<= (-octave); + p1 <<= -octave; + p2 <<= -octave; } - return jar_xm_LERP(p1, p2, note - intnote); } static float jar_xm_amiga_frequency(float period) { if(period == .0f) return .0f; - - /* This is the PAL value. No reason to choose this one over the - * NTSC value. */ - return 7093789.2f / (period * 2.f); + return 7093789.2f / (period * 2.f); /* This is the PAL value. (we could use the NTSC value also) */ } static float jar_xm_period(jar_xm_context_t* ctx, float note) { @@ -1508,29 +1281,20 @@ static float jar_xm_period(jar_xm_context_t* ctx, float note) { } static float jar_xm_frequency(jar_xm_context_t* ctx, float period, float note_offset) { - uint8_t a; - int8_t octave; - float note; - uint16_t p1, p2; - switch(ctx->module.frequency_type) { - case jar_xm_LINEAR_FREQUENCIES: return jar_xm_linear_frequency(period - 64.f * note_offset); - case jar_xm_AMIGA_FREQUENCIES: - if(note_offset == 0) { - /* A chance to escape from insanity */ - return jar_xm_amiga_frequency(period); - } - - /* FIXME: this is very crappy at best */ - a = octave = 0; + if(note_offset == 0) { return jar_xm_amiga_frequency(period); }; + int8_t octave; + float note; + uint16_t p1, p2; + uint8_t a = octave = 0; /* Find the octave of the current period */ if(period > amiga_frequencies[0]) { --octave; - while(period > (amiga_frequencies[0] << (-octave))) --octave; + while(period > (amiga_frequencies[0] << -octave)) --octave; } else if(period < amiga_frequencies[12]) { ++octave; while(period < (amiga_frequencies[12] >> octave)) ++octave; @@ -1539,7 +1303,6 @@ static float jar_xm_frequency(jar_xm_context_t* ctx, float period, float note_of /* Find the smallest note closest to the current period */ for(uint8_t i = 0; i < 12; ++i) { p1 = amiga_frequencies[i], p2 = amiga_frequencies[i + 1]; - if(octave > 0) { p1 >>= octave; p2 >>= octave; @@ -1547,51 +1310,36 @@ static float jar_xm_frequency(jar_xm_context_t* ctx, float period, float note_of p1 <<= (-octave); p2 <<= (-octave); } - if(p2 <= period && period <= p1) { a = i; break; } } - - if(JAR_XM_DEBUG && (p1 < period || p2 > period)) { - DEBUG("%i <= %f <= %i should hold but doesn't, this is a bug", p2, period, p1); - } - + if(JAR_XM_DEBUG && (p1 < period || p2 > period)) { DEBUG("%i <= %f <= %i should hold but doesn't, this is a bug", p2, period, p1); } note = 12.f * (octave + 2) + a + jar_xm_INVERSE_LERP(p1, p2, period); - return jar_xm_amiga_frequency(jar_xm_amiga_period(note + note_offset)); - } return .0f; } static void jar_xm_update_frequency(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch) { - ch->frequency = jar_xm_frequency( - ctx, ch->period, - (ch->arp_note_offset > 0 ? ch->arp_note_offset : ( - ch->vibrato_note_offset + ch->autovibrato_note_offset - )) - ); + ch->frequency = jar_xm_frequency( ctx, ch->period, (ch->arp_note_offset > 0 ? ch->arp_note_offset : ( ch->vibrato_note_offset + ch->autovibrato_note_offset )) ); ch->step = ch->frequency / ctx->rate; } -static void jar_xm_handle_note_and_instrument(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, - jar_xm_pattern_slot_t* s) { +static void jar_xm_handle_note_and_instrument(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, jar_xm_pattern_slot_t* s) { + jar_xm_module_t* mod = &(ctx->module); if(s->instrument > 0) { - if(HAS_TONE_PORTAMENTO(ch->current) && ch->instrument != NULL && ch->sample != NULL) { - /* Tone portamento in effect, unclear stuff happens */ + if(HAS_TONE_PORTAMENTO(ch->current) && ch->instrument != NULL && ch->sample != NULL) { /* Tone portamento in effect */ jar_xm_trigger_note(ctx, ch, jar_xm_TRIGGER_KEEP_PERIOD | jar_xm_TRIGGER_KEEP_SAMPLE_POSITION); - } else if(s->instrument > ctx->module.num_instruments) { - /* Invalid instrument, Cut current note */ + } else if(s->instrument > ctx->module.num_instruments) { /* Invalid instrument, Cut current note */ jar_xm_cut_note(ch); ch->instrument = NULL; ch->sample = NULL; } else { ch->instrument = ctx->module.instruments + (s->instrument - 1); - if(s->note == 0 && ch->sample != NULL) { - /* Ghost instrument, trigger note */ + if(s->note == 0 && ch->sample != NULL) { /* Ghost instrument, trigger note */ /* Sample position is kept, but envelopes are reset */ jar_xm_trigger_note(ctx, ch, jar_xm_TRIGGER_KEEP_SAMPLE_POSITION); } @@ -1599,270 +1347,174 @@ static void jar_xm_handle_note_and_instrument(jar_xm_context_t* ctx, jar_xm_chan } if(NOTE_IS_VALID(s->note)) { - /* Yes, the real note number is s->note -1. Try finding - * THAT in any of the specs! :-) */ - + // note value is s->note -1 jar_xm_instrument_t* instr = ch->instrument; - if(HAS_TONE_PORTAMENTO(ch->current) && instr != NULL && ch->sample != NULL) { /* Tone portamento in effect */ ch->note = s->note + ch->sample->relative_note + ch->sample->finetune / 128.f - 1.f; ch->tone_portamento_target_period = jar_xm_period(ctx, ch->note); - } else if(instr == NULL || ch->instrument->num_samples == 0) { - /* Bad instrument */ + } else if(instr == NULL || ch->instrument->num_samples == 0) { /* Issue on instrument */ jar_xm_cut_note(ch); } else { if(instr->sample_of_notes[s->note - 1] < instr->num_samples) { -#if JAR_XM_RAMPING - for(unsigned int z = 0; z < jar_xm_SAMPLE_RAMPING_POINTS; ++z) { - ch->end_of_previous_sample[z] = jar_xm_next_of_sample(ch); - } - ch->frame_count = 0; -#endif + if (mod->ramping) { + for(int i = 0; i < jar_xm_SAMPLE_RAMPING_POINTS; ++i) { + jar_xm_next_of_sample(ctx, ch, i); + } + ch->frame_count = 0; + }; ch->sample = instr->samples + instr->sample_of_notes[s->note - 1]; - ch->orig_note = ch->note = s->note + ch->sample->relative_note - + ch->sample->finetune / 128.f - 1.f; + ch->orig_note = ch->note = s->note + ch->sample->relative_note + ch->sample->finetune / 128.f - 1.f; if(s->instrument > 0) { jar_xm_trigger_note(ctx, ch, 0); - } else { - /* Ghost note: keep old volume */ + } else { /* Ghost note: keep old volume */ jar_xm_trigger_note(ctx, ch, jar_xm_TRIGGER_KEEP_VOLUME); } } else { - /* Bad sample */ jar_xm_cut_note(ch); } } - } else if(s->note == 97) { - /* Key Off */ + } else if(s->note == NOTE_OFF) { jar_xm_key_off(ch); } - switch(s->volume_column >> 4) { - - case 0x5: - if(s->volume_column > 0x50) break; - case 0x1: - case 0x2: - case 0x3: - case 0x4: - /* Set volume */ - ch->volume = (float)(s->volume_column - 0x10) / (float)0x40; - break; - - case 0x8: /* Fine volume slide down */ - jar_xm_volume_slide(ch, s->volume_column & 0x0F); - break; - - case 0x9: /* Fine volume slide up */ - jar_xm_volume_slide(ch, s->volume_column << 4); - break; - - case 0xA: /* Set vibrato speed */ - ch->vibrato_param = (ch->vibrato_param & 0x0F) | ((s->volume_column & 0x0F) << 4); - break; - - case 0xC: /* Set panning */ - ch->panning = (float)( - ((s->volume_column & 0x0F) << 4) | (s->volume_column & 0x0F) - ) / (float)0xFF; - break; - - case 0xF: /* Tone portamento */ - if(s->volume_column & 0x0F) { - ch->tone_portamento_param = ((s->volume_column & 0x0F) << 4) - | (s->volume_column & 0x0F); - } - break; - - default: - break; - - } - + // Interpret Effect column switch(s->effect_type) { - case 1: /* 1xx: Portamento up */ - if(s->effect_param > 0) { - ch->portamento_up_param = s->effect_param; - } + if(s->effect_param > 0) { ch->portamento_up_param = s->effect_param; } break; - case 2: /* 2xx: Portamento down */ - if(s->effect_param > 0) { - ch->portamento_down_param = s->effect_param; - } + if(s->effect_param > 0) { ch->portamento_down_param = s->effect_param; } break; - case 3: /* 3xx: Tone portamento */ - if(s->effect_param > 0) { - ch->tone_portamento_param = s->effect_param; - } + if(s->effect_param > 0) { ch->tone_portamento_param = s->effect_param; } break; - case 4: /* 4xy: Vibrato */ - if(s->effect_param & 0x0F) { - /* Set vibrato depth */ - ch->vibrato_param = (ch->vibrato_param & 0xF0) | (s->effect_param & 0x0F); - } - if(s->effect_param >> 4) { - /* Set vibrato speed */ - ch->vibrato_param = (s->effect_param & 0xF0) | (ch->vibrato_param & 0x0F); - } + if(s->effect_param & 0x0F) { ch->vibrato_param = (ch->vibrato_param & 0xF0) | (s->effect_param & 0x0F); } /* Set vibrato depth */ + if(s->effect_param >> 4) { ch->vibrato_param = (s->effect_param & 0xF0) | (ch->vibrato_param & 0x0F); } /* Set vibrato speed */ break; - case 5: /* 5xy: Tone portamento + Volume slide */ - if(s->effect_param > 0) { - ch->volume_slide_param = s->effect_param; - } + if(s->effect_param > 0) { ch->volume_slide_param = s->effect_param; } break; - case 6: /* 6xy: Vibrato + Volume slide */ - if(s->effect_param > 0) { - ch->volume_slide_param = s->effect_param; - } + if(s->effect_param > 0) { ch->volume_slide_param = s->effect_param; } break; - case 7: /* 7xy: Tremolo */ - if(s->effect_param & 0x0F) { - /* Set tremolo depth */ - ch->tremolo_param = (ch->tremolo_param & 0xF0) | (s->effect_param & 0x0F); - } - if(s->effect_param >> 4) { - /* Set tremolo speed */ - ch->tremolo_param = (s->effect_param & 0xF0) | (ch->tremolo_param & 0x0F); - } + if(s->effect_param & 0x0F) { ch->tremolo_param = (ch->tremolo_param & 0xF0) | (s->effect_param & 0x0F); } /* Set tremolo depth */ + if(s->effect_param >> 4) { ch->tremolo_param = (s->effect_param & 0xF0) | (ch->tremolo_param & 0x0F); } /* Set tremolo speed */ break; - case 8: /* 8xx: Set panning */ - ch->panning = (float)s->effect_param / (float)0xFF; + ch->panning = (float)s->effect_param / 255.f; break; - case 9: /* 9xx: Sample offset */ - if(ch->sample != NULL && NOTE_IS_VALID(s->note)) { + if(ch->sample != 0) { //&& NOTE_IS_VALID(s->note)) { uint32_t final_offset = s->effect_param << (ch->sample->bits == 16 ? 7 : 8); - if(final_offset >= ch->sample->length) { - /* Pretend the sample dosen't loop and is done playing */ - ch->sample_position = -1; + switch (ch->sample->loop_type) { + case jar_xm_NO_LOOP: + if(final_offset >= ch->sample->length) { /* Pretend the sample dosen't loop and is done playing */ + ch->sample_position = -1; + } else { + ch->sample_position = final_offset; + } + break; + case jar_xm_FORWARD_LOOP: + if (final_offset >= ch->sample->loop_end) { + ch->sample_position -= ch->sample->loop_length; + } else if(final_offset >= ch->sample->length) { + ch->sample_position = ch->sample->loop_start; + } else { + ch->sample_position = final_offset; + } + break; + case jar_xm_PING_PONG_LOOP: + if(final_offset >= ch->sample->loop_end) { + ch->ping = false; + ch->sample_position = (ch->sample->loop_end << 1) - ch->sample_position; + } else if(final_offset >= ch->sample->length) { + ch->ping = false; + ch->sample_position -= ch->sample->length - 1; + } else { + ch->sample_position = final_offset; + }; break; } - ch->sample_position = final_offset; } break; - case 0xA: /* Axy: Volume slide */ - if(s->effect_param > 0) { - ch->volume_slide_param = s->effect_param; - } + if(s->effect_param > 0) { ch->volume_slide_param = s->effect_param; } break; - case 0xB: /* Bxx: Position jump */ if(s->effect_param < ctx->module.length) { ctx->position_jump = true; ctx->jump_dest = s->effect_param; } break; - case 0xC: /* Cxx: Set volume */ - ch->volume = (float)((s->effect_param > 0x40) - ? 0x40 : s->effect_param) / (float)0x40; + ch->volume = (float)((s->effect_param > 0x40) ? 0x40 : s->effect_param) / (float)0x40; break; - case 0xD: /* Dxx: Pattern break */ /* Jump after playing this line */ ctx->pattern_break = true; ctx->jump_row = (s->effect_param >> 4) * 10 + (s->effect_param & 0x0F); break; - case 0xE: /* EXy: Extended command */ switch(s->effect_param >> 4) { - case 1: /* E1y: Fine portamento up */ - if(s->effect_param & 0x0F) { - ch->fine_portamento_up_param = s->effect_param & 0x0F; - } + if(s->effect_param & 0x0F) { ch->fine_portamento_up_param = s->effect_param & 0x0F; } jar_xm_pitch_slide(ctx, ch, -ch->fine_portamento_up_param); break; - case 2: /* E2y: Fine portamento down */ - if(s->effect_param & 0x0F) { - ch->fine_portamento_down_param = s->effect_param & 0x0F; - } + if(s->effect_param & 0x0F) { ch->fine_portamento_down_param = s->effect_param & 0x0F; } jar_xm_pitch_slide(ctx, ch, ch->fine_portamento_down_param); break; - case 4: /* E4y: Set vibrato control */ ch->vibrato_waveform = s->effect_param & 3; ch->vibrato_waveform_retrigger = !((s->effect_param >> 2) & 1); break; - case 5: /* E5y: Set finetune */ if(NOTE_IS_VALID(ch->current->note) && ch->sample != NULL) { - ch->note = ch->current->note + ch->sample->relative_note + - (float)(((s->effect_param & 0x0F) - 8) << 4) / 128.f - 1.f; + ch->note = ch->current->note + ch->sample->relative_note + (float)(((s->effect_param & 0x0F) - 8) << 4) / 128.f - 1.f; ch->period = jar_xm_period(ctx, ch->note); jar_xm_update_frequency(ctx, ch); } break; - case 6: /* E6y: Pattern loop */ if(s->effect_param & 0x0F) { - if((s->effect_param & 0x0F) == ch->pattern_loop_count) { - /* Loop is over */ + if((s->effect_param & 0x0F) == ch->pattern_loop_count) { /* Loop is over */ ch->pattern_loop_count = 0; - break; + ctx->position_jump = false; + } else { /* Jump to the beginning of the loop */ + ch->pattern_loop_count++; + ctx->position_jump = true; + ctx->jump_row = ch->pattern_loop_origin; + ctx->jump_dest = ctx->current_table_index; } - - /* Jump to the beginning of the loop */ - ch->pattern_loop_count++; - ctx->position_jump = true; - ctx->jump_row = ch->pattern_loop_origin; - ctx->jump_dest = ctx->current_table_index; } else { - /* Set loop start point */ - ch->pattern_loop_origin = ctx->current_row; - /* Replicate FT2 E60 bug */ - ctx->jump_row = ch->pattern_loop_origin; + ch->pattern_loop_origin = ctx->current_row; /* Set loop start point */ + ctx->jump_row = ch->pattern_loop_origin; /* Replicate FT2 E60 bug */ } break; - case 7: /* E7y: Set tremolo control */ ch->tremolo_waveform = s->effect_param & 3; ch->tremolo_waveform_retrigger = !((s->effect_param >> 2) & 1); break; - case 0xA: /* EAy: Fine volume slide up */ - if(s->effect_param & 0x0F) { - ch->fine_volume_slide_param = s->effect_param & 0x0F; - } + if(s->effect_param & 0x0F) { ch->fine_volume_slide_param = s->effect_param & 0x0F; } jar_xm_volume_slide(ch, ch->fine_volume_slide_param << 4); break; - case 0xB: /* EBy: Fine volume slide down */ - if(s->effect_param & 0x0F) { - ch->fine_volume_slide_param = s->effect_param & 0x0F; - } + if(s->effect_param & 0x0F) { ch->fine_volume_slide_param = s->effect_param & 0x0F; } jar_xm_volume_slide(ch, ch->fine_volume_slide_param); break; - case 0xD: /* EDy: Note delay */ - /* XXX: figure this out better. EDx triggers - * the note even when there no note and no - * instrument. But ED0 acts like like a ghost - * note, EDx (x ≠ 0) does not. */ + /* XXX: figure this out better. EDx triggers the note even when there no note and no instrument. But ED0 acts like like a ghost note, EDx (x ≠ 0) does not. */ if(s->note == 0 && s->instrument == 0) { unsigned int flags = jar_xm_TRIGGER_KEEP_VOLUME; - if(ch->current->effect_param & 0x0F) { ch->note = ch->orig_note; jar_xm_trigger_note(ctx, ch, flags); } else { - jar_xm_trigger_note( - ctx, ch, - flags - | jar_xm_TRIGGER_KEEP_PERIOD - | jar_xm_TRIGGER_KEEP_SAMPLE_POSITION - ); + jar_xm_trigger_note(ctx, ch, flags | jar_xm_TRIGGER_KEEP_PERIOD | jar_xm_TRIGGER_KEEP_SAMPLE_POSITION ); } } break; @@ -1870,106 +1522,77 @@ static void jar_xm_handle_note_and_instrument(jar_xm_context_t* ctx, jar_xm_chan case 0xE: /* EEy: Pattern delay */ ctx->extra_ticks = (ch->current->effect_param & 0x0F) * ctx->tempo; break; - default: break; - } break; case 0xF: /* Fxx: Set tempo/BPM */ if(s->effect_param > 0) { - if(s->effect_param <= 0x1F) { + if(s->effect_param <= 0x1F) { // First 32 possible values adjust the ticks (goes into tempo) ctx->tempo = s->effect_param; - } else { + } else { //32 and greater values adjust the BPM ctx->bpm = s->effect_param; } } break; case 16: /* Gxx: Set global volume */ - ctx->global_volume = (float)((s->effect_param > 0x40) - ? 0x40 : s->effect_param) / (float)0x40; + ctx->global_volume = (float)((s->effect_param > 0x40) ? 0x40 : s->effect_param) / (float)0x40; break; - case 17: /* Hxy: Global volume slide */ - if(s->effect_param > 0) { - ch->global_volume_slide_param = s->effect_param; - } + if(s->effect_param > 0) { ch->global_volume_slide_param = s->effect_param; } break; - case 21: /* Lxx: Set envelope position */ ch->volume_envelope_frame_count = s->effect_param; ch->panning_envelope_frame_count = s->effect_param; break; - case 25: /* Pxy: Panning slide */ - if(s->effect_param > 0) { - ch->panning_slide_param = s->effect_param; - } + if(s->effect_param > 0) { ch->panning_slide_param = s->effect_param; } break; - case 27: /* Rxy: Multi retrig note */ if(s->effect_param > 0) { - if((s->effect_param >> 4) == 0) { - /* Keep previous x value */ + if((s->effect_param >> 4) == 0) { /* Keep previous x value */ ch->multi_retrig_param = (ch->multi_retrig_param & 0xF0) | (s->effect_param & 0x0F); } else { ch->multi_retrig_param = s->effect_param; } } break; - case 29: /* Txy: Tremor */ - if(s->effect_param > 0) { - /* Tremor x and y params do not appear to be separately - * kept in memory, unlike Rxy */ - ch->tremor_param = s->effect_param; - } + if(s->effect_param > 0) { ch->tremor_param = s->effect_param; } /* Tremor x and y params are not separately kept in memory, unlike Rxy */ break; - case 33: /* Xxy: Extra stuff */ switch(s->effect_param >> 4) { case 1: /* X1y: Extra fine portamento up */ - if(s->effect_param & 0x0F) { - ch->extra_fine_portamento_up_param = s->effect_param & 0x0F; - } + if(s->effect_param & 0x0F) { ch->extra_fine_portamento_up_param = s->effect_param & 0x0F; } jar_xm_pitch_slide(ctx, ch, -1.0f * ch->extra_fine_portamento_up_param); break; - case 2: /* X2y: Extra fine portamento down */ - if(s->effect_param & 0x0F) { - ch->extra_fine_portamento_down_param = s->effect_param & 0x0F; - } + if(s->effect_param & 0x0F) { ch->extra_fine_portamento_down_param = s->effect_param & 0x0F; } jar_xm_pitch_slide(ctx, ch, ch->extra_fine_portamento_down_param); break; - default: break; - } break; - default: break; - } } static void jar_xm_trigger_note(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, unsigned int flags) { - if(!(flags & jar_xm_TRIGGER_KEEP_SAMPLE_POSITION)) { + if (!(flags & jar_xm_TRIGGER_KEEP_SAMPLE_POSITION)) { ch->sample_position = 0.f; ch->ping = true; - } - - if(ch->sample != NULL) { - if(!(flags & jar_xm_TRIGGER_KEEP_VOLUME)) { - ch->volume = ch->sample->volume; - } - - ch->panning = ch->sample->panning; - } - + }; + + if (!(flags & jar_xm_TRIGGER_KEEP_VOLUME)) { + if(ch->sample != NULL) { + ch->volume = ch->sample->volume; + }; + }; + ch->panning = ch->sample->panning; ch->sustained = true; ch->fadeout_volume = ch->volume_envelope_volume = 1.0f; ch->panning_envelope_panning = .5f; @@ -1977,44 +1600,28 @@ static void jar_xm_trigger_note(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch->vibrato_note_offset = 0.f; ch->tremolo_volume = 0.f; ch->tremor_on = false; - ch->autovibrato_ticks = 0; - if(ch->vibrato_waveform_retrigger) { - ch->vibrato_ticks = 0; /* XXX: should the waveform itself also - * be reset to sine? */ - } - if(ch->tremolo_waveform_retrigger) { - ch->tremolo_ticks = 0; - } - + if(ch->vibrato_waveform_retrigger) { ch->vibrato_ticks = 0; } /* XXX: should the waveform itself also be reset to sine? */ + if(ch->tremolo_waveform_retrigger) { ch->tremolo_ticks = 0; } if(!(flags & jar_xm_TRIGGER_KEEP_PERIOD)) { ch->period = jar_xm_period(ctx, ch->note); jar_xm_update_frequency(ctx, ch); } - ch->latest_trigger = ctx->generated_samples; - if(ch->instrument != NULL) { - ch->instrument->latest_trigger = ctx->generated_samples; - } - if(ch->sample != NULL) { - ch->sample->latest_trigger = ctx->generated_samples; - } + if(ch->instrument != NULL) { ch->instrument->latest_trigger = ctx->generated_samples; } + if(ch->sample != NULL) { ch->sample->latest_trigger = ctx->generated_samples; } } static void jar_xm_cut_note(jar_xm_channel_context_t* ch) { - /* NB: this is not the same as Key Off */ - ch->volume = .0f; + ch->volume = .0f; /* NB: this is not the same as Key Off */ +// ch->curr_left = .0f; +// ch->curr_right = .0f; } static void jar_xm_key_off(jar_xm_channel_context_t* ch) { - /* Key Off */ - ch->sustained = false; - - /* If no volume envelope is used, also cut the note */ - if(ch->instrument == NULL || !ch->instrument->volume_envelope.enabled) { - jar_xm_cut_note(ch); - } + ch->sustained = false; /* Key Off */ + if(ch->instrument == NULL || !ch->instrument->volume_envelope.enabled) { jar_xm_cut_note(ch); } /* If no volume envelope is used, also cut the note */ } static void jar_xm_row(jar_xm_context_t* ctx) { @@ -2032,24 +1639,24 @@ static void jar_xm_row(jar_xm_context_t* ctx) { ctx->jump_row = 0; jar_xm_post_pattern_change(ctx); } - jar_xm_pattern_t* cur = ctx->module.patterns + ctx->module.pattern_table[ctx->current_table_index]; bool in_a_loop = false; - /* Read notes… */ + /* Read notes information for all channels into temporary pattern slot */ for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { jar_xm_pattern_slot_t* s = cur->slots + ctx->current_row * ctx->module.num_channels + i; jar_xm_channel_context_t* ch = ctx->channels + i; - ch->current = s; - + // If there is no note delay effect (0xED) then... if(s->effect_type != 0xE || s->effect_param >> 4 != 0xD) { + //********** Process the channel slot information ********** jar_xm_handle_note_and_instrument(ctx, ch, s); } else { + // read the note delay information ch->note_delay_param = s->effect_param & 0x0F; } - if(!in_a_loop && ch->pattern_loop_count > 0) { + // clarify if in a loop or not in_a_loop = true; } } @@ -2058,101 +1665,68 @@ static void jar_xm_row(jar_xm_context_t* ctx) { /* No E6y loop is in effect (or we are in the first pass) */ ctx->loop_count = (ctx->row_loop_count[MAX_NUM_ROWS * ctx->current_table_index + ctx->current_row]++); } - - ctx->current_row++; /* Since this is an uint8, this line can - * increment from 255 to 0, in which case it - * is still necessary to go the next - * pattern. */ - if(!ctx->position_jump && !ctx->pattern_break && - (ctx->current_row >= cur->num_rows || ctx->current_row == 0)) { + + /// Move to next row + ctx->current_row++; /* uint8 warning: can increment from 255 to 0, in which case it is still necessary to go the next pattern. */ + if (!ctx->position_jump && !ctx->pattern_break && (ctx->current_row >= cur->num_rows || ctx->current_row == 0)) { ctx->current_table_index++; - ctx->current_row = ctx->jump_row; /* This will be 0 most of - * the time, except when E60 - * is used */ + ctx->current_row = ctx->jump_row; /* This will be 0 most of the time, except when E60 is used */ ctx->jump_row = 0; jar_xm_post_pattern_change(ctx); } } -static void jar_xm_envelope_tick(jar_xm_channel_context_t* ch, - jar_xm_envelope_t* env, - uint16_t* counter, - float* outval) { +static void jar_xm_envelope_tick(jar_xm_channel_context_t *ch, jar_xm_envelope_t *env, uint16_t *counter, float *outval) { if(env->num_points < 2) { - /* Don't really know what to do… */ if(env->num_points == 1) { - /* XXX I am pulling this out of my ass */ *outval = (float)env->points[0].value / (float)0x40; - if(*outval > 1) { - *outval = 1; - } - } - - return; + if(*outval > 1) { *outval = 1; }; + } else {; + return; + }; } else { - uint8_t j; - if(env->loop_enabled) { uint16_t loop_start = env->points[env->loop_start_point].frame; uint16_t loop_end = env->points[env->loop_end_point].frame; uint16_t loop_length = loop_end - loop_start; - - if(*counter >= loop_end) { - *counter -= loop_length; - } - } - - for(j = 0; j < (env->num_points - 2); ++j) { - if(env->points[j].frame <= *counter && - env->points[j+1].frame >= *counter) { + if(*counter >= loop_end) { *counter -= loop_length; }; + }; + for(uint8_t j = 0; j < (env->num_points - 1); ++j) { + if(env->points[j].frame <= *counter && env->points[j+1].frame >= *counter) { + *outval = jar_xm_envelope_lerp(env->points + j, env->points + j + 1, *counter) / (float)0x40; break; - } - } - - *outval = jar_xm_envelope_lerp(env->points + j, env->points + j + 1, *counter) / (float)0x40; - + }; + }; /* Make sure it is safe to increment frame count */ - if(!ch->sustained || !env->sustain_enabled || - *counter != env->points[env->sustain_point].frame) { - (*counter)++; - } - } -} + if(!ch->sustained || !env->sustain_enabled || *counter != env->points[env->sustain_point].frame) { (*counter)++; }; + }; +}; -static void jar_xm_envelopes(jar_xm_channel_context_t* ch) { +static void jar_xm_envelopes(jar_xm_channel_context_t *ch) { if(ch->instrument != NULL) { if(ch->instrument->volume_envelope.enabled) { if(!ch->sustained) { ch->fadeout_volume -= (float)ch->instrument->volume_fadeout / 65536.f; jar_xm_CLAMP_DOWN(ch->fadeout_volume); - } - - jar_xm_envelope_tick(ch, - &(ch->instrument->volume_envelope), - &(ch->volume_envelope_frame_count), - &(ch->volume_envelope_volume)); - } - + }; + jar_xm_envelope_tick(ch, &(ch->instrument->volume_envelope), &(ch->volume_envelope_frame_count), &(ch->volume_envelope_volume)); + }; if(ch->instrument->panning_envelope.enabled) { - jar_xm_envelope_tick(ch, - &(ch->instrument->panning_envelope), - &(ch->panning_envelope_frame_count), - &(ch->panning_envelope_panning)); - } - } -} + jar_xm_envelope_tick(ch, &(ch->instrument->panning_envelope), &(ch->panning_envelope_frame_count), &(ch->panning_envelope_panning)); + }; + }; +}; static void jar_xm_tick(jar_xm_context_t* ctx) { if(ctx->current_tick == 0) { - jar_xm_row(ctx); + jar_xm_row(ctx); // We have processed all ticks and we run the row } - + + jar_xm_module_t* mod = &(ctx->module); for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { jar_xm_channel_context_t* ch = ctx->channels + i; - jar_xm_envelopes(ch); jar_xm_autovibrato(ctx, ch); - if(ch->arp_in_progress && !HAS_ARPEGGIO(ch->current)) { ch->arp_in_progress = false; ch->arp_note_offset = 0; @@ -2164,46 +1738,59 @@ static void jar_xm_tick(jar_xm_context_t* ctx) { jar_xm_update_frequency(ctx, ch); } - switch(ch->current->volume_column >> 4) { - - case 0x6: /* Volume slide down */ - if(ctx->current_tick == 0) break; + // Effects in volumne column mostly handled on a per tick basis + switch(ch->current->volume_column & 0xF0) { + case 0x50: // Checks for volume = 64 + if(ch->current->volume_column != 0x50) break; + case 0x10: // Set volume 0-15 + case 0x20: // Set volume 16-32 + case 0x30: // Set volume 32-48 + case 0x40: // Set volume 48-64 + ch->volume = (float)(ch->current->volume_column - 16) / 64.0f; + break; + case 0x60: // Volume slide down jar_xm_volume_slide(ch, ch->current->volume_column & 0x0F); break; - - case 0x7: /* Volume slide up */ - if(ctx->current_tick == 0) break; + case 0x70: // Volume slide up jar_xm_volume_slide(ch, ch->current->volume_column << 4); break; - - case 0xB: /* Vibrato */ - if(ctx->current_tick == 0) break; + case 0x80: // Fine volume slide down + jar_xm_volume_slide(ch, ch->current->volume_column & 0x0F); + break; + case 0x90: // Fine volume slide up + jar_xm_volume_slide(ch, ch->current->volume_column << 4); + break; + case 0xA0: // Set vibrato speed + ch->vibrato_param = (ch->vibrato_param & 0x0F) | ((ch->current->volume_column & 0x0F) << 4); + break; + case 0xB0: // Vibrato ch->vibrato_in_progress = false; jar_xm_vibrato(ctx, ch, ch->vibrato_param, ch->vibrato_ticks++); break; - - case 0xD: /* Panning slide left */ - if(ctx->current_tick == 0) break; + case 0xC0: // Set panning + if(!ctx->current_tick ) { + ch->panning = (float)(ch->current->volume_column & 0x0F) / 15.0f; + } + break; + case 0xD0: // Panning slide left jar_xm_panning_slide(ch, ch->current->volume_column & 0x0F); break; - - case 0xE: /* Panning slide right */ - if(ctx->current_tick == 0) break; + case 0xE0: // Panning slide right jar_xm_panning_slide(ch, ch->current->volume_column << 4); break; - - case 0xF: /* Tone portamento */ - if(ctx->current_tick == 0) break; + case 0xF0: // Tone portamento + if(!ctx->current_tick ) { + if(ch->current->volume_column & 0x0F) { ch->tone_portamento_param = ((ch->current->volume_column & 0x0F) << 4) | (ch->current->volume_column & 0x0F); } + }; jar_xm_tone_portamento(ctx, ch); break; - default: break; - } + // Only some standard effects handled on a per tick basis + // see jar_xm_handle_note_and_instrument for all effects handling on a per row basis switch(ch->current->effect_type) { - case 0: /* 0xy: Arpeggio */ if(ch->current->effect_param > 0) { char arp_offset = ctx->tempo % 3; @@ -2236,49 +1823,44 @@ static void jar_xm_tick(jar_xm_context_t* ctx) { if(ctx->current_tick == 0) break; jar_xm_pitch_slide(ctx, ch, -ch->portamento_up_param); break; - case 2: /* 2xx: Portamento down */ if(ctx->current_tick == 0) break; jar_xm_pitch_slide(ctx, ch, ch->portamento_down_param); break; - case 3: /* 3xx: Tone portamento */ if(ctx->current_tick == 0) break; jar_xm_tone_portamento(ctx, ch); break; - case 4: /* 4xy: Vibrato */ if(ctx->current_tick == 0) break; ch->vibrato_in_progress = true; jar_xm_vibrato(ctx, ch, ch->vibrato_param, ch->vibrato_ticks++); break; - case 5: /* 5xy: Tone portamento + Volume slide */ if(ctx->current_tick == 0) break; jar_xm_tone_portamento(ctx, ch); jar_xm_volume_slide(ch, ch->volume_slide_param); break; - case 6: /* 6xy: Vibrato + Volume slide */ if(ctx->current_tick == 0) break; ch->vibrato_in_progress = true; jar_xm_vibrato(ctx, ch, ch->vibrato_param, ch->vibrato_ticks++); jar_xm_volume_slide(ch, ch->volume_slide_param); break; - case 7: /* 7xy: Tremolo */ if(ctx->current_tick == 0) break; jar_xm_tremolo(ctx, ch, ch->tremolo_param, ch->tremolo_ticks++); break; - + case 8: /* 8xy: Set panning */ + break; + case 9: /* 9xy: Sample offset */ + break; case 0xA: /* Axy: Volume slide */ if(ctx->current_tick == 0) break; jar_xm_volume_slide(ch, ch->volume_slide_param); break; - case 0xE: /* EXy: Extended command */ switch(ch->current->effect_param >> 4) { - case 0x9: /* E9y: Retrigger note */ if(ctx->current_tick != 0 && ch->current->effect_param & 0x0F) { if(!(ctx->current_tick % (ch->current->effect_param & 0x0F))) { @@ -2287,59 +1869,46 @@ static void jar_xm_tick(jar_xm_context_t* ctx) { } } break; - case 0xC: /* ECy: Note cut */ if((ch->current->effect_param & 0x0F) == ctx->current_tick) { jar_xm_cut_note(ch); } break; - case 0xD: /* EDy: Note delay */ if(ch->note_delay_param == ctx->current_tick) { jar_xm_handle_note_and_instrument(ctx, ch, ch->current); jar_xm_envelopes(ch); } break; - default: break; - } break; - + case 16: /* Fxy: Set tempo/BPM */ + break; case 17: /* Hxy: Global volume slide */ if(ctx->current_tick == 0) break; - if((ch->global_volume_slide_param & 0xF0) && - (ch->global_volume_slide_param & 0x0F)) { - /* Illegal state */ - break; - } - if(ch->global_volume_slide_param & 0xF0) { - /* Global slide up */ + if((ch->global_volume_slide_param & 0xF0) && (ch->global_volume_slide_param & 0x0F)) { break; }; /* Invalid state */ + if(ch->global_volume_slide_param & 0xF0) { /* Global slide up */ float f = (float)(ch->global_volume_slide_param >> 4) / (float)0x40; ctx->global_volume += f; jar_xm_CLAMP_UP(ctx->global_volume); - } else { - /* Global slide down */ + } else { /* Global slide down */ float f = (float)(ch->global_volume_slide_param & 0x0F) / (float)0x40; ctx->global_volume -= f; jar_xm_CLAMP_DOWN(ctx->global_volume); - } + }; break; case 20: /* Kxx: Key off */ - /* Most documentations will tell you the parameter has no - * use. Don't be fooled. */ - if(ctx->current_tick == ch->current->effect_param) { - jar_xm_key_off(ch); - } + if(ctx->current_tick == ch->current->effect_param) { jar_xm_key_off(ch); }; break; - + case 21: /* Lxx: Set envelope position */ + break; case 25: /* Pxy: Panning slide */ if(ctx->current_tick == 0) break; jar_xm_panning_slide(ch, ch->panning_slide_param); break; - case 27: /* Rxy: Multi retrig note */ if(ctx->current_tick == 0) break; if(((ch->multi_retrig_param) & 0x0F) == 0) break; @@ -2349,228 +1918,251 @@ static void jar_xm_tick(jar_xm_context_t* ctx) { jar_xm_CLAMP(v); jar_xm_trigger_note(ctx, ch, 0); ch->volume = v; - } + }; break; case 29: /* Txy: Tremor */ if(ctx->current_tick == 0) break; - ch->tremor_on = ( - (ctx->current_tick - 1) % ((ch->tremor_param >> 4) + (ch->tremor_param & 0x0F) + 2) - > - (ch->tremor_param >> 4) - ); + ch->tremor_on = ( (ctx->current_tick - 1) % ((ch->tremor_param >> 4) + (ch->tremor_param & 0x0F) + 2) > (ch->tremor_param >> 4) ); break; - default: break; - - } + }; float panning, volume; - - panning = ch->panning + - (ch->panning_envelope_panning - .5f) * (.5f - fabs(ch->panning - .5f)) * 2.0f; - + panning = ch->panning + (ch->panning_envelope_panning - .5f) * (.5f - fabs(ch->panning - .5f)) * 2.0f; if(ch->tremor_on) { - volume = .0f; + volume = .0f; } else { volume = ch->volume + ch->tremolo_volume; jar_xm_CLAMP(volume); volume *= ch->fadeout_volume * ch->volume_envelope_volume; - } + }; -#if JAR_XM_RAMPING - ch->target_panning = panning; - ch->target_volume = volume; -#else - ch->actual_panning = panning; - ch->actual_volume = volume; -#endif - } + if (mod->ramping) { + ch->target_panning = panning; + ch->target_volume = volume; + } else { + ch->actual_panning = panning; + ch->actual_volume = volume; + }; + }; - ctx->current_tick++; + ctx->current_tick++; // ok so we understand that ticks increment within the row if(ctx->current_tick >= ctx->tempo + ctx->extra_ticks) { + // This means it reached the end of the row and we reset ctx->current_tick = 0; ctx->extra_ticks = 0; - } + }; - /* FT2 manual says number of ticks / second = BPM * 0.4 */ + // Number of ticks / second = BPM * 0.4 ctx->remaining_samples_in_tick += (float)ctx->rate / ((float)ctx->bpm * 0.4f); -} +}; -static float jar_xm_next_of_sample(jar_xm_channel_context_t* ch) { +static void jar_xm_next_of_sample(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, int previous) { + jar_xm_module_t* mod = &(ctx->module); + +// ch->curr_left = 0.f; +// ch->curr_right = 0.f; if(ch->instrument == NULL || ch->sample == NULL || ch->sample_position < 0) { -#if JAR_XM_RAMPING - if(ch->frame_count < jar_xm_SAMPLE_RAMPING_POINTS) { - return jar_xm_LERP(ch->end_of_previous_sample[ch->frame_count], .0f, - (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); - } -#endif - return .0f; - } + ch->curr_left = 0.f; + ch->curr_right = 0.f; + if (mod->ramping) { + if (ch->frame_count < jar_xm_SAMPLE_RAMPING_POINTS) { + if (previous > -1) { + ch->end_of_previous_sample_left[previous] = jar_xm_LERP(ch->end_of_previous_sample_left[ch->frame_count], ch->curr_left, (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); + ch->end_of_previous_sample_right[previous] = jar_xm_LERP(ch->end_of_previous_sample_right[ch->frame_count], ch->curr_right, (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); + } else { + ch->curr_left = jar_xm_LERP(ch->end_of_previous_sample_left[ch->frame_count], ch->curr_left, (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); + ch->curr_right = jar_xm_LERP(ch->end_of_previous_sample_right[ch->frame_count], ch->curr_right, (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); + }; + }; + }; + return; + }; if(ch->sample->length == 0) { - return .0f; - } + return; + }; - float u, v, t; - uint32_t a, b; - a = (uint32_t)ch->sample_position; /* This cast is fine, - * sample_position will not - * go above integer - * ranges */ - if(JAR_XM_LINEAR_INTERPOLATION) { - b = a + 1; - t = ch->sample_position - a; /* Cheaper than fmodf(., 1.f) */ - } - u = ch->sample->data[a]; + float t = 0.f; + uint32_t b = 0; + if(mod->linear_interpolation) { + b = ch->sample_position + 1; + t = ch->sample_position - (uint32_t)ch->sample_position; /* Cheaper than fmodf(., 1.f) */ + }; + float u_left, u_right; + u_left = ch->sample->data[(uint32_t)ch->sample_position]; + if (ch->sample->stereo) { + u_right = ch->sample->data[(uint32_t)ch->sample_position + ch->sample->length]; + } else { + u_right = u_left; + }; + float v_left = 0.f, v_right = 0.f; switch(ch->sample->loop_type) { - case jar_xm_NO_LOOP: - if(JAR_XM_LINEAR_INTERPOLATION) { - v = (b < ch->sample->length) ? ch->sample->data[b] : .0f; - } + if(mod->linear_interpolation) { + v_left = (b < ch->sample->length) ? ch->sample->data[b] : .0f; + if (ch->sample->stereo) { + v_right = (b < ch->sample->length) ? ch->sample->data[b + ch->sample->length] : .0f; + } else { + v_right = v_left; + }; + }; ch->sample_position += ch->step; - if(ch->sample_position >= ch->sample->length) { - ch->sample_position = -1; - } + if(ch->sample_position >= ch->sample->length) { ch->sample_position = -1; } // stop playing this sample break; - case jar_xm_FORWARD_LOOP: - if(JAR_XM_LINEAR_INTERPOLATION) { - v = ch->sample->data[ - (b == ch->sample->loop_end) ? ch->sample->loop_start : b - ]; - } + if(mod->linear_interpolation) { + v_left = ch->sample->data[ (b == ch->sample->loop_end) ? ch->sample->loop_start : b ]; + if (ch->sample->stereo) { + v_right = ch->sample->data[ (b == ch->sample->loop_end) ? ch->sample->loop_start + ch->sample->length : b + ch->sample->length]; + } else { + v_right = v_left; + }; + }; ch->sample_position += ch->step; - while(ch->sample_position >= ch->sample->loop_end) { + if (ch->sample_position >= ch->sample->loop_end) { ch->sample_position -= ch->sample->loop_length; - } + }; + if(ch->sample_position >= ch->sample->length) { + ch->sample_position = ch->sample->loop_start; + }; break; - case jar_xm_PING_PONG_LOOP: if(ch->ping) { + if(mod->linear_interpolation) { + v_left = (b >= ch->sample->loop_end) ? ch->sample->data[(uint32_t)ch->sample_position] : ch->sample->data[b]; + if (ch->sample->stereo) { + v_right = (b >= ch->sample->loop_end) ? ch->sample->data[(uint32_t)ch->sample_position + ch->sample->length] : ch->sample->data[b + ch->sample->length]; + } else { + v_right = v_left; + }; + }; ch->sample_position += ch->step; - } else { - ch->sample_position -= ch->step; - } - /* XXX: this may not work for very tight ping-pong loops - * (ie switches direction more than once per sample */ - if(ch->ping) { - if(JAR_XM_LINEAR_INTERPOLATION) { - v = (b >= ch->sample->loop_end) ? ch->sample->data[a] : ch->sample->data[b]; - } if(ch->sample_position >= ch->sample->loop_end) { ch->ping = false; ch->sample_position = (ch->sample->loop_end << 1) - ch->sample_position; - } - /* sanity checking */ + }; if(ch->sample_position >= ch->sample->length) { ch->ping = false; ch->sample_position -= ch->sample->length - 1; - } + }; } else { - if(JAR_XM_LINEAR_INTERPOLATION) { - v = u; - u = (b == 1 || b - 2 <= ch->sample->loop_start) ? ch->sample->data[a] : ch->sample->data[b - 2]; - } + if(mod->linear_interpolation) { + v_left = u_left; + v_right = u_right; + u_left = (b == 1 || b - 2 <= ch->sample->loop_start) ? ch->sample->data[(uint32_t)ch->sample_position] : ch->sample->data[b - 2]; + if (ch->sample->stereo) { + u_right = (b == 1 || b - 2 <= ch->sample->loop_start) ? ch->sample->data[(uint32_t)ch->sample_position + ch->sample->length] : ch->sample->data[b + ch->sample->length - 2]; + } else { + u_right = u_left; + }; + }; + ch->sample_position -= ch->step; if(ch->sample_position <= ch->sample->loop_start) { ch->ping = true; ch->sample_position = (ch->sample->loop_start << 1) - ch->sample_position; - } - /* sanity checking */ - if(ch->sample_position <= .0f) { + }; + if (ch->sample_position <= .0f) { ch->ping = true; ch->sample_position = .0f; - } - } + }; + }; break; default: - v = .0f; + v_left = .0f; + v_right = .0f; break; - } + }; - float endval = JAR_XM_LINEAR_INTERPOLATION ? jar_xm_LERP(u, v, t) : u; + float endval_left = mod->linear_interpolation ? jar_xm_LERP(u_left, v_left, t) : u_left; + float endval_right = mod->linear_interpolation ? jar_xm_LERP(u_right, v_right, t) : u_right; -#if JAR_XM_RAMPING - if(ch->frame_count < jar_xm_SAMPLE_RAMPING_POINTS) { - /* Smoothly transition between old and new sample. */ - return jar_xm_LERP(ch->end_of_previous_sample[ch->frame_count], endval, - (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); - } -#endif + if (mod->ramping) { + if(ch->frame_count < jar_xm_SAMPLE_RAMPING_POINTS) { + /* Smoothly transition between old and new sample. */ + if (previous > -1) { + ch->end_of_previous_sample_left[previous] = jar_xm_LERP(ch->end_of_previous_sample_left[ch->frame_count], endval_left, (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); + ch->end_of_previous_sample_right[previous] = jar_xm_LERP(ch->end_of_previous_sample_right[ch->frame_count], endval_right, (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); + } else { + ch->curr_left = jar_xm_LERP(ch->end_of_previous_sample_left[ch->frame_count], endval_left, (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); + ch->curr_right = jar_xm_LERP(ch->end_of_previous_sample_right[ch->frame_count], endval_right, (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); + }; + }; + }; - return endval; -} + if (previous > -1) { + ch->end_of_previous_sample_left[previous] = endval_left; + ch->end_of_previous_sample_right[previous] = endval_right; + } else { + ch->curr_left = endval_left; + ch->curr_right = endval_right; + }; +}; -static void jar_xm_sample(jar_xm_context_t* ctx, float* left, float* right) { +// gather all channel audio into stereo float +static void jar_xm_mixdown(jar_xm_context_t* ctx, float* left, float* right) { + jar_xm_module_t* mod = &(ctx->module); + if(ctx->remaining_samples_in_tick <= 0) { jar_xm_tick(ctx); - } + }; ctx->remaining_samples_in_tick--; - *left = 0.f; *right = 0.f; - - if(ctx->max_loop_count > 0 && ctx->loop_count >= ctx->max_loop_count) { - return; - } + if(ctx->max_loop_count > 0 && ctx->loop_count > ctx->max_loop_count) { return; } for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { jar_xm_channel_context_t* ch = ctx->channels + i; + if(ch->instrument != NULL && ch->sample != NULL && ch->sample_position >= 0) { + jar_xm_next_of_sample(ctx, ch, -1); + if(!ch->muted && !ch->instrument->muted) { + *left += ch->curr_left * ch->actual_volume * (1.f - ch->actual_panning); + *right += ch->curr_right * ch->actual_volume * ch->actual_panning; + }; - if(ch->instrument == NULL || ch->sample == NULL || ch->sample_position < 0) { - continue; - } + if (mod->ramping) { + ch->frame_count++; + jar_xm_SLIDE_TOWARDS(ch->actual_volume, ch->target_volume, ctx->volume_ramp); + jar_xm_SLIDE_TOWARDS(ch->actual_panning, ch->target_panning, ctx->panning_ramp); + }; + }; + }; + if (ctx->global_volume != 1.0f) { + *left *= ctx->global_volume; + *right *= ctx->global_volume; + }; - const float fval = jar_xm_next_of_sample(ch); + // experimental +// float counter = (float)ctx->generated_samples * 0.0001f +// *left = tan(&left + sin(counter)); +// *right = tan(&right + cos(counter)); - if(!ch->muted && !ch->instrument->muted) { - *left += fval * ch->actual_volume * (1.f - ch->actual_panning); - *right += fval * ch->actual_volume * ch->actual_panning; - } - -#if JAR_XM_RAMPING - ch->frame_count++; - jar_xm_SLIDE_TOWARDS(ch->actual_volume, ch->target_volume, ctx->volume_ramp); - jar_xm_SLIDE_TOWARDS(ch->actual_panning, ch->target_panning, ctx->panning_ramp); -#endif - } - - const float fgvol = ctx->global_volume * ctx->amplification; - *left *= fgvol; - *right *= fgvol; - -#if JAR_XM_DEBUG - if(fabs(*left) > 1 || fabs(*right) > 1) { - DEBUG("clipping frame: %f %f, this is a bad module or a libxm bug", *left, *right); - } -#endif -} + // apply brick wall limiter when audio goes beyond bounderies + if(*left < -1.0) {*left = -1.0;} else if(*left > 1.0) {*left = 1.0;}; + if(*right < -1.0) {*right = -1.0;} else if(*right > 1.0) {*right = 1.0;}; +}; void jar_xm_generate_samples(jar_xm_context_t* ctx, float* output, size_t numsamples) { if(ctx && output) { ctx->generated_samples += numsamples; for(size_t i = 0; i < numsamples; i++) { - jar_xm_sample(ctx, output + (2 * i), output + (2 * i + 1)); - } - } -} + jar_xm_mixdown(ctx, output + (2 * i), output + (2 * i + 1)); + }; + }; +}; -uint64_t jar_xm_get_remaining_samples(jar_xm_context_t* ctx) -{ +uint64_t jar_xm_get_remaining_samples(jar_xm_context_t* ctx) { uint64_t total = 0; uint8_t currentLoopCount = jar_xm_get_loop_count(ctx); jar_xm_set_max_loop_count(ctx, 0); - - while(jar_xm_get_loop_count(ctx) == currentLoopCount) - { + while(jar_xm_get_loop_count(ctx) == currentLoopCount) { total += ctx->remaining_samples_in_tick; ctx->remaining_samples_in_tick = 0; jar_xm_tick(ctx); } - ctx->loop_count = currentLoopCount; return total; } @@ -2578,7 +2170,6 @@ uint64_t jar_xm_get_remaining_samples(jar_xm_context_t* ctx) //-------------------------------------------- //FILE LOADER - TODO - NEEDS TO BE CLEANED UP //-------------------------------------------- - #undef DEBUG #define DEBUG(...) do { \ fprintf(stderr, __VA_ARGS__); \ @@ -2642,44 +2233,237 @@ int jar_xm_create_context_from_file(jar_xm_context_t** ctx, uint32_t rate, const switch(ret) { case 0: break; - - case 1: - DEBUG("could not create context: module is not sane\n"); + case 1: DEBUG("could not create context: module is not sane\n"); *ctx = NULL; return 1; break; - - case 2: - FATAL("could not create context: malloc failed\n"); + case 2: FATAL("could not create context: malloc failed\n"); return 2; break; - - default: - FATAL("could not create context: unknown error\n"); + default: FATAL("could not create context: unknown error\n"); return 6; break; - } - + return 0; } // not part of the original library -void jar_xm_reset(jar_xm_context_t* ctx) -{ - // I don't know what I am doing - // this is probably very broken - // but it kinda works - for (uint16_t i = 0; i < jar_xm_get_number_of_channels(ctx); i++) - { +void jar_xm_reset(jar_xm_context_t* ctx) { + for (uint16_t i = 0; i < jar_xm_get_number_of_channels(ctx); i++) { jar_xm_cut_note(&ctx->channels[i]); } ctx->current_row = 0; ctx->current_table_index = 0; ctx->current_tick = 0; + ctx->tempo =ctx->default_tempo; // reset to file default value + ctx->bpm = ctx->default_bpm; // reset to file default value + ctx->global_volume = ctx->default_global_volume; // reset to file default value } +void jar_xm_flip_linear_interpolation(jar_xm_context_t* ctx) { + if (ctx->module.linear_interpolation) { + ctx->module.linear_interpolation = 0; + } else { + ctx->module.linear_interpolation = 1; + } +} + +void jar_xm_table_jump(jar_xm_context_t* ctx, int table_ptr) { + for (uint16_t i = 0; i < jar_xm_get_number_of_channels(ctx); i++) { + jar_xm_cut_note(&ctx->channels[i]); + } + ctx->current_row = 0; + ctx->current_tick = 0; + if(table_ptr > 0 && table_ptr < ctx->module.length) { + ctx->current_table_index = table_ptr; + ctx->module.restart_position = table_ptr; // The reason to jump is to start a new loop or track + } else { + ctx->current_table_index = 0; + ctx->module.restart_position = 0; // The reason to jump is to start a new loop or track + ctx->tempo =ctx->default_tempo; // reset to file default value + ctx->bpm = ctx->default_bpm; // reset to file default value + ctx->global_volume = ctx->default_global_volume; // reset to file default value + }; +} + + +// TRANSLATE NOTE NUMBER INTO USER VALUE (ie. 1 = C-1, 2 = C#1, 3 = D-1 ... ) +const char* xm_note_chr(int number) { + if (number == NOTE_OFF) { + return "=="; + }; + number = number % 12; + switch(number) { + case 1: return "C-"; + case 2: return "C#"; + case 3: return "D-"; + case 4: return "D#"; + case 5: return "E-"; + case 6: return "F-"; + case 7: return "F#"; + case 8: return "G-"; + case 9: return "G#"; + case 10: return "A-"; + case 11: return "A#"; + case 12: return "B-"; + }; + return "??"; +}; + +const char* xm_octave_chr(int number) { + if (number == NOTE_OFF) { + return "="; + }; + + int number2 = number - number % 12; + int result = floor(number2 / 12) + 1; + switch(result) { + case 1: return "1"; + case 2: return "2"; + case 3: return "3"; + case 4: return "4"; + case 5: return "5"; + case 6: return "6"; + case 7: return "7"; + case 8: return "8"; + default: return "?"; /* UNKNOWN */ + }; + +}; + +// TRANSLATE NOTE EFFECT CODE INTO USER VALUE +const char* xm_effect_chr(int fx) { + switch(fx) { + case 0: return "0"; /* ZERO = NO EFFECT */ + case 1: return "1"; /* 1xx: Portamento up */ + case 2: return "2"; /* 2xx: Portamento down */ + case 3: return "3"; /* 3xx: Tone portamento */ + case 4: return "4"; /* 4xy: Vibrato */ + case 5: return "5"; /* 5xy: Tone portamento + Volume slide */ + case 6: return "6"; /* 6xy: Vibrato + Volume slide */ + case 7: return "7"; /* 7xy: Tremolo */ + case 8: return "8"; /* 8xx: Set panning */ + case 9: return "9"; /* 9xx: Sample offset */ + case 0xA: return "A";/* Axy: Volume slide */ + case 0xB: return "B";/* Bxx: Position jump */ + case 0xC: return "C";/* Cxx: Set volume */ + case 0xD: return "D";/* Dxx: Pattern break */ + case 0xE: return "E";/* EXy: Extended command */ + case 0xF: return "F";/* Fxx: Set tempo/BPM */ + case 16: return "G"; /* Gxx: Set global volume */ + case 17: return "H"; /* Hxy: Global volume slide */ + case 21: return "L"; /* Lxx: Set envelope position */ + case 25: return "P"; /* Pxy: Panning slide */ + case 27: return "R"; /* Rxy: Multi retrig note */ + case 29: return "T"; /* Txy: Tremor */ + case 33: return "X"; /* Xxy: Extra stuff */ + default: return "?"; /* UNKNOWN */ + }; +} + +#ifdef JAR_XM_RAYLIB + +#include "raylib.h" // Need RayLib API calls for the DEBUG display + +void jar_xm_debug(jar_xm_context_t *ctx) { + int size=40; + int x = 0, y = 0; + + // DEBUG VARIABLES + y += size; DrawText(TextFormat("CUR TBL = %i", ctx->current_table_index), x, y, size, WHITE); + y += size; DrawText(TextFormat("CUR PAT = %i", ctx->module.pattern_table[ctx->current_table_index]), x, y, size, WHITE); + y += size; DrawText(TextFormat("POS JMP = %d", ctx->position_jump), x, y, size, WHITE); + y += size; DrawText(TextFormat("JMP DST = %i", ctx->jump_dest), x, y, size, WHITE); + y += size; DrawText(TextFormat("PTN BRK = %d", ctx->pattern_break), x, y, size, WHITE); + y += size; DrawText(TextFormat("CUR ROW = %i", ctx->current_row), x, y, size, WHITE); + y += size; DrawText(TextFormat("JMP ROW = %i", ctx->jump_row), x, y, size, WHITE); + y += size; DrawText(TextFormat("ROW LCT = %i", ctx->row_loop_count), x, y, size, WHITE); + y += size; DrawText(TextFormat("LCT = %i", ctx->loop_count), x, y, size, WHITE); + y += size; DrawText(TextFormat("MAX LCT = %i", ctx->max_loop_count), x, y, size, WHITE); + x = size * 12; y = 0; + + y += size; DrawText(TextFormat("CUR TCK = %i", ctx->current_tick), x, y, size, WHITE); + y += size; DrawText(TextFormat("XTR TCK = %i", ctx->extra_ticks), x, y, size, WHITE); + y += size; DrawText(TextFormat("TCK/ROW = %i", ctx->tempo), x, y, size, ORANGE); + y += size; DrawText(TextFormat("SPL TCK = %f", ctx->remaining_samples_in_tick), x, y, size, WHITE); + y += size; DrawText(TextFormat("GEN SPL = %i", ctx->generated_samples), x, y, size, WHITE); + y += size * 7; + + x = 0; + size=16; + // TIMELINE OF MODULE + for (int i=0; i < ctx->module.length; i++) { + if (i == ctx->jump_dest) { + if (ctx->position_jump) { + DrawRectangle(i * size * 2, y - size, size * 2, size, GOLD); + } else { + DrawRectangle(i * size * 2, y - size, size * 2, size, BROWN); + }; + }; + if (i == ctx->current_table_index) { +// DrawText(TextFormat("%02X", ctx->current_tick), i * size * 2, y - size, size, WHITE); + DrawRectangle(i * size * 2, y, size * 2, size, RED); + DrawText(TextFormat("%02X", ctx->current_row), i * size * 2, y - size, size, YELLOW); + } else { + DrawRectangle(i * size * 2, y, size * 2, size, ORANGE); + }; + DrawText(TextFormat("%02X", ctx->module.pattern_table[i]), i * size * 2, y, size, WHITE); + }; + y += size; + + jar_xm_pattern_t* cur = ctx->module.patterns + ctx->module.pattern_table[ctx->current_table_index]; + + /* DISPLAY CURRENTLY PLAYING PATTERN */ + + x += 2 * size; + for(uint8_t i = 0; i < ctx->module.num_channels; i++) { + DrawRectangle(x, y, 8 * size, size, PURPLE); + DrawText("N", x, y, size, YELLOW); + DrawText("I", x + size * 2, y, size, YELLOW); + DrawText("V", x + size * 4, y, size, YELLOW); + DrawText("FX", x + size * 6, y, size, YELLOW); + x += 9 * size; + }; + x += size; + for (int j=(ctx->current_row - 14); j<(ctx->current_row + 15); j++) { + y += size; + x = 0; + if (j >=0 && j < (cur->num_rows)) { + DrawRectangle(x, y, size * 2, size, BROWN); + DrawText(TextFormat("%02X",j), x, y, size, WHITE); + x += 2 * size; + for(uint8_t i = 0; i < ctx->module.num_channels; i++) { + if (j==(ctx->current_row)) { + DrawRectangle(x, y, 8 * size, size, DARKGREEN); + } else { + DrawRectangle(x, y, 8 * size, size, DARKGRAY); + }; + jar_xm_pattern_slot_t *s = cur->slots + j * ctx->module.num_channels + i; + // jar_xm_channel_context_t *ch = ctx->channels + i; + if (s->note > 0) {DrawText(TextFormat("%s%s", xm_note_chr(s->note), xm_octave_chr(s->note) ), x, y, size, WHITE);} else {DrawText("...", x, y, size, GRAY);}; + if (s->instrument > 0) { + DrawText(TextFormat("%02X", s->instrument), x + size * 2, y, size, WHITE); + if (s->volume_column == 0) { + DrawText(TextFormat("%02X", 64), x + size * 4, y, size, YELLOW); + }; + } else { + DrawText("..", x + size * 2, y, size, GRAY); + if (s->volume_column == 0) { + DrawText("..", x + size * 4, y, size, GRAY); + }; + }; + if (s->volume_column > 0) {DrawText(TextFormat("%02X", (s->volume_column - 16)), x + size * 4, y, size, WHITE);}; + if (s->effect_type > 0 || s->effect_param > 0) {DrawText(TextFormat("%s%02X", xm_effect_chr(s->effect_type), s->effect_param), x + size * 6, y, size, WHITE);}; + x += 9 * size; + }; + }; + }; + +} +#endif // RayLib extension + #endif//end of JAR_XM_IMPLEMENTATION //------------------------------------------------------------------------------- diff --git a/src/external/miniaudio.h b/src/external/miniaudio.h index 085f307db..60522da51 100644 --- a/src/external/miniaudio.h +++ b/src/external/miniaudio.h @@ -1,6 +1,6 @@ /* Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file. -miniaudio - v0.10.30 - 2021-01-10 +miniaudio - v0.10.33 - 2021-04-04 David Reid - mackron@gmail.com @@ -280,93 +280,147 @@ The Emscripten build emits Web Audio JavaScript directly and should compile clea ------------------ `#define` these options before including miniaudio.h. - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | Option | Description | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_WASAPI | Disables the WASAPI backend. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_DSOUND | Disables the DirectSound backend. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_WINMM | Disables the WinMM backend. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_ALSA | Disables the ALSA backend. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_PULSEAUDIO | Disables the PulseAudio backend. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_JACK | Disables the JACK backend. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_COREAUDIO | Disables the Core Audio backend. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_SNDIO | Disables the sndio backend. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_AUDIO4 | Disables the audio(4) backend. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_OSS | Disables the OSS backend. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_AAUDIO | Disables the AAudio backend. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_OPENSL | Disables the OpenSL|ES backend. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_WEBAUDIO | Disables the Web Audio backend. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_NULL | Disables the null backend. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_DECODING | Disables decoding APIs. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_ENCODING | Disables encoding APIs. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_WAV | Disables the built-in WAV decoder and encoder. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_FLAC | Disables the built-in FLAC decoder. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_MP3 | Disables the built-in MP3 decoder. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_DEVICE_IO | Disables playback and recording. This will disable ma_context and ma_device APIs. This is useful if you only want to use | - | | miniaudio's data conversion and/or decoding APIs. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_THREADING | Disables the ma_thread, ma_mutex, ma_semaphore and ma_event APIs. This option is useful if you only need to use miniaudio for | - | | data conversion, decoding and/or encoding. Some families of APIs require threading which means the following options must also | - | | be set: | - | | | - | | ``` | - | | MA_NO_DEVICE_IO | - | | ``` | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_GENERATION | Disables generation APIs such a ma_waveform and ma_noise. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_SSE2 | Disables SSE2 optimizations. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_AVX2 | Disables AVX2 optimizations. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_AVX512 | Disables AVX-512 optimizations. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_NEON | Disables NEON optimizations. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_NO_RUNTIME_LINKING | Disables runtime linking. This is useful for passing Apple's notarization process. When enabling this, you may need to avoid | - | | using `-std=c89` or `-std=c99` on Linux builds or else you may end up with compilation errors due to conflicts with `timespec` | - | | and `timeval` data types. | - | | | - | | You may need to enable this if your target platform does not allow runtime linking via `dlopen()`. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_LOG_LEVEL [level] | Sets the logging level. Set `level` to one of the following: | - | | | - | | ``` | - | | MA_LOG_LEVEL_VERBOSE | - | | MA_LOG_LEVEL_INFO | - | | MA_LOG_LEVEL_WARNING | - | | MA_LOG_LEVEL_ERROR | - | | ``` | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_DEBUG_OUTPUT | Enable `printf()` debug output. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_COINIT_VALUE | Windows only. The value to pass to internal calls to `CoInitializeEx()`. Defaults to `COINIT_MULTITHREADED`. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_API | Controls how public APIs should be decorated. Defaults to `extern`. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MA_DLL | If set, configures MA_API to either import or export APIs depending on whether or not the implementation is being defined. If | - | | defining the implementation, MA_API will be configured to export. Otherwise it will be configured to import. This has no effect | - | | if MA_API is defined externally. | - +-----------------------+---------------------------------------------------------------------------------------------------------------------------------+ + +----------------------------------+--------------------------------------------------------------------+ + | Option | Description | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_WASAPI | Disables the WASAPI backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_DSOUND | Disables the DirectSound backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_WINMM | Disables the WinMM backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_ALSA | Disables the ALSA backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_PULSEAUDIO | Disables the PulseAudio backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_JACK | Disables the JACK backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_COREAUDIO | Disables the Core Audio backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_SNDIO | Disables the sndio backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_AUDIO4 | Disables the audio(4) backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_OSS | Disables the OSS backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_AAUDIO | Disables the AAudio backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_OPENSL | Disables the OpenSL|ES backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_WEBAUDIO | Disables the Web Audio backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_NULL | Disables the null backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_ONLY_SPECIFIC_BACKENDS | Disables all backends by default and requires `MA_ENABLE_*` to | + | | enable specific backends. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_WASAPI | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | + | | enable the WASAPI backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_DSOUND | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | + | | enable the DirectSound backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_WINMM | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | + | | enable the WinMM backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_ALSA | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | + | | enable the ALSA backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_PULSEAUDIO | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | + | | enable the PulseAudio backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_JACK | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | + | | enable the JACK backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_COREAUDIO | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | + | | enable the Core Audio backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_SNDIO | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | + | | enable the sndio backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_AUDIO4 | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | + | | enable the audio(4) backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_OSS | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | + | | enable the OSS backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_AAUDIO | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | + | | enable the AAudio backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_OPENSL | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | + | | enable the OpenSL|ES backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_WEBAUDIO | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | + | | enable the Web Audio backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_ENABLE_NULL | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | + | | enable the null backend. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_DECODING | Disables decoding APIs. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_ENCODING | Disables encoding APIs. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_WAV | Disables the built-in WAV decoder and encoder. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_FLAC | Disables the built-in FLAC decoder. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_MP3 | Disables the built-in MP3 decoder. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_DEVICE_IO | Disables playback and recording. This will disable ma_context and | + | | ma_device APIs. This is useful if you only want to use miniaudio's | + | | data conversion and/or decoding APIs. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_THREADING | Disables the ma_thread, ma_mutex, ma_semaphore and ma_event APIs. | + | | This option is useful if you only need to use miniaudio for data | + | | conversion, decoding and/or encoding. Some families of APIs | + | | require threading which means the following options must also be | + | | set: | + | | | + | | ``` | + | | MA_NO_DEVICE_IO | + | | ``` | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_GENERATION | Disables generation APIs such a ma_waveform and ma_noise. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_SSE2 | Disables SSE2 optimizations. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_AVX2 | Disables AVX2 optimizations. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_AVX512 | Disables AVX-512 optimizations. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_NEON | Disables NEON optimizations. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_NO_RUNTIME_LINKING | Disables runtime linking. This is useful for passing Apple's | + | | notarization process. When enabling this, you may need to avoid | + | | using `-std=c89` or `-std=c99` on Linux builds or else you may end | + | | up with compilation errors due to conflicts with `timespec` and | + | | `timeval` data types. | + | | | + | | You may need to enable this if your target platform does not allow | + | | runtime linking via `dlopen()`. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_LOG_LEVEL [level] | Sets the logging level. Set `level` to one of the following: | + | | | + | | ``` | + | | MA_LOG_LEVEL_VERBOSE | + | | MA_LOG_LEVEL_INFO | + | | MA_LOG_LEVEL_WARNING | + | | MA_LOG_LEVEL_ERROR | + | | ``` | + +----------------------------------+--------------------------------------------------------------------+ + | MA_DEBUG_OUTPUT | Enable `printf()` debug output. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_COINIT_VALUE | Windows only. The value to pass to internal calls to | + | | `CoInitializeEx()`. Defaults to `COINIT_MULTITHREADED`. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_API | Controls how public APIs should be decorated. Default is `extern`. | + +----------------------------------+--------------------------------------------------------------------+ + | MA_DLL | If set, configures MA_API to either import or export APIs | + | | depending on whether or not the implementation is being defined. | + | | If defining the implementation, MA_API will be configured to | + | | export. Otherwise it will be configured to import. This has no | + | | effect if MA_API is defined externally. | + +----------------------------------+--------------------------------------------------------------------+ 3. Definitions @@ -1456,7 +1510,7 @@ extern "C" { #define MA_VERSION_MAJOR 0 #define MA_VERSION_MINOR 10 -#define MA_VERSION_REVISION 30 +#define MA_VERSION_REVISION 33 #define MA_VERSION_STRING MA_XSTRINGIFY(MA_VERSION_MAJOR) "." MA_XSTRINGIFY(MA_VERSION_MINOR) "." MA_XSTRINGIFY(MA_VERSION_REVISION) #if defined(_MSC_VER) && !defined(__clang__) @@ -1649,6 +1703,12 @@ MA_LOG_LEVEL_ERROR #define MA_LOG_LEVEL MA_LOG_LEVEL_ERROR #endif +/* +An annotation for variables which must be used atomically. This doesn't actually do anything - it's +just used as a way for humans to identify variables that should be used atomically. +*/ +#define MA_ATOMIC + typedef struct ma_context ma_context; typedef struct ma_device ma_device; @@ -1789,28 +1849,11 @@ typedef int ma_result; #define MA_FAILED_TO_STOP_BACKEND_DEVICE -303 -/* Standard sample rates. */ -#define MA_SAMPLE_RATE_8000 8000 -#define MA_SAMPLE_RATE_11025 11025 -#define MA_SAMPLE_RATE_16000 16000 -#define MA_SAMPLE_RATE_22050 22050 -#define MA_SAMPLE_RATE_24000 24000 -#define MA_SAMPLE_RATE_32000 32000 -#define MA_SAMPLE_RATE_44100 44100 -#define MA_SAMPLE_RATE_48000 48000 -#define MA_SAMPLE_RATE_88200 88200 -#define MA_SAMPLE_RATE_96000 96000 -#define MA_SAMPLE_RATE_176400 176400 -#define MA_SAMPLE_RATE_192000 192000 -#define MA_SAMPLE_RATE_352800 352800 -#define MA_SAMPLE_RATE_384000 384000 - #define MA_MIN_CHANNELS 1 #ifndef MA_MAX_CHANNELS #define MA_MAX_CHANNELS 32 #endif -#define MA_MIN_SAMPLE_RATE MA_SAMPLE_RATE_8000 -#define MA_MAX_SAMPLE_RATE MA_SAMPLE_RATE_384000 + #ifndef MA_MAX_FILTER_ORDER #define MA_MAX_FILTER_ORDER 8 @@ -1849,6 +1892,38 @@ typedef enum ma_format_count } ma_format; +typedef enum +{ + /* Standard rates need to be in priority order. */ + ma_standard_sample_rate_48000 = 48000, /* Most common */ + ma_standard_sample_rate_44100 = 44100, + + ma_standard_sample_rate_32000 = 32000, /* Lows */ + ma_standard_sample_rate_24000 = 24000, + ma_standard_sample_rate_22050 = 22050, + + ma_standard_sample_rate_88200 = 88200, /* Highs */ + ma_standard_sample_rate_96000 = 96000, + ma_standard_sample_rate_176400 = 176400, + ma_standard_sample_rate_192000 = 192000, + + ma_standard_sample_rate_16000 = 16000, /* Extreme lows */ + ma_standard_sample_rate_11025 = 11250, + ma_standard_sample_rate_8000 = 8000, + + ma_standard_sample_rate_352800 = 352800, /* Extreme highs */ + ma_standard_sample_rate_384000 = 384000, + + ma_standard_sample_rate_min = ma_standard_sample_rate_8000, + ma_standard_sample_rate_max = ma_standard_sample_rate_384000, + ma_standard_sample_rate_count = 14 /* Need to maintain the count manually. Make sure this is updated if items are added to enum. */ +} ma_standard_sample_rate; + +/* These are deprecated. Use ma_standard_sample_rate_min and ma_standard_sample_rate_max. */ +#define MA_MIN_SAMPLE_RATE (ma_uint32)ma_standard_sample_rate_min +#define MA_MAX_SAMPLE_RATE (ma_uint32)ma_standard_sample_rate_max + + typedef enum { ma_channel_mix_mode_rectangular = 0, /* Simple averaging based on the plane(s) the channel is sitting on. */ @@ -1906,7 +1981,8 @@ typedef enum ma_thread_priority_default = 0 } ma_thread_priority; -typedef unsigned char ma_spinlock; +/* Spinlocks are 32-bit for compatibility reasons. */ +typedef ma_uint32 ma_spinlock; #if defined(MA_WIN32) typedef ma_handle ma_thread; @@ -2005,7 +2081,7 @@ typedef struct MA_API ma_result ma_biquad_init(const ma_biquad_config* pConfig, ma_biquad* pBQ); MA_API ma_result ma_biquad_reinit(const ma_biquad_config* pConfig, ma_biquad* pBQ); MA_API ma_result ma_biquad_process_pcm_frames(ma_biquad* pBQ, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); -MA_API ma_uint32 ma_biquad_get_latency(ma_biquad* pBQ); +MA_API ma_uint32 ma_biquad_get_latency(const ma_biquad* pBQ); /************************************************************************************************************************************************************** @@ -2036,7 +2112,7 @@ typedef struct MA_API ma_result ma_lpf1_init(const ma_lpf1_config* pConfig, ma_lpf1* pLPF); MA_API ma_result ma_lpf1_reinit(const ma_lpf1_config* pConfig, ma_lpf1* pLPF); MA_API ma_result ma_lpf1_process_pcm_frames(ma_lpf1* pLPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); -MA_API ma_uint32 ma_lpf1_get_latency(ma_lpf1* pLPF); +MA_API ma_uint32 ma_lpf1_get_latency(const ma_lpf1* pLPF); typedef struct { @@ -2046,7 +2122,7 @@ typedef struct MA_API ma_result ma_lpf2_init(const ma_lpf2_config* pConfig, ma_lpf2* pLPF); MA_API ma_result ma_lpf2_reinit(const ma_lpf2_config* pConfig, ma_lpf2* pLPF); MA_API ma_result ma_lpf2_process_pcm_frames(ma_lpf2* pLPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); -MA_API ma_uint32 ma_lpf2_get_latency(ma_lpf2* pLPF); +MA_API ma_uint32 ma_lpf2_get_latency(const ma_lpf2* pLPF); typedef struct @@ -2074,7 +2150,7 @@ typedef struct MA_API ma_result ma_lpf_init(const ma_lpf_config* pConfig, ma_lpf* pLPF); MA_API ma_result ma_lpf_reinit(const ma_lpf_config* pConfig, ma_lpf* pLPF); MA_API ma_result ma_lpf_process_pcm_frames(ma_lpf* pLPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); -MA_API ma_uint32 ma_lpf_get_latency(ma_lpf* pLPF); +MA_API ma_uint32 ma_lpf_get_latency(const ma_lpf* pLPF); /************************************************************************************************************************************************************** @@ -2105,7 +2181,7 @@ typedef struct MA_API ma_result ma_hpf1_init(const ma_hpf1_config* pConfig, ma_hpf1* pHPF); MA_API ma_result ma_hpf1_reinit(const ma_hpf1_config* pConfig, ma_hpf1* pHPF); MA_API ma_result ma_hpf1_process_pcm_frames(ma_hpf1* pHPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); -MA_API ma_uint32 ma_hpf1_get_latency(ma_hpf1* pHPF); +MA_API ma_uint32 ma_hpf1_get_latency(const ma_hpf1* pHPF); typedef struct { @@ -2115,7 +2191,7 @@ typedef struct MA_API ma_result ma_hpf2_init(const ma_hpf2_config* pConfig, ma_hpf2* pHPF); MA_API ma_result ma_hpf2_reinit(const ma_hpf2_config* pConfig, ma_hpf2* pHPF); MA_API ma_result ma_hpf2_process_pcm_frames(ma_hpf2* pHPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); -MA_API ma_uint32 ma_hpf2_get_latency(ma_hpf2* pHPF); +MA_API ma_uint32 ma_hpf2_get_latency(const ma_hpf2* pHPF); typedef struct @@ -2143,7 +2219,7 @@ typedef struct MA_API ma_result ma_hpf_init(const ma_hpf_config* pConfig, ma_hpf* pHPF); MA_API ma_result ma_hpf_reinit(const ma_hpf_config* pConfig, ma_hpf* pHPF); MA_API ma_result ma_hpf_process_pcm_frames(ma_hpf* pHPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); -MA_API ma_uint32 ma_hpf_get_latency(ma_hpf* pHPF); +MA_API ma_uint32 ma_hpf_get_latency(const ma_hpf* pHPF); /************************************************************************************************************************************************************** @@ -2170,7 +2246,7 @@ typedef struct MA_API ma_result ma_bpf2_init(const ma_bpf2_config* pConfig, ma_bpf2* pBPF); MA_API ma_result ma_bpf2_reinit(const ma_bpf2_config* pConfig, ma_bpf2* pBPF); MA_API ma_result ma_bpf2_process_pcm_frames(ma_bpf2* pBPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); -MA_API ma_uint32 ma_bpf2_get_latency(ma_bpf2* pBPF); +MA_API ma_uint32 ma_bpf2_get_latency(const ma_bpf2* pBPF); typedef struct @@ -2195,7 +2271,7 @@ typedef struct MA_API ma_result ma_bpf_init(const ma_bpf_config* pConfig, ma_bpf* pBPF); MA_API ma_result ma_bpf_reinit(const ma_bpf_config* pConfig, ma_bpf* pBPF); MA_API ma_result ma_bpf_process_pcm_frames(ma_bpf* pBPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); -MA_API ma_uint32 ma_bpf_get_latency(ma_bpf* pBPF); +MA_API ma_uint32 ma_bpf_get_latency(const ma_bpf* pBPF); /************************************************************************************************************************************************************** @@ -2222,7 +2298,7 @@ typedef struct MA_API ma_result ma_notch2_init(const ma_notch2_config* pConfig, ma_notch2* pFilter); MA_API ma_result ma_notch2_reinit(const ma_notch2_config* pConfig, ma_notch2* pFilter); MA_API ma_result ma_notch2_process_pcm_frames(ma_notch2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); -MA_API ma_uint32 ma_notch2_get_latency(ma_notch2* pFilter); +MA_API ma_uint32 ma_notch2_get_latency(const ma_notch2* pFilter); /************************************************************************************************************************************************************** @@ -2250,7 +2326,7 @@ typedef struct MA_API ma_result ma_peak2_init(const ma_peak2_config* pConfig, ma_peak2* pFilter); MA_API ma_result ma_peak2_reinit(const ma_peak2_config* pConfig, ma_peak2* pFilter); MA_API ma_result ma_peak2_process_pcm_frames(ma_peak2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); -MA_API ma_uint32 ma_peak2_get_latency(ma_peak2* pFilter); +MA_API ma_uint32 ma_peak2_get_latency(const ma_peak2* pFilter); /************************************************************************************************************************************************************** @@ -2278,7 +2354,7 @@ typedef struct MA_API ma_result ma_loshelf2_init(const ma_loshelf2_config* pConfig, ma_loshelf2* pFilter); MA_API ma_result ma_loshelf2_reinit(const ma_loshelf2_config* pConfig, ma_loshelf2* pFilter); MA_API ma_result ma_loshelf2_process_pcm_frames(ma_loshelf2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); -MA_API ma_uint32 ma_loshelf2_get_latency(ma_loshelf2* pFilter); +MA_API ma_uint32 ma_loshelf2_get_latency(const ma_loshelf2* pFilter); /************************************************************************************************************************************************************** @@ -2306,7 +2382,7 @@ typedef struct MA_API ma_result ma_hishelf2_init(const ma_hishelf2_config* pConfig, ma_hishelf2* pFilter); MA_API ma_result ma_hishelf2_reinit(const ma_hishelf2_config* pConfig, ma_hishelf2* pFilter); MA_API ma_result ma_hishelf2_process_pcm_frames(ma_hishelf2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); -MA_API ma_uint32 ma_hishelf2_get_latency(ma_hishelf2* pFilter); +MA_API ma_uint32 ma_hishelf2_get_latency(const ma_hishelf2* pFilter); @@ -2363,10 +2439,10 @@ MA_API void ma_linear_resampler_uninit(ma_linear_resampler* pResampler); MA_API ma_result ma_linear_resampler_process_pcm_frames(ma_linear_resampler* pResampler, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut); MA_API ma_result ma_linear_resampler_set_rate(ma_linear_resampler* pResampler, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut); MA_API ma_result ma_linear_resampler_set_rate_ratio(ma_linear_resampler* pResampler, float ratioInOut); -MA_API ma_uint64 ma_linear_resampler_get_required_input_frame_count(ma_linear_resampler* pResampler, ma_uint64 outputFrameCount); -MA_API ma_uint64 ma_linear_resampler_get_expected_output_frame_count(ma_linear_resampler* pResampler, ma_uint64 inputFrameCount); -MA_API ma_uint64 ma_linear_resampler_get_input_latency(ma_linear_resampler* pResampler); -MA_API ma_uint64 ma_linear_resampler_get_output_latency(ma_linear_resampler* pResampler); +MA_API ma_uint64 ma_linear_resampler_get_required_input_frame_count(const ma_linear_resampler* pResampler, ma_uint64 outputFrameCount); +MA_API ma_uint64 ma_linear_resampler_get_expected_output_frame_count(const ma_linear_resampler* pResampler, ma_uint64 inputFrameCount); +MA_API ma_uint64 ma_linear_resampler_get_input_latency(const ma_linear_resampler* pResampler); +MA_API ma_uint64 ma_linear_resampler_get_output_latency(const ma_linear_resampler* pResampler); typedef enum { @@ -2462,24 +2538,24 @@ number of output frames. The returned value does not include cached input frames. It only returns the number of extra frames that would need to be read from the input buffer in order to output the specified number of output frames. */ -MA_API ma_uint64 ma_resampler_get_required_input_frame_count(ma_resampler* pResampler, ma_uint64 outputFrameCount); +MA_API ma_uint64 ma_resampler_get_required_input_frame_count(const ma_resampler* pResampler, ma_uint64 outputFrameCount); /* Calculates the number of whole output frames that would be output after fully reading and consuming the specified number of input frames. */ -MA_API ma_uint64 ma_resampler_get_expected_output_frame_count(ma_resampler* pResampler, ma_uint64 inputFrameCount); +MA_API ma_uint64 ma_resampler_get_expected_output_frame_count(const ma_resampler* pResampler, ma_uint64 inputFrameCount); /* Retrieves the latency introduced by the resampler in input frames. */ -MA_API ma_uint64 ma_resampler_get_input_latency(ma_resampler* pResampler); +MA_API ma_uint64 ma_resampler_get_input_latency(const ma_resampler* pResampler); /* Retrieves the latency introduced by the resampler in output frames. */ -MA_API ma_uint64 ma_resampler_get_output_latency(ma_resampler* pResampler); +MA_API ma_uint64 ma_resampler_get_output_latency(const ma_resampler* pResampler); @@ -2580,10 +2656,10 @@ MA_API void ma_data_converter_uninit(ma_data_converter* pConverter); MA_API ma_result ma_data_converter_process_pcm_frames(ma_data_converter* pConverter, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut); MA_API ma_result ma_data_converter_set_rate(ma_data_converter* pConverter, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut); MA_API ma_result ma_data_converter_set_rate_ratio(ma_data_converter* pConverter, float ratioInOut); -MA_API ma_uint64 ma_data_converter_get_required_input_frame_count(ma_data_converter* pConverter, ma_uint64 outputFrameCount); -MA_API ma_uint64 ma_data_converter_get_expected_output_frame_count(ma_data_converter* pConverter, ma_uint64 inputFrameCount); -MA_API ma_uint64 ma_data_converter_get_input_latency(ma_data_converter* pConverter); -MA_API ma_uint64 ma_data_converter_get_output_latency(ma_data_converter* pConverter); +MA_API ma_uint64 ma_data_converter_get_required_input_frame_count(const ma_data_converter* pConverter, ma_uint64 outputFrameCount); +MA_API ma_uint64 ma_data_converter_get_expected_output_frame_count(const ma_data_converter* pConverter, ma_uint64 inputFrameCount); +MA_API ma_uint64 ma_data_converter_get_input_latency(const ma_data_converter* pConverter); +MA_API ma_uint64 ma_data_converter_get_output_latency(const ma_data_converter* pConverter); /************************************************************************************************************************************************************ @@ -2728,10 +2804,10 @@ typedef struct ma_uint32 subbufferSizeInBytes; ma_uint32 subbufferCount; ma_uint32 subbufferStrideInBytes; - volatile ma_uint32 encodedReadOffset; /* Most significant bit is the loop flag. Lower 31 bits contains the actual offset in bytes. */ - volatile ma_uint32 encodedWriteOffset; /* Most significant bit is the loop flag. Lower 31 bits contains the actual offset in bytes. */ - ma_bool8 ownsBuffer; /* Used to know whether or not miniaudio is responsible for free()-ing the buffer. */ - ma_bool8 clearOnWriteAcquire; /* When set, clears the acquired write buffer before returning from ma_rb_acquire_write(). */ + MA_ATOMIC ma_uint32 encodedReadOffset; /* Most significant bit is the loop flag. Lower 31 bits contains the actual offset in bytes. Must be used atomically. */ + MA_ATOMIC ma_uint32 encodedWriteOffset; /* Most significant bit is the loop flag. Lower 31 bits contains the actual offset in bytes. Must be used atomically. */ + ma_bool8 ownsBuffer; /* Used to know whether or not miniaudio is responsible for free()-ing the buffer. */ + ma_bool8 clearOnWriteAcquire; /* When set, clears the acquired write buffer before returning from ma_rb_acquire_write(). */ ma_allocation_callbacks allocationCallbacks; } ma_rb; @@ -2795,7 +2871,7 @@ typedef struct ma_pcm_rb rb; } ma_duplex_rb; -MA_API ma_result ma_duplex_rb_init(ma_uint32 inputSampleRate, ma_format captureFormat, ma_uint32 captureChannels, ma_uint32 captureSampleRate, ma_uint32 capturePeriodSizeInFrames, const ma_allocation_callbacks* pAllocationCallbacks, ma_duplex_rb* pRB); +MA_API ma_result ma_duplex_rb_init(ma_format captureFormat, ma_uint32 captureChannels, ma_uint32 sampleRate, ma_uint32 captureInternalSampleRate, ma_uint32 captureInternalPeriodSizeInFrames, const ma_allocation_callbacks* pAllocationCallbacks, ma_duplex_rb* pRB); MA_API ma_result ma_duplex_rb_uninit(ma_duplex_rb* pRB); @@ -2922,50 +2998,50 @@ This section contains the APIs for device playback and capture. Here is where yo #endif -#if !defined(MA_NO_WASAPI) && defined(MA_SUPPORT_WASAPI) - #define MA_ENABLE_WASAPI +#if defined(MA_SUPPORT_WASAPI) && !defined(MA_NO_WASAPI) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_WASAPI)) + #define MA_HAS_WASAPI #endif -#if !defined(MA_NO_DSOUND) && defined(MA_SUPPORT_DSOUND) - #define MA_ENABLE_DSOUND +#if defined(MA_SUPPORT_DSOUND) && !defined(MA_NO_DSOUND) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_DSOUND)) + #define MA_HAS_DSOUND #endif -#if !defined(MA_NO_WINMM) && defined(MA_SUPPORT_WINMM) - #define MA_ENABLE_WINMM +#if defined(MA_SUPPORT_WINMM) && !defined(MA_NO_WINMM) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_WINMM)) + #define MA_HAS_WINMM #endif -#if !defined(MA_NO_ALSA) && defined(MA_SUPPORT_ALSA) - #define MA_ENABLE_ALSA +#if defined(MA_SUPPORT_ALSA) && !defined(MA_NO_ALSA) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_ALSA)) + #define MA_HAS_ALSA #endif -#if !defined(MA_NO_PULSEAUDIO) && defined(MA_SUPPORT_PULSEAUDIO) - #define MA_ENABLE_PULSEAUDIO +#if defined(MA_SUPPORT_PULSEAUDIO) && !defined(MA_NO_PULSEAUDIO) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_PULSEAUDIO)) + #define MA_HAS_PULSEAUDIO #endif -#if !defined(MA_NO_JACK) && defined(MA_SUPPORT_JACK) - #define MA_ENABLE_JACK +#if defined(MA_SUPPORT_JACK) && !defined(MA_NO_JACK) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_JACK)) + #define MA_HAS_JACK #endif -#if !defined(MA_NO_COREAUDIO) && defined(MA_SUPPORT_COREAUDIO) - #define MA_ENABLE_COREAUDIO +#if defined(MA_SUPPORT_COREAUDIO) && !defined(MA_NO_COREAUDIO) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_COREAUDIO)) + #define MA_HAS_COREAUDIO #endif -#if !defined(MA_NO_SNDIO) && defined(MA_SUPPORT_SNDIO) - #define MA_ENABLE_SNDIO +#if defined(MA_SUPPORT_SNDIO) && !defined(MA_NO_SNDIO) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_SNDIO)) + #define MA_HAS_SNDIO #endif -#if !defined(MA_NO_AUDIO4) && defined(MA_SUPPORT_AUDIO4) - #define MA_ENABLE_AUDIO4 +#if defined(MA_SUPPORT_AUDIO4) && !defined(MA_NO_AUDIO4) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_AUDIO4)) + #define MA_HAS_AUDIO4 #endif -#if !defined(MA_NO_OSS) && defined(MA_SUPPORT_OSS) - #define MA_ENABLE_OSS +#if defined(MA_SUPPORT_OSS) && !defined(MA_NO_OSS) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_OSS)) + #define MA_HAS_OSS #endif -#if !defined(MA_NO_AAUDIO) && defined(MA_SUPPORT_AAUDIO) - #define MA_ENABLE_AAUDIO +#if defined(MA_SUPPORT_AAUDIO) && !defined(MA_NO_AAUDIO) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_AAUDIO)) + #define MA_HAS_AAUDIO #endif -#if !defined(MA_NO_OPENSL) && defined(MA_SUPPORT_OPENSL) - #define MA_ENABLE_OPENSL +#if defined(MA_SUPPORT_OPENSL) && !defined(MA_NO_OPENSL) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_OPENSL)) + #define MA_HAS_OPENSL #endif -#if !defined(MA_NO_WEBAUDIO) && defined(MA_SUPPORT_WEBAUDIO) - #define MA_ENABLE_WEBAUDIO +#if defined(MA_SUPPORT_WEBAUDIO) && !defined(MA_NO_WEBAUDIO) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_WEBAUDIO)) + #define MA_HAS_WEBAUDIO #endif -#if !defined(MA_NO_CUSTOM) && defined(MA_SUPPORT_CUSTOM) - #define MA_ENABLE_CUSTOM +#if defined(MA_SUPPORT_CUSTOM) && !defined(MA_NO_CUSTOM) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_CUSTOM)) + #define MA_HAS_CUSTOM #endif -#if !defined(MA_NO_NULL) && defined(MA_SUPPORT_NULL) - #define MA_ENABLE_NULL +#if defined(MA_SUPPORT_NULL) && !defined(MA_NO_NULL) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_NULL)) + #define MA_HAS_NULL #endif #define MA_STATE_UNINITIALIZED 0 @@ -3276,8 +3352,8 @@ typedef struct ma_format format; /* Sample format. If set to ma_format_unknown, all sample formats are supported. */ ma_uint32 channels; /* If set to 0, all channels are supported. */ ma_uint32 sampleRate; /* If set to 0, all sample rates are supported. */ - ma_uint32 flags; - } nativeDataFormats[64]; + ma_uint32 flags; /* A combination of MA_DATA_FORMAT_FLAG_* flags. */ + } nativeDataFormats[/*ma_format_count * ma_standard_sample_rate_count * MA_MAX_CHANNELS*/ 64]; /* Not sure how big to make this. There can be *many* permutations for virtual devices which can support anything. */ } ma_device_info; struct ma_device_config @@ -3457,12 +3533,13 @@ If the backend requires absolute flexibility with it's data delivery, it can opt which will allow it to implement the logic that will run on the audio thread. This is much more advanced and is completely optional. The audio thread should run data delivery logic in a loop while `ma_device_get_state() == MA_STATE_STARTED` and no errors have been -encounted. Do not start or stop the device here. That will be handled from outside the `onDeviceAudioThread()` callback. +encounted. Do not start or stop the device here. That will be handled from outside the `onDeviceDataLoop()` callback. -The invocation of the `onDeviceAudioThread()` callback will be handled by miniaudio. When you start the device, miniaudio will fire this +The invocation of the `onDeviceDataLoop()` callback will be handled by miniaudio. When you start the device, miniaudio will fire this callback. When the device is stopped, the `ma_device_get_state() == MA_STATE_STARTED` condition will fail and the loop will be terminated -which will then fall through to the part that stops the device. For an example on how to implement the `onDeviceAudioThread()` callback, -look at `ma_device_audio_thread__default_read_write()`. +which will then fall through to the part that stops the device. For an example on how to implement the `onDeviceDataLoop()` callback, +look at `ma_device_audio_thread__default_read_write()`. Implement the `onDeviceDataLoopWakeup()` callback if you need a mechanism to +wake up the audio thread. */ struct ma_backend_callbacks { @@ -3476,7 +3553,8 @@ struct ma_backend_callbacks ma_result (* onDeviceStop)(ma_device* pDevice); ma_result (* onDeviceRead)(ma_device* pDevice, void* pFrames, ma_uint32 frameCount, ma_uint32* pFramesRead); ma_result (* onDeviceWrite)(ma_device* pDevice, const void* pFrames, ma_uint32 frameCount, ma_uint32* pFramesWritten); - ma_result (* onDeviceAudioThread)(ma_device* pDevice); + ma_result (* onDeviceDataLoop)(ma_device* pDevice); + ma_result (* onDeviceDataLoopWakeup)(ma_device* pDevice); }; struct ma_context_config @@ -3511,6 +3589,32 @@ struct ma_context_config ma_backend_callbacks custom; }; +/* WASAPI specific structure for some commands which must run on a common thread due to bugs in WASAPI. */ +typedef struct +{ + int code; + ma_event* pEvent; /* This will be signalled when the event is complete. */ + union + { + struct + { + int _unused; + } quit; + struct + { + ma_device_type deviceType; + void* pAudioClient; + void** ppAudioClientService; + ma_result result; /* The result from creating the audio client service. */ + } createAudioClient; + struct + { + ma_device* pDevice; + ma_device_type deviceType; + } releaseAudioClient; + } data; +} ma_context_command__wasapi; + struct ma_context { ma_backend_callbacks callbacks; @@ -3526,23 +3630,18 @@ struct ma_context ma_uint32 playbackDeviceInfoCount; ma_uint32 captureDeviceInfoCount; ma_device_info* pDeviceInfos; /* Playback devices first, then capture. */ - ma_bool8 isBackendAsynchronous; /* Set when the context is initialized. Set to 1 for asynchronous backends such as Core Audio and JACK. Do not modify. */ - - ma_result (* onUninit )(ma_context* pContext); - ma_result (* onEnumDevices )(ma_context* pContext, ma_enum_devices_callback_proc callback, void* pUserData); /* Return false from the callback to stop enumeration. */ - ma_result (* onGetDeviceInfo )(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_share_mode shareMode, ma_device_info* pDeviceInfo); - ma_result (* onDeviceInit )(ma_context* pContext, const ma_device_config* pConfig, ma_device* pDevice); - void (* onDeviceUninit )(ma_device* pDevice); - ma_result (* onDeviceStart )(ma_device* pDevice); - ma_result (* onDeviceStop )(ma_device* pDevice); - ma_result (* onDeviceMainLoop)(ma_device* pDevice); union { #ifdef MA_SUPPORT_WASAPI struct { - int _unused; + ma_thread commandThread; + ma_mutex commandLock; + ma_semaphore commandSem; + ma_uint32 commandIndex; + ma_uint32 commandCount; + ma_context_command__wasapi commands[4]; } wasapi; #endif #ifdef MA_SUPPORT_DSOUND @@ -3589,8 +3688,11 @@ struct ma_context ma_proc snd_pcm_hw_params_set_format; ma_proc snd_pcm_hw_params_set_format_first; ma_proc snd_pcm_hw_params_get_format_mask; + ma_proc snd_pcm_hw_params_set_channels; ma_proc snd_pcm_hw_params_set_channels_near; + ma_proc snd_pcm_hw_params_set_channels_minmax; ma_proc snd_pcm_hw_params_set_rate_resample; + ma_proc snd_pcm_hw_params_set_rate; ma_proc snd_pcm_hw_params_set_rate_near; ma_proc snd_pcm_hw_params_set_buffer_size_near; ma_proc snd_pcm_hw_params_set_periods_near; @@ -3605,6 +3707,9 @@ struct ma_context ma_proc snd_pcm_hw_params_get_buffer_size; ma_proc snd_pcm_hw_params_get_periods; ma_proc snd_pcm_hw_params_get_access; + ma_proc snd_pcm_hw_params_test_format; + ma_proc snd_pcm_hw_params_test_channels; + ma_proc snd_pcm_hw_params_test_rate; ma_proc snd_pcm_hw_params; ma_proc snd_pcm_sw_params_sizeof; ma_proc snd_pcm_sw_params_current; @@ -3705,7 +3810,7 @@ struct ma_context ma_proc pa_stream_writable_size; ma_proc pa_stream_readable_size; - /*pa_threaded_mainloop**/ ma_ptr pMainLoop; + /*pa_mainloop**/ ma_ptr pMainLoop; /*pa_context**/ ma_ptr pPulseContext; } pulse; #endif @@ -3762,7 +3867,6 @@ struct ma_context ma_proc AudioUnitRender; /*AudioComponent*/ ma_ptr component; - ma_bool32 noAudioSessionDeactivate; /* For tracking whether or not the iOS audio session should be explicitly deactivated. Set from the config in ma_context_init__coreaudio(). */ } coreaudio; #endif @@ -3917,23 +4021,20 @@ struct ma_device ma_context* pContext; ma_device_type type; ma_uint32 sampleRate; - volatile ma_uint32 state; /* The state of the device is variable and can change at any time on any thread, so tell the compiler as such with `volatile`. */ + MA_ATOMIC ma_uint32 state; /* The state of the device is variable and can change at any time on any thread. Must be used atomically. */ ma_device_callback_proc onData; /* Set once at initialization time and should not be changed after. */ ma_stop_proc onStop; /* Set once at initialization time and should not be changed after. */ void* pUserData; /* Application defined data. */ - ma_mutex lock; + ma_mutex startStopLock; ma_event wakeupEvent; ma_event startEvent; ma_event stopEvent; ma_thread thread; ma_result workResult; /* This is set by the worker thread after it's finished doing a job. */ - ma_bool8 usingDefaultSampleRate; - ma_bool8 usingDefaultBufferSize; - ma_bool8 usingDefaultPeriods; ma_bool8 isOwnerOfContext; /* When set to true, uninitializing the device will also uninitialize the context. Set to true when NULL is passed into ma_device_init(). */ ma_bool8 noPreZeroedOutputBuffer; ma_bool8 noClip; - volatile float masterVolumeFactor; /* Volatile so we can use some thread safety when applying volume to periods. */ + MA_ATOMIC float masterVolumeFactor; /* Linear 0..1. Can be read and written simultaneously by different threads. Must be used atomically. */ ma_duplex_rb duplexRB; /* Intermediary buffer for duplex device on asynchronous backends. */ struct { @@ -3963,9 +4064,6 @@ struct ma_device ma_uint32 internalPeriods; ma_channel_mix_mode channelMixMode; ma_data_converter converter; - ma_bool8 usingDefaultFormat; - ma_bool8 usingDefaultChannels; - ma_bool8 usingDefaultChannelMap; } playback; struct { @@ -3983,9 +4081,6 @@ struct ma_device ma_uint32 internalPeriods; ma_channel_mix_mode channelMixMode; ma_data_converter converter; - ma_bool8 usingDefaultFormat; - ma_bool8 usingDefaultChannels; - ma_bool8 usingDefaultChannelMap; } capture; union @@ -3997,27 +4092,27 @@ struct ma_device /*IAudioClient**/ ma_ptr pAudioClientCapture; /*IAudioRenderClient**/ ma_ptr pRenderClient; /*IAudioCaptureClient**/ ma_ptr pCaptureClient; - /*IMMDeviceEnumerator**/ ma_ptr pDeviceEnumerator; /* Used for IMMNotificationClient notifications. Required for detecting default device changes. */ + /*IMMDeviceEnumerator**/ ma_ptr pDeviceEnumerator; /* Used for IMMNotificationClient notifications. Required for detecting default device changes. */ ma_IMMNotificationClient notificationClient; - /*HANDLE*/ ma_handle hEventPlayback; /* Auto reset. Initialized to signaled. */ - /*HANDLE*/ ma_handle hEventCapture; /* Auto reset. Initialized to unsignaled. */ - ma_uint32 actualPeriodSizeInFramesPlayback; /* Value from GetBufferSize(). internalPeriodSizeInFrames is not set to the _actual_ buffer size when low-latency shared mode is being used due to the way the IAudioClient3 API works. */ + /*HANDLE*/ ma_handle hEventPlayback; /* Auto reset. Initialized to signaled. */ + /*HANDLE*/ ma_handle hEventCapture; /* Auto reset. Initialized to unsignaled. */ + ma_uint32 actualPeriodSizeInFramesPlayback; /* Value from GetBufferSize(). internalPeriodSizeInFrames is not set to the _actual_ buffer size when low-latency shared mode is being used due to the way the IAudioClient3 API works. */ ma_uint32 actualPeriodSizeInFramesCapture; ma_uint32 originalPeriodSizeInFrames; ma_uint32 originalPeriodSizeInMilliseconds; ma_uint32 originalPeriods; ma_performance_profile originalPerformanceProfile; - volatile ma_bool32 hasDefaultPlaybackDeviceChanged; /* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */ - volatile ma_bool32 hasDefaultCaptureDeviceChanged; /* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */ ma_uint32 periodSizeInFramesPlayback; ma_uint32 periodSizeInFramesCapture; - volatile ma_bool32 isStartedCapture; /* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */ - volatile ma_bool32 isStartedPlayback; /* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */ - ma_bool8 noAutoConvertSRC; /* When set to true, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */ - ma_bool8 noDefaultQualitySRC; /* When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */ + MA_ATOMIC ma_bool32 isStartedCapture; /* Can be read and written simultaneously across different threads. Must be used atomically, and must be 32-bit. */ + MA_ATOMIC ma_bool32 isStartedPlayback; /* Can be read and written simultaneously across different threads. Must be used atomically, and must be 32-bit. */ + ma_bool8 noAutoConvertSRC; /* When set to true, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */ + ma_bool8 noDefaultQualitySRC; /* When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */ ma_bool8 noHardwareOffloading; ma_bool8 allowCaptureAutoStreamRouting; ma_bool8 allowPlaybackAutoStreamRouting; + ma_bool8 isDetachedPlayback; + ma_bool8 isDetachedCapture; } wasapi; #endif #ifdef MA_SUPPORT_DSOUND @@ -4063,7 +4158,6 @@ struct ma_device { /*pa_stream**/ ma_ptr pStreamPlayback; /*pa_stream**/ ma_ptr pStreamCapture; - ma_pcm_rb duplexRB; } pulse; #endif #ifdef MA_SUPPORT_JACK @@ -4089,11 +4183,11 @@ struct ma_device ma_uint32 originalPeriodSizeInFrames; ma_uint32 originalPeriodSizeInMilliseconds; ma_uint32 originalPeriods; + ma_performance_profile originalPerformanceProfile; ma_bool32 isDefaultPlaybackDevice; ma_bool32 isDefaultCaptureDevice; ma_bool32 isSwitchingPlaybackDevice; /* <-- Set to true when the default device has changed and miniaudio is in the process of switching. */ ma_bool32 isSwitchingCaptureDevice; /* <-- Set to true when the default device has changed and miniaudio is in the process of switching. */ - ma_pcm_rb duplexRB; void* pRouteChangeHandler; /* Only used on mobile platforms. Obj-C object for handling route changes. */ } coreaudio; #endif @@ -4125,7 +4219,6 @@ struct ma_device { /*AAudioStream**/ ma_ptr pStreamPlayback; /*AAudioStream**/ ma_ptr pStreamCapture; - ma_pcm_rb duplexRB; } aaudio; #endif #ifdef MA_SUPPORT_OPENSL @@ -4145,7 +4238,6 @@ struct ma_device ma_uint32 currentBufferIndexCapture; ma_uint8* pBufferPlayback; /* This is malloc()'d and is used for storing audio data. Typed as ma_uint8 for easy offsetting. */ ma_uint8* pBufferCapture; - ma_pcm_rb duplexRB; } opensl; #endif #ifdef MA_SUPPORT_WEBAUDIO @@ -4163,14 +4255,14 @@ struct ma_device ma_event operationCompletionEvent; ma_semaphore operationSemaphore; ma_uint32 operation; - volatile ma_result operationResult; + ma_result operationResult; ma_timer timer; double priorRunTime; ma_uint32 currentPeriodFramesRemainingPlayback; ma_uint32 currentPeriodFramesRemainingCapture; ma_uint64 lastProcessedFramePlayback; ma_uint64 lastProcessedFrameCapture; - volatile ma_bool32 isStarted; + MA_ATOMIC ma_bool32 isStarted; /* Read and written by multiple threads. Must be used atomically, and must be 32-bit for compiler compatibility. */ } null_device; #endif }; @@ -5045,7 +5137,7 @@ pDevice (in) Return Value ------------ -MA_SUCCESS if successful; any other error code otherwise. +Nothing Thread Safety @@ -5475,6 +5567,58 @@ callback. MA_API ma_result ma_device_handle_backend_data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uint32 frameCount); +/* +Calculates an appropriate buffer size from a descriptor, native sample rate and performance profile. + +This function is used by backends for helping determine an appropriately sized buffer to use with +the device depending on the values of `periodSizeInFrames` and `periodSizeInMilliseconds` in the +`pDescriptor` object. Since buffer size calculations based on time depends on the sample rate, a +best guess at the device's native sample rate is also required which is where `nativeSampleRate` +comes in. In addition, the performance profile is also needed for cases where both the period size +in frames and milliseconds are both zero. + + +Parameters +---------- +pDescriptor (in) + A pointer to device descriptor whose `periodSizeInFrames` and `periodSizeInMilliseconds` members + will be used for the calculation of the buffer size. + +nativeSampleRate (in) + The device's native sample rate. This is only ever used when the `periodSizeInFrames` member of + `pDescriptor` is zero. In this case, `periodSizeInMilliseconds` will be used instead, in which + case a sample rate is required to convert to a size in frames. + +performanceProfile (in) + When both the `periodSizeInFrames` and `periodSizeInMilliseconds` members of `pDescriptor` are + zero, miniaudio will fall back to a buffer size based on the performance profile. The profile + to use for this calculation is determine by this parameter. + + +Return Value +------------ +The calculated buffer size in frames. + + +Thread Safety +------------- +This is safe so long as nothing modifies `pDescriptor` at the same time. However, this function +should only ever be called from within the backend's device initialization routine and therefore +shouldn't have any multithreading concerns. + + +Callback Safety +--------------- +This is safe to call within the data callback, but there is no reason to ever do this. + + +Remarks +------- +If `nativeSampleRate` is zero, this function will fall back to `pDescriptor->sampleRate`. If that +is also zero, `MA_DEFAULT_SAMPLE_RATE` will be used instead. +*/ +MA_API ma_uint32 ma_calculate_buffer_size_in_frames_from_descriptor(const ma_device_descriptor* pDescriptor, ma_uint32 nativeSampleRate, ma_performance_profile performanceProfile); + /* @@ -5676,7 +5820,7 @@ Offsets a pointer by the specified number of PCM frames. */ MA_API void* ma_offset_pcm_frames_ptr(void* p, ma_uint64 offsetInFrames, ma_format format, ma_uint32 channels); MA_API const void* ma_offset_pcm_frames_const_ptr(const void* p, ma_uint64 offsetInFrames, ma_format format, ma_uint32 channels); -static MA_INLINE float* ma_offset_pcm_frames_ptr_f32(float* p, ma_uint64 offsetInFrames, ma_uint32 channels) { return (float*)ma_offset_pcm_frames_const_ptr((void*)p, offsetInFrames, ma_format_f32, channels); } +static MA_INLINE float* ma_offset_pcm_frames_ptr_f32(float* p, ma_uint64 offsetInFrames, ma_uint32 channels) { return (float*)ma_offset_pcm_frames_ptr((void*)p, offsetInFrames, ma_format_f32, channels); } static MA_INLINE const float* ma_offset_pcm_frames_const_ptr_f32(const float* p, ma_uint64 offsetInFrames, ma_uint32 channels) { return (const float*)ma_offset_pcm_frames_const_ptr((const void*)p, offsetInFrames, ma_format_f32, channels); } @@ -5752,6 +5896,29 @@ MA_API ma_result ma_data_source_get_cursor_in_pcm_frames(ma_data_source* pDataSo MA_API ma_result ma_data_source_get_length_in_pcm_frames(ma_data_source* pDataSource, ma_uint64* pLength); /* Returns MA_NOT_IMPLEMENTED if the length is unknown or cannot be determined. Decoders can return this. */ + + +typedef struct +{ + ma_data_source_callbacks ds; + ma_format format; + ma_uint32 channels; + ma_uint64 cursor; + ma_uint64 sizeInFrames; + const void* pData; +} ma_audio_buffer_ref; + +MA_API ma_result ma_audio_buffer_ref_init(ma_format format, ma_uint32 channels, const void* pData, ma_uint64 sizeInFrames, ma_audio_buffer_ref* pAudioBufferRef); +MA_API ma_result ma_audio_buffer_ref_set_data(ma_audio_buffer_ref* pAudioBufferRef, const void* pData, ma_uint64 sizeInFrames); +MA_API ma_uint64 ma_audio_buffer_ref_read_pcm_frames(ma_audio_buffer_ref* pAudioBufferRef, void* pFramesOut, ma_uint64 frameCount, ma_bool32 loop); +MA_API ma_result ma_audio_buffer_ref_seek_to_pcm_frame(ma_audio_buffer_ref* pAudioBufferRef, ma_uint64 frameIndex); +MA_API ma_result ma_audio_buffer_ref_map(ma_audio_buffer_ref* pAudioBufferRef, void** ppFramesOut, ma_uint64* pFrameCount); +MA_API ma_result ma_audio_buffer_ref_unmap(ma_audio_buffer_ref* pAudioBufferRef, ma_uint64 frameCount); /* Returns MA_AT_END if the end has been reached. This should be considered successful. */ +MA_API ma_result ma_audio_buffer_ref_at_end(ma_audio_buffer_ref* pAudioBufferRef); +MA_API ma_result ma_audio_buffer_ref_get_available_frames(ma_audio_buffer_ref* pAudioBufferRef, ma_uint64* pAvailableFrames); + + + typedef struct { ma_format format; @@ -5765,12 +5932,7 @@ MA_API ma_audio_buffer_config ma_audio_buffer_config_init(ma_format format, ma_u typedef struct { - ma_data_source_callbacks ds; - ma_format format; - ma_uint32 channels; - ma_uint64 cursor; - ma_uint64 sizeInFrames; - const void* pData; + ma_audio_buffer_ref ref; ma_allocation_callbacks allocationCallbacks; ma_bool32 ownsData; /* Used to control whether or not miniaudio owns the data buffer. If set to true, pData will be freed in ma_audio_buffer_uninit(). */ ma_uint8 _pExtraData[1]; /* For allocating a buffer with the memory located directly after the other memory of the structure. */ @@ -6572,22 +6734,45 @@ static MA_INLINE ma_bool32 ma_has_neon(void) #endif #endif +#if defined(__has_builtin) + #define MA_COMPILER_HAS_BUILTIN(x) __has_builtin(x) +#else + #define MA_COMPILER_HAS_BUILTIN(x) 0 +#endif + +#ifndef MA_ASSUME + #if MA_COMPILER_HAS_BUILTIN(__builtin_assume) + #define MA_ASSUME(x) __builtin_assume(x) + #elif MA_COMPILER_HAS_BUILTIN(__builtin_unreachable) + #define MA_ASSUME(x) do { if (!(x)) __builtin_unreachable(); } while (0) + #elif defined(_MSC_VER) + #define MA_ASSUME(x) __assume(x) + #else + #define MA_ASSUME(x) while(0) + #endif +#endif + +#ifndef MA_RESTRICT + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) + #define MA_RESTRICT __restrict + #else + #define MA_RESTRICT + #endif +#endif #if defined(_MSC_VER) && _MSC_VER >= 1400 #define MA_HAS_BYTESWAP16_INTRINSIC #define MA_HAS_BYTESWAP32_INTRINSIC #define MA_HAS_BYTESWAP64_INTRINSIC #elif defined(__clang__) - #if defined(__has_builtin) - #if __has_builtin(__builtin_bswap16) - #define MA_HAS_BYTESWAP16_INTRINSIC - #endif - #if __has_builtin(__builtin_bswap32) - #define MA_HAS_BYTESWAP32_INTRINSIC - #endif - #if __has_builtin(__builtin_bswap64) - #define MA_HAS_BYTESWAP64_INTRINSIC - #endif + #if MA_COMPILER_HAS_BUILTIN(__builtin_bswap16) + #define MA_HAS_BYTESWAP16_INTRINSIC + #endif + #if MA_COMPILER_HAS_BUILTIN(__builtin_bswap32) + #define MA_HAS_BYTESWAP32_INTRINSIC + #endif + #if MA_COMPILER_HAS_BUILTIN(__builtin_bswap64) + #define MA_HAS_BYTESWAP64_INTRINSIC #endif #elif defined(__GNUC__) #if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) @@ -6726,6 +6911,14 @@ static MA_INLINE void ma_yield() #endif +#ifndef MA_FLT_MAX + #ifdef FLT_MAX + #define MA_FLT_MAX FLT_MAX + #else + #define MA_FLT_MAX 3.402823466e+38F + #endif +#endif + #ifndef MA_PI #define MA_PI 3.14159265358979323846264f @@ -6785,28 +6978,44 @@ static MA_INLINE void ma_yield() #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-variable" #endif + /* Standard sample rates, in order of priority. */ static ma_uint32 g_maStandardSampleRatePriorities[] = { - MA_SAMPLE_RATE_48000, /* Most common */ - MA_SAMPLE_RATE_44100, + (ma_uint32)ma_standard_sample_rate_48000, + (ma_uint32)ma_standard_sample_rate_44100, - MA_SAMPLE_RATE_32000, /* Lows */ - MA_SAMPLE_RATE_24000, - MA_SAMPLE_RATE_22050, + (ma_uint32)ma_standard_sample_rate_32000, + (ma_uint32)ma_standard_sample_rate_24000, + (ma_uint32)ma_standard_sample_rate_22050, - MA_SAMPLE_RATE_88200, /* Highs */ - MA_SAMPLE_RATE_96000, - MA_SAMPLE_RATE_176400, - MA_SAMPLE_RATE_192000, + (ma_uint32)ma_standard_sample_rate_88200, + (ma_uint32)ma_standard_sample_rate_96000, + (ma_uint32)ma_standard_sample_rate_176400, + (ma_uint32)ma_standard_sample_rate_192000, - MA_SAMPLE_RATE_16000, /* Extreme lows */ - MA_SAMPLE_RATE_11025, - MA_SAMPLE_RATE_8000, + (ma_uint32)ma_standard_sample_rate_16000, + (ma_uint32)ma_standard_sample_rate_11025, + (ma_uint32)ma_standard_sample_rate_8000, - MA_SAMPLE_RATE_352800, /* Extreme highs */ - MA_SAMPLE_RATE_384000 + (ma_uint32)ma_standard_sample_rate_352800, + (ma_uint32)ma_standard_sample_rate_384000 }; +static MA_INLINE ma_bool32 ma_is_standard_sample_rate(ma_uint32 sampleRate) +{ + ma_uint32 iSampleRate; + + for (iSampleRate = 0; iSampleRate < sizeof(g_maStandardSampleRatePriorities) / sizeof(g_maStandardSampleRatePriorities[0]); iSampleRate += 1) { + if (g_maStandardSampleRatePriorities[iSampleRate] == sampleRate) { + return MA_TRUE; + } + } + + /* Getting here means the sample rate is not supported. */ + return MA_FALSE; +} + + static ma_format g_maFormatPriorities[] = { ma_format_s16, /* Most common */ ma_format_f32, @@ -6960,6 +7169,27 @@ static MA_INLINE float ma_log10f(float x) } +static MA_INLINE double ma_degrees_to_radians(double degrees) +{ + return degrees * 0.01745329252; +} + +static MA_INLINE double ma_radians_to_degrees(double radians) +{ + return radians * 57.295779512896; +} + +static MA_INLINE float ma_degrees_to_radians_f(float degrees) +{ + return degrees * 0.01745329252f; +} + +static MA_INLINE float ma_radians_to_degrees_f(float radians) +{ + return radians * 57.295779512896f; +} + + /* Return Values: 0: Success @@ -6996,6 +7226,35 @@ MA_API int ma_strcpy_s(char* dst, size_t dstSizeInBytes, const char* src) return 34; } +MA_API int ma_wcscpy_s(wchar_t* dst, size_t dstCap, const wchar_t* src) +{ + size_t i; + + if (dst == 0) { + return 22; + } + if (dstCap == 0) { + return 34; + } + if (src == 0) { + dst[0] = '\0'; + return 22; + } + + for (i = 0; i < dstCap && src[i] != '\0'; ++i) { + dst[i] = src[i]; + } + + if (i < dstCap) { + dst[i] = '\0'; + return 0; + } + + dst[0] = '\0'; + return 34; +} + + MA_API int ma_strncpy_s(char* dst, size_t dstSizeInBytes, const char* src, size_t count) { size_t maxcount; @@ -7240,6 +7499,19 @@ MA_API char* ma_copy_string(const char* src, const ma_allocation_callbacks* pAll return dst; } +MA_API wchar_t* ma_copy_string_w(const wchar_t* src, const ma_allocation_callbacks* pAllocationCallbacks) +{ + size_t sz = wcslen(src)+1; + wchar_t* dst = (wchar_t*)ma_malloc(sz * sizeof(*dst), pAllocationCallbacks); + if (dst == NULL) { + return NULL; + } + + ma_wcscpy_s(dst, sz, src); + + return dst; +} + #include static ma_result ma_result_from_errno(int e) @@ -7646,7 +7918,7 @@ static ma_result ma_result_from_errno(int e) MA_API ma_result ma_fopen(FILE** ppFile, const char* pFilePath, const char* pOpenMode) { -#if _MSC_VER && _MSC_VER >= 1400 +#if defined(_MSC_VER) && _MSC_VER >= 1400 errno_t err; #endif @@ -7658,7 +7930,7 @@ MA_API ma_result ma_fopen(FILE** ppFile, const char* pFilePath, const char* pOpe return MA_INVALID_ARGS; } -#if _MSC_VER && _MSC_VER >= 1400 +#if defined(_MSC_VER) && _MSC_VER >= 1400 err = fopen_s(ppFile, pFilePath, pOpenMode); if (err != 0) { return ma_result_from_errno(err); @@ -8135,7 +8407,6 @@ typedef unsigned int c89atomic_uint32; #endif typedef int c89atomic_memory_order; typedef unsigned char c89atomic_bool; -typedef unsigned char c89atomic_flag; #if !defined(C89ATOMIC_64BIT) && !defined(C89ATOMIC_32BIT) #ifdef _WIN32 #ifdef _WIN64 @@ -8182,6 +8453,10 @@ typedef unsigned char c89atomic_flag; #else #define C89ATOMIC_INLINE #endif +#define C89ATOMIC_HAS_8 +#define C89ATOMIC_HAS_16 +#define C89ATOMIC_HAS_32 +#define C89ATOMIC_HAS_64 #if (defined(_MSC_VER) ) || defined(__WATCOMC__) || defined(__DMC__) #define c89atomic_memory_order_relaxed 0 #define c89atomic_memory_order_consume 1 @@ -8189,147 +8464,18 @@ typedef unsigned char c89atomic_flag; #define c89atomic_memory_order_release 3 #define c89atomic_memory_order_acq_rel 4 #define c89atomic_memory_order_seq_cst 5 - #if _MSC_VER >= 1400 + #if _MSC_VER < 1600 && defined(C89ATOMIC_32BIT) + #define C89ATOMIC_MSVC_USE_INLINED_ASSEMBLY + #endif + #if _MSC_VER < 1600 + #undef C89ATOMIC_HAS_8 + #undef C89ATOMIC_HAS_16 + #endif + #if !defined(C89ATOMIC_MSVC_USE_INLINED_ASSEMBLY) #include - static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_exchange_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) - { - (void)order; - return (c89atomic_uint8)_InterlockedExchange8((volatile char*)dst, (char)src); - } - static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_exchange_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) - { - (void)order; - return (c89atomic_uint16)_InterlockedExchange16((volatile short*)dst, (short)src); - } - static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_exchange_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) - { - (void)order; - return (c89atomic_uint32)_InterlockedExchange((volatile long*)dst, (long)src); - } - #if defined(C89ATOMIC_64BIT) - static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_exchange_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) - { - (void)order; - return (c89atomic_uint64)_InterlockedExchange64((volatile long long*)dst, (long long)src); - } #endif - static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_add_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) - { - (void)order; - return (c89atomic_uint8)_InterlockedExchangeAdd8((volatile char*)dst, (char)src); - } - static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_add_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) - { - (void)order; - return (c89atomic_uint16)_InterlockedExchangeAdd16((volatile short*)dst, (short)src); - } - static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_add_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) - { - (void)order; - return (c89atomic_uint32)_InterlockedExchangeAdd((volatile long*)dst, (long)src); - } - #if defined(C89ATOMIC_64BIT) - static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_add_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) - { - (void)order; - return (c89atomic_uint64)_InterlockedExchangeAdd64((volatile long long*)dst, (long long)src); - } - #endif - #define c89atomic_compare_and_swap_8( dst, expected, desired) (c89atomic_uint8 )_InterlockedCompareExchange8 ((volatile char* )dst, (char )desired, (char )expected) - #define c89atomic_compare_and_swap_16(dst, expected, desired) (c89atomic_uint16)_InterlockedCompareExchange16((volatile short* )dst, (short )desired, (short )expected) - #define c89atomic_compare_and_swap_32(dst, expected, desired) (c89atomic_uint32)_InterlockedCompareExchange ((volatile long* )dst, (long )desired, (long )expected) - #define c89atomic_compare_and_swap_64(dst, expected, desired) (c89atomic_uint64)_InterlockedCompareExchange64((volatile long long*)dst, (long long)desired, (long long)expected) - #if defined(C89ATOMIC_X64) - #define c89atomic_thread_fence(order) __faststorefence(), (void)order - #else - static C89ATOMIC_INLINE void c89atomic_thread_fence(c89atomic_memory_order order) - { - volatile c89atomic_uint32 barrier = 0; - (void)order; - c89atomic_fetch_add_explicit_32(&barrier, 0, order); - } - #endif - #else - #if defined(C89ATOMIC_X86) - static C89ATOMIC_INLINE void __stdcall c89atomic_thread_fence(c89atomic_memory_order order) - { - (void)order; - __asm { - lock add [esp], 0 - } - } - static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_exchange_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) - { - c89atomic_uint8 result = 0; - (void)order; - __asm { - mov ecx, dst - mov al, src - lock xchg [ecx], al - mov result, al - } - return result; - } - static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_exchange_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) - { - c89atomic_uint16 result = 0; - (void)order; - __asm { - mov ecx, dst - mov ax, src - lock xchg [ecx], ax - mov result, ax - } - return result; - } - static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_exchange_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) - { - c89atomic_uint32 result = 0; - (void)order; - __asm { - mov ecx, dst - mov eax, src - lock xchg [ecx], eax - mov result, eax - } - return result; - } - static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_add_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) - { - c89atomic_uint8 result = 0; - (void)order; - __asm { - mov ecx, dst - mov al, src - lock xadd [ecx], al - mov result, al - } - return result; - } - static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_add_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) - { - c89atomic_uint16 result = 0; - (void)order; - __asm { - mov ecx, dst - mov ax, src - lock xadd [ecx], ax - mov result, ax - } - return result; - } - static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_add_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) - { - c89atomic_uint32 result = 0; - (void)order; - __asm { - mov ecx, dst - mov eax, src - lock xadd [ecx], eax - mov result, eax - } - return result; - } + #if defined(C89ATOMIC_MSVC_USE_INLINED_ASSEMBLY) + #if defined(C89ATOMIC_HAS_8) static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_compare_and_swap_8(volatile c89atomic_uint8* dst, c89atomic_uint8 expected, c89atomic_uint8 desired) { c89atomic_uint8 result = 0; @@ -8342,6 +8488,8 @@ typedef unsigned char c89atomic_flag; } return result; } + #endif + #if defined(C89ATOMIC_HAS_16) static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_compare_and_swap_16(volatile c89atomic_uint16* dst, c89atomic_uint16 expected, c89atomic_uint16 desired) { c89atomic_uint16 result = 0; @@ -8354,6 +8502,8 @@ typedef unsigned char c89atomic_flag; } return result; } + #endif + #if defined(C89ATOMIC_HAS_32) static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_compare_and_swap_32(volatile c89atomic_uint32* dst, c89atomic_uint32 expected, c89atomic_uint32 desired) { c89atomic_uint32 result = 0; @@ -8366,6 +8516,8 @@ typedef unsigned char c89atomic_flag; } return result; } + #endif + #if defined(C89ATOMIC_HAS_64) static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_compare_and_swap_64(volatile c89atomic_uint64* dst, c89atomic_uint64 expected, c89atomic_uint64 desired) { c89atomic_uint32 resultEAX = 0; @@ -8382,262 +8534,513 @@ typedef unsigned char c89atomic_flag; } return ((c89atomic_uint64)resultEDX << 32) | resultEAX; } + #endif + #else + #if defined(C89ATOMIC_HAS_8) + #define c89atomic_compare_and_swap_8( dst, expected, desired) (c89atomic_uint8 )_InterlockedCompareExchange8((volatile char*)dst, (char)desired, (char)expected) + #endif + #if defined(C89ATOMIC_HAS_16) + #define c89atomic_compare_and_swap_16(dst, expected, desired) (c89atomic_uint16)_InterlockedCompareExchange16((volatile short*)dst, (short)desired, (short)expected) + #endif + #if defined(C89ATOMIC_HAS_32) + #define c89atomic_compare_and_swap_32(dst, expected, desired) (c89atomic_uint32)_InterlockedCompareExchange((volatile long*)dst, (long)desired, (long)expected) + #endif + #if defined(C89ATOMIC_HAS_64) + #define c89atomic_compare_and_swap_64(dst, expected, desired) (c89atomic_uint64)_InterlockedCompareExchange64((volatile long long*)dst, (long long)desired, (long long)expected) + #endif + #endif + #if defined(C89ATOMIC_MSVC_USE_INLINED_ASSEMBLY) + #if defined(C89ATOMIC_HAS_8) + static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_exchange_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) + { + c89atomic_uint8 result = 0; + (void)order; + __asm { + mov ecx, dst + mov al, src + lock xchg [ecx], al + mov result, al + } + return result; + } + #endif + #if defined(C89ATOMIC_HAS_16) + static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_exchange_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) + { + c89atomic_uint16 result = 0; + (void)order; + __asm { + mov ecx, dst + mov ax, src + lock xchg [ecx], ax + mov result, ax + } + return result; + } + #endif + #if defined(C89ATOMIC_HAS_32) + static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_exchange_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) + { + c89atomic_uint32 result = 0; + (void)order; + __asm { + mov ecx, dst + mov eax, src + lock xchg [ecx], eax + mov result, eax + } + return result; + } + #endif + #else + #if defined(C89ATOMIC_HAS_8) + static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_exchange_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) + { + (void)order; + return (c89atomic_uint8)_InterlockedExchange8((volatile char*)dst, (char)src); + } + #endif + #if defined(C89ATOMIC_HAS_16) + static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_exchange_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) + { + (void)order; + return (c89atomic_uint16)_InterlockedExchange16((volatile short*)dst, (short)src); + } + #endif + #if defined(C89ATOMIC_HAS_32) + static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_exchange_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) + { + (void)order; + return (c89atomic_uint32)_InterlockedExchange((volatile long*)dst, (long)src); + } + #endif + #if defined(C89ATOMIC_HAS_64) && defined(C89ATOMIC_64BIT) + static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_exchange_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) + { + (void)order; + return (c89atomic_uint64)_InterlockedExchange64((volatile long long*)dst, (long long)src); + } #else - #error Unsupported architecture. + #endif + #endif + #if defined(C89ATOMIC_HAS_64) && !defined(C89ATOMIC_64BIT) + static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_exchange_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) + { + c89atomic_uint64 oldValue; + do { + oldValue = *dst; + } while (c89atomic_compare_and_swap_64(dst, oldValue, src) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_MSVC_USE_INLINED_ASSEMBLY) + #if defined(C89ATOMIC_HAS_8) + static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_add_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) + { + c89atomic_uint8 result = 0; + (void)order; + __asm { + mov ecx, dst + mov al, src + lock xadd [ecx], al + mov result, al + } + return result; + } + #endif + #if defined(C89ATOMIC_HAS_16) + static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_add_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) + { + c89atomic_uint16 result = 0; + (void)order; + __asm { + mov ecx, dst + mov ax, src + lock xadd [ecx], ax + mov result, ax + } + return result; + } + #endif + #if defined(C89ATOMIC_HAS_32) + static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_add_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) + { + c89atomic_uint32 result = 0; + (void)order; + __asm { + mov ecx, dst + mov eax, src + lock xadd [ecx], eax + mov result, eax + } + return result; + } + #endif + #else + #if defined(C89ATOMIC_HAS_8) + static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_add_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) + { + (void)order; + return (c89atomic_uint8)_InterlockedExchangeAdd8((volatile char*)dst, (char)src); + } + #endif + #if defined(C89ATOMIC_HAS_16) + static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_add_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) + { + (void)order; + return (c89atomic_uint16)_InterlockedExchangeAdd16((volatile short*)dst, (short)src); + } + #endif + #if defined(C89ATOMIC_HAS_32) + static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_add_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) + { + (void)order; + return (c89atomic_uint32)_InterlockedExchangeAdd((volatile long*)dst, (long)src); + } + #endif + #if defined(C89ATOMIC_HAS_64) && defined(C89ATOMIC_64BIT) + static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_add_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) + { + (void)order; + return (c89atomic_uint64)_InterlockedExchangeAdd64((volatile long long*)dst, (long long)src); + } + #else + #endif + #endif + #if defined(C89ATOMIC_HAS_64) && !defined(C89ATOMIC_64BIT) + static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_add_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) + { + c89atomic_uint64 oldValue; + c89atomic_uint64 newValue; + do { + oldValue = *dst; + newValue = oldValue + src; + } while (c89atomic_compare_and_swap_64(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_MSVC_USE_INLINED_ASSEMBLY) + static C89ATOMIC_INLINE void __stdcall c89atomic_thread_fence(c89atomic_memory_order order) + { + (void)order; + __asm { + lock add [esp], 0 + } + } + #else + #if defined(C89ATOMIC_X64) + #define c89atomic_thread_fence(order) __faststorefence(), (void)order + #else + static C89ATOMIC_INLINE void c89atomic_thread_fence(c89atomic_memory_order order) + { + volatile c89atomic_uint32 barrier = 0; + c89atomic_fetch_add_explicit_32(&barrier, 0, order); + } #endif #endif #define c89atomic_compiler_fence() c89atomic_thread_fence(c89atomic_memory_order_seq_cst) #define c89atomic_signal_fence(order) c89atomic_thread_fence(order) - static C89ATOMIC_INLINE c89atomic_uint8 c89atomic_load_explicit_8(volatile c89atomic_uint8* ptr, c89atomic_memory_order order) - { - (void)order; - return c89atomic_compare_and_swap_8(ptr, 0, 0); - } - static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_load_explicit_16(volatile c89atomic_uint16* ptr, c89atomic_memory_order order) - { - (void)order; - return c89atomic_compare_and_swap_16(ptr, 0, 0); - } - static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_load_explicit_32(volatile c89atomic_uint32* ptr, c89atomic_memory_order order) - { - (void)order; - return c89atomic_compare_and_swap_32(ptr, 0, 0); - } - static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_load_explicit_64(volatile c89atomic_uint64* ptr, c89atomic_memory_order order) - { - (void)order; - return c89atomic_compare_and_swap_64(ptr, 0, 0); - } - #define c89atomic_store_explicit_8( dst, src, order) (void)c89atomic_exchange_explicit_8 (dst, src, order) - #define c89atomic_store_explicit_16(dst, src, order) (void)c89atomic_exchange_explicit_16(dst, src, order) - #define c89atomic_store_explicit_32(dst, src, order) (void)c89atomic_exchange_explicit_32(dst, src, order) - #define c89atomic_store_explicit_64(dst, src, order) (void)c89atomic_exchange_explicit_64(dst, src, order) -#if defined(C89ATOMIC_32BIT) - static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_exchange_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) - { - volatile c89atomic_uint64 oldValue; - do { - oldValue = *dst; - } while (c89atomic_compare_and_swap_64(dst, oldValue, src) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_add_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) - { - volatile c89atomic_uint64 oldValue; - volatile c89atomic_uint64 newValue; - do { - oldValue = *dst; - newValue = oldValue + src; - } while (c89atomic_compare_and_swap_64(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } -#endif - static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_sub_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) - { - volatile c89atomic_uint8 oldValue; - volatile c89atomic_uint8 newValue; - do { - oldValue = *dst; - newValue = (c89atomic_uint8)(oldValue - src); - } while (c89atomic_compare_and_swap_8(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_sub_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) - { - volatile c89atomic_uint16 oldValue; - volatile c89atomic_uint16 newValue; - do { - oldValue = *dst; - newValue = (c89atomic_uint16)(oldValue - src); - } while (c89atomic_compare_and_swap_16(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_sub_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) - { - volatile c89atomic_uint32 oldValue; - volatile c89atomic_uint32 newValue; - do { - oldValue = *dst; - newValue = oldValue - src; - } while (c89atomic_compare_and_swap_32(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_sub_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) - { - volatile c89atomic_uint64 oldValue; - volatile c89atomic_uint64 newValue; - do { - oldValue = *dst; - newValue = oldValue - src; - } while (c89atomic_compare_and_swap_64(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_and_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) - { - volatile c89atomic_uint8 oldValue; - volatile c89atomic_uint8 newValue; - do { - oldValue = *dst; - newValue = (c89atomic_uint8)(oldValue & src); - } while (c89atomic_compare_and_swap_8(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_and_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) - { - volatile c89atomic_uint16 oldValue; - volatile c89atomic_uint16 newValue; - do { - oldValue = *dst; - newValue = (c89atomic_uint16)(oldValue & src); - } while (c89atomic_compare_and_swap_16(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_and_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) - { - volatile c89atomic_uint32 oldValue; - volatile c89atomic_uint32 newValue; - do { - oldValue = *dst; - newValue = oldValue & src; - } while (c89atomic_compare_and_swap_32(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_and_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) - { - volatile c89atomic_uint64 oldValue; - volatile c89atomic_uint64 newValue; - do { - oldValue = *dst; - newValue = oldValue & src; - } while (c89atomic_compare_and_swap_64(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_xor_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) - { - volatile c89atomic_uint8 oldValue; - volatile c89atomic_uint8 newValue; - do { - oldValue = *dst; - newValue = (c89atomic_uint8)(oldValue ^ src); - } while (c89atomic_compare_and_swap_8(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_xor_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) - { - volatile c89atomic_uint16 oldValue; - volatile c89atomic_uint16 newValue; - do { - oldValue = *dst; - newValue = (c89atomic_uint16)(oldValue ^ src); - } while (c89atomic_compare_and_swap_16(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_xor_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) - { - volatile c89atomic_uint32 oldValue; - volatile c89atomic_uint32 newValue; - do { - oldValue = *dst; - newValue = oldValue ^ src; - } while (c89atomic_compare_and_swap_32(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_xor_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) - { - volatile c89atomic_uint64 oldValue; - volatile c89atomic_uint64 newValue; - do { - oldValue = *dst; - newValue = oldValue ^ src; - } while (c89atomic_compare_and_swap_64(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_or_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) - { - volatile c89atomic_uint8 oldValue; - volatile c89atomic_uint8 newValue; - do { - oldValue = *dst; - newValue = (c89atomic_uint8)(oldValue | src); - } while (c89atomic_compare_and_swap_8(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_or_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) - { - volatile c89atomic_uint16 oldValue; - volatile c89atomic_uint16 newValue; - do { - oldValue = *dst; - newValue = (c89atomic_uint16)(oldValue | src); - } while (c89atomic_compare_and_swap_16(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_or_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) - { - volatile c89atomic_uint32 oldValue; - volatile c89atomic_uint32 newValue; - do { - oldValue = *dst; - newValue = oldValue | src; - } while (c89atomic_compare_and_swap_32(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_or_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) - { - volatile c89atomic_uint64 oldValue; - volatile c89atomic_uint64 newValue; - do { - oldValue = *dst; - newValue = oldValue | src; - } while (c89atomic_compare_and_swap_64(dst, oldValue, newValue) != oldValue); - (void)order; - return oldValue; - } - #define c89atomic_test_and_set_explicit_8( dst, order) c89atomic_exchange_explicit_8 (dst, 1, order) - #define c89atomic_test_and_set_explicit_16(dst, order) c89atomic_exchange_explicit_16(dst, 1, order) - #define c89atomic_test_and_set_explicit_32(dst, order) c89atomic_exchange_explicit_32(dst, 1, order) - #define c89atomic_test_and_set_explicit_64(dst, order) c89atomic_exchange_explicit_64(dst, 1, order) - #define c89atomic_clear_explicit_8( dst, order) c89atomic_store_explicit_8 (dst, 0, order) - #define c89atomic_clear_explicit_16(dst, order) c89atomic_store_explicit_16(dst, 0, order) - #define c89atomic_clear_explicit_32(dst, order) c89atomic_store_explicit_32(dst, 0, order) - #define c89atomic_clear_explicit_64(dst, order) c89atomic_store_explicit_64(dst, 0, order) - #define c89atomic_flag_test_and_set_explicit(ptr, order) (c89atomic_flag)c89atomic_test_and_set_explicit_8(ptr, order) - #define c89atomic_flag_clear_explicit(ptr, order) c89atomic_clear_explicit_8(ptr, order) + #if defined(C89ATOMIC_HAS_8) + static C89ATOMIC_INLINE c89atomic_uint8 c89atomic_load_explicit_8(volatile const c89atomic_uint8* ptr, c89atomic_memory_order order) + { + (void)order; + return c89atomic_compare_and_swap_8((c89atomic_uint8*)ptr, 0, 0); + } + #endif + #if defined(C89ATOMIC_HAS_16) + static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_load_explicit_16(volatile const c89atomic_uint16* ptr, c89atomic_memory_order order) + { + (void)order; + return c89atomic_compare_and_swap_16((c89atomic_uint16*)ptr, 0, 0); + } + #endif + #if defined(C89ATOMIC_HAS_32) + static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_load_explicit_32(volatile const c89atomic_uint32* ptr, c89atomic_memory_order order) + { + (void)order; + return c89atomic_compare_and_swap_32((c89atomic_uint32*)ptr, 0, 0); + } + #endif + #if defined(C89ATOMIC_HAS_64) + static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_load_explicit_64(volatile const c89atomic_uint64* ptr, c89atomic_memory_order order) + { + (void)order; + return c89atomic_compare_and_swap_64((c89atomic_uint64*)ptr, 0, 0); + } + #endif + #if defined(C89ATOMIC_HAS_8) + #define c89atomic_store_explicit_8( dst, src, order) (void)c89atomic_exchange_explicit_8 (dst, src, order) + #endif + #if defined(C89ATOMIC_HAS_16) + #define c89atomic_store_explicit_16(dst, src, order) (void)c89atomic_exchange_explicit_16(dst, src, order) + #endif + #if defined(C89ATOMIC_HAS_32) + #define c89atomic_store_explicit_32(dst, src, order) (void)c89atomic_exchange_explicit_32(dst, src, order) + #endif + #if defined(C89ATOMIC_HAS_64) + #define c89atomic_store_explicit_64(dst, src, order) (void)c89atomic_exchange_explicit_64(dst, src, order) + #endif + #if defined(C89ATOMIC_HAS_8) + static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_sub_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) + { + c89atomic_uint8 oldValue; + c89atomic_uint8 newValue; + do { + oldValue = *dst; + newValue = (c89atomic_uint8)(oldValue - src); + } while (c89atomic_compare_and_swap_8(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_16) + static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_sub_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) + { + c89atomic_uint16 oldValue; + c89atomic_uint16 newValue; + do { + oldValue = *dst; + newValue = (c89atomic_uint16)(oldValue - src); + } while (c89atomic_compare_and_swap_16(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_32) + static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_sub_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) + { + c89atomic_uint32 oldValue; + c89atomic_uint32 newValue; + do { + oldValue = *dst; + newValue = oldValue - src; + } while (c89atomic_compare_and_swap_32(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_64) + static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_sub_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) + { + c89atomic_uint64 oldValue; + c89atomic_uint64 newValue; + do { + oldValue = *dst; + newValue = oldValue - src; + } while (c89atomic_compare_and_swap_64(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_8) + static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_and_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) + { + c89atomic_uint8 oldValue; + c89atomic_uint8 newValue; + do { + oldValue = *dst; + newValue = (c89atomic_uint8)(oldValue & src); + } while (c89atomic_compare_and_swap_8(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_16) + static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_and_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) + { + c89atomic_uint16 oldValue; + c89atomic_uint16 newValue; + do { + oldValue = *dst; + newValue = (c89atomic_uint16)(oldValue & src); + } while (c89atomic_compare_and_swap_16(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_32) + static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_and_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) + { + c89atomic_uint32 oldValue; + c89atomic_uint32 newValue; + do { + oldValue = *dst; + newValue = oldValue & src; + } while (c89atomic_compare_and_swap_32(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_64) + static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_and_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) + { + c89atomic_uint64 oldValue; + c89atomic_uint64 newValue; + do { + oldValue = *dst; + newValue = oldValue & src; + } while (c89atomic_compare_and_swap_64(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_8) + static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_xor_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) + { + c89atomic_uint8 oldValue; + c89atomic_uint8 newValue; + do { + oldValue = *dst; + newValue = (c89atomic_uint8)(oldValue ^ src); + } while (c89atomic_compare_and_swap_8(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_16) + static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_xor_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) + { + c89atomic_uint16 oldValue; + c89atomic_uint16 newValue; + do { + oldValue = *dst; + newValue = (c89atomic_uint16)(oldValue ^ src); + } while (c89atomic_compare_and_swap_16(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_32) + static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_xor_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) + { + c89atomic_uint32 oldValue; + c89atomic_uint32 newValue; + do { + oldValue = *dst; + newValue = oldValue ^ src; + } while (c89atomic_compare_and_swap_32(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_64) + static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_xor_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) + { + c89atomic_uint64 oldValue; + c89atomic_uint64 newValue; + do { + oldValue = *dst; + newValue = oldValue ^ src; + } while (c89atomic_compare_and_swap_64(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_8) + static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_or_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) + { + c89atomic_uint8 oldValue; + c89atomic_uint8 newValue; + do { + oldValue = *dst; + newValue = (c89atomic_uint8)(oldValue | src); + } while (c89atomic_compare_and_swap_8(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_16) + static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_or_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) + { + c89atomic_uint16 oldValue; + c89atomic_uint16 newValue; + do { + oldValue = *dst; + newValue = (c89atomic_uint16)(oldValue | src); + } while (c89atomic_compare_and_swap_16(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_32) + static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_or_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) + { + c89atomic_uint32 oldValue; + c89atomic_uint32 newValue; + do { + oldValue = *dst; + newValue = oldValue | src; + } while (c89atomic_compare_and_swap_32(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_64) + static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_or_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) + { + c89atomic_uint64 oldValue; + c89atomic_uint64 newValue; + do { + oldValue = *dst; + newValue = oldValue | src; + } while (c89atomic_compare_and_swap_64(dst, oldValue, newValue) != oldValue); + (void)order; + return oldValue; + } + #endif + #if defined(C89ATOMIC_HAS_8) + #define c89atomic_test_and_set_explicit_8( dst, order) c89atomic_exchange_explicit_8 (dst, 1, order) + #endif + #if defined(C89ATOMIC_HAS_16) + #define c89atomic_test_and_set_explicit_16(dst, order) c89atomic_exchange_explicit_16(dst, 1, order) + #endif + #if defined(C89ATOMIC_HAS_32) + #define c89atomic_test_and_set_explicit_32(dst, order) c89atomic_exchange_explicit_32(dst, 1, order) + #endif + #if defined(C89ATOMIC_HAS_64) + #define c89atomic_test_and_set_explicit_64(dst, order) c89atomic_exchange_explicit_64(dst, 1, order) + #endif + #if defined(C89ATOMIC_HAS_8) + #define c89atomic_clear_explicit_8( dst, order) c89atomic_store_explicit_8 (dst, 0, order) + #endif + #if defined(C89ATOMIC_HAS_16) + #define c89atomic_clear_explicit_16(dst, order) c89atomic_store_explicit_16(dst, 0, order) + #endif + #if defined(C89ATOMIC_HAS_32) + #define c89atomic_clear_explicit_32(dst, order) c89atomic_store_explicit_32(dst, 0, order) + #endif + #if defined(C89ATOMIC_HAS_64) + #define c89atomic_clear_explicit_64(dst, order) c89atomic_store_explicit_64(dst, 0, order) + #endif + #if defined(C89ATOMIC_HAS_8) + typedef c89atomic_uint8 c89atomic_flag; + #define c89atomic_flag_test_and_set_explicit(ptr, order) (c89atomic_bool)c89atomic_test_and_set_explicit_8(ptr, order) + #define c89atomic_flag_clear_explicit(ptr, order) c89atomic_clear_explicit_8(ptr, order) + #define c89atoimc_flag_load_explicit(ptr, order) c89atomic_load_explicit_8(ptr, order) + #else + typedef c89atomic_uint32 c89atomic_flag; + #define c89atomic_flag_test_and_set_explicit(ptr, order) (c89atomic_bool)c89atomic_test_and_set_explicit_32(ptr, order) + #define c89atomic_flag_clear_explicit(ptr, order) c89atomic_clear_explicit_32(ptr, order) + #define c89atoimc_flag_load_explicit(ptr, order) c89atomic_load_explicit_32(ptr, order) + #endif #elif defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))) #define C89ATOMIC_HAS_NATIVE_COMPARE_EXCHANGE #define C89ATOMIC_HAS_NATIVE_IS_LOCK_FREE - #define c89atomic_memory_order_relaxed __ATOMIC_RELAXED - #define c89atomic_memory_order_consume __ATOMIC_CONSUME - #define c89atomic_memory_order_acquire __ATOMIC_ACQUIRE - #define c89atomic_memory_order_release __ATOMIC_RELEASE - #define c89atomic_memory_order_acq_rel __ATOMIC_ACQ_REL - #define c89atomic_memory_order_seq_cst __ATOMIC_SEQ_CST - #define c89atomic_compiler_fence() __asm__ __volatile__("":::"memory") - #define c89atomic_thread_fence(order) __atomic_thread_fence(order) - #define c89atomic_signal_fence(order) __atomic_signal_fence(order) - #define c89atomic_is_lock_free_8(ptr) __atomic_is_lock_free(1, ptr) - #define c89atomic_is_lock_free_16(ptr) __atomic_is_lock_free(2, ptr) - #define c89atomic_is_lock_free_32(ptr) __atomic_is_lock_free(4, ptr) - #define c89atomic_is_lock_free_64(ptr) __atomic_is_lock_free(8, ptr) - #define c89atomic_flag_test_and_set_explicit(dst, order) (c89atomic_flag)__atomic_test_and_set(dst, order) - #define c89atomic_flag_clear_explicit(dst, order) __atomic_clear(dst, order) + #define c89atomic_memory_order_relaxed __ATOMIC_RELAXED + #define c89atomic_memory_order_consume __ATOMIC_CONSUME + #define c89atomic_memory_order_acquire __ATOMIC_ACQUIRE + #define c89atomic_memory_order_release __ATOMIC_RELEASE + #define c89atomic_memory_order_acq_rel __ATOMIC_ACQ_REL + #define c89atomic_memory_order_seq_cst __ATOMIC_SEQ_CST + #define c89atomic_compiler_fence() __asm__ __volatile__("":::"memory") + #define c89atomic_thread_fence(order) __atomic_thread_fence(order) + #define c89atomic_signal_fence(order) __atomic_signal_fence(order) + #define c89atomic_is_lock_free_8(ptr) __atomic_is_lock_free(1, ptr) + #define c89atomic_is_lock_free_16(ptr) __atomic_is_lock_free(2, ptr) + #define c89atomic_is_lock_free_32(ptr) __atomic_is_lock_free(4, ptr) + #define c89atomic_is_lock_free_64(ptr) __atomic_is_lock_free(8, ptr) #define c89atomic_test_and_set_explicit_8( dst, order) __atomic_exchange_n(dst, 1, order) #define c89atomic_test_and_set_explicit_16(dst, order) __atomic_exchange_n(dst, 1, order) #define c89atomic_test_and_set_explicit_32(dst, order) __atomic_exchange_n(dst, 1, order) @@ -8690,6 +9093,10 @@ typedef unsigned char c89atomic_flag; #define c89atomic_compare_and_swap_16(dst, expected, desired) __sync_val_compare_and_swap(dst, expected, desired) #define c89atomic_compare_and_swap_32(dst, expected, desired) __sync_val_compare_and_swap(dst, expected, desired) #define c89atomic_compare_and_swap_64(dst, expected, desired) __sync_val_compare_and_swap(dst, expected, desired) + typedef c89atomic_uint8 c89atomic_flag; + #define c89atomic_flag_test_and_set_explicit(dst, order) (c89atomic_bool)__atomic_test_and_set(dst, order) + #define c89atomic_flag_clear_explicit(dst, order) __atomic_clear(dst, order) + #define c89atoimc_flag_load_explicit(ptr, order) c89atomic_load_explicit_8(ptr, order) #else #define c89atomic_memory_order_relaxed 1 #define c89atomic_memory_order_consume 2 @@ -8709,7 +9116,7 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_exchange_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) { - volatile c89atomic_uint16 oldValue; + c89atomic_uint16 oldValue; do { oldValue = *dst; } while (__sync_val_compare_and_swap(dst, oldValue, src) != oldValue); @@ -8718,7 +9125,7 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_exchange_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) { - volatile c89atomic_uint32 oldValue; + c89atomic_uint32 oldValue; do { oldValue = *dst; } while (__sync_val_compare_and_swap(dst, oldValue, src) != oldValue); @@ -8727,7 +9134,7 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_exchange_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) { - volatile c89atomic_uint64 oldValue; + c89atomic_uint64 oldValue; do { oldValue = *dst; } while (__sync_val_compare_and_swap(dst, oldValue, src) != oldValue); @@ -8749,87 +9156,87 @@ typedef unsigned char c89atomic_flag; (void)order; return __sync_fetch_and_add(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_add_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_fetch_add_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_add(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_sub_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint8 c89atomic_fetch_sub_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_sub(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_sub_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_fetch_sub_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_sub(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_sub_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_fetch_sub_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_sub(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_sub_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_fetch_sub_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_sub(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_or_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint8 c89atomic_fetch_or_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_or(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_or_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_fetch_or_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_or(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_or_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_fetch_or_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_or(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_or_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_fetch_or_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_or(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_xor_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint8 c89atomic_fetch_xor_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_xor(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_xor_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_fetch_xor_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_xor(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_xor_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_fetch_xor_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_xor(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_xor_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_fetch_xor_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_xor(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint8 __stdcall c89atomic_fetch_and_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint8 c89atomic_fetch_and_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_and(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint16 __stdcall c89atomic_fetch_and_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_fetch_and_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_and(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint32 __stdcall c89atomic_fetch_and_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_fetch_and_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_and(dst, src); } - static C89ATOMIC_INLINE c89atomic_uint64 __stdcall c89atomic_fetch_and_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_fetch_and_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) { (void)order; return __sync_fetch_and_and(dst, src); @@ -8848,7 +9255,7 @@ typedef unsigned char c89atomic_flag; #endif static C89ATOMIC_INLINE c89atomic_uint8 c89atomic_compare_and_swap_8(volatile c89atomic_uint8* dst, c89atomic_uint8 expected, c89atomic_uint8 desired) { - volatile c89atomic_uint8 result; + c89atomic_uint8 result; #if defined(C89ATOMIC_X86) || defined(C89ATOMIC_X64) __asm__ __volatile__("lock; cmpxchg %3, %0" : "+m"(*dst), "=a"(result) : "a"(expected), "d"(desired) : "cc"); #else @@ -8858,7 +9265,7 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_compare_and_swap_16(volatile c89atomic_uint16* dst, c89atomic_uint16 expected, c89atomic_uint16 desired) { - volatile c89atomic_uint16 result; + c89atomic_uint16 result; #if defined(C89ATOMIC_X86) || defined(C89ATOMIC_X64) __asm__ __volatile__("lock; cmpxchg %3, %0" : "+m"(*dst), "=a"(result) : "a"(expected), "d"(desired) : "cc"); #else @@ -8868,7 +9275,7 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_compare_and_swap_32(volatile c89atomic_uint32* dst, c89atomic_uint32 expected, c89atomic_uint32 desired) { - volatile c89atomic_uint32 result; + c89atomic_uint32 result; #if defined(C89ATOMIC_X86) || defined(C89ATOMIC_X64) __asm__ __volatile__("lock; cmpxchg %3, %0" : "+m"(*dst), "=a"(result) : "a"(expected), "d"(desired) : "cc"); #else @@ -8880,8 +9287,8 @@ typedef unsigned char c89atomic_flag; { volatile c89atomic_uint64 result; #if defined(C89ATOMIC_X86) - volatile c89atomic_uint32 resultEAX; - volatile c89atomic_uint32 resultEDX; + c89atomic_uint32 resultEAX; + c89atomic_uint32 resultEDX; __asm__ __volatile__("push %%ebx; xchg %5, %%ebx; lock; cmpxchg8b %0; pop %%ebx" : "+m"(*dst), "=a"(resultEAX), "=d"(resultEDX) : "a"(expected & 0xFFFFFFFF), "d"(expected >> 32), "r"(desired & 0xFFFFFFFF), "c"(desired >> 32) : "cc"); result = ((c89atomic_uint64)resultEDX << 32) | resultEAX; #elif defined(C89ATOMIC_X64) @@ -8893,7 +9300,7 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint8 c89atomic_exchange_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) { - volatile c89atomic_uint8 result = 0; + c89atomic_uint8 result = 0; (void)order; #if defined(C89ATOMIC_X86) || defined(C89ATOMIC_X64) __asm__ __volatile__("lock; xchg %1, %0" : "+m"(*dst), "=a"(result) : "a"(src)); @@ -8904,7 +9311,7 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_exchange_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) { - volatile c89atomic_uint16 result = 0; + c89atomic_uint16 result = 0; (void)order; #if defined(C89ATOMIC_X86) || defined(C89ATOMIC_X64) __asm__ __volatile__("lock; xchg %1, %0" : "+m"(*dst), "=a"(result) : "a"(src)); @@ -8915,7 +9322,7 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_exchange_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) { - volatile c89atomic_uint32 result; + c89atomic_uint32 result; (void)order; #if defined(C89ATOMIC_X86) || defined(C89ATOMIC_X64) __asm__ __volatile__("lock; xchg %1, %0" : "+m"(*dst), "=a"(result) : "a"(src)); @@ -8926,7 +9333,7 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_exchange_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) { - volatile c89atomic_uint64 result; + c89atomic_uint64 result; (void)order; #if defined(C89ATOMIC_X86) do { @@ -8975,8 +9382,8 @@ typedef unsigned char c89atomic_flag; static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_fetch_add_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) { #if defined(C89ATOMIC_X86) - volatile c89atomic_uint64 oldValue; - volatile c89atomic_uint64 newValue; + c89atomic_uint64 oldValue; + c89atomic_uint64 newValue; (void)order; do { oldValue = *dst; @@ -8984,7 +9391,7 @@ typedef unsigned char c89atomic_flag; } while (c89atomic_compare_and_swap_64(dst, oldValue, newValue) != oldValue); return oldValue; #elif defined(C89ATOMIC_X64) - volatile c89atomic_uint64 result; + c89atomic_uint64 result; (void)order; __asm__ __volatile__("lock; xadd %1, %0" : "+m"(*dst), "=a"(result) : "a"(src) : "cc"); return result; @@ -8992,8 +9399,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint8 c89atomic_fetch_sub_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) { - volatile c89atomic_uint8 oldValue; - volatile c89atomic_uint8 newValue; + c89atomic_uint8 oldValue; + c89atomic_uint8 newValue; do { oldValue = *dst; newValue = (c89atomic_uint8)(oldValue - src); @@ -9003,8 +9410,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_fetch_sub_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) { - volatile c89atomic_uint16 oldValue; - volatile c89atomic_uint16 newValue; + c89atomic_uint16 oldValue; + c89atomic_uint16 newValue; do { oldValue = *dst; newValue = (c89atomic_uint16)(oldValue - src); @@ -9014,8 +9421,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_fetch_sub_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) { - volatile c89atomic_uint32 oldValue; - volatile c89atomic_uint32 newValue; + c89atomic_uint32 oldValue; + c89atomic_uint32 newValue; do { oldValue = *dst; newValue = oldValue - src; @@ -9025,8 +9432,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_fetch_sub_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) { - volatile c89atomic_uint64 oldValue; - volatile c89atomic_uint64 newValue; + c89atomic_uint64 oldValue; + c89atomic_uint64 newValue; do { oldValue = *dst; newValue = oldValue - src; @@ -9036,8 +9443,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint8 c89atomic_fetch_and_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) { - volatile c89atomic_uint8 oldValue; - volatile c89atomic_uint8 newValue; + c89atomic_uint8 oldValue; + c89atomic_uint8 newValue; do { oldValue = *dst; newValue = (c89atomic_uint8)(oldValue & src); @@ -9047,8 +9454,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_fetch_and_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) { - volatile c89atomic_uint16 oldValue; - volatile c89atomic_uint16 newValue; + c89atomic_uint16 oldValue; + c89atomic_uint16 newValue; do { oldValue = *dst; newValue = (c89atomic_uint16)(oldValue & src); @@ -9058,8 +9465,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_fetch_and_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) { - volatile c89atomic_uint32 oldValue; - volatile c89atomic_uint32 newValue; + c89atomic_uint32 oldValue; + c89atomic_uint32 newValue; do { oldValue = *dst; newValue = oldValue & src; @@ -9069,8 +9476,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_fetch_and_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) { - volatile c89atomic_uint64 oldValue; - volatile c89atomic_uint64 newValue; + c89atomic_uint64 oldValue; + c89atomic_uint64 newValue; do { oldValue = *dst; newValue = oldValue & src; @@ -9080,8 +9487,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint8 c89atomic_fetch_xor_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) { - volatile c89atomic_uint8 oldValue; - volatile c89atomic_uint8 newValue; + c89atomic_uint8 oldValue; + c89atomic_uint8 newValue; do { oldValue = *dst; newValue = (c89atomic_uint8)(oldValue ^ src); @@ -9091,8 +9498,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_fetch_xor_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) { - volatile c89atomic_uint16 oldValue; - volatile c89atomic_uint16 newValue; + c89atomic_uint16 oldValue; + c89atomic_uint16 newValue; do { oldValue = *dst; newValue = (c89atomic_uint16)(oldValue ^ src); @@ -9102,8 +9509,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_fetch_xor_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) { - volatile c89atomic_uint32 oldValue; - volatile c89atomic_uint32 newValue; + c89atomic_uint32 oldValue; + c89atomic_uint32 newValue; do { oldValue = *dst; newValue = oldValue ^ src; @@ -9113,8 +9520,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_fetch_xor_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) { - volatile c89atomic_uint64 oldValue; - volatile c89atomic_uint64 newValue; + c89atomic_uint64 oldValue; + c89atomic_uint64 newValue; do { oldValue = *dst; newValue = oldValue ^ src; @@ -9124,8 +9531,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint8 c89atomic_fetch_or_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8 src, c89atomic_memory_order order) { - volatile c89atomic_uint8 oldValue; - volatile c89atomic_uint8 newValue; + c89atomic_uint8 oldValue; + c89atomic_uint8 newValue; do { oldValue = *dst; newValue = (c89atomic_uint8)(oldValue | src); @@ -9135,8 +9542,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_fetch_or_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16 src, c89atomic_memory_order order) { - volatile c89atomic_uint16 oldValue; - volatile c89atomic_uint16 newValue; + c89atomic_uint16 oldValue; + c89atomic_uint16 newValue; do { oldValue = *dst; newValue = (c89atomic_uint16)(oldValue | src); @@ -9146,8 +9553,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_fetch_or_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32 src, c89atomic_memory_order order) { - volatile c89atomic_uint32 oldValue; - volatile c89atomic_uint32 newValue; + c89atomic_uint32 oldValue; + c89atomic_uint32 newValue; do { oldValue = *dst; newValue = oldValue | src; @@ -9157,8 +9564,8 @@ typedef unsigned char c89atomic_flag; } static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_fetch_or_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64 src, c89atomic_memory_order order) { - volatile c89atomic_uint64 oldValue; - volatile c89atomic_uint64 newValue; + c89atomic_uint64 oldValue; + c89atomic_uint64 newValue; do { oldValue = *dst; newValue = oldValue | src; @@ -9168,25 +9575,25 @@ typedef unsigned char c89atomic_flag; } #endif #define c89atomic_signal_fence(order) c89atomic_thread_fence(order) - static C89ATOMIC_INLINE c89atomic_uint8 c89atomic_load_explicit_8(volatile c89atomic_uint8* ptr, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint8 c89atomic_load_explicit_8(volatile const c89atomic_uint8* ptr, c89atomic_memory_order order) { (void)order; - return c89atomic_compare_and_swap_8(ptr, 0, 0); + return c89atomic_compare_and_swap_8((c89atomic_uint8*)ptr, 0, 0); } - static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_load_explicit_16(volatile c89atomic_uint16* ptr, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint16 c89atomic_load_explicit_16(volatile const c89atomic_uint16* ptr, c89atomic_memory_order order) { (void)order; - return c89atomic_compare_and_swap_16(ptr, 0, 0); + return c89atomic_compare_and_swap_16((c89atomic_uint16*)ptr, 0, 0); } - static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_load_explicit_32(volatile c89atomic_uint32* ptr, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint32 c89atomic_load_explicit_32(volatile const c89atomic_uint32* ptr, c89atomic_memory_order order) { (void)order; - return c89atomic_compare_and_swap_32(ptr, 0, 0); + return c89atomic_compare_and_swap_32((c89atomic_uint32*)ptr, 0, 0); } - static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_load_explicit_64(volatile c89atomic_uint64* ptr, c89atomic_memory_order order) + static C89ATOMIC_INLINE c89atomic_uint64 c89atomic_load_explicit_64(volatile const c89atomic_uint64* ptr, c89atomic_memory_order order) { (void)order; - return c89atomic_compare_and_swap_64(ptr, 0, 0); + return c89atomic_compare_and_swap_64((c89atomic_uint64*)ptr, 0, 0); } #define c89atomic_store_explicit_8( dst, src, order) (void)c89atomic_exchange_explicit_8 (dst, src, order) #define c89atomic_store_explicit_16(dst, src, order) (void)c89atomic_exchange_explicit_16(dst, src, order) @@ -9200,74 +9607,84 @@ typedef unsigned char c89atomic_flag; #define c89atomic_clear_explicit_16(dst, order) c89atomic_store_explicit_16(dst, 0, order) #define c89atomic_clear_explicit_32(dst, order) c89atomic_store_explicit_32(dst, 0, order) #define c89atomic_clear_explicit_64(dst, order) c89atomic_store_explicit_64(dst, 0, order) - #define c89atomic_flag_test_and_set_explicit(ptr, order) (c89atomic_flag)c89atomic_test_and_set_explicit_8(ptr, order) + typedef c89atomic_uint8 c89atomic_flag; + #define c89atomic_flag_test_and_set_explicit(ptr, order) (c89atomic_bool)c89atomic_test_and_set_explicit_8(ptr, order) #define c89atomic_flag_clear_explicit(ptr, order) c89atomic_clear_explicit_8(ptr, order) + #define c89atoimc_flag_load_explicit(ptr, order) c89atomic_load_explicit_8(ptr, order) #endif #if !defined(C89ATOMIC_HAS_NATIVE_COMPARE_EXCHANGE) -c89atomic_bool c89atomic_compare_exchange_strong_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8* expected, c89atomic_uint8 desired, c89atomic_memory_order successOrder, c89atomic_memory_order failureOrder) -{ - c89atomic_uint8 expectedValue; - c89atomic_uint8 result; - (void)successOrder; - (void)failureOrder; - expectedValue = c89atomic_load_explicit_8(expected, c89atomic_memory_order_seq_cst); - result = c89atomic_compare_and_swap_8(dst, expectedValue, desired); - if (result == expectedValue) { - return 1; - } else { - c89atomic_store_explicit_8(expected, result, failureOrder); - return 0; - } -} -c89atomic_bool c89atomic_compare_exchange_strong_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16* expected, c89atomic_uint16 desired, c89atomic_memory_order successOrder, c89atomic_memory_order failureOrder) -{ - c89atomic_uint16 expectedValue; - c89atomic_uint16 result; - (void)successOrder; - (void)failureOrder; - expectedValue = c89atomic_load_explicit_16(expected, c89atomic_memory_order_seq_cst); - result = c89atomic_compare_and_swap_16(dst, expectedValue, desired); - if (result == expectedValue) { - return 1; - } else { - c89atomic_store_explicit_16(expected, result, failureOrder); - return 0; - } -} -c89atomic_bool c89atomic_compare_exchange_strong_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32* expected, c89atomic_uint32 desired, c89atomic_memory_order successOrder, c89atomic_memory_order failureOrder) -{ - c89atomic_uint32 expectedValue; - c89atomic_uint32 result; - (void)successOrder; - (void)failureOrder; - expectedValue = c89atomic_load_explicit_32(expected, c89atomic_memory_order_seq_cst); - result = c89atomic_compare_and_swap_32(dst, expectedValue, desired); - if (result == expectedValue) { - return 1; - } else { - c89atomic_store_explicit_32(expected, result, failureOrder); - return 0; - } -} -c89atomic_bool c89atomic_compare_exchange_strong_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64* expected, c89atomic_uint64 desired, c89atomic_memory_order successOrder, c89atomic_memory_order failureOrder) -{ - c89atomic_uint64 expectedValue; - c89atomic_uint64 result; - (void)successOrder; - (void)failureOrder; - expectedValue = c89atomic_load_explicit_64(expected, c89atomic_memory_order_seq_cst); - result = c89atomic_compare_and_swap_64(dst, expectedValue, desired); - if (result == expectedValue) { - return 1; - } else { - c89atomic_store_explicit_64(expected, result, failureOrder); - return 0; - } -} -#define c89atomic_compare_exchange_weak_explicit_8( dst, expected, desired, successOrder, failureOrder) c89atomic_compare_exchange_strong_explicit_8 (dst, expected, desired, successOrder, failureOrder) -#define c89atomic_compare_exchange_weak_explicit_16(dst, expected, desired, successOrder, failureOrder) c89atomic_compare_exchange_strong_explicit_16(dst, expected, desired, successOrder, failureOrder) -#define c89atomic_compare_exchange_weak_explicit_32(dst, expected, desired, successOrder, failureOrder) c89atomic_compare_exchange_strong_explicit_32(dst, expected, desired, successOrder, failureOrder) -#define c89atomic_compare_exchange_weak_explicit_64(dst, expected, desired, successOrder, failureOrder) c89atomic_compare_exchange_strong_explicit_64(dst, expected, desired, successOrder, failureOrder) + #if defined(C89ATOMIC_HAS_8) + c89atomic_bool c89atomic_compare_exchange_strong_explicit_8(volatile c89atomic_uint8* dst, c89atomic_uint8* expected, c89atomic_uint8 desired, c89atomic_memory_order successOrder, c89atomic_memory_order failureOrder) + { + c89atomic_uint8 expectedValue; + c89atomic_uint8 result; + (void)successOrder; + (void)failureOrder; + expectedValue = c89atomic_load_explicit_8(expected, c89atomic_memory_order_seq_cst); + result = c89atomic_compare_and_swap_8(dst, expectedValue, desired); + if (result == expectedValue) { + return 1; + } else { + c89atomic_store_explicit_8(expected, result, failureOrder); + return 0; + } + } + #endif + #if defined(C89ATOMIC_HAS_16) + c89atomic_bool c89atomic_compare_exchange_strong_explicit_16(volatile c89atomic_uint16* dst, c89atomic_uint16* expected, c89atomic_uint16 desired, c89atomic_memory_order successOrder, c89atomic_memory_order failureOrder) + { + c89atomic_uint16 expectedValue; + c89atomic_uint16 result; + (void)successOrder; + (void)failureOrder; + expectedValue = c89atomic_load_explicit_16(expected, c89atomic_memory_order_seq_cst); + result = c89atomic_compare_and_swap_16(dst, expectedValue, desired); + if (result == expectedValue) { + return 1; + } else { + c89atomic_store_explicit_16(expected, result, failureOrder); + return 0; + } + } + #endif + #if defined(C89ATOMIC_HAS_32) + c89atomic_bool c89atomic_compare_exchange_strong_explicit_32(volatile c89atomic_uint32* dst, c89atomic_uint32* expected, c89atomic_uint32 desired, c89atomic_memory_order successOrder, c89atomic_memory_order failureOrder) + { + c89atomic_uint32 expectedValue; + c89atomic_uint32 result; + (void)successOrder; + (void)failureOrder; + expectedValue = c89atomic_load_explicit_32(expected, c89atomic_memory_order_seq_cst); + result = c89atomic_compare_and_swap_32(dst, expectedValue, desired); + if (result == expectedValue) { + return 1; + } else { + c89atomic_store_explicit_32(expected, result, failureOrder); + return 0; + } + } + #endif + #if defined(C89ATOMIC_HAS_64) + c89atomic_bool c89atomic_compare_exchange_strong_explicit_64(volatile c89atomic_uint64* dst, c89atomic_uint64* expected, c89atomic_uint64 desired, c89atomic_memory_order successOrder, c89atomic_memory_order failureOrder) + { + c89atomic_uint64 expectedValue; + c89atomic_uint64 result; + (void)successOrder; + (void)failureOrder; + expectedValue = c89atomic_load_explicit_64(expected, c89atomic_memory_order_seq_cst); + result = c89atomic_compare_and_swap_64(dst, expectedValue, desired); + if (result == expectedValue) { + return 1; + } else { + c89atomic_store_explicit_64(expected, result, failureOrder); + return 0; + } + } + #endif + #define c89atomic_compare_exchange_weak_explicit_8( dst, expected, desired, successOrder, failureOrder) c89atomic_compare_exchange_strong_explicit_8 (dst, expected, desired, successOrder, failureOrder) + #define c89atomic_compare_exchange_weak_explicit_16(dst, expected, desired, successOrder, failureOrder) c89atomic_compare_exchange_strong_explicit_16(dst, expected, desired, successOrder, failureOrder) + #define c89atomic_compare_exchange_weak_explicit_32(dst, expected, desired, successOrder, failureOrder) c89atomic_compare_exchange_strong_explicit_32(dst, expected, desired, successOrder, failureOrder) + #define c89atomic_compare_exchange_weak_explicit_64(dst, expected, desired, successOrder, failureOrder) c89atomic_compare_exchange_strong_explicit_64(dst, expected, desired, successOrder, failureOrder) #endif #if !defined(C89ATOMIC_HAS_NATIVE_IS_LOCK_FREE) static C89ATOMIC_INLINE c89atomic_bool c89atomic_is_lock_free_8(volatile void* ptr) @@ -9415,26 +9832,26 @@ c89atomic_bool c89atomic_compare_exchange_strong_explicit_64(volatile c89atomic_ #define c89atomic_fetch_and_16(dst, src) c89atomic_fetch_and_explicit_16(dst, src, c89atomic_memory_order_seq_cst) #define c89atomic_fetch_and_32(dst, src) c89atomic_fetch_and_explicit_32(dst, src, c89atomic_memory_order_seq_cst) #define c89atomic_fetch_and_64(dst, src) c89atomic_fetch_and_explicit_64(dst, src, c89atomic_memory_order_seq_cst) -#define c89atomic_test_and_set_explicit_i8( ptr, order) c89atomic_test_and_set_explicit_8( (c89atomic_uint8* )ptr, order) -#define c89atomic_test_and_set_explicit_i16(ptr, order) c89atomic_test_and_set_explicit_16((c89atomic_uint16*)ptr, order) -#define c89atomic_test_and_set_explicit_i32(ptr, order) c89atomic_test_and_set_explicit_32((c89atomic_uint32*)ptr, order) -#define c89atomic_test_and_set_explicit_i64(ptr, order) c89atomic_test_and_set_explicit_64((c89atomic_uint64*)ptr, order) +#define c89atomic_test_and_set_explicit_i8( ptr, order) (c89atomic_int8 )c89atomic_test_and_set_explicit_8( (c89atomic_uint8* )ptr, order) +#define c89atomic_test_and_set_explicit_i16(ptr, order) (c89atomic_int16)c89atomic_test_and_set_explicit_16((c89atomic_uint16*)ptr, order) +#define c89atomic_test_and_set_explicit_i32(ptr, order) (c89atomic_int32)c89atomic_test_and_set_explicit_32((c89atomic_uint32*)ptr, order) +#define c89atomic_test_and_set_explicit_i64(ptr, order) (c89atomic_int64)c89atomic_test_and_set_explicit_64((c89atomic_uint64*)ptr, order) #define c89atomic_clear_explicit_i8( ptr, order) c89atomic_clear_explicit_8( (c89atomic_uint8* )ptr, order) #define c89atomic_clear_explicit_i16(ptr, order) c89atomic_clear_explicit_16((c89atomic_uint16*)ptr, order) #define c89atomic_clear_explicit_i32(ptr, order) c89atomic_clear_explicit_32((c89atomic_uint32*)ptr, order) #define c89atomic_clear_explicit_i64(ptr, order) c89atomic_clear_explicit_64((c89atomic_uint64*)ptr, order) -#define c89atomic_store_explicit_i8( dst, src, order) c89atomic_store_explicit_8( (c89atomic_uint8* )dst, (c89atomic_uint8 )src, order) -#define c89atomic_store_explicit_i16(dst, src, order) c89atomic_store_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16)src, order) -#define c89atomic_store_explicit_i32(dst, src, order) c89atomic_store_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32)src, order) -#define c89atomic_store_explicit_i64(dst, src, order) c89atomic_store_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64)src, order) -#define c89atomic_load_explicit_i8( ptr, order) c89atomic_load_explicit_8( (c89atomic_uint8* )ptr, order) -#define c89atomic_load_explicit_i16(ptr, order) c89atomic_load_explicit_16((c89atomic_uint16*)ptr, order) -#define c89atomic_load_explicit_i32(ptr, order) c89atomic_load_explicit_32((c89atomic_uint32*)ptr, order) -#define c89atomic_load_explicit_i64(ptr, order) c89atomic_load_explicit_64((c89atomic_uint64*)ptr, order) -#define c89atomic_exchange_explicit_i8( dst, src, order) c89atomic_exchange_explicit_8 ((c89atomic_uint8* )dst, (c89atomic_uint8 )src, order) -#define c89atomic_exchange_explicit_i16(dst, src, order) c89atomic_exchange_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16)src, order) -#define c89atomic_exchange_explicit_i32(dst, src, order) c89atomic_exchange_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32)src, order) -#define c89atomic_exchange_explicit_i64(dst, src, order) c89atomic_exchange_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64)src, order) +#define c89atomic_store_explicit_i8( dst, src, order) (c89atomic_int8 )c89atomic_store_explicit_8( (c89atomic_uint8* )dst, (c89atomic_uint8 )src, order) +#define c89atomic_store_explicit_i16(dst, src, order) (c89atomic_int16)c89atomic_store_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16)src, order) +#define c89atomic_store_explicit_i32(dst, src, order) (c89atomic_int32)c89atomic_store_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32)src, order) +#define c89atomic_store_explicit_i64(dst, src, order) (c89atomic_int64)c89atomic_store_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64)src, order) +#define c89atomic_load_explicit_i8( ptr, order) (c89atomic_int8 )c89atomic_load_explicit_8( (c89atomic_uint8* )ptr, order) +#define c89atomic_load_explicit_i16(ptr, order) (c89atomic_int16)c89atomic_load_explicit_16((c89atomic_uint16*)ptr, order) +#define c89atomic_load_explicit_i32(ptr, order) (c89atomic_int32)c89atomic_load_explicit_32((c89atomic_uint32*)ptr, order) +#define c89atomic_load_explicit_i64(ptr, order) (c89atomic_int64)c89atomic_load_explicit_64((c89atomic_uint64*)ptr, order) +#define c89atomic_exchange_explicit_i8( dst, src, order) (c89atomic_int8 )c89atomic_exchange_explicit_8 ((c89atomic_uint8* )dst, (c89atomic_uint8 )src, order) +#define c89atomic_exchange_explicit_i16(dst, src, order) (c89atomic_int16)c89atomic_exchange_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16)src, order) +#define c89atomic_exchange_explicit_i32(dst, src, order) (c89atomic_int32)c89atomic_exchange_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32)src, order) +#define c89atomic_exchange_explicit_i64(dst, src, order) (c89atomic_int64)c89atomic_exchange_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64)src, order) #define c89atomic_compare_exchange_strong_explicit_i8( dst, expected, desired, successOrder, failureOrder) c89atomic_compare_exchange_strong_explicit_8( (c89atomic_uint8* )dst, (c89atomic_uint8* )expected, (c89atomic_uint8 )desired, successOrder, failureOrder) #define c89atomic_compare_exchange_strong_explicit_i16(dst, expected, desired, successOrder, failureOrder) c89atomic_compare_exchange_strong_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16*)expected, (c89atomic_uint16)desired, successOrder, failureOrder) #define c89atomic_compare_exchange_strong_explicit_i32(dst, expected, desired, successOrder, failureOrder) c89atomic_compare_exchange_strong_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32*)expected, (c89atomic_uint32)desired, successOrder, failureOrder) @@ -9443,26 +9860,26 @@ c89atomic_bool c89atomic_compare_exchange_strong_explicit_64(volatile c89atomic_ #define c89atomic_compare_exchange_weak_explicit_i16(dst, expected, desired, successOrder, failureOrder) c89atomic_compare_exchange_weak_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16*)expected, (c89atomic_uint16)desired, successOrder, failureOrder) #define c89atomic_compare_exchange_weak_explicit_i32(dst, expected, desired, successOrder, failureOrder) c89atomic_compare_exchange_weak_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32*)expected, (c89atomic_uint32)desired, successOrder, failureOrder) #define c89atomic_compare_exchange_weak_explicit_i64(dst, expected, desired, successOrder, failureOrder) c89atomic_compare_exchange_weak_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64*)expected, (c89atomic_uint64)desired, successOrder, failureOrder) -#define c89atomic_fetch_add_explicit_i8( dst, src, order) c89atomic_fetch_add_explicit_8( (c89atomic_uint8* )dst, (c89atomic_uint8 )src, order) -#define c89atomic_fetch_add_explicit_i16(dst, src, order) c89atomic_fetch_add_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16)src, order) -#define c89atomic_fetch_add_explicit_i32(dst, src, order) c89atomic_fetch_add_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32)src, order) -#define c89atomic_fetch_add_explicit_i64(dst, src, order) c89atomic_fetch_add_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64)src, order) -#define c89atomic_fetch_sub_explicit_i8( dst, src, order) c89atomic_fetch_sub_explicit_8( (c89atomic_uint8* )dst, (c89atomic_uint8 )src, order) -#define c89atomic_fetch_sub_explicit_i16(dst, src, order) c89atomic_fetch_sub_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16)src, order) -#define c89atomic_fetch_sub_explicit_i32(dst, src, order) c89atomic_fetch_sub_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32)src, order) -#define c89atomic_fetch_sub_explicit_i64(dst, src, order) c89atomic_fetch_sub_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64)src, order) -#define c89atomic_fetch_or_explicit_i8( dst, src, order) c89atomic_fetch_or_explicit_8( (c89atomic_uint8* )dst, (c89atomic_uint8 )src, order) -#define c89atomic_fetch_or_explicit_i16(dst, src, order) c89atomic_fetch_or_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16)src, order) -#define c89atomic_fetch_or_explicit_i32(dst, src, order) c89atomic_fetch_or_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32)src, order) -#define c89atomic_fetch_or_explicit_i64(dst, src, order) c89atomic_fetch_or_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64)src, order) -#define c89atomic_fetch_xor_explicit_i8( dst, src, order) c89atomic_fetch_xor_explicit_8( (c89atomic_uint8* )dst, (c89atomic_uint8 )src, order) -#define c89atomic_fetch_xor_explicit_i16(dst, src, order) c89atomic_fetch_xor_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16)src, order) -#define c89atomic_fetch_xor_explicit_i32(dst, src, order) c89atomic_fetch_xor_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32)src, order) -#define c89atomic_fetch_xor_explicit_i64(dst, src, order) c89atomic_fetch_xor_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64)src, order) -#define c89atomic_fetch_and_explicit_i8( dst, src, order) c89atomic_fetch_and_explicit_8( (c89atomic_uint8* )dst, (c89atomic_uint8 )src, order) -#define c89atomic_fetch_and_explicit_i16(dst, src, order) c89atomic_fetch_and_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16)src, order) -#define c89atomic_fetch_and_explicit_i32(dst, src, order) c89atomic_fetch_and_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32)src, order) -#define c89atomic_fetch_and_explicit_i64(dst, src, order) c89atomic_fetch_and_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64)src, order) +#define c89atomic_fetch_add_explicit_i8( dst, src, order) (c89atomic_int8 )c89atomic_fetch_add_explicit_8( (c89atomic_uint8* )dst, (c89atomic_uint8 )src, order) +#define c89atomic_fetch_add_explicit_i16(dst, src, order) (c89atomic_int16)c89atomic_fetch_add_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16)src, order) +#define c89atomic_fetch_add_explicit_i32(dst, src, order) (c89atomic_int32)c89atomic_fetch_add_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32)src, order) +#define c89atomic_fetch_add_explicit_i64(dst, src, order) (c89atomic_int64)c89atomic_fetch_add_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64)src, order) +#define c89atomic_fetch_sub_explicit_i8( dst, src, order) (c89atomic_int8 )c89atomic_fetch_sub_explicit_8( (c89atomic_uint8* )dst, (c89atomic_uint8 )src, order) +#define c89atomic_fetch_sub_explicit_i16(dst, src, order) (c89atomic_int16)c89atomic_fetch_sub_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16)src, order) +#define c89atomic_fetch_sub_explicit_i32(dst, src, order) (c89atomic_int32)c89atomic_fetch_sub_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32)src, order) +#define c89atomic_fetch_sub_explicit_i64(dst, src, order) (c89atomic_int64)c89atomic_fetch_sub_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64)src, order) +#define c89atomic_fetch_or_explicit_i8( dst, src, order) (c89atomic_int8 )c89atomic_fetch_or_explicit_8( (c89atomic_uint8* )dst, (c89atomic_uint8 )src, order) +#define c89atomic_fetch_or_explicit_i16(dst, src, order) (c89atomic_int16)c89atomic_fetch_or_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16)src, order) +#define c89atomic_fetch_or_explicit_i32(dst, src, order) (c89atomic_int32)c89atomic_fetch_or_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32)src, order) +#define c89atomic_fetch_or_explicit_i64(dst, src, order) (c89atomic_int64)c89atomic_fetch_or_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64)src, order) +#define c89atomic_fetch_xor_explicit_i8( dst, src, order) (c89atomic_int8 )c89atomic_fetch_xor_explicit_8( (c89atomic_uint8* )dst, (c89atomic_uint8 )src, order) +#define c89atomic_fetch_xor_explicit_i16(dst, src, order) (c89atomic_int16)c89atomic_fetch_xor_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16)src, order) +#define c89atomic_fetch_xor_explicit_i32(dst, src, order) (c89atomic_int32)c89atomic_fetch_xor_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32)src, order) +#define c89atomic_fetch_xor_explicit_i64(dst, src, order) (c89atomic_int64)c89atomic_fetch_xor_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64)src, order) +#define c89atomic_fetch_and_explicit_i8( dst, src, order) (c89atomic_int8 )c89atomic_fetch_and_explicit_8( (c89atomic_uint8* )dst, (c89atomic_uint8 )src, order) +#define c89atomic_fetch_and_explicit_i16(dst, src, order) (c89atomic_int16)c89atomic_fetch_and_explicit_16((c89atomic_uint16*)dst, (c89atomic_uint16)src, order) +#define c89atomic_fetch_and_explicit_i32(dst, src, order) (c89atomic_int32)c89atomic_fetch_and_explicit_32((c89atomic_uint32*)dst, (c89atomic_uint32)src, order) +#define c89atomic_fetch_and_explicit_i64(dst, src, order) (c89atomic_int64)c89atomic_fetch_and_explicit_64((c89atomic_uint64*)dst, (c89atomic_uint64)src, order) #define c89atomic_test_and_set_i8( ptr) c89atomic_test_and_set_explicit_i8( ptr, c89atomic_memory_order_seq_cst) #define c89atomic_test_and_set_i16(ptr) c89atomic_test_and_set_explicit_i16(ptr, c89atomic_memory_order_seq_cst) #define c89atomic_test_and_set_i32(ptr) c89atomic_test_and_set_explicit_i32(ptr, c89atomic_memory_order_seq_cst) @@ -9563,14 +9980,14 @@ static C89ATOMIC_INLINE double c89atomic_exchange_explicit_f64(volatile double* r.i = c89atomic_exchange_explicit_64((volatile c89atomic_uint64*)dst, x.i, order); return r.f; } -#define c89atomic_clear_f32(ptr) c89atomic_clear_explicit_f32(ptr, c89atomic_memory_order_seq_cst) -#define c89atomic_clear_f64(ptr) c89atomic_clear_explicit_f64(ptr, c89atomic_memory_order_seq_cst) +#define c89atomic_clear_f32(ptr) (float )c89atomic_clear_explicit_f32(ptr, c89atomic_memory_order_seq_cst) +#define c89atomic_clear_f64(ptr) (double)c89atomic_clear_explicit_f64(ptr, c89atomic_memory_order_seq_cst) #define c89atomic_store_f32(dst, src) c89atomic_store_explicit_f32(dst, src, c89atomic_memory_order_seq_cst) #define c89atomic_store_f64(dst, src) c89atomic_store_explicit_f64(dst, src, c89atomic_memory_order_seq_cst) -#define c89atomic_load_f32(ptr) c89atomic_load_explicit_f32(ptr, c89atomic_memory_order_seq_cst) -#define c89atomic_load_f64(ptr) c89atomic_load_explicit_f64(ptr, c89atomic_memory_order_seq_cst) -#define c89atomic_exchange_f32(dst, src) c89atomic_exchange_explicit_f32(dst, src, c89atomic_memory_order_seq_cst) -#define c89atomic_exchange_f64(dst, src) c89atomic_exchange_explicit_f64(dst, src, c89atomic_memory_order_seq_cst) +#define c89atomic_load_f32(ptr) (float )c89atomic_load_explicit_f32(ptr, c89atomic_memory_order_seq_cst) +#define c89atomic_load_f64(ptr) (double)c89atomic_load_explicit_f64(ptr, c89atomic_memory_order_seq_cst) +#define c89atomic_exchange_f32(dst, src) (float )c89atomic_exchange_explicit_f32(dst, src, c89atomic_memory_order_seq_cst) +#define c89atomic_exchange_f64(dst, src) (double)c89atomic_exchange_explicit_f64(dst, src, c89atomic_memory_order_seq_cst) typedef c89atomic_flag c89atomic_spinlock; static C89ATOMIC_INLINE void c89atomic_spinlock_lock(volatile c89atomic_spinlock* pSpinlock) { @@ -9578,7 +9995,7 @@ static C89ATOMIC_INLINE void c89atomic_spinlock_lock(volatile c89atomic_spinlock if (c89atomic_flag_test_and_set_explicit(pSpinlock, c89atomic_memory_order_acquire) == 0) { break; } - while (c89atomic_load_explicit_8(pSpinlock, c89atomic_memory_order_relaxed) == 1) { + while (c89atoimc_flag_load_explicit(pSpinlock, c89atomic_memory_order_relaxed) == 1) { } } } @@ -9793,11 +10210,11 @@ static MA_INLINE ma_result ma_spinlock_lock_ex(volatile ma_spinlock* pSpinlock, } for (;;) { - if (c89atomic_flag_test_and_set_explicit(pSpinlock, c89atomic_memory_order_acquire) == 0) { + if (c89atomic_exchange_explicit_32(pSpinlock, 1, c89atomic_memory_order_acquire) == 0) { break; } - while (c89atomic_load_explicit_8(pSpinlock, c89atomic_memory_order_relaxed) == 1) { + while (c89atomic_load_explicit_32(pSpinlock, c89atomic_memory_order_relaxed) == 1) { if (yield) { ma_yield(); } @@ -9823,7 +10240,7 @@ MA_API ma_result ma_spinlock_unlock(volatile ma_spinlock* pSpinlock) return MA_INVALID_ARGS; } - c89atomic_flag_clear_explicit(pSpinlock, c89atomic_memory_order_release); + c89atomic_store_explicit_32(pSpinlock, 0, c89atomic_memory_order_release); return MA_SUCCESS; } @@ -9857,6 +10274,7 @@ static ma_result ma_thread_create__win32(ma_thread* pThread, ma_thread_priority static void ma_thread_wait__win32(ma_thread* pThread) { WaitForSingleObject((HANDLE)*pThread, INFINITE); + CloseHandle((HANDLE)*pThread); } @@ -10050,6 +10468,7 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority static void ma_thread_wait__posix(ma_thread* pThread) { pthread_join(*pThread, NULL); + pthread_detach(*pThread); } @@ -10500,76 +10919,22 @@ not officially supporting this, but I'm leaving it here in case it's useful for #endif #endif -/* -Check if we have the necessary development packages for each backend at the top so we can use this to determine whether or not -certain unused functions and variables can be excluded from the build to avoid warnings. -*/ -#ifdef MA_ENABLE_WASAPI - #define MA_HAS_WASAPI /* Every compiler should support WASAPI */ -#endif -#ifdef MA_ENABLE_DSOUND - #define MA_HAS_DSOUND /* Every compiler should support DirectSound. */ -#endif -#ifdef MA_ENABLE_WINMM - #define MA_HAS_WINMM /* Every compiler I'm aware of supports WinMM. */ -#endif -#ifdef MA_ENABLE_ALSA - #define MA_HAS_ALSA - #ifdef MA_NO_RUNTIME_LINKING - #ifdef __has_include - #if !__has_include() - #undef MA_HAS_ALSA - #endif - #endif - #endif -#endif -#ifdef MA_ENABLE_PULSEAUDIO - #define MA_HAS_PULSEAUDIO - #ifdef MA_NO_RUNTIME_LINKING - #ifdef __has_include - #if !__has_include() - #undef MA_HAS_PULSEAUDIO - #endif - #endif - #endif -#endif -#ifdef MA_ENABLE_JACK - #define MA_HAS_JACK - #ifdef MA_NO_RUNTIME_LINKING - #ifdef __has_include - #if !__has_include() - #undef MA_HAS_JACK - #endif - #endif - #endif -#endif -#ifdef MA_ENABLE_COREAUDIO - #define MA_HAS_COREAUDIO -#endif -#ifdef MA_ENABLE_SNDIO - #define MA_HAS_SNDIO -#endif -#ifdef MA_ENABLE_AUDIO4 - #define MA_HAS_AUDIO4 -#endif -#ifdef MA_ENABLE_OSS - #define MA_HAS_OSS -#endif -#ifdef MA_ENABLE_AAUDIO - #define MA_HAS_AAUDIO -#endif -#ifdef MA_ENABLE_OPENSL - #define MA_HAS_OPENSL -#endif -#ifdef MA_ENABLE_WEBAUDIO - #define MA_HAS_WEBAUDIO -#endif -#ifdef MA_ENABLE_CUSTOM - #define MA_HAS_CUSTOM -#endif -#ifdef MA_ENABLE_NULL - #define MA_HAS_NULL /* Everything supports the null backend. */ -#endif + +MA_API void ma_device_info_add_native_data_format(ma_device_info* pDeviceInfo, ma_format format, ma_uint32 channels, ma_uint32 sampleRate, ma_uint32 flags) +{ + if (pDeviceInfo == NULL) { + return; + } + + if (pDeviceInfo->nativeDataFormatCount < ma_countof(pDeviceInfo->nativeDataFormats)) { + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].format = format; + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].channels = channels; + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].sampleRate = sampleRate; + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].flags = flags; + pDeviceInfo->nativeDataFormatCount += 1; + } +} + MA_API const char* ma_get_backend_name(ma_backend backend) { @@ -11705,29 +12070,32 @@ static ma_bool32 ma_device_descriptor_is_valid(const ma_device_descriptor* pDevi } -/* TODO: Remove the pCallbacks parameter when we move all backends to the new callbacks system, at which time we can just reference the context directly. */ -static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice, ma_backend_callbacks* pCallbacks) +static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice) { ma_result result = MA_SUCCESS; ma_bool32 exitLoop = MA_FALSE; ma_uint8 capturedDeviceData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; ma_uint8 playbackDeviceData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 capturedDeviceDataCapInFrames = sizeof(capturedDeviceData) / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); - ma_uint32 playbackDeviceDataCapInFrames = sizeof(playbackDeviceData) / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); + ma_uint32 capturedDeviceDataCapInFrames = 0; + ma_uint32 playbackDeviceDataCapInFrames = 0; MA_ASSERT(pDevice != NULL); /* Just some quick validation on the device type and the available callbacks. */ if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex || pDevice->type == ma_device_type_loopback) { - if (pCallbacks->onDeviceRead == NULL) { + if (pDevice->pContext->callbacks.onDeviceRead == NULL) { return MA_NOT_IMPLEMENTED; } + + capturedDeviceDataCapInFrames = sizeof(capturedDeviceData) / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); } if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { - if (pCallbacks->onDeviceWrite == NULL) { + if (pDevice->pContext->callbacks.onDeviceWrite == NULL) { return MA_NOT_IMPLEMENTED; } + + playbackDeviceDataCapInFrames = sizeof(playbackDeviceData) / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); } /* NOTE: The device was started outside of this function, in the worker thread. */ @@ -11749,7 +12117,7 @@ static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice, capturedDeviceFramesToTryProcessing = capturedDeviceDataCapInFrames; } - result = pCallbacks->onDeviceRead(pDevice, capturedDeviceData, capturedDeviceFramesToTryProcessing, &capturedDeviceFramesToProcess); + result = pDevice->pContext->callbacks.onDeviceRead(pDevice, capturedDeviceData, capturedDeviceFramesToTryProcessing, &capturedDeviceFramesToProcess); if (result != MA_SUCCESS) { exitLoop = MA_TRUE; break; @@ -11796,7 +12164,7 @@ static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice, break; } - result = pCallbacks->onDeviceWrite(pDevice, playbackDeviceData, (ma_uint32)convertedDeviceFrameCount, NULL); /* Safe cast. */ + result = pDevice->pContext->callbacks.onDeviceWrite(pDevice, playbackDeviceData, (ma_uint32)convertedDeviceFrameCount, NULL); /* Safe cast. */ if (result != MA_SUCCESS) { exitLoop = MA_TRUE; break; @@ -11832,7 +12200,7 @@ static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice, framesToReadThisIteration = capturedDeviceDataCapInFrames; } - result = pCallbacks->onDeviceRead(pDevice, capturedDeviceData, framesToReadThisIteration, &framesProcessed); + result = pDevice->pContext->callbacks.onDeviceRead(pDevice, capturedDeviceData, framesToReadThisIteration, &framesProcessed); if (result != MA_SUCCESS) { exitLoop = MA_TRUE; break; @@ -11859,7 +12227,7 @@ static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice, ma_device__read_frames_from_client(pDevice, framesToWriteThisIteration, playbackDeviceData); - result = pCallbacks->onDeviceWrite(pDevice, playbackDeviceData, framesToWriteThisIteration, &framesProcessed); + result = pDevice->pContext->callbacks.onDeviceWrite(pDevice, playbackDeviceData, framesToWriteThisIteration, &framesProcessed); if (result != MA_SUCCESS) { exitLoop = MA_TRUE; break; @@ -11903,7 +12271,7 @@ static ma_thread_result MA_THREADCALL ma_device_thread__null(void* pData) ma_event_wait(&pDevice->null_device.operationEvent); /* At this point an event should have been triggered. */ - operation = c89atomic_load_32(&pDevice->null_device.operation); + operation = pDevice->null_device.operation; /* Starting the device needs to put the thread into a loop. */ if (operation == MA_DEVICE_OP_START__NULL) { @@ -11911,7 +12279,7 @@ static ma_thread_result MA_THREADCALL ma_device_thread__null(void* pData) ma_timer_init(&pDevice->null_device.timer); /* Getting here means a suspend or kill operation has been requested. */ - c89atomic_exchange_32((c89atomic_uint32*)&pDevice->null_device.operationResult, MA_SUCCESS); + pDevice->null_device.operationResult = MA_SUCCESS; ma_event_signal(&pDevice->null_device.operationCompletionEvent); ma_semaphore_release(&pDevice->null_device.operationSemaphore); continue; @@ -11924,7 +12292,7 @@ static ma_thread_result MA_THREADCALL ma_device_thread__null(void* pData) ma_timer_init(&pDevice->null_device.timer); /* We're done. */ - c89atomic_exchange_32((c89atomic_uint32*)&pDevice->null_device.operationResult, MA_SUCCESS); + pDevice->null_device.operationResult = MA_SUCCESS; ma_event_signal(&pDevice->null_device.operationCompletionEvent); ma_semaphore_release(&pDevice->null_device.operationSemaphore); continue; @@ -11932,7 +12300,7 @@ static ma_thread_result MA_THREADCALL ma_device_thread__null(void* pData) /* Killing the device means we need to get out of this loop so that this thread can terminate. */ if (operation == MA_DEVICE_OP_KILL__NULL) { - c89atomic_exchange_32((c89atomic_uint32*)&pDevice->null_device.operationResult, MA_SUCCESS); + pDevice->null_device.operationResult = MA_SUCCESS; ma_event_signal(&pDevice->null_device.operationCompletionEvent); ma_semaphore_release(&pDevice->null_device.operationSemaphore); break; @@ -11941,7 +12309,7 @@ static ma_thread_result MA_THREADCALL ma_device_thread__null(void* pData) /* Getting a signal on a "none" operation probably means an error. Return invalid operation. */ if (operation == MA_DEVICE_OP_NONE__NULL) { MA_ASSERT(MA_FALSE); /* <-- Trigger this in debug mode to ensure developers are aware they're doing something wrong (or there's a bug in a miniaudio). */ - c89atomic_exchange_32((c89atomic_uint32*)&pDevice->null_device.operationResult, (c89atomic_uint32)MA_INVALID_OPERATION); + pDevice->null_device.operationResult = MA_INVALID_OPERATION; ma_event_signal(&pDevice->null_device.operationCompletionEvent); ma_semaphore_release(&pDevice->null_device.operationSemaphore); continue; /* Continue the loop. Don't terminate. */ @@ -11955,6 +12323,12 @@ static ma_result ma_device_do_operation__null(ma_device* pDevice, ma_uint32 oper { ma_result result; + /* + TODO: Need to review this and consider just using mutual exclusion. I think the original motivation + for this was to just post the event to a queue and return immediately, but that has since changed + and now this function is synchronous. I think this can be simplified to just use a mutex. + */ + /* The first thing to do is wait for an operation slot to become available. We only have a single slot for this, but we could extend this later to support queing of operations. @@ -11968,7 +12342,7 @@ static ma_result ma_device_do_operation__null(ma_device* pDevice, ma_uint32 oper When we get here it means the background thread is not referencing the operation code and it can be changed. After changing this we need to signal an event to the worker thread to let it know that it can start work. */ - c89atomic_exchange_32(&pDevice->null_device.operation, operation); + pDevice->null_device.operation = operation; /* Once the operation code has been set, the worker thread can start work. */ if (ma_event_signal(&pDevice->null_device.operationEvent) != MA_SUCCESS) { @@ -11980,7 +12354,7 @@ static ma_result ma_device_do_operation__null(ma_device* pDevice, ma_uint32 oper return MA_ERROR; } - return c89atomic_load_i32(&pDevice->null_device.operationResult); + return pDevice->null_device.operationResult; } static ma_uint64 ma_device_get_total_run_time_in_frames__null(ma_device* pDevice) @@ -12068,23 +12442,6 @@ static ma_result ma_device_uninit__null(ma_device* pDevice) return MA_SUCCESS; } -static ma_uint32 ma_calculate_buffer_size_in_frames__null(const ma_device_config* pConfig, const ma_device_descriptor* pDescriptor) -{ - if (pDescriptor->periodSizeInFrames == 0) { - if (pDescriptor->periodSizeInMilliseconds == 0) { - if (pConfig->performanceProfile == ma_performance_profile_low_latency) { - return ma_calculate_buffer_size_in_frames_from_milliseconds(MA_DEFAULT_PERIOD_SIZE_IN_MILLISECONDS_LOW_LATENCY, pDescriptor->sampleRate); - } else { - return ma_calculate_buffer_size_in_frames_from_milliseconds(MA_DEFAULT_PERIOD_SIZE_IN_MILLISECONDS_CONSERVATIVE, pDescriptor->sampleRate); - } - } else { - return ma_calculate_buffer_size_in_frames_from_milliseconds(pDescriptor->periodSizeInMilliseconds, pDescriptor->sampleRate); - } - } else { - return pDescriptor->periodSizeInFrames; - } -} - static ma_result ma_device_init__null(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptorPlayback, ma_device_descriptor* pDescriptorCapture) { ma_result result; @@ -12107,7 +12464,7 @@ static ma_result ma_device_init__null(ma_device* pDevice, const ma_device_config ma_get_standard_channel_map(ma_standard_channel_map_default, pDescriptorCapture->channels, pDescriptorCapture->channelMap); } - pDescriptorCapture->periodSizeInFrames = ma_calculate_buffer_size_in_frames__null(pConfig, pDescriptorCapture); + pDescriptorCapture->periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptorCapture, pDescriptorCapture->sampleRate, pConfig->performanceProfile); } if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { @@ -12119,7 +12476,7 @@ static ma_result ma_device_init__null(ma_device* pDevice, const ma_device_config ma_get_standard_channel_map(ma_standard_channel_map_default, pDescriptorPlayback->channels, pDescriptorPlayback->channelMap); } - pDescriptorPlayback->periodSizeInFrames = ma_calculate_buffer_size_in_frames__null(pConfig, pDescriptorPlayback); + pDescriptorPlayback->periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptorPlayback, pDescriptorPlayback->sampleRate, pConfig->performanceProfile); } /* @@ -12346,7 +12703,7 @@ static ma_result ma_context_init__null(ma_context* pContext, const ma_context_co pCallbacks->onDeviceStop = ma_device_stop__null; pCallbacks->onDeviceRead = ma_device_read__null; pCallbacks->onDeviceWrite = ma_device_write__null; - pCallbacks->onDeviceAudioThread = NULL; /* Our backend is asynchronous with a blocking read-write API which means we can get miniaudio to deal with the audio thread. */ + pCallbacks->onDeviceDataLoop = NULL; /* Our backend is asynchronous with a blocking read-write API which means we can get miniaudio to deal with the audio thread. */ /* The null backend always works. */ return MA_SUCCESS; @@ -12636,6 +12993,8 @@ WASAPI Backend #endif #endif /* 0 */ +static ma_result ma_device_reroute__wasapi(ma_device* pDevice, ma_device_type deviceType); + /* Some compilers don't define VerifyVersionInfoW. Need to write this ourselves. */ #define MA_WIN32_WINNT_VISTA 0x0600 #define MA_VER_MINORVERSION 0x01 @@ -13157,7 +13516,7 @@ typedef struct struct ma_completion_handler_uwp { ma_completion_handler_uwp_vtbl* lpVtbl; - volatile ma_uint32 counter; + MA_ATOMIC ma_uint32 counter; HANDLE hEvent; }; @@ -13273,33 +13632,83 @@ static ULONG STDMETHODCALLTYPE ma_IMMNotificationClient_Release(ma_IMMNotificati static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDeviceStateChanged(ma_IMMNotificationClient* pThis, LPCWSTR pDeviceID, DWORD dwNewState) { ma_bool32 isThisDevice = MA_FALSE; + ma_bool32 isCapture = MA_FALSE; + ma_bool32 isPlayback = MA_FALSE; + #ifdef MA_DEBUG_OUTPUT - /*printf("IMMNotificationClient_OnDeviceStateChanged(pDeviceID=%S, dwNewState=%u)\n", (pDeviceID != NULL) ? pDeviceID : L"(NULL)", (unsigned int)dwNewState);*/ + printf("IMMNotificationClient_OnDeviceStateChanged(pDeviceID=%S, dwNewState=%u)\n", (pDeviceID != NULL) ? pDeviceID : L"(NULL)", (unsigned int)dwNewState); #endif - if ((dwNewState & MA_MM_DEVICE_STATE_ACTIVE) != 0) { - return S_OK; - } - /* There have been reports of a hang when a playback device is disconnected. The idea with this code is to explicitly stop the device if we detect that the device is disabled or has been unplugged. */ if (pThis->pDevice->wasapi.allowCaptureAutoStreamRouting && (pThis->pDevice->type == ma_device_type_capture || pThis->pDevice->type == ma_device_type_duplex || pThis->pDevice->type == ma_device_type_loopback)) { + isCapture = MA_TRUE; if (wcscmp(pThis->pDevice->capture.id.wasapi, pDeviceID) == 0) { isThisDevice = MA_TRUE; } } if (pThis->pDevice->wasapi.allowPlaybackAutoStreamRouting && (pThis->pDevice->type == ma_device_type_playback || pThis->pDevice->type == ma_device_type_duplex)) { + isPlayback = MA_TRUE; if (wcscmp(pThis->pDevice->playback.id.wasapi, pDeviceID) == 0) { isThisDevice = MA_TRUE; } } + + /* + If the device ID matches our device we need to mark our device as detached and stop it. When a + device is added in OnDeviceAdded(), we'll restart it. We only mark it as detached if the device + was started at the time of being removed. + */ if (isThisDevice) { - ma_device_stop(pThis->pDevice); + if ((dwNewState & MA_MM_DEVICE_STATE_ACTIVE) == 0) { + /* + Unplugged or otherwise unavailable. Mark as detached if we were in a playing state. We'll + use this to determine whether or not we need to automatically start the device when it's + plugged back in again. + */ + if (ma_device_get_state(pThis->pDevice) == MA_STATE_STARTED) { + if (isPlayback) { + pThis->pDevice->wasapi.isDetachedPlayback = MA_TRUE; + } + if (isCapture) { + pThis->pDevice->wasapi.isDetachedCapture = MA_TRUE; + } + + ma_device_stop(pThis->pDevice); + } + } + + if ((dwNewState & MA_MM_DEVICE_STATE_ACTIVE) != 0) { + /* The device was activated. If we were detached, we need to start it again. */ + ma_bool8 tryRestartingDevice = MA_FALSE; + + if (isPlayback) { + if (pThis->pDevice->wasapi.isDetachedPlayback) { + pThis->pDevice->wasapi.isDetachedPlayback = MA_FALSE; + ma_device_reroute__wasapi(pThis->pDevice, ma_device_type_playback); + tryRestartingDevice = MA_TRUE; + } + } + + if (isCapture) { + if (pThis->pDevice->wasapi.isDetachedCapture) { + pThis->pDevice->wasapi.isDetachedCapture = MA_FALSE; + ma_device_reroute__wasapi(pThis->pDevice, (pThis->pDevice->type == ma_device_type_loopback) ? ma_device_type_loopback : ma_device_type_capture); + tryRestartingDevice = MA_TRUE; + } + } + + if (tryRestartingDevice) { + if (pThis->pDevice->wasapi.isDetachedPlayback == MA_FALSE && pThis->pDevice->wasapi.isDetachedCapture == MA_FALSE) { + ma_device_start(pThis->pDevice); + } + } + } } return S_OK; @@ -13320,7 +13729,7 @@ static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDeviceAdded(ma_IMMNo static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDeviceRemoved(ma_IMMNotificationClient* pThis, LPCWSTR pDeviceID) { #ifdef MA_DEBUG_OUTPUT - /*printf("IMMNotificationClient_OnDeviceRemoved(pDeviceID=%S)\n", (pDeviceID != NULL) ? pDeviceID : L"(NULL)");*/ + printf("IMMNotificationClient_OnDeviceRemoved(pDeviceID=%S)\n", (pDeviceID != NULL) ? pDeviceID : L"(NULL)"); #endif /* We don't need to worry about this event for our purposes. */ @@ -13332,23 +13741,32 @@ static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDeviceRemoved(ma_IMM static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDefaultDeviceChanged(ma_IMMNotificationClient* pThis, ma_EDataFlow dataFlow, ma_ERole role, LPCWSTR pDefaultDeviceID) { #ifdef MA_DEBUG_OUTPUT - /*printf("IMMNotificationClient_OnDefaultDeviceChanged(dataFlow=%d, role=%d, pDefaultDeviceID=%S)\n", dataFlow, role, (pDefaultDeviceID != NULL) ? pDefaultDeviceID : L"(NULL)");*/ + printf("IMMNotificationClient_OnDefaultDeviceChanged(dataFlow=%d, role=%d, pDefaultDeviceID=%S)\n", dataFlow, role, (pDefaultDeviceID != NULL) ? pDefaultDeviceID : L"(NULL)"); #endif /* We only ever use the eConsole role in miniaudio. */ if (role != ma_eConsole) { + #ifdef MA_DEBUG_OUTPUT + printf("[WASAPI] Stream rerouting: role != eConsole\n"); + #endif return S_OK; } /* We only care about devices with the same data flow and role as the current device. */ if ((pThis->pDevice->type == ma_device_type_playback && dataFlow != ma_eRender) || (pThis->pDevice->type == ma_device_type_capture && dataFlow != ma_eCapture)) { + #ifdef MA_DEBUG_OUTPUT + printf("[WASAPI] Stream rerouting abandoned because dataFlow does match device type.\n"); + #endif return S_OK; } /* Don't do automatic stream routing if we're not allowed. */ if ((dataFlow == ma_eRender && pThis->pDevice->wasapi.allowPlaybackAutoStreamRouting == MA_FALSE) || (dataFlow == ma_eCapture && pThis->pDevice->wasapi.allowCaptureAutoStreamRouting == MA_FALSE)) { + #ifdef MA_DEBUG_OUTPUT + printf("[WASAPI] Stream rerouting abandoned because automatic stream routing has been disabled by the device config.\n"); + #endif return S_OK; } @@ -13359,22 +13777,62 @@ static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDefaultDeviceChanged */ if ((dataFlow == ma_eRender && pThis->pDevice->playback.shareMode == ma_share_mode_exclusive) || (dataFlow == ma_eCapture && pThis->pDevice->capture.shareMode == ma_share_mode_exclusive)) { + #ifdef MA_DEBUG_OUTPUT + printf("[WASAPI] Stream rerouting abandoned because the device shared mode is exclusive.\n"); + #endif return S_OK; } + + + /* - We don't change the device here - we change it in the worker thread to keep synchronization simple. To do this I'm just setting a flag to - indicate that the default device has changed. Loopback devices are treated as capture devices so we need to do a bit of a dance to handle - that properly. + Second attempt at device rerouting. We're going to retrieve the device's state at the time of + the route change. We're then going to stop the device, reinitialize the device, and then start + it again if the state before stopping was MA_STATE_STARTED. */ - if (dataFlow == ma_eRender && pThis->pDevice->type != ma_device_type_loopback) { - c89atomic_exchange_32(&pThis->pDevice->wasapi.hasDefaultPlaybackDeviceChanged, MA_TRUE); - } - if (dataFlow == ma_eCapture || pThis->pDevice->type == ma_device_type_loopback) { - c89atomic_exchange_32(&pThis->pDevice->wasapi.hasDefaultCaptureDeviceChanged, MA_TRUE); + { + ma_uint32 previousState = ma_device_get_state(pThis->pDevice); + ma_bool8 restartDevice = MA_FALSE; + + if (previousState == MA_STATE_STARTED) { + ma_device_stop(pThis->pDevice); + restartDevice = MA_TRUE; + } + + if (pDefaultDeviceID != NULL) { /* <-- The input device ID will be null if there's no other device available. */ + if (dataFlow == ma_eRender) { + ma_device_reroute__wasapi(pThis->pDevice, ma_device_type_playback); + + if (pThis->pDevice->wasapi.isDetachedPlayback) { + pThis->pDevice->wasapi.isDetachedPlayback = MA_FALSE; + + if (pThis->pDevice->type == ma_device_type_duplex && pThis->pDevice->wasapi.isDetachedCapture) { + restartDevice = MA_FALSE; /* It's a duplex device and the capture side is detached. We cannot be restarting the device just yet. */ + } else { + restartDevice = MA_TRUE; /* It's not a duplex device, or the capture side is also attached so we can go ahead and restart the device. */ + } + } + } else { + ma_device_reroute__wasapi(pThis->pDevice, (pThis->pDevice->type == ma_device_type_loopback) ? ma_device_type_loopback : ma_device_type_capture); + + if (pThis->pDevice->wasapi.isDetachedCapture) { + pThis->pDevice->wasapi.isDetachedCapture = MA_FALSE; + + if (pThis->pDevice->type == ma_device_type_duplex && pThis->pDevice->wasapi.isDetachedPlayback) { + restartDevice = MA_FALSE; /* It's a duplex device and the playback side is detached. We cannot be restarting the device just yet. */ + } else { + restartDevice = MA_TRUE; /* It's not a duplex device, or the playback side is also attached so we can go ahead and restart the device. */ + } + } + } + + if (restartDevice) { + ma_device_start(pThis->pDevice); + } + } } - (void)pDefaultDeviceID; return S_OK; } @@ -13409,6 +13867,189 @@ typedef ma_IUnknown ma_WASAPIDeviceInterface; #endif +#define MA_CONTEXT_COMMAND_QUIT__WASAPI 1 +#define MA_CONTEXT_COMMAND_CREATE_IAUDIOCLIENT__WASAPI 2 +#define MA_CONTEXT_COMMAND_RELEASE_IAUDIOCLIENT__WASAPI 3 + +static ma_context_command__wasapi ma_context_init_command__wasapi(int code) +{ + ma_context_command__wasapi cmd; + + MA_ZERO_OBJECT(&cmd); + cmd.code = code; + + return cmd; +} + +static ma_result ma_context_post_command__wasapi(ma_context* pContext, const ma_context_command__wasapi* pCmd) +{ + /* For now we are doing everything synchronously, but I might relax this later if the need arises. */ + ma_result result; + ma_bool32 isUsingLocalEvent = MA_FALSE; + ma_event localEvent; + + MA_ASSERT(pContext != NULL); + MA_ASSERT(pCmd != NULL); + + if (pCmd->pEvent == NULL) { + isUsingLocalEvent = MA_TRUE; + + result = ma_event_init(&localEvent); + if (result != MA_SUCCESS) { + return result; /* Failed to create the event for this command. */ + } + } + + /* Here is where we add the command to the list. If there's not enough room we'll spin until there is. */ + ma_mutex_lock(&pContext->wasapi.commandLock); + { + ma_uint32 index; + + /* Spin until we've got some space available. */ + while (pContext->wasapi.commandCount == ma_countof(pContext->wasapi.commands)) { + ma_yield(); + } + + /* Space is now available. Can safely add to the list. */ + index = (pContext->wasapi.commandIndex + pContext->wasapi.commandCount) % ma_countof(pContext->wasapi.commands); + pContext->wasapi.commands[index] = *pCmd; + pContext->wasapi.commands[index].pEvent = &localEvent; + pContext->wasapi.commandCount += 1; + + /* Now that the command has been added, release the semaphore so ma_context_next_command__wasapi() can return. */ + ma_semaphore_release(&pContext->wasapi.commandSem); + } + ma_mutex_unlock(&pContext->wasapi.commandLock); + + if (isUsingLocalEvent) { + ma_event_wait(&localEvent); + ma_event_uninit(&localEvent); + } + + return MA_SUCCESS; +} + +static ma_result ma_context_next_command__wasapi(ma_context* pContext, ma_context_command__wasapi* pCmd) +{ + ma_result result = MA_SUCCESS; + + MA_ASSERT(pContext != NULL); + MA_ASSERT(pCmd != NULL); + + result = ma_semaphore_wait(&pContext->wasapi.commandSem); + if (result == MA_SUCCESS) { + ma_mutex_lock(&pContext->wasapi.commandLock); + { + *pCmd = pContext->wasapi.commands[pContext->wasapi.commandIndex]; + pContext->wasapi.commandIndex = (pContext->wasapi.commandIndex + 1) % ma_countof(pContext->wasapi.commands); + pContext->wasapi.commandCount -= 1; + } + ma_mutex_unlock(&pContext->wasapi.commandLock); + } + + return result; +} + +static ma_thread_result MA_THREADCALL ma_context_command_thread__wasapi(void* pUserData) +{ + ma_result result; + ma_context* pContext = (ma_context*)pUserData; + MA_ASSERT(pContext != NULL); + + for (;;) { + ma_context_command__wasapi cmd; + result = ma_context_next_command__wasapi(pContext, &cmd); + if (result != MA_SUCCESS) { + break; + } + + switch (cmd.code) + { + case MA_CONTEXT_COMMAND_QUIT__WASAPI: + { + /* Do nothing. Handled after the switch. */ + } break; + + case MA_CONTEXT_COMMAND_CREATE_IAUDIOCLIENT__WASAPI: + { + if (cmd.data.createAudioClient.deviceType == ma_device_type_playback) { + result = ma_result_from_HRESULT(ma_IAudioClient_GetService((ma_IAudioClient*)cmd.data.createAudioClient.pAudioClient, &MA_IID_IAudioRenderClient, cmd.data.createAudioClient.ppAudioClientService)); + } else { + result = ma_result_from_HRESULT(ma_IAudioClient_GetService((ma_IAudioClient*)cmd.data.createAudioClient.pAudioClient, &MA_IID_IAudioCaptureClient, cmd.data.createAudioClient.ppAudioClientService)); + } + } break; + + case MA_CONTEXT_COMMAND_RELEASE_IAUDIOCLIENT__WASAPI: + { + if (cmd.data.releaseAudioClient.deviceType == ma_device_type_playback) { + if (cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientPlayback != NULL) { + ma_IAudioClient_Release((ma_IAudioClient*)cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientPlayback); + cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientPlayback = NULL; + } + } + + if (cmd.data.releaseAudioClient.deviceType == ma_device_type_capture) { + if (cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientCapture != NULL) { + ma_IAudioClient_Release((ma_IAudioClient*)cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientCapture); + cmd.data.releaseAudioClient.pDevice->wasapi.pAudioClientCapture = NULL; + } + } + } break; + + default: + { + /* Unknown command. Ignore it, but trigger an assert in debug mode so we're aware of it. */ + MA_ASSERT(MA_FALSE); + } break; + } + + if (cmd.pEvent != NULL) { + ma_event_signal(cmd.pEvent); + } + + if (cmd.code == MA_CONTEXT_COMMAND_QUIT__WASAPI) { + break; /* Received a quit message. Get out of here. */ + } + } + + return (ma_thread_result)0; +} + +static ma_result ma_device_create_IAudioClient_service__wasapi(ma_context* pContext, ma_device_type deviceType, ma_IAudioClient* pAudioClient, void** ppAudioClientService) +{ + ma_result result; + ma_context_command__wasapi cmd = ma_context_init_command__wasapi(MA_CONTEXT_COMMAND_CREATE_IAUDIOCLIENT__WASAPI); + cmd.data.createAudioClient.deviceType = deviceType; + cmd.data.createAudioClient.pAudioClient = (void*)pAudioClient; + cmd.data.createAudioClient.ppAudioClientService = ppAudioClientService; + cmd.data.createAudioClient.result = MA_SUCCESS; + + result = ma_context_post_command__wasapi(pContext, &cmd); /* This will not return until the command has actually been run. */ + if (result != MA_SUCCESS) { + return result; + } + + return cmd.data.createAudioClient.result; +} + +#if 0 /* Not used at the moment, but leaving here for future use. */ +static ma_result ma_device_release_IAudioClient_service__wasapi(ma_device* pDevice, ma_device_type deviceType) +{ + ma_result result; + ma_context_command__wasapi cmd = ma_context_init_command__wasapi(MA_CONTEXT_COMMAND_RELEASE_IAUDIOCLIENT__WASAPI); + cmd.data.releaseAudioClient.pDevice = pDevice; + cmd.data.releaseAudioClient.deviceType = deviceType; + + result = ma_context_post_command__wasapi(pDevice->pContext, &cmd); /* This will not return until the command has actually been run. */ + if (result != MA_SUCCESS) { + return result; + } + + return MA_SUCCESS; +} +#endif + + static void ma_add_native_data_format_to_device_info_from_WAVEFORMATEX(const WAVEFORMATEX* pWF, ma_share_mode shareMode, ma_device_info* pInfo) { MA_ASSERT(pWF != NULL); @@ -13429,9 +14070,6 @@ static ma_result ma_context_get_device_info_from_IAudioClient__wasapi(ma_context { HRESULT hr; WAVEFORMATEX* pWF = NULL; -#ifdef MA_WIN32_DESKTOP - ma_IPropertyStore *pProperties; -#endif MA_ASSERT(pAudioClient != NULL); MA_ASSERT(pInfo != NULL); @@ -13444,109 +14082,107 @@ static ma_result ma_context_get_device_info_from_IAudioClient__wasapi(ma_context return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to retrieve mix format for device info retrieval.", ma_result_from_HRESULT(hr)); } - /* Exlcusive Mode. We repeatedly call IsFormatSupported() here. This is not currently support on UWP. */ -#ifdef MA_WIN32_DESKTOP /* - The first thing to do is get the format from PKEY_AudioEngine_DeviceFormat. This should give us a channel count we assume is - correct which will simplify our searching. + Exlcusive Mode. We repeatedly call IsFormatSupported() here. This is not currently supported on + UWP. Failure to retrieve the exclusive mode format is not considered an error, so from here on + out, MA_SUCCESS is guaranteed to be returned. */ - hr = ma_IMMDevice_OpenPropertyStore((ma_IMMDevice*)pMMDevice, STGM_READ, &pProperties); - if (SUCCEEDED(hr)) { - PROPVARIANT var; - ma_PropVariantInit(&var); + #ifdef MA_WIN32_DESKTOP + { + ma_IPropertyStore *pProperties; - hr = ma_IPropertyStore_GetValue(pProperties, &MA_PKEY_AudioEngine_DeviceFormat, &var); + /* + The first thing to do is get the format from PKEY_AudioEngine_DeviceFormat. This should give us a channel count we assume is + correct which will simplify our searching. + */ + hr = ma_IMMDevice_OpenPropertyStore((ma_IMMDevice*)pMMDevice, STGM_READ, &pProperties); if (SUCCEEDED(hr)) { - pWF = (WAVEFORMATEX*)var.blob.pBlobData; + PROPVARIANT var; + ma_PropVariantInit(&var); - /* - In my testing, the format returned by PKEY_AudioEngine_DeviceFormat is suitable for exclusive mode so we check this format - first. If this fails, fall back to a search. - */ - hr = ma_IAudioClient_IsFormatSupported((ma_IAudioClient*)pAudioClient, MA_AUDCLNT_SHAREMODE_EXCLUSIVE, pWF, NULL); + hr = ma_IPropertyStore_GetValue(pProperties, &MA_PKEY_AudioEngine_DeviceFormat, &var); if (SUCCEEDED(hr)) { - /* The format returned by PKEY_AudioEngine_DeviceFormat is supported. */ - ma_add_native_data_format_to_device_info_from_WAVEFORMATEX(pWF, ma_share_mode_exclusive, pInfo); - } else { + pWF = (WAVEFORMATEX*)var.blob.pBlobData; + /* - The format returned by PKEY_AudioEngine_DeviceFormat is not supported, so fall back to a search. We assume the channel - count returned by MA_PKEY_AudioEngine_DeviceFormat is valid and correct. For simplicity we're only returning one format. + In my testing, the format returned by PKEY_AudioEngine_DeviceFormat is suitable for exclusive mode so we check this format + first. If this fails, fall back to a search. */ - ma_uint32 channels = pInfo->minChannels; - ma_format formatsToSearch[] = { - ma_format_s16, - ma_format_s24, - /*ma_format_s24_32,*/ - ma_format_f32, - ma_format_s32, - ma_format_u8 - }; - ma_channel defaultChannelMap[MA_MAX_CHANNELS]; - WAVEFORMATEXTENSIBLE wf; - ma_bool32 found; - ma_uint32 iFormat; + hr = ma_IAudioClient_IsFormatSupported((ma_IAudioClient*)pAudioClient, MA_AUDCLNT_SHAREMODE_EXCLUSIVE, pWF, NULL); + if (SUCCEEDED(hr)) { + /* The format returned by PKEY_AudioEngine_DeviceFormat is supported. */ + ma_add_native_data_format_to_device_info_from_WAVEFORMATEX(pWF, ma_share_mode_exclusive, pInfo); + } else { + /* + The format returned by PKEY_AudioEngine_DeviceFormat is not supported, so fall back to a search. We assume the channel + count returned by MA_PKEY_AudioEngine_DeviceFormat is valid and correct. For simplicity we're only returning one format. + */ + ma_uint32 channels = pInfo->minChannels; + ma_channel defaultChannelMap[MA_MAX_CHANNELS]; + WAVEFORMATEXTENSIBLE wf; + ma_bool32 found; + ma_uint32 iFormat; - /* Make sure we don't overflow the channel map. */ - if (channels > MA_MAX_CHANNELS) { - channels = MA_MAX_CHANNELS; - } - - ma_get_standard_channel_map(ma_standard_channel_map_microsoft, channels, defaultChannelMap); - - MA_ZERO_OBJECT(&wf); - wf.Format.cbSize = sizeof(wf); - wf.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; - wf.Format.nChannels = (WORD)channels; - wf.dwChannelMask = ma_channel_map_to_channel_mask__win32(defaultChannelMap, channels); - - found = MA_FALSE; - for (iFormat = 0; iFormat < ma_countof(formatsToSearch); ++iFormat) { - ma_format format = formatsToSearch[iFormat]; - ma_uint32 iSampleRate; - - wf.Format.wBitsPerSample = (WORD)(ma_get_bytes_per_sample(format)*8); - wf.Format.nBlockAlign = (WORD)(wf.Format.nChannels * wf.Format.wBitsPerSample / 8); - wf.Format.nAvgBytesPerSec = wf.Format.nBlockAlign * wf.Format.nSamplesPerSec; - wf.Samples.wValidBitsPerSample = /*(format == ma_format_s24_32) ? 24 :*/ wf.Format.wBitsPerSample; - if (format == ma_format_f32) { - wf.SubFormat = MA_GUID_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; - } else { - wf.SubFormat = MA_GUID_KSDATAFORMAT_SUBTYPE_PCM; + /* Make sure we don't overflow the channel map. */ + if (channels > MA_MAX_CHANNELS) { + channels = MA_MAX_CHANNELS; } - for (iSampleRate = 0; iSampleRate < ma_countof(g_maStandardSampleRatePriorities); ++iSampleRate) { - wf.Format.nSamplesPerSec = g_maStandardSampleRatePriorities[iSampleRate]; + ma_get_standard_channel_map(ma_standard_channel_map_microsoft, channels, defaultChannelMap); - hr = ma_IAudioClient_IsFormatSupported((ma_IAudioClient*)pAudioClient, MA_AUDCLNT_SHAREMODE_EXCLUSIVE, (WAVEFORMATEX*)&wf, NULL); - if (SUCCEEDED(hr)) { - ma_add_native_data_format_to_device_info_from_WAVEFORMATEX((WAVEFORMATEX*)&wf, ma_share_mode_exclusive, pInfo); - found = MA_TRUE; + MA_ZERO_OBJECT(&wf); + wf.Format.cbSize = sizeof(wf); + wf.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + wf.Format.nChannels = (WORD)channels; + wf.dwChannelMask = ma_channel_map_to_channel_mask__win32(defaultChannelMap, channels); + + found = MA_FALSE; + for (iFormat = 0; iFormat < ma_countof(g_maFormatPriorities); ++iFormat) { + ma_format format = g_maFormatPriorities[iFormat]; + ma_uint32 iSampleRate; + + wf.Format.wBitsPerSample = (WORD)(ma_get_bytes_per_sample(format)*8); + wf.Format.nBlockAlign = (WORD)(wf.Format.nChannels * wf.Format.wBitsPerSample / 8); + wf.Format.nAvgBytesPerSec = wf.Format.nBlockAlign * wf.Format.nSamplesPerSec; + wf.Samples.wValidBitsPerSample = /*(format == ma_format_s24_32) ? 24 :*/ wf.Format.wBitsPerSample; + if (format == ma_format_f32) { + wf.SubFormat = MA_GUID_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; + } else { + wf.SubFormat = MA_GUID_KSDATAFORMAT_SUBTYPE_PCM; + } + + for (iSampleRate = 0; iSampleRate < ma_countof(g_maStandardSampleRatePriorities); ++iSampleRate) { + wf.Format.nSamplesPerSec = g_maStandardSampleRatePriorities[iSampleRate]; + + hr = ma_IAudioClient_IsFormatSupported((ma_IAudioClient*)pAudioClient, MA_AUDCLNT_SHAREMODE_EXCLUSIVE, (WAVEFORMATEX*)&wf, NULL); + if (SUCCEEDED(hr)) { + ma_add_native_data_format_to_device_info_from_WAVEFORMATEX((WAVEFORMATEX*)&wf, ma_share_mode_exclusive, pInfo); + found = MA_TRUE; + break; + } + } + + if (found) { break; } } - if (found) { - break; + ma_PropVariantClear(pContext, &var); + + if (!found) { + ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_WARNING, "[WASAPI] Failed to find suitable device format for device info retrieval.", MA_FORMAT_NOT_SUPPORTED); } } - - ma_PropVariantClear(pContext, &var); - - if (!found) { - ma_IPropertyStore_Release(pProperties); - return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to find suitable device format for device info retrieval.", MA_FORMAT_NOT_SUPPORTED); - } + } else { + ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_WARNING, "[WASAPI] Failed to retrieve device format for device info retrieval.", ma_result_from_HRESULT(hr)); } - } else { - ma_IPropertyStore_Release(pProperties); - return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to retrieve device format for device info retrieval.", ma_result_from_HRESULT(hr)); - } - ma_IPropertyStore_Release(pProperties); - } else { - return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to open property store for device info retrieval.", ma_result_from_HRESULT(hr)); + ma_IPropertyStore_Release(pProperties); + } else { + ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_WARNING, "[WASAPI] Failed to open property store for device info retrieval.", ma_result_from_HRESULT(hr)); + } } -#endif + #endif return MA_SUCCESS; } @@ -13666,9 +14302,36 @@ static ma_result ma_context_get_MMDevice__wasapi(ma_context* pContext, ma_device return MA_SUCCESS; } +static ma_result ma_context_get_device_id_from_MMDevice__wasapi(ma_context* pContext, ma_IMMDevice* pMMDevice, ma_device_id* pDeviceID) +{ + LPWSTR pDeviceIDString; + HRESULT hr; + + MA_ASSERT(pDeviceID != NULL); + + hr = ma_IMMDevice_GetId(pMMDevice, &pDeviceIDString); + if (SUCCEEDED(hr)) { + size_t idlen = wcslen(pDeviceIDString); + if (idlen+1 > ma_countof(pDeviceID->wasapi)) { + ma_CoTaskMemFree(pContext, pDeviceIDString); + MA_ASSERT(MA_FALSE); /* NOTE: If this is triggered, please report it. It means the format of the ID must haved change and is too long to fit in our fixed sized buffer. */ + return MA_ERROR; + } + + MA_COPY_MEMORY(pDeviceID->wasapi, pDeviceIDString, idlen * sizeof(wchar_t)); + pDeviceID->wasapi[idlen] = '\0'; + + ma_CoTaskMemFree(pContext, pDeviceIDString); + + return MA_SUCCESS; + } + + return MA_ERROR; +} + static ma_result ma_context_get_device_info_from_MMDevice__wasapi(ma_context* pContext, ma_IMMDevice* pMMDevice, LPWSTR pDefaultDeviceID, ma_bool32 onlySimpleInfo, ma_device_info* pInfo) { - LPWSTR pDeviceID; + ma_result result; HRESULT hr; MA_ASSERT(pContext != NULL); @@ -13676,35 +14339,22 @@ static ma_result ma_context_get_device_info_from_MMDevice__wasapi(ma_context* pC MA_ASSERT(pInfo != NULL); /* ID. */ - hr = ma_IMMDevice_GetId(pMMDevice, &pDeviceID); - if (SUCCEEDED(hr)) { - size_t idlen = wcslen(pDeviceID); - if (idlen+1 > ma_countof(pInfo->id.wasapi)) { - ma_CoTaskMemFree(pContext, pDeviceID); - MA_ASSERT(MA_FALSE); /* NOTE: If this is triggered, please report it. It means the format of the ID must haved change and is too long to fit in our fixed sized buffer. */ - return MA_ERROR; - } - - MA_COPY_MEMORY(pInfo->id.wasapi, pDeviceID, idlen * sizeof(wchar_t)); - pInfo->id.wasapi[idlen] = '\0'; - + result = ma_context_get_device_id_from_MMDevice__wasapi(pContext, pMMDevice, &pInfo->id); + if (result == MA_SUCCESS) { if (pDefaultDeviceID != NULL) { - if (wcscmp(pDeviceID, pDefaultDeviceID) == 0) { - /* It's a default device. */ + if (wcscmp(pInfo->id.wasapi, pDefaultDeviceID) == 0) { pInfo->isDefault = MA_TRUE; } } - - ma_CoTaskMemFree(pContext, pDeviceID); } + /* Description / Friendly Name */ { ma_IPropertyStore *pProperties; hr = ma_IMMDevice_OpenPropertyStore(pMMDevice, STGM_READ, &pProperties); if (SUCCEEDED(hr)) { PROPVARIANT var; - /* Description / Friendly Name */ ma_PropVariantInit(&var); hr = ma_IPropertyStore_GetValue(pProperties, &MA_PKEY_Device_FriendlyName, &var); if (SUCCEEDED(hr)) { @@ -13721,7 +14371,7 @@ static ma_result ma_context_get_device_info_from_MMDevice__wasapi(ma_context* pC ma_IAudioClient* pAudioClient; hr = ma_IMMDevice_Activate(pMMDevice, &MA_IID_IAudioClient, CLSCTX_ALL, NULL, (void**)&pAudioClient); if (SUCCEEDED(hr)) { - ma_result result = ma_context_get_device_info_from_IAudioClient__wasapi(pContext, pMMDevice, pAudioClient, pInfo); + result = ma_context_get_device_info_from_IAudioClient__wasapi(pContext, pMMDevice, pAudioClient, pInfo); ma_IAudioClient_Release(pAudioClient); return result; @@ -14051,10 +14701,6 @@ typedef struct ma_uint32 periodSizeInFramesIn; ma_uint32 periodSizeInMillisecondsIn; ma_uint32 periodsIn; - /*ma_bool32 usingDefaultFormat; - ma_bool32 usingDefaultChannels; - ma_bool32 usingDefaultSampleRate; - ma_bool32 usingDefaultChannelMap;*/ ma_share_mode shareMode; ma_performance_profile performanceProfile; ma_bool32 noAutoConvertSRC; @@ -14073,6 +14719,7 @@ typedef struct ma_uint32 periodsOut; ma_bool32 usingAudioClient3; char deviceName[256]; + ma_device_id id; } ma_device_init_internal_data__wasapi; static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_device_init_internal_data__wasapi* pData) @@ -14423,20 +15070,22 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device pData->usingAudioClient3 = wasInitializedUsingIAudioClient3; + if (deviceType == ma_device_type_playback) { - hr = ma_IAudioClient_GetService((ma_IAudioClient*)pData->pAudioClient, &MA_IID_IAudioRenderClient, (void**)&pData->pRenderClient); + result = ma_device_create_IAudioClient_service__wasapi(pContext, deviceType, (ma_IAudioClient*)pData->pAudioClient, (void**)&pData->pRenderClient); } else { - hr = ma_IAudioClient_GetService((ma_IAudioClient*)pData->pAudioClient, &MA_IID_IAudioCaptureClient, (void**)&pData->pCaptureClient); + result = ma_device_create_IAudioClient_service__wasapi(pContext, deviceType, (ma_IAudioClient*)pData->pAudioClient, (void**)&pData->pCaptureClient); } - if (FAILED(hr)) { - errorMsg = "[WASAPI] Failed to get audio client service.", result = ma_result_from_HRESULT(hr); + /*if (FAILED(hr)) {*/ + if (result != MA_SUCCESS) { + errorMsg = "[WASAPI] Failed to get audio client service."; goto done; } /* Grab the name of the device. */ -#ifdef MA_WIN32_DESKTOP + #ifdef MA_WIN32_DESKTOP { ma_IPropertyStore *pProperties; hr = ma_IMMDevice_OpenPropertyStore(pDeviceInterface, STGM_READ, &pProperties); @@ -14452,7 +15101,24 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device ma_IPropertyStore_Release(pProperties); } } -#endif + #endif + + /* + For the WASAPI backend we need to know the actual IDs of the device in order to do automatic + stream routing so that IDs can be compared and we can determine which device has been detached + and whether or not it matches with our ma_device. + */ + #ifdef MA_WIN32_DESKTOP + { + /* Desktop */ + ma_context_get_device_id_from_MMDevice__wasapi(pContext, pDeviceInterface, &pData->id); + } + #else + { + /* UWP */ + /* TODO: Implement me. Need to figure out how to get the ID of the default device. */ + } + #endif done: /* Clean up. */ @@ -14502,6 +15168,42 @@ static ma_result ma_device_reinit__wasapi(ma_device* pDevice, ma_device_type dev return MA_INVALID_ARGS; } + + /* + Before reinitializing the device we need to free the previous audio clients. + + There's a known memory leak here. We will be calling this from the routing change callback that + is fired by WASAPI. If we attempt to release the IAudioClient we will deadlock. In my opinion + this is a bug. I'm not sure what I need to do to handle this cleanly, but I think we'll probably + need some system where we post an event, but delay the execution of it until the callback has + returned. I'm not sure how to do this reliably, however. I have set up some infrastructure for + a command thread which might be useful for this. + */ + if (deviceType == ma_device_type_capture || deviceType == ma_device_type_loopback) { + if (pDevice->wasapi.pCaptureClient) { + ma_IAudioCaptureClient_Release((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient); + pDevice->wasapi.pCaptureClient = NULL; + } + + if (pDevice->wasapi.pAudioClientCapture) { + /*ma_device_release_IAudioClient_service__wasapi(pDevice, ma_device_type_capture);*/ + pDevice->wasapi.pAudioClientCapture = NULL; + } + } + + if (deviceType == ma_device_type_playback) { + if (pDevice->wasapi.pRenderClient) { + ma_IAudioRenderClient_Release((ma_IAudioRenderClient*)pDevice->wasapi.pRenderClient); + pDevice->wasapi.pRenderClient = NULL; + } + + if (pDevice->wasapi.pAudioClientPlayback) { + /*ma_device_release_IAudioClient_service__wasapi(pDevice, ma_device_type_playback);*/ + pDevice->wasapi.pAudioClientPlayback = NULL; + } + } + + if (deviceType == ma_device_type_playback) { data.formatIn = pDevice->playback.format; data.channelsIn = pDevice->playback.channels; @@ -14529,16 +15231,6 @@ static ma_result ma_device_reinit__wasapi(ma_device* pDevice, ma_device_type dev /* At this point we have some new objects ready to go. We need to uninitialize the previous ones and then set the new ones. */ if (deviceType == ma_device_type_capture || deviceType == ma_device_type_loopback) { - if (pDevice->wasapi.pCaptureClient) { - ma_IAudioCaptureClient_Release((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient); - pDevice->wasapi.pCaptureClient = NULL; - } - - if (pDevice->wasapi.pAudioClientCapture) { - ma_IAudioClient_Release((ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture); - pDevice->wasapi.pAudioClientCapture = NULL; - } - pDevice->wasapi.pAudioClientCapture = data.pAudioClient; pDevice->wasapi.pCaptureClient = data.pCaptureClient; @@ -14555,26 +15247,11 @@ static ma_result ma_device_reinit__wasapi(ma_device* pDevice, ma_device_type dev pDevice->wasapi.periodSizeInFramesCapture = data.periodSizeInFramesOut; ma_IAudioClient_GetBufferSize((ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture, &pDevice->wasapi.actualPeriodSizeInFramesCapture); - /* The device may be in a started state. If so we need to immediately restart it. */ - if (c89atomic_load_32(&pDevice->wasapi.isStartedCapture)) { - HRESULT hr = ma_IAudioClient_Start((ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture); - if (FAILED(hr)) { - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to start internal capture device after reinitialization.", ma_result_from_HRESULT(hr)); - } - } + /* We must always have a valid ID. */ + ma_wcscpy_s(pDevice->capture.id.wasapi, sizeof(pDevice->capture.id.wasapi), data.id.wasapi); } if (deviceType == ma_device_type_playback) { - if (pDevice->wasapi.pRenderClient) { - ma_IAudioRenderClient_Release((ma_IAudioRenderClient*)pDevice->wasapi.pRenderClient); - pDevice->wasapi.pRenderClient = NULL; - } - - if (pDevice->wasapi.pAudioClientPlayback) { - ma_IAudioClient_Release((ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback); - pDevice->wasapi.pAudioClientPlayback = NULL; - } - pDevice->wasapi.pAudioClientPlayback = data.pAudioClient; pDevice->wasapi.pRenderClient = data.pRenderClient; @@ -14591,13 +15268,8 @@ static ma_result ma_device_reinit__wasapi(ma_device* pDevice, ma_device_type dev pDevice->wasapi.periodSizeInFramesPlayback = data.periodSizeInFramesOut; ma_IAudioClient_GetBufferSize((ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback, &pDevice->wasapi.actualPeriodSizeInFramesPlayback); - /* The device may be in a started state. If so we need to immediately restart it. */ - if (c89atomic_load_32(&pDevice->wasapi.isStartedPlayback)) { - HRESULT hr = ma_IAudioClient_Start((ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback); - if (FAILED(hr)) { - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to start internal playback device after reinitialization.", ma_result_from_HRESULT(hr)); - } - } + /* We must always have a valid ID. */ + ma_wcscpy_s(pDevice->playback.id.wasapi, sizeof(pDevice->playback.id.wasapi), data.id.wasapi); } return MA_SUCCESS; @@ -14675,6 +15347,9 @@ static ma_result ma_device_init__wasapi(ma_device* pDevice, const ma_device_conf pDevice->wasapi.periodSizeInFramesCapture = data.periodSizeInFramesOut; ma_IAudioClient_GetBufferSize((ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture, &pDevice->wasapi.actualPeriodSizeInFramesCapture); + /* We must always have a valid ID. */ + ma_wcscpy_s(pDevice->capture.id.wasapi, sizeof(pDevice->capture.id.wasapi), data.id.wasapi); + /* The descriptor needs to be updated with actual values. */ pDescriptorCapture->format = data.formatOut; pDescriptorCapture->channels = data.channelsOut; @@ -14765,6 +15440,8 @@ static ma_result ma_device_init__wasapi(ma_device* pDevice, const ma_device_conf pDevice->wasapi.periodSizeInFramesPlayback = data.periodSizeInFramesOut; ma_IAudioClient_GetBufferSize((ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback, &pDevice->wasapi.actualPeriodSizeInFramesPlayback); + /* We must always have a valid ID. */ + ma_wcscpy_s(pDevice->playback.id.wasapi, sizeof(pDevice->playback.id.wasapi), data.id.wasapi); /* The descriptor needs to be updated with actual values. */ pDescriptorPlayback->format = data.formatOut; @@ -14830,40 +15507,46 @@ static ma_result ma_device__get_available_frames__wasapi(ma_device* pDevice, ma_ return MA_INVALID_OPERATION; } - hr = ma_IAudioClient_GetCurrentPadding(pAudioClient, &paddingFramesCount); - if (FAILED(hr)) { - return ma_result_from_HRESULT(hr); - } + /* + I've had a report that GetCurrentPadding() is returning a frame count of 0 which is preventing + higher level function calls from doing anything because it thinks nothing is available. I have + taken a look at the documentation and it looks like this is unnecessary in exclusive mode. - /* Slightly different rules for exclusive and shared modes. */ + From Microsoft's documentation: + + For an exclusive-mode rendering or capture stream that was initialized with the + AUDCLNT_STREAMFLAGS_EVENTCALLBACK flag, the client typically has no use for the padding + value reported by GetCurrentPadding. Instead, the client accesses an entire buffer during + each processing pass. + + Considering this, I'm going to skip GetCurrentPadding() for exclusive mode and just report the + entire buffer. This depends on the caller making sure they wait on the event handler. + */ shareMode = ((ma_ptr)pAudioClient == pDevice->wasapi.pAudioClientPlayback) ? pDevice->playback.shareMode : pDevice->capture.shareMode; - if (shareMode == ma_share_mode_exclusive) { - *pFrameCount = paddingFramesCount; - } else { + if (shareMode == ma_share_mode_shared) { + /* Shared mode. */ + hr = ma_IAudioClient_GetCurrentPadding(pAudioClient, &paddingFramesCount); + if (FAILED(hr)) { + return ma_result_from_HRESULT(hr); + } + if ((ma_ptr)pAudioClient == pDevice->wasapi.pAudioClientPlayback) { *pFrameCount = pDevice->wasapi.actualPeriodSizeInFramesPlayback - paddingFramesCount; } else { *pFrameCount = paddingFramesCount; } + } else { + /* Exclusive mode. */ + if ((ma_ptr)pAudioClient == pDevice->wasapi.pAudioClientPlayback) { + *pFrameCount = pDevice->wasapi.actualPeriodSizeInFramesPlayback; + } else { + *pFrameCount = pDevice->wasapi.actualPeriodSizeInFramesCapture; + } } return MA_SUCCESS; } -static ma_bool32 ma_device_is_reroute_required__wasapi(ma_device* pDevice, ma_device_type deviceType) -{ - MA_ASSERT(pDevice != NULL); - - if (deviceType == ma_device_type_playback) { - return c89atomic_load_32(&pDevice->wasapi.hasDefaultPlaybackDeviceChanged); - } - - if (deviceType == ma_device_type_capture || deviceType == ma_device_type_loopback) { - return c89atomic_load_32(&pDevice->wasapi.hasDefaultCaptureDeviceChanged); - } - - return MA_FALSE; -} static ma_result ma_device_reroute__wasapi(ma_device* pDevice, ma_device_type deviceType) { @@ -14873,20 +15556,15 @@ static ma_result ma_device_reroute__wasapi(ma_device* pDevice, ma_device_type de return MA_INVALID_ARGS; } - if (deviceType == ma_device_type_playback) { - c89atomic_exchange_32(&pDevice->wasapi.hasDefaultPlaybackDeviceChanged, MA_FALSE); - } - if (deviceType == ma_device_type_capture || deviceType == ma_device_type_loopback) { - c89atomic_exchange_32(&pDevice->wasapi.hasDefaultCaptureDeviceChanged, MA_FALSE); - } - - - #ifdef MA_DEBUG_OUTPUT - printf("=== CHANGING DEVICE ===\n"); - #endif +#ifdef MA_DEBUG_OUTPUT + printf("=== CHANGING DEVICE ===\n"); +#endif result = ma_device_reinit__wasapi(pDevice, deviceType); if (result != MA_SUCCESS) { + #ifdef MA_DEBUG_OUTPUT + printf("[WASAPI] Reinitializing device after route change failed.\n"); + #endif return result; } @@ -14895,30 +15573,112 @@ static ma_result ma_device_reroute__wasapi(ma_device* pDevice, ma_device_type de return MA_SUCCESS; } - -static ma_result ma_device_stop__wasapi(ma_device* pDevice) +static ma_result ma_device_start__wasapi(ma_device* pDevice) { + HRESULT hr; + MA_ASSERT(pDevice != NULL); - /* - It's possible for the main loop to get stuck if the device is disconnected. - - In loopback mode it's possible for WaitForSingleObject() to get stuck in a deadlock when nothing is being played. When nothing - is being played, the event is never signalled internally by WASAPI which means we will deadlock when stopping the device. - */ if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex || pDevice->type == ma_device_type_loopback) { - SetEvent((HANDLE)pDevice->wasapi.hEventCapture); + hr = ma_IAudioClient_Start((ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture); + if (FAILED(hr)) { + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to start internal capture device.", ma_result_from_HRESULT(hr)); + } + + c89atomic_exchange_32(&pDevice->wasapi.isStartedCapture, MA_TRUE); } if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { - SetEvent((HANDLE)pDevice->wasapi.hEventPlayback); + /* No need to do anything for playback as that'll be started automatically in the data loop. */ + } + + return MA_SUCCESS; +} + +static ma_result ma_device_stop__wasapi(ma_device* pDevice) +{ + ma_result result; + HRESULT hr; + + MA_ASSERT(pDevice != NULL); + + if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex || pDevice->type == ma_device_type_loopback) { + hr = ma_IAudioClient_Stop((ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture); + if (FAILED(hr)) { + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to stop internal capture device.", ma_result_from_HRESULT(hr)); + } + + /* The audio client needs to be reset otherwise restarting will fail. */ + hr = ma_IAudioClient_Reset((ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture); + if (FAILED(hr)) { + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to reset internal capture device.", ma_result_from_HRESULT(hr)); + } + + c89atomic_exchange_32(&pDevice->wasapi.isStartedCapture, MA_FALSE); + } + + if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { + /* + The buffer needs to be drained before stopping the device. Not doing this will result in the last few frames not getting output to + the speakers. This is a problem for very short sounds because it'll result in a significant portion of it not getting played. + */ + if (c89atomic_load_32(&pDevice->wasapi.isStartedPlayback)) { + /* We need to make sure we put a timeout here or else we'll risk getting stuck in a deadlock in some cases. */ + DWORD waitTime = pDevice->wasapi.actualPeriodSizeInFramesPlayback / pDevice->playback.internalSampleRate; + + if (pDevice->playback.shareMode == ma_share_mode_exclusive) { + WaitForSingleObject(pDevice->wasapi.hEventPlayback, waitTime); + } else { + ma_uint32 prevFramesAvaialablePlayback = (ma_uint32)-1; + ma_uint32 framesAvailablePlayback; + for (;;) { + result = ma_device__get_available_frames__wasapi(pDevice, (ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback, &framesAvailablePlayback); + if (result != MA_SUCCESS) { + break; + } + + if (framesAvailablePlayback >= pDevice->wasapi.actualPeriodSizeInFramesPlayback) { + break; + } + + /* + Just a safety check to avoid an infinite loop. If this iteration results in a situation where the number of available frames + has not changed, get out of the loop. I don't think this should ever happen, but I think it's nice to have just in case. + */ + if (framesAvailablePlayback == prevFramesAvaialablePlayback) { + break; + } + prevFramesAvaialablePlayback = framesAvailablePlayback; + + WaitForSingleObject(pDevice->wasapi.hEventPlayback, waitTime); + ResetEvent(pDevice->wasapi.hEventPlayback); /* Manual reset. */ + } + } + } + + hr = ma_IAudioClient_Stop((ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback); + if (FAILED(hr)) { + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to stop internal playback device.", ma_result_from_HRESULT(hr)); + } + + /* The audio client needs to be reset otherwise restarting will fail. */ + hr = ma_IAudioClient_Reset((ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback); + if (FAILED(hr)) { + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to reset internal playback device.", ma_result_from_HRESULT(hr)); + } + + c89atomic_exchange_32(&pDevice->wasapi.isStartedPlayback, MA_FALSE); } return MA_SUCCESS; } -static ma_result ma_device_audio_thread__wasapi(ma_device* pDevice) +#ifndef MA_WASAPI_WAIT_TIMEOUT_MILLISECONDS +#define MA_WASAPI_WAIT_TIMEOUT_MILLISECONDS 5000 +#endif + +static ma_result ma_device_data_loop__wasapi(ma_device* pDevice) { ma_result result; HRESULT hr; @@ -14935,43 +15695,25 @@ static ma_result ma_device_audio_thread__wasapi(ma_device* pDevice) ma_uint32 bpfCaptureClient = ma_get_bytes_per_frame(pDevice->capture.format, pDevice->capture.channels); ma_uint32 bpfPlaybackClient = ma_get_bytes_per_frame(pDevice->playback.format, pDevice->playback.channels); ma_uint8 inputDataInClientFormat[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 inputDataInClientFormatCap = sizeof(inputDataInClientFormat) / bpfCaptureClient; + ma_uint32 inputDataInClientFormatCap = 0; ma_uint8 outputDataInClientFormat[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 outputDataInClientFormatCap = sizeof(outputDataInClientFormat) / bpfPlaybackClient; + ma_uint32 outputDataInClientFormatCap = 0; ma_uint32 outputDataInClientFormatCount = 0; ma_uint32 outputDataInClientFormatConsumed = 0; ma_uint32 periodSizeInFramesCapture = 0; MA_ASSERT(pDevice != NULL); - /* The capture device needs to be started immediately. */ if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex || pDevice->type == ma_device_type_loopback) { - periodSizeInFramesCapture = pDevice->capture.internalPeriodSizeInFrames; + periodSizeInFramesCapture = pDevice->capture.internalPeriodSizeInFrames; + inputDataInClientFormatCap = sizeof(inputDataInClientFormat) / bpfCaptureClient; + } - hr = ma_IAudioClient_Start((ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture); - if (FAILED(hr)) { - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to start internal capture device.", ma_result_from_HRESULT(hr)); - } - c89atomic_exchange_32(&pDevice->wasapi.isStartedCapture, MA_TRUE); + if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { + outputDataInClientFormatCap = sizeof(outputDataInClientFormat) / bpfPlaybackClient; } while (ma_device_get_state(pDevice) == MA_STATE_STARTED && !exitLoop) { - /* We may need to reroute the device. */ - if (ma_device_is_reroute_required__wasapi(pDevice, ma_device_type_playback)) { - result = ma_device_reroute__wasapi(pDevice, ma_device_type_playback); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - } - if (ma_device_is_reroute_required__wasapi(pDevice, ma_device_type_capture)) { - result = ma_device_reroute__wasapi(pDevice, (pDevice->type == ma_device_type_loopback) ? ma_device_type_loopback : ma_device_type_capture); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - } - switch (pDevice->type) { case ma_device_type_duplex: @@ -14982,13 +15724,6 @@ static ma_result ma_device_audio_thread__wasapi(ma_device* pDevice) /* The process is to map the playback buffer and fill it as quickly as possible from input data. */ if (pMappedDeviceBufferPlayback == NULL) { - /* WASAPI is weird with exclusive mode. You need to wait on the event _before_ querying the available frames. */ - if (pDevice->playback.shareMode == ma_share_mode_exclusive) { - if (WaitForSingleObject(pDevice->wasapi.hEventPlayback, INFINITE) != WAIT_OBJECT_0) { - return MA_ERROR; /* Wait failed. */ - } - } - result = ma_device__get_available_frames__wasapi(pDevice, (ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback, &framesAvailablePlayback); if (result != MA_SUCCESS) { return result; @@ -15004,18 +15739,6 @@ static ma_result ma_device_audio_thread__wasapi(ma_device* pDevice) } } - /* If there's no frames available in the playback device we need to wait for more. */ - if (framesAvailablePlayback == 0) { - /* In exclusive mode we waited at the top. */ - if (pDevice->playback.shareMode != ma_share_mode_exclusive) { - if (WaitForSingleObject(pDevice->wasapi.hEventPlayback, INFINITE) != WAIT_OBJECT_0) { - return MA_ERROR; /* Wait failed. */ - } - } - - continue; - } - /* We're ready to map the playback device's buffer. We don't release this until it's been entirely filled. */ hr = ma_IAudioRenderClient_GetBuffer((ma_IAudioRenderClient*)pDevice->wasapi.pRenderClient, framesAvailablePlayback, &pMappedDeviceBufferPlayback); if (FAILED(hr)) { @@ -15028,221 +15751,223 @@ static ma_result ma_device_audio_thread__wasapi(ma_device* pDevice) mappedDeviceBufferFramesRemainingPlayback = framesAvailablePlayback; } - /* At this point we should have a buffer available for output. We need to keep writing input samples to it. */ - for (;;) { - /* Try grabbing some captured data if we haven't already got a mapped buffer. */ - if (pMappedDeviceBufferCapture == NULL) { - if (pDevice->capture.shareMode == ma_share_mode_shared) { - if (WaitForSingleObject(pDevice->wasapi.hEventCapture, INFINITE) != WAIT_OBJECT_0) { - return MA_ERROR; /* Wait failed. */ - } - } - - result = ma_device__get_available_frames__wasapi(pDevice, (ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture, &framesAvailableCapture); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - /*printf("TRACE 2: framesAvailableCapture=%d\n", framesAvailableCapture);*/ - - /* Wait for more if nothing is available. */ - if (framesAvailableCapture == 0) { - /* In exclusive mode we waited at the top. */ - if (pDevice->capture.shareMode != ma_share_mode_shared) { - if (WaitForSingleObject(pDevice->wasapi.hEventCapture, INFINITE) != WAIT_OBJECT_0) { + if (mappedDeviceBufferFramesRemainingPlayback > 0) { + /* At this point we should have a buffer available for output. We need to keep writing input samples to it. */ + for (;;) { + /* Try grabbing some captured data if we haven't already got a mapped buffer. */ + if (pMappedDeviceBufferCapture == NULL) { + if (pDevice->capture.shareMode == ma_share_mode_shared) { + if (WaitForSingleObject(pDevice->wasapi.hEventCapture, MA_WASAPI_WAIT_TIMEOUT_MILLISECONDS) != WAIT_OBJECT_0) { return MA_ERROR; /* Wait failed. */ } } - continue; - } + result = ma_device__get_available_frames__wasapi(pDevice, (ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture, &framesAvailableCapture); + if (result != MA_SUCCESS) { + exitLoop = MA_TRUE; + break; + } - /* Getting here means there's data available for writing to the output device. */ - mappedDeviceBufferSizeInFramesCapture = ma_min(framesAvailableCapture, periodSizeInFramesCapture); - hr = ma_IAudioCaptureClient_GetBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, (BYTE**)&pMappedDeviceBufferCapture, &mappedDeviceBufferSizeInFramesCapture, &flagsCapture, NULL, NULL); - if (FAILED(hr)) { - ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to retrieve internal buffer from capture device in preparation for writing to the device.", ma_result_from_HRESULT(hr)); - exitLoop = MA_TRUE; - break; - } + /*printf("TRACE 2: framesAvailableCapture=%d\n", framesAvailableCapture);*/ - - /* Overrun detection. */ - if ((flagsCapture & MA_AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY) != 0) { - /* Glitched. Probably due to an overrun. */ - #ifdef MA_DEBUG_OUTPUT - printf("[WASAPI] Data discontinuity (possible overrun). framesAvailableCapture=%d, mappedBufferSizeInFramesCapture=%d\n", framesAvailableCapture, mappedDeviceBufferSizeInFramesCapture); - #endif - - /* - Exeriment: If we get an overrun it probably means we're straddling the end of the buffer. In order to prevent a never-ending sequence of glitches let's experiment - by dropping every frame until we're left with only a single period. To do this we just keep retrieving and immediately releasing buffers until we're down to the - last period. - */ - if (framesAvailableCapture >= pDevice->wasapi.actualPeriodSizeInFramesCapture) { - #ifdef MA_DEBUG_OUTPUT - printf("[WASAPI] Synchronizing capture stream. "); - #endif - do - { - hr = ma_IAudioCaptureClient_ReleaseBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, mappedDeviceBufferSizeInFramesCapture); - if (FAILED(hr)) { - break; + /* Wait for more if nothing is available. */ + if (framesAvailableCapture == 0) { + /* In exclusive mode we waited at the top. */ + if (pDevice->capture.shareMode != ma_share_mode_shared) { + if (WaitForSingleObject(pDevice->wasapi.hEventCapture, MA_WASAPI_WAIT_TIMEOUT_MILLISECONDS) != WAIT_OBJECT_0) { + return MA_ERROR; /* Wait failed. */ } + } - framesAvailableCapture -= mappedDeviceBufferSizeInFramesCapture; + continue; + } - if (framesAvailableCapture > 0) { - mappedDeviceBufferSizeInFramesCapture = ma_min(framesAvailableCapture, periodSizeInFramesCapture); - hr = ma_IAudioCaptureClient_GetBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, (BYTE**)&pMappedDeviceBufferCapture, &mappedDeviceBufferSizeInFramesCapture, &flagsCapture, NULL, NULL); + /* Getting here means there's data available for writing to the output device. */ + mappedDeviceBufferSizeInFramesCapture = ma_min(framesAvailableCapture, periodSizeInFramesCapture); + hr = ma_IAudioCaptureClient_GetBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, (BYTE**)&pMappedDeviceBufferCapture, &mappedDeviceBufferSizeInFramesCapture, &flagsCapture, NULL, NULL); + if (FAILED(hr)) { + ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to retrieve internal buffer from capture device in preparation for writing to the device.", ma_result_from_HRESULT(hr)); + exitLoop = MA_TRUE; + break; + } + + + /* Overrun detection. */ + if ((flagsCapture & MA_AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY) != 0) { + /* Glitched. Probably due to an overrun. */ + #ifdef MA_DEBUG_OUTPUT + printf("[WASAPI] Data discontinuity (possible overrun). framesAvailableCapture=%d, mappedBufferSizeInFramesCapture=%d\n", framesAvailableCapture, mappedDeviceBufferSizeInFramesCapture); + #endif + + /* + Exeriment: If we get an overrun it probably means we're straddling the end of the buffer. In order to prevent a never-ending sequence of glitches let's experiment + by dropping every frame until we're left with only a single period. To do this we just keep retrieving and immediately releasing buffers until we're down to the + last period. + */ + if (framesAvailableCapture >= pDevice->wasapi.actualPeriodSizeInFramesCapture) { + #ifdef MA_DEBUG_OUTPUT + printf("[WASAPI] Synchronizing capture stream. "); + #endif + do + { + hr = ma_IAudioCaptureClient_ReleaseBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, mappedDeviceBufferSizeInFramesCapture); if (FAILED(hr)) { - ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to retrieve internal buffer from capture device in preparation for writing to the device.", ma_result_from_HRESULT(hr)); - exitLoop = MA_TRUE; break; } - } else { - pMappedDeviceBufferCapture = NULL; - mappedDeviceBufferSizeInFramesCapture = 0; - } - } while (framesAvailableCapture > periodSizeInFramesCapture); + + framesAvailableCapture -= mappedDeviceBufferSizeInFramesCapture; + + if (framesAvailableCapture > 0) { + mappedDeviceBufferSizeInFramesCapture = ma_min(framesAvailableCapture, periodSizeInFramesCapture); + hr = ma_IAudioCaptureClient_GetBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, (BYTE**)&pMappedDeviceBufferCapture, &mappedDeviceBufferSizeInFramesCapture, &flagsCapture, NULL, NULL); + if (FAILED(hr)) { + ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to retrieve internal buffer from capture device in preparation for writing to the device.", ma_result_from_HRESULT(hr)); + exitLoop = MA_TRUE; + break; + } + } else { + pMappedDeviceBufferCapture = NULL; + mappedDeviceBufferSizeInFramesCapture = 0; + } + } while (framesAvailableCapture > periodSizeInFramesCapture); + #ifdef MA_DEBUG_OUTPUT + printf("framesAvailableCapture=%d, mappedBufferSizeInFramesCapture=%d\n", framesAvailableCapture, mappedDeviceBufferSizeInFramesCapture); + #endif + } + } else { #ifdef MA_DEBUG_OUTPUT - printf("framesAvailableCapture=%d, mappedBufferSizeInFramesCapture=%d\n", framesAvailableCapture, mappedDeviceBufferSizeInFramesCapture); + if (flagsCapture != 0) { + printf("[WASAPI] Capture Flags: %ld\n", flagsCapture); + } #endif } - } else { - #ifdef MA_DEBUG_OUTPUT - if (flagsCapture != 0) { - printf("[WASAPI] Capture Flags: %ld\n", flagsCapture); - } - #endif + + mappedDeviceBufferFramesRemainingCapture = mappedDeviceBufferSizeInFramesCapture; } - mappedDeviceBufferFramesRemainingCapture = mappedDeviceBufferSizeInFramesCapture; - } + /* At this point we should have both input and output data available. We now need to convert the data and post it to the client. */ + for (;;) { + BYTE* pRunningDeviceBufferCapture; + BYTE* pRunningDeviceBufferPlayback; + ma_uint32 framesToProcess; + ma_uint32 framesProcessed; - /* At this point we should have both input and output data available. We now need to convert the data and post it to the client. */ - for (;;) { - BYTE* pRunningDeviceBufferCapture; - BYTE* pRunningDeviceBufferPlayback; - ma_uint32 framesToProcess; - ma_uint32 framesProcessed; + pRunningDeviceBufferCapture = pMappedDeviceBufferCapture + ((mappedDeviceBufferSizeInFramesCapture - mappedDeviceBufferFramesRemainingCapture ) * bpfCaptureDevice); + pRunningDeviceBufferPlayback = pMappedDeviceBufferPlayback + ((mappedDeviceBufferSizeInFramesPlayback - mappedDeviceBufferFramesRemainingPlayback) * bpfPlaybackDevice); - pRunningDeviceBufferCapture = pMappedDeviceBufferCapture + ((mappedDeviceBufferSizeInFramesCapture - mappedDeviceBufferFramesRemainingCapture ) * bpfCaptureDevice); - pRunningDeviceBufferPlayback = pMappedDeviceBufferPlayback + ((mappedDeviceBufferSizeInFramesPlayback - mappedDeviceBufferFramesRemainingPlayback) * bpfPlaybackDevice); + /* There may be some data sitting in the converter that needs to be processed first. Once this is exhaused, run the data callback again. */ + if (!pDevice->playback.converter.isPassthrough && outputDataInClientFormatConsumed < outputDataInClientFormatCount) { + ma_uint64 convertedFrameCountClient = (outputDataInClientFormatCount - outputDataInClientFormatConsumed); + ma_uint64 convertedFrameCountDevice = mappedDeviceBufferFramesRemainingPlayback; + void* pConvertedFramesClient = outputDataInClientFormat + (outputDataInClientFormatConsumed * bpfPlaybackClient); + void* pConvertedFramesDevice = pRunningDeviceBufferPlayback; + result = ma_data_converter_process_pcm_frames(&pDevice->playback.converter, pConvertedFramesClient, &convertedFrameCountClient, pConvertedFramesDevice, &convertedFrameCountDevice); + if (result != MA_SUCCESS) { + break; + } - /* There may be some data sitting in the converter that needs to be processed first. Once this is exhaused, run the data callback again. */ - if (!pDevice->playback.converter.isPassthrough && outputDataInClientFormatConsumed < outputDataInClientFormatCount) { - ma_uint64 convertedFrameCountClient = (outputDataInClientFormatCount - outputDataInClientFormatConsumed); - ma_uint64 convertedFrameCountDevice = mappedDeviceBufferFramesRemainingPlayback; - void* pConvertedFramesClient = outputDataInClientFormat + (outputDataInClientFormatConsumed * bpfPlaybackClient); - void* pConvertedFramesDevice = pRunningDeviceBufferPlayback; - result = ma_data_converter_process_pcm_frames(&pDevice->playback.converter, pConvertedFramesClient, &convertedFrameCountClient, pConvertedFramesDevice, &convertedFrameCountDevice); - if (result != MA_SUCCESS) { - break; + outputDataInClientFormatConsumed += (ma_uint32)convertedFrameCountClient; /* Safe cast. */ + mappedDeviceBufferFramesRemainingPlayback -= (ma_uint32)convertedFrameCountDevice; /* Safe cast. */ + + if (mappedDeviceBufferFramesRemainingPlayback == 0) { + break; + } } - outputDataInClientFormatConsumed += (ma_uint32)convertedFrameCountClient; /* Safe cast. */ - mappedDeviceBufferFramesRemainingPlayback -= (ma_uint32)convertedFrameCountDevice; /* Safe cast. */ + /* + Getting here means we need to fire the callback. If format conversion is unnecessary, we can optimize this by passing the pointers to the internal + buffers directly to the callback. + */ + if (pDevice->capture.converter.isPassthrough && pDevice->playback.converter.isPassthrough) { + /* Optimal path. We can pass mapped pointers directly to the callback. */ + framesToProcess = ma_min(mappedDeviceBufferFramesRemainingCapture, mappedDeviceBufferFramesRemainingPlayback); + framesProcessed = framesToProcess; - if (mappedDeviceBufferFramesRemainingPlayback == 0) { - break; + ma_device__on_data(pDevice, pRunningDeviceBufferPlayback, pRunningDeviceBufferCapture, framesToProcess); + + mappedDeviceBufferFramesRemainingCapture -= framesProcessed; + mappedDeviceBufferFramesRemainingPlayback -= framesProcessed; + + if (mappedDeviceBufferFramesRemainingCapture == 0) { + break; /* Exhausted input data. */ + } + if (mappedDeviceBufferFramesRemainingPlayback == 0) { + break; /* Exhausted output data. */ + } + } else if (pDevice->capture.converter.isPassthrough) { + /* The input buffer is a passthrough, but the playback buffer requires a conversion. */ + framesToProcess = ma_min(mappedDeviceBufferFramesRemainingCapture, outputDataInClientFormatCap); + framesProcessed = framesToProcess; + + ma_device__on_data(pDevice, outputDataInClientFormat, pRunningDeviceBufferCapture, framesToProcess); + outputDataInClientFormatCount = framesProcessed; + outputDataInClientFormatConsumed = 0; + + mappedDeviceBufferFramesRemainingCapture -= framesProcessed; + if (mappedDeviceBufferFramesRemainingCapture == 0) { + break; /* Exhausted input data. */ + } + } else if (pDevice->playback.converter.isPassthrough) { + /* The input buffer requires conversion, the playback buffer is passthrough. */ + ma_uint64 capturedDeviceFramesToProcess = mappedDeviceBufferFramesRemainingCapture; + ma_uint64 capturedClientFramesToProcess = ma_min(inputDataInClientFormatCap, mappedDeviceBufferFramesRemainingPlayback); + + result = ma_data_converter_process_pcm_frames(&pDevice->capture.converter, pRunningDeviceBufferCapture, &capturedDeviceFramesToProcess, inputDataInClientFormat, &capturedClientFramesToProcess); + if (result != MA_SUCCESS) { + break; + } + + if (capturedClientFramesToProcess == 0) { + break; + } + + ma_device__on_data(pDevice, pRunningDeviceBufferPlayback, inputDataInClientFormat, (ma_uint32)capturedClientFramesToProcess); /* Safe cast. */ + + mappedDeviceBufferFramesRemainingCapture -= (ma_uint32)capturedDeviceFramesToProcess; + mappedDeviceBufferFramesRemainingPlayback -= (ma_uint32)capturedClientFramesToProcess; + } else { + ma_uint64 capturedDeviceFramesToProcess = mappedDeviceBufferFramesRemainingCapture; + ma_uint64 capturedClientFramesToProcess = ma_min(inputDataInClientFormatCap, outputDataInClientFormatCap); + + result = ma_data_converter_process_pcm_frames(&pDevice->capture.converter, pRunningDeviceBufferCapture, &capturedDeviceFramesToProcess, inputDataInClientFormat, &capturedClientFramesToProcess); + if (result != MA_SUCCESS) { + break; + } + + if (capturedClientFramesToProcess == 0) { + break; + } + + ma_device__on_data(pDevice, outputDataInClientFormat, inputDataInClientFormat, (ma_uint32)capturedClientFramesToProcess); + + mappedDeviceBufferFramesRemainingCapture -= (ma_uint32)capturedDeviceFramesToProcess; + outputDataInClientFormatCount = (ma_uint32)capturedClientFramesToProcess; + outputDataInClientFormatConsumed = 0; } } - /* - Getting here means we need to fire the callback. If format conversion is unnecessary, we can optimize this by passing the pointers to the internal - buffers directly to the callback. - */ - if (pDevice->capture.converter.isPassthrough && pDevice->playback.converter.isPassthrough) { - /* Optimal path. We can pass mapped pointers directly to the callback. */ - framesToProcess = ma_min(mappedDeviceBufferFramesRemainingCapture, mappedDeviceBufferFramesRemainingPlayback); - framesProcessed = framesToProcess; - ma_device__on_data(pDevice, pRunningDeviceBufferPlayback, pRunningDeviceBufferCapture, framesToProcess); - - mappedDeviceBufferFramesRemainingCapture -= framesProcessed; - mappedDeviceBufferFramesRemainingPlayback -= framesProcessed; - - if (mappedDeviceBufferFramesRemainingCapture == 0) { - break; /* Exhausted input data. */ - } - if (mappedDeviceBufferFramesRemainingPlayback == 0) { - break; /* Exhausted output data. */ - } - } else if (pDevice->capture.converter.isPassthrough) { - /* The input buffer is a passthrough, but the playback buffer requires a conversion. */ - framesToProcess = ma_min(mappedDeviceBufferFramesRemainingCapture, outputDataInClientFormatCap); - framesProcessed = framesToProcess; - - ma_device__on_data(pDevice, outputDataInClientFormat, pRunningDeviceBufferCapture, framesToProcess); - outputDataInClientFormatCount = framesProcessed; - outputDataInClientFormatConsumed = 0; - - mappedDeviceBufferFramesRemainingCapture -= framesProcessed; - if (mappedDeviceBufferFramesRemainingCapture == 0) { - break; /* Exhausted input data. */ - } - } else if (pDevice->playback.converter.isPassthrough) { - /* The input buffer requires conversion, the playback buffer is passthrough. */ - ma_uint64 capturedDeviceFramesToProcess = mappedDeviceBufferFramesRemainingCapture; - ma_uint64 capturedClientFramesToProcess = ma_min(inputDataInClientFormatCap, mappedDeviceBufferFramesRemainingPlayback); - - result = ma_data_converter_process_pcm_frames(&pDevice->capture.converter, pRunningDeviceBufferCapture, &capturedDeviceFramesToProcess, inputDataInClientFormat, &capturedClientFramesToProcess); - if (result != MA_SUCCESS) { + /* If at this point we've run out of capture data we need to release the buffer. */ + if (mappedDeviceBufferFramesRemainingCapture == 0 && pMappedDeviceBufferCapture != NULL) { + hr = ma_IAudioCaptureClient_ReleaseBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, mappedDeviceBufferSizeInFramesCapture); + if (FAILED(hr)) { + ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to release internal buffer from capture device after reading from the device.", ma_result_from_HRESULT(hr)); + exitLoop = MA_TRUE; break; } - if (capturedClientFramesToProcess == 0) { - break; - } + /*printf("TRACE: Released capture buffer\n");*/ - ma_device__on_data(pDevice, pRunningDeviceBufferPlayback, inputDataInClientFormat, (ma_uint32)capturedClientFramesToProcess); /* Safe cast. */ - - mappedDeviceBufferFramesRemainingCapture -= (ma_uint32)capturedDeviceFramesToProcess; - mappedDeviceBufferFramesRemainingPlayback -= (ma_uint32)capturedClientFramesToProcess; - } else { - ma_uint64 capturedDeviceFramesToProcess = mappedDeviceBufferFramesRemainingCapture; - ma_uint64 capturedClientFramesToProcess = ma_min(inputDataInClientFormatCap, outputDataInClientFormatCap); - - result = ma_data_converter_process_pcm_frames(&pDevice->capture.converter, pRunningDeviceBufferCapture, &capturedDeviceFramesToProcess, inputDataInClientFormat, &capturedClientFramesToProcess); - if (result != MA_SUCCESS) { - break; - } - - if (capturedClientFramesToProcess == 0) { - break; - } - - ma_device__on_data(pDevice, outputDataInClientFormat, inputDataInClientFormat, (ma_uint32)capturedClientFramesToProcess); - - mappedDeviceBufferFramesRemainingCapture -= (ma_uint32)capturedDeviceFramesToProcess; - outputDataInClientFormatCount = (ma_uint32)capturedClientFramesToProcess; - outputDataInClientFormatConsumed = 0; + pMappedDeviceBufferCapture = NULL; + mappedDeviceBufferFramesRemainingCapture = 0; + mappedDeviceBufferSizeInFramesCapture = 0; } - } - - /* If at this point we've run out of capture data we need to release the buffer. */ - if (mappedDeviceBufferFramesRemainingCapture == 0 && pMappedDeviceBufferCapture != NULL) { - hr = ma_IAudioCaptureClient_ReleaseBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, mappedDeviceBufferSizeInFramesCapture); - if (FAILED(hr)) { - ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to release internal buffer from capture device after reading from the device.", ma_result_from_HRESULT(hr)); - exitLoop = MA_TRUE; + /* Get out of this loop if we're run out of room in the playback buffer. */ + if (mappedDeviceBufferFramesRemainingPlayback == 0) { break; } - - /*printf("TRACE: Released capture buffer\n");*/ - - pMappedDeviceBufferCapture = NULL; - mappedDeviceBufferFramesRemainingCapture = 0; - mappedDeviceBufferSizeInFramesCapture = 0; - } - - /* Get out of this loop if we're run out of room in the playback buffer. */ - if (mappedDeviceBufferFramesRemainingPlayback == 0) { - break; } } @@ -15279,9 +16004,15 @@ static ma_result ma_device_audio_thread__wasapi(ma_device* pDevice) ma_IAudioClient_Reset((ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to start internal playback device.", ma_result_from_HRESULT(hr)); } + c89atomic_exchange_32(&pDevice->wasapi.isStartedPlayback, MA_TRUE); } } + + /* Make sure the device has started before waiting. */ + if (WaitForSingleObject(pDevice->wasapi.hEventPlayback, MA_WASAPI_WAIT_TIMEOUT_MILLISECONDS) != WAIT_OBJECT_0) { + return MA_ERROR; /* Wait failed. */ + } } break; @@ -15293,7 +16024,7 @@ static ma_result ma_device_audio_thread__wasapi(ma_device* pDevice) DWORD flagsCapture; /* Passed to IAudioCaptureClient_GetBuffer(). */ /* Wait for data to become available first. */ - if (WaitForSingleObject(pDevice->wasapi.hEventCapture, INFINITE) != WAIT_OBJECT_0) { + if (WaitForSingleObject(pDevice->wasapi.hEventCapture, MA_WASAPI_WAIT_TIMEOUT_MILLISECONDS) != WAIT_OBJECT_0) { exitLoop = MA_TRUE; break; /* Wait failed. */ } @@ -15390,12 +16121,6 @@ static ma_result ma_device_audio_thread__wasapi(ma_device* pDevice) { ma_uint32 framesAvailablePlayback; - /* Wait for space to become available first. */ - if (WaitForSingleObject(pDevice->wasapi.hEventPlayback, INFINITE) != WAIT_OBJECT_0) { - exitLoop = MA_TRUE; - break; /* Wait failed. */ - } - /* Check how much space is available. If this returns 0 we just keep waiting. */ result = ma_device__get_available_frames__wasapi(pDevice, (ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback, &framesAvailablePlayback); if (result != MA_SUCCESS) { @@ -15403,43 +16128,47 @@ static ma_result ma_device_audio_thread__wasapi(ma_device* pDevice) break; } - if (framesAvailablePlayback < pDevice->wasapi.periodSizeInFramesPlayback) { - continue; /* No space available. */ - } - - /* Map a the data buffer in preparation for the callback. */ - hr = ma_IAudioRenderClient_GetBuffer((ma_IAudioRenderClient*)pDevice->wasapi.pRenderClient, framesAvailablePlayback, &pMappedDeviceBufferPlayback); - if (FAILED(hr)) { - ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to retrieve internal buffer from playback device in preparation for writing to the device.", ma_result_from_HRESULT(hr)); - exitLoop = MA_TRUE; - break; - } - - /* We should have a buffer at this point. */ - ma_device__read_frames_from_client(pDevice, framesAvailablePlayback, pMappedDeviceBufferPlayback); - - /* At this point we're done writing to the device and we just need to release the buffer. */ - hr = ma_IAudioRenderClient_ReleaseBuffer((ma_IAudioRenderClient*)pDevice->wasapi.pRenderClient, framesAvailablePlayback, 0); - pMappedDeviceBufferPlayback = NULL; /* <-- Important. Not doing this can result in an error once we leave this loop because it will use this to know whether or not a final ReleaseBuffer() needs to be called. */ - mappedDeviceBufferSizeInFramesPlayback = 0; - - if (FAILED(hr)) { - ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to release internal buffer from playback device after writing to the device.", ma_result_from_HRESULT(hr)); - exitLoop = MA_TRUE; - break; - } - - framesWrittenToPlaybackDevice += framesAvailablePlayback; - if (!c89atomic_load_32(&pDevice->wasapi.isStartedPlayback)) { - if (pDevice->playback.shareMode == ma_share_mode_exclusive || framesWrittenToPlaybackDevice >= pDevice->playback.internalPeriodSizeInFrames*1) { - hr = ma_IAudioClient_Start((ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback); - if (FAILED(hr)) { - ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to start internal playback device.", ma_result_from_HRESULT(hr)); - exitLoop = MA_TRUE; - break; - } - c89atomic_exchange_32(&pDevice->wasapi.isStartedPlayback, MA_TRUE); + if (framesAvailablePlayback >= pDevice->wasapi.periodSizeInFramesPlayback) { + /* Map a the data buffer in preparation for the callback. */ + hr = ma_IAudioRenderClient_GetBuffer((ma_IAudioRenderClient*)pDevice->wasapi.pRenderClient, framesAvailablePlayback, &pMappedDeviceBufferPlayback); + if (FAILED(hr)) { + ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to retrieve internal buffer from playback device in preparation for writing to the device.", ma_result_from_HRESULT(hr)); + exitLoop = MA_TRUE; + break; } + + /* We should have a buffer at this point. */ + ma_device__read_frames_from_client(pDevice, framesAvailablePlayback, pMappedDeviceBufferPlayback); + + /* At this point we're done writing to the device and we just need to release the buffer. */ + hr = ma_IAudioRenderClient_ReleaseBuffer((ma_IAudioRenderClient*)pDevice->wasapi.pRenderClient, framesAvailablePlayback, 0); + pMappedDeviceBufferPlayback = NULL; /* <-- Important. Not doing this can result in an error once we leave this loop because it will use this to know whether or not a final ReleaseBuffer() needs to be called. */ + mappedDeviceBufferSizeInFramesPlayback = 0; + + if (FAILED(hr)) { + ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to release internal buffer from playback device after writing to the device.", ma_result_from_HRESULT(hr)); + exitLoop = MA_TRUE; + break; + } + + framesWrittenToPlaybackDevice += framesAvailablePlayback; + } + + if (!c89atomic_load_32(&pDevice->wasapi.isStartedPlayback)) { + hr = ma_IAudioClient_Start((ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback); + if (FAILED(hr)) { + ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to start internal playback device.", ma_result_from_HRESULT(hr)); + exitLoop = MA_TRUE; + break; + } + + c89atomic_exchange_32(&pDevice->wasapi.isStartedPlayback, MA_TRUE); + } + + /* Make sure we don't wait on the event before we've started the device or we may end up deadlocking. */ + if (WaitForSingleObject(pDevice->wasapi.hEventPlayback, MA_WASAPI_WAIT_TIMEOUT_MILLISECONDS) != WAIT_OBJECT_0) { + exitLoop = MA_TRUE; + break; /* Wait failed. Probably timed out. */ } } break; @@ -15453,19 +16182,6 @@ static ma_result ma_device_audio_thread__wasapi(ma_device* pDevice) if (pMappedDeviceBufferCapture != NULL) { hr = ma_IAudioCaptureClient_ReleaseBuffer((ma_IAudioCaptureClient*)pDevice->wasapi.pCaptureClient, mappedDeviceBufferSizeInFramesCapture); } - - hr = ma_IAudioClient_Stop((ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture); - if (FAILED(hr)) { - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to stop internal capture device.", ma_result_from_HRESULT(hr)); - } - - /* The audio client needs to be reset otherwise restarting will fail. */ - hr = ma_IAudioClient_Reset((ma_IAudioClient*)pDevice->wasapi.pAudioClientCapture); - if (FAILED(hr)) { - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to reset internal capture device.", ma_result_from_HRESULT(hr)); - } - - c89atomic_exchange_32(&pDevice->wasapi.isStartedCapture, MA_FALSE); } if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { @@ -15473,67 +16189,41 @@ static ma_result ma_device_audio_thread__wasapi(ma_device* pDevice) if (pMappedDeviceBufferPlayback != NULL) { hr = ma_IAudioRenderClient_ReleaseBuffer((ma_IAudioRenderClient*)pDevice->wasapi.pRenderClient, mappedDeviceBufferSizeInFramesPlayback, 0); } - - /* - The buffer needs to be drained before stopping the device. Not doing this will result in the last few frames not getting output to - the speakers. This is a problem for very short sounds because it'll result in a significant portion of it not getting played. - */ - if (c89atomic_load_32(&pDevice->wasapi.isStartedPlayback)) { - /* We need to make sure we put a timeout here or else we'll risk getting stuck in a deadlock in some cases. */ - DWORD waitTime = pDevice->wasapi.actualPeriodSizeInFramesPlayback / pDevice->playback.internalSampleRate; - - if (pDevice->playback.shareMode == ma_share_mode_exclusive) { - WaitForSingleObject(pDevice->wasapi.hEventPlayback, waitTime); - } else { - ma_uint32 prevFramesAvaialablePlayback = (ma_uint32)-1; - ma_uint32 framesAvailablePlayback; - for (;;) { - result = ma_device__get_available_frames__wasapi(pDevice, (ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback, &framesAvailablePlayback); - if (result != MA_SUCCESS) { - break; - } - - if (framesAvailablePlayback >= pDevice->wasapi.actualPeriodSizeInFramesPlayback) { - break; - } - - /* - Just a safety check to avoid an infinite loop. If this iteration results in a situation where the number of available frames - has not changed, get out of the loop. I don't think this should ever happen, but I think it's nice to have just in case. - */ - if (framesAvailablePlayback == prevFramesAvaialablePlayback) { - break; - } - prevFramesAvaialablePlayback = framesAvailablePlayback; - - WaitForSingleObject(pDevice->wasapi.hEventPlayback, waitTime); - ResetEvent(pDevice->wasapi.hEventPlayback); /* Manual reset. */ - } - } - } - - hr = ma_IAudioClient_Stop((ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback); - if (FAILED(hr)) { - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to stop internal playback device.", ma_result_from_HRESULT(hr)); - } - - /* The audio client needs to be reset otherwise restarting will fail. */ - hr = ma_IAudioClient_Reset((ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback); - if (FAILED(hr)) { - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to reset internal playback device.", ma_result_from_HRESULT(hr)); - } - - c89atomic_exchange_32(&pDevice->wasapi.isStartedPlayback, MA_FALSE); } return MA_SUCCESS; } +static ma_result ma_device_data_loop_wakeup__wasapi(ma_device* pDevice) +{ + MA_ASSERT(pDevice != NULL); + + if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex || pDevice->type == ma_device_type_loopback) { + SetEvent((HANDLE)pDevice->wasapi.hEventCapture); + } + + if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { + SetEvent((HANDLE)pDevice->wasapi.hEventPlayback); + } + + return MA_SUCCESS; +} + + static ma_result ma_context_uninit__wasapi(ma_context* pContext) { MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_wasapi); - (void)pContext; + + if (pContext->wasapi.commandThread != NULL) { + ma_context_command__wasapi cmd = ma_context_init_command__wasapi(MA_CONTEXT_COMMAND_QUIT__WASAPI); + ma_context_post_command__wasapi(pContext, &cmd); + ma_thread_wait(&pContext->wasapi.commandThread); + + /* Only after the thread has been terminated can we uninitialize the sync objects for the command thread. */ + ma_semaphore_uninit(&pContext->wasapi.commandSem); + ma_mutex_uninit(&pContext->wasapi.commandLock); + } return MA_SUCCESS; } @@ -15590,19 +16280,68 @@ static ma_result ma_context_init__wasapi(ma_context* pContext, const ma_context_ return result; } + MA_ZERO_OBJECT(&pContext->wasapi); + + /* + Annoyingly, WASAPI does not allow you to release an IAudioClient object from a different thread + than the one that retrieved it with GetService(). This can result in a deadlock in two + situations: + + 1) When calling ma_device_uninit() from a different thread to ma_device_init(); and + 2) When uninitializing and reinitializing the internal IAudioClient object in response to + automatic stream routing. + + We could define ma_device_uninit() such that it must be called on the same thread as + ma_device_init(). We could also just not release the IAudioClient when performing automatic + stream routing to avoid the deadlock. Neither of these are acceptable solutions in my view so + we're going to have to work around this with a worker thread. This is not ideal, but I can't + think of a better way to do this. + + More information about this can be found here: + + https://docs.microsoft.com/en-us/windows/win32/api/audioclient/nn-audioclient-iaudiorenderclient + + Note this section: + + When releasing an IAudioRenderClient interface instance, the client must call the interface's + Release method from the same thread as the call to IAudioClient::GetService that created the + object. + */ + { + result = ma_mutex_init(&pContext->wasapi.commandLock); + if (result != MA_SUCCESS) { + return result; + } + + result = ma_semaphore_init(0, &pContext->wasapi.commandSem); + if (result != MA_SUCCESS) { + ma_mutex_uninit(&pContext->wasapi.commandLock); + return result; + } + + result = ma_thread_create(&pContext->wasapi.commandThread, ma_thread_priority_normal, 0, ma_context_command_thread__wasapi, pContext); + if (result != MA_SUCCESS) { + ma_semaphore_uninit(&pContext->wasapi.commandSem); + ma_mutex_uninit(&pContext->wasapi.commandLock); + return result; + } + } + + pCallbacks->onContextInit = ma_context_init__wasapi; pCallbacks->onContextUninit = ma_context_uninit__wasapi; pCallbacks->onContextEnumerateDevices = ma_context_enumerate_devices__wasapi; pCallbacks->onContextGetDeviceInfo = ma_context_get_device_info__wasapi; pCallbacks->onDeviceInit = ma_device_init__wasapi; pCallbacks->onDeviceUninit = ma_device_uninit__wasapi; - pCallbacks->onDeviceStart = NULL; /* Not used. Started in onDeviceAudioThread. */ - pCallbacks->onDeviceStop = ma_device_stop__wasapi; /* Required to ensure the capture event is signalled when stopping a loopback device while nothing is playing. */ + pCallbacks->onDeviceStart = ma_device_start__wasapi; + pCallbacks->onDeviceStop = ma_device_stop__wasapi; pCallbacks->onDeviceRead = NULL; /* Not used. Reading is done manually in the audio thread. */ pCallbacks->onDeviceWrite = NULL; /* Not used. Writing is done manually in the audio thread. */ - pCallbacks->onDeviceAudioThread = ma_device_audio_thread__wasapi; + pCallbacks->onDeviceDataLoop = ma_device_data_loop__wasapi; + pCallbacks->onDeviceDataLoopWakeup = ma_device_data_loop_wakeup__wasapi; - return result; + return MA_SUCCESS; } #endif @@ -15936,11 +16675,11 @@ typedef HRESULT (WINAPI * ma_DirectSoundCaptureEnumerateAProc)(ma_DSEnumCallba static ma_uint32 ma_get_best_sample_rate_within_range(ma_uint32 sampleRateMin, ma_uint32 sampleRateMax) { /* Normalize the range in case we were given something stupid. */ - if (sampleRateMin < MA_MIN_SAMPLE_RATE) { - sampleRateMin = MA_MIN_SAMPLE_RATE; + if (sampleRateMin < (ma_uint32)ma_standard_sample_rate_min) { + sampleRateMin = (ma_uint32)ma_standard_sample_rate_min; } - if (sampleRateMax > MA_MAX_SAMPLE_RATE) { - sampleRateMax = MA_MAX_SAMPLE_RATE; + if (sampleRateMax > (ma_uint32)ma_standard_sample_rate_max) { + sampleRateMax = (ma_uint32)ma_standard_sample_rate_max; } if (sampleRateMin > sampleRateMax) { sampleRateMin = sampleRateMax; @@ -16497,23 +17236,13 @@ static ma_result ma_config_to_WAVEFORMATEXTENSIBLE(ma_format format, ma_uint32 c return MA_SUCCESS; } -static ma_uint32 ma_calculate_period_size_in_frames__dsound(ma_uint32 periodSizeInFrames, ma_uint32 periodSizeInMilliseconds, ma_uint32 sampleRate, ma_performance_profile performanceProfile) +static ma_uint32 ma_calculate_period_size_in_frames_from_descriptor__dsound(const ma_device_descriptor* pDescriptor, ma_uint32 nativeSampleRate, ma_performance_profile performanceProfile) { /* DirectSound has a minimum period size of 20ms. */ - ma_uint32 minPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(20, sampleRate); - - if (periodSizeInFrames == 0) { - if (periodSizeInMilliseconds == 0) { - if (performanceProfile == ma_performance_profile_low_latency) { - periodSizeInFrames = minPeriodSizeInFrames; - } else { - periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(MA_DEFAULT_PERIOD_SIZE_IN_MILLISECONDS_CONSERVATIVE, sampleRate); - } - } else { - periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(periodSizeInMilliseconds, sampleRate); - } - } + ma_uint32 minPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(20, nativeSampleRate); + ma_uint32 periodSizeInFrames; + periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptor, nativeSampleRate, performanceProfile); if (periodSizeInFrames < minPeriodSizeInFrames) { periodSizeInFrames = minPeriodSizeInFrames; } @@ -16570,7 +17299,7 @@ static ma_result ma_device_init__dsound(ma_device* pDevice, const ma_device_conf wf.SubFormat = MA_GUID_KSDATAFORMAT_SUBTYPE_PCM; /* The size of the buffer must be a clean multiple of the period count. */ - periodSizeInFrames = ma_calculate_period_size_in_frames__dsound(pDescriptorCapture->periodSizeInFrames, pDescriptorCapture->periodSizeInMilliseconds, wf.Format.nSamplesPerSec, pConfig->performanceProfile); + periodSizeInFrames = ma_calculate_period_size_in_frames_from_descriptor__dsound(pDescriptorCapture, wf.Format.nSamplesPerSec, pConfig->performanceProfile); periodCount = (pDescriptorCapture->periodCount > 0) ? pDescriptorCapture->periodCount : MA_DEFAULT_PERIODS; MA_ZERO_OBJECT(&descDS); @@ -16727,7 +17456,7 @@ static ma_result ma_device_init__dsound(ma_device* pDevice, const ma_device_conf } /* The size of the buffer must be a clean multiple of the period count. */ - periodSizeInFrames = ma_calculate_period_size_in_frames__dsound(pDescriptorPlayback->periodSizeInFrames, pDescriptorPlayback->periodSizeInMilliseconds, pDescriptorPlayback->sampleRate, pConfig->performanceProfile); + periodSizeInFrames = ma_calculate_period_size_in_frames_from_descriptor__dsound(pDescriptorPlayback, pDescriptorPlayback->sampleRate, pConfig->performanceProfile); periodCount = (pDescriptorPlayback->periodCount > 0) ? pDescriptorPlayback->periodCount : MA_DEFAULT_PERIODS; /* @@ -16765,7 +17494,7 @@ static ma_result ma_device_init__dsound(ma_device* pDevice, const ma_device_conf } -static ma_result ma_device_audio_thread__dsound(ma_device* pDevice) +static ma_result ma_device_data_loop__dsound(ma_device* pDevice) { ma_result result = MA_SUCCESS; ma_uint32 bpfDeviceCapture = ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); @@ -17320,11 +18049,11 @@ static ma_result ma_context_init__dsound(ma_context* pContext, const ma_context_ pCallbacks->onContextGetDeviceInfo = ma_context_get_device_info__dsound; pCallbacks->onDeviceInit = ma_device_init__dsound; pCallbacks->onDeviceUninit = ma_device_uninit__dsound; - pCallbacks->onDeviceStart = NULL; /* Not used. Started in onDeviceAudioThread. */ - pCallbacks->onDeviceStop = NULL; /* Not used. Stopped in onDeviceAudioThread. */ - pCallbacks->onDeviceRead = NULL; /* Not used. Data is read directly in onDeviceAudioThread. */ - pCallbacks->onDeviceWrite = NULL; /* Not used. Data is written directly in onDeviceAudioThread. */ - pCallbacks->onDeviceAudioThread = ma_device_audio_thread__dsound; + pCallbacks->onDeviceStart = NULL; /* Not used. Started in onDeviceDataLoop. */ + pCallbacks->onDeviceStop = NULL; /* Not used. Stopped in onDeviceDataLoop. */ + pCallbacks->onDeviceRead = NULL; /* Not used. Data is read directly in onDeviceDataLoop. */ + pCallbacks->onDeviceWrite = NULL; /* Not used. Data is written directly in onDeviceDataLoop. */ + pCallbacks->onDeviceDataLoop = ma_device_data_loop__dsound; return MA_SUCCESS; } @@ -17812,23 +18541,13 @@ static ma_result ma_device_uninit__winmm(ma_device* pDevice) return MA_SUCCESS; } -static ma_uint32 ma_calculate_period_size_in_frames__winmm(ma_uint32 periodSizeInFrames, ma_uint32 periodSizeInMilliseconds, ma_uint32 sampleRate, ma_performance_profile performanceProfile) +static ma_uint32 ma_calculate_period_size_in_frames_from_descriptor__winmm(const ma_device_descriptor* pDescriptor, ma_uint32 nativeSampleRate, ma_performance_profile performanceProfile) { /* WinMM has a minimum period size of 40ms. */ - ma_uint32 minPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(40, sampleRate); - - if (periodSizeInFrames == 0) { - if (periodSizeInMilliseconds == 0) { - if (performanceProfile == ma_performance_profile_low_latency) { - periodSizeInFrames = minPeriodSizeInFrames; - } else { - periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(MA_DEFAULT_PERIOD_SIZE_IN_MILLISECONDS_CONSERVATIVE, sampleRate); - } - } else { - periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(periodSizeInMilliseconds, sampleRate); - } - } + ma_uint32 minPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(40, nativeSampleRate); + ma_uint32 periodSizeInFrames; + periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptor, nativeSampleRate, performanceProfile); if (periodSizeInFrames < minPeriodSizeInFrames) { periodSizeInFrames = minPeriodSizeInFrames; } @@ -17902,7 +18621,7 @@ static ma_result ma_device_init__winmm(ma_device* pDevice, const ma_device_confi pDescriptorCapture->sampleRate = wf.nSamplesPerSec; ma_get_standard_channel_map(ma_standard_channel_map_microsoft, pDescriptorCapture->channels, pDescriptorCapture->channelMap); pDescriptorCapture->periodCount = pDescriptorCapture->periodCount; - pDescriptorCapture->periodSizeInFrames = ma_calculate_period_size_in_frames__winmm(pDescriptorCapture->periodSizeInFrames, pDescriptorCapture->periodSizeInMilliseconds, pDescriptorCapture->sampleRate, pConfig->performanceProfile); + pDescriptorCapture->periodSizeInFrames = ma_calculate_period_size_in_frames_from_descriptor__winmm(pDescriptorCapture, pDescriptorCapture->sampleRate, pConfig->performanceProfile); } if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { @@ -17940,7 +18659,7 @@ static ma_result ma_device_init__winmm(ma_device* pDevice, const ma_device_confi pDescriptorPlayback->sampleRate = wf.nSamplesPerSec; ma_get_standard_channel_map(ma_standard_channel_map_microsoft, pDescriptorPlayback->channels, pDescriptorPlayback->channelMap); pDescriptorPlayback->periodCount = pDescriptorPlayback->periodCount; - pDescriptorPlayback->periodSizeInFrames = ma_calculate_period_size_in_frames__winmm(pDescriptorPlayback->periodSizeInFrames, pDescriptorPlayback->periodSizeInMilliseconds, pDescriptorPlayback->sampleRate, pConfig->performanceProfile); + pDescriptorPlayback->periodSizeInFrames = ma_calculate_period_size_in_frames_from_descriptor__winmm(pDescriptorPlayback, pDescriptorPlayback->sampleRate, pConfig->performanceProfile); } /* @@ -18365,7 +19084,7 @@ static ma_result ma_context_init__winmm(ma_context* pContext, const ma_context_c pCallbacks->onDeviceStop = ma_device_stop__winmm; pCallbacks->onDeviceRead = ma_device_read__winmm; pCallbacks->onDeviceWrite = ma_device_write__winmm; - pCallbacks->onDeviceAudioThread = NULL; /* This is a blocking read-write API, so this can be NULL since miniaudio will manage the audio thread for us. */ + pCallbacks->onDeviceDataLoop = NULL; /* This is a blocking read-write API, so this can be NULL since miniaudio will manage the audio thread for us. */ return MA_SUCCESS; } @@ -18601,8 +19320,11 @@ typedef int (* ma_snd_pcm_hw_params_any_proc) ( typedef int (* ma_snd_pcm_hw_params_set_format_proc) (ma_snd_pcm_t *pcm, ma_snd_pcm_hw_params_t *params, ma_snd_pcm_format_t val); typedef int (* ma_snd_pcm_hw_params_set_format_first_proc) (ma_snd_pcm_t *pcm, ma_snd_pcm_hw_params_t *params, ma_snd_pcm_format_t *format); typedef void (* ma_snd_pcm_hw_params_get_format_mask_proc) (ma_snd_pcm_hw_params_t *params, ma_snd_pcm_format_mask_t *mask); +typedef int (* ma_snd_pcm_hw_params_set_channels_proc) (ma_snd_pcm_t *pcm, ma_snd_pcm_hw_params_t *params, unsigned int val); typedef int (* ma_snd_pcm_hw_params_set_channels_near_proc) (ma_snd_pcm_t *pcm, ma_snd_pcm_hw_params_t *params, unsigned int *val); +typedef int (* ma_snd_pcm_hw_params_set_channels_minmax_proc) (ma_snd_pcm_t *pcm, ma_snd_pcm_hw_params_t *params, unsigned int *minimum, unsigned int *maximum); typedef int (* ma_snd_pcm_hw_params_set_rate_resample_proc) (ma_snd_pcm_t *pcm, ma_snd_pcm_hw_params_t *params, unsigned int val); +typedef int (* ma_snd_pcm_hw_params_set_rate_proc) (ma_snd_pcm_t *pcm, ma_snd_pcm_hw_params_t *params, unsigned int val, int dir); typedef int (* ma_snd_pcm_hw_params_set_rate_near_proc) (ma_snd_pcm_t *pcm, ma_snd_pcm_hw_params_t *params, unsigned int *val, int *dir); typedef int (* ma_snd_pcm_hw_params_set_buffer_size_near_proc)(ma_snd_pcm_t *pcm, ma_snd_pcm_hw_params_t *params, ma_snd_pcm_uframes_t *val); typedef int (* ma_snd_pcm_hw_params_set_periods_near_proc) (ma_snd_pcm_t *pcm, ma_snd_pcm_hw_params_t *params, unsigned int *val, int *dir); @@ -18617,6 +19339,9 @@ typedef int (* ma_snd_pcm_hw_params_get_rate_max_proc) ( typedef int (* ma_snd_pcm_hw_params_get_buffer_size_proc) (const ma_snd_pcm_hw_params_t *params, ma_snd_pcm_uframes_t *val); typedef int (* ma_snd_pcm_hw_params_get_periods_proc) (const ma_snd_pcm_hw_params_t *params, unsigned int *val, int *dir); typedef int (* ma_snd_pcm_hw_params_get_access_proc) (const ma_snd_pcm_hw_params_t *params, ma_snd_pcm_access_t *_access); +typedef int (* ma_snd_pcm_hw_params_test_format_proc) (ma_snd_pcm_t *pcm, ma_snd_pcm_hw_params_t *params, ma_snd_pcm_format_t val); +typedef int (* ma_snd_pcm_hw_params_test_channels_proc) (ma_snd_pcm_t *pcm, ma_snd_pcm_hw_params_t *params, unsigned int val); +typedef int (* ma_snd_pcm_hw_params_test_rate_proc) (ma_snd_pcm_t *pcm, ma_snd_pcm_hw_params_t *params, unsigned int val, int dir); typedef int (* ma_snd_pcm_hw_params_proc) (ma_snd_pcm_t *pcm, ma_snd_pcm_hw_params_t *params); typedef size_t (* ma_snd_pcm_sw_params_sizeof_proc) (void); typedef int (* ma_snd_pcm_sw_params_current_proc) (ma_snd_pcm_t *pcm, ma_snd_pcm_sw_params_t *params); @@ -18669,36 +19394,6 @@ static const char* g_maBlacklistedCaptureDeviceNamesALSA[] = { }; -/* -This array allows miniaudio to control device-specific default buffer sizes. This uses a scaling factor. Order is important. If -any part of the string is present in the device's name, the associated scale will be used. -*/ -static struct -{ - const char* name; - float scale; -} g_maDefaultBufferSizeScalesALSA[] = { - {"bcm2835 IEC958/HDMI", 2.0f}, - {"bcm2835 ALSA", 2.0f} -}; - -static float ma_find_default_buffer_size_scale__alsa(const char* deviceName) -{ - size_t i; - - if (deviceName == NULL) { - return 1; - } - - for (i = 0; i < ma_countof(g_maDefaultBufferSizeScalesALSA); ++i) { - if (strstr(g_maDefaultBufferSizeScalesALSA[i].name, deviceName) != NULL) { - return g_maDefaultBufferSizeScalesALSA[i].scale; - } - } - - return 1; -} - static ma_snd_pcm_format_t ma_convert_ma_format_to_alsa_format(ma_format format) { ma_snd_pcm_format_t ALSAFormats[] = { @@ -19296,22 +19991,69 @@ static ma_bool32 ma_context_get_device_info_enum_callback__alsa(ma_context* pCon return !pData->foundDevice; } -static ma_result ma_context_get_device_info__alsa(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_share_mode shareMode, ma_device_info* pDeviceInfo) +static void ma_context_test_rate_and_add_native_data_format__alsa(ma_context* pContext, ma_snd_pcm_t* pPCM, ma_snd_pcm_hw_params_t* pHWParams, ma_format format, ma_uint32 channels, ma_uint32 sampleRate, ma_uint32 flags, ma_device_info* pDeviceInfo) +{ + MA_ASSERT(pPCM != NULL); + MA_ASSERT(pHWParams != NULL); + MA_ASSERT(pDeviceInfo != NULL); + + if (pDeviceInfo->nativeDataFormatCount < ma_countof(pDeviceInfo->nativeDataFormats) && ((ma_snd_pcm_hw_params_test_rate_proc)pContext->alsa.snd_pcm_hw_params_test_rate)(pPCM, pHWParams, sampleRate, 0) == 0) { + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].format = format; + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].channels = channels; + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].sampleRate = sampleRate; + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].flags = flags; + pDeviceInfo->nativeDataFormatCount += 1; + } +} + +static void ma_context_iterate_rates_and_add_native_data_format__alsa(ma_context* pContext, ma_snd_pcm_t* pPCM, ma_snd_pcm_hw_params_t* pHWParams, ma_format format, ma_uint32 channels, ma_uint32 flags, ma_device_info* pDeviceInfo) +{ + ma_uint32 iSampleRate; + unsigned int minSampleRate; + unsigned int maxSampleRate; + int sampleRateDir; /* Not used. Just passed into snd_pcm_hw_params_get_rate_min/max(). */ + + /* There could be a range. */ + ((ma_snd_pcm_hw_params_get_rate_min_proc)pContext->alsa.snd_pcm_hw_params_get_rate_min)(pHWParams, &minSampleRate, &sampleRateDir); + ((ma_snd_pcm_hw_params_get_rate_max_proc)pContext->alsa.snd_pcm_hw_params_get_rate_max)(pHWParams, &maxSampleRate, &sampleRateDir); + + /* Make sure our sample rates are clamped to sane values. Stupid devices like "pulse" will reports rates like "1" which is ridiculus. */ + minSampleRate = ma_clamp(minSampleRate, (unsigned int)ma_standard_sample_rate_min, (unsigned int)ma_standard_sample_rate_max); + maxSampleRate = ma_clamp(maxSampleRate, (unsigned int)ma_standard_sample_rate_min, (unsigned int)ma_standard_sample_rate_max); + + for (iSampleRate = 0; iSampleRate < ma_countof(g_maStandardSampleRatePriorities); iSampleRate += 1) { + ma_uint32 standardSampleRate = g_maStandardSampleRatePriorities[iSampleRate]; + + if (standardSampleRate >= minSampleRate && standardSampleRate <= maxSampleRate) { + ma_context_test_rate_and_add_native_data_format__alsa(pContext, pPCM, pHWParams, format, channels, standardSampleRate, flags, pDeviceInfo); + } + } + + /* Now make sure our min and max rates are included just in case they aren't in the range of our standard rates. */ + if (!ma_is_standard_sample_rate(minSampleRate)) { + ma_context_test_rate_and_add_native_data_format__alsa(pContext, pPCM, pHWParams, format, channels, minSampleRate, flags, pDeviceInfo); + } + + if (!ma_is_standard_sample_rate(maxSampleRate) && maxSampleRate != minSampleRate) { + ma_context_test_rate_and_add_native_data_format__alsa(pContext, pPCM, pHWParams, format, channels, maxSampleRate, flags, pDeviceInfo); + } +} + +static ma_result ma_context_get_device_info__alsa(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_device_info* pDeviceInfo) { ma_context_get_device_info_enum_callback_data__alsa data; ma_result result; int resultALSA; ma_snd_pcm_t* pPCM; ma_snd_pcm_hw_params_t* pHWParams; - ma_snd_pcm_format_mask_t* pFormatMask; - int sampleRateDir = 0; + ma_uint32 iFormat; + ma_uint32 iChannel; MA_ASSERT(pContext != NULL); /* We just enumerate to find basic information about the device. */ data.deviceType = deviceType; data.pDeviceID = pDeviceID; - data.shareMode = shareMode; data.pDeviceInfo = pDeviceInfo; data.foundDevice = MA_FALSE; result = ma_context_enumerate_devices__alsa(pContext, ma_context_get_device_info_enum_callback__alsa, &data); @@ -19328,7 +20070,7 @@ static ma_result ma_context_get_device_info__alsa(ma_context* pContext, ma_devic } /* For detailed info we need to open the device. */ - result = ma_context_open_pcm__alsa(pContext, shareMode, deviceType, pDeviceID, 0, &pPCM); + result = ma_context_open_pcm__alsa(pContext, ma_share_mode_shared, deviceType, pDeviceID, 0, &pPCM); if (result != MA_SUCCESS) { return result; } @@ -19347,314 +20089,94 @@ static ma_result ma_context_get_device_info__alsa(ma_context* pContext, ma_devic return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to initialize hardware parameters. snd_pcm_hw_params_any() failed.", ma_result_from_errno(-resultALSA)); } - ((ma_snd_pcm_hw_params_get_channels_min_proc)pContext->alsa.snd_pcm_hw_params_get_channels_min)(pHWParams, &pDeviceInfo->minChannels); - ((ma_snd_pcm_hw_params_get_channels_max_proc)pContext->alsa.snd_pcm_hw_params_get_channels_max)(pHWParams, &pDeviceInfo->maxChannels); - ((ma_snd_pcm_hw_params_get_rate_min_proc)pContext->alsa.snd_pcm_hw_params_get_rate_min)(pHWParams, &pDeviceInfo->minSampleRate, &sampleRateDir); - ((ma_snd_pcm_hw_params_get_rate_max_proc)pContext->alsa.snd_pcm_hw_params_get_rate_max)(pHWParams, &pDeviceInfo->maxSampleRate, &sampleRateDir); + /* + Some ALSA devices can support many permutations of formats, channels and rates. We only support + a fixed number of permutations which means we need to employ some strategies to ensure the best + combinations are returned. An example is the "pulse" device which can do it's own data conversion + in software and as a result can support any combination of format, channels and rate. - /* Formats. */ - pFormatMask = (ma_snd_pcm_format_mask_t*)ma__calloc_from_callbacks(((ma_snd_pcm_format_mask_sizeof_proc)pContext->alsa.snd_pcm_format_mask_sizeof)(), &pContext->allocationCallbacks); - if (pFormatMask == NULL) { - ma__free_from_callbacks(pHWParams, &pContext->allocationCallbacks); - ((ma_snd_pcm_close_proc)pContext->alsa.snd_pcm_close)(pPCM); - return MA_OUT_OF_MEMORY; + We want to ensure the the first data formats are the best. We have a list of favored sample + formats and sample rates, so these will be the basis of our iteration. + */ + + /* Formats. We just iterate over our standard formats and test them, making sure we reset the configuration space each iteration. */ + for (iFormat = 0; iFormat < ma_countof(g_maFormatPriorities); iFormat += 1) { + ma_format format = g_maFormatPriorities[iFormat]; + + /* + For each format we need to make sure we reset the configuration space so we don't return + channel counts and rates that aren't compatible with a format. + */ + ((ma_snd_pcm_hw_params_any_proc)pContext->alsa.snd_pcm_hw_params_any)(pPCM, pHWParams); + + /* Test the format first. If this fails it means the format is not supported and we can skip it. */ + if (((ma_snd_pcm_hw_params_test_format_proc)pContext->alsa.snd_pcm_hw_params_test_format)(pPCM, pHWParams, ma_convert_ma_format_to_alsa_format(format)) == 0) { + /* The format is supported. */ + unsigned int minChannels; + unsigned int maxChannels; + + /* + The configuration space needs to be restricted to this format so we can get an accurate + picture of which sample rates and channel counts are support with this format. + */ + ((ma_snd_pcm_hw_params_set_format_proc)pContext->alsa.snd_pcm_hw_params_set_format)(pPCM, pHWParams, ma_convert_ma_format_to_alsa_format(format)); + + /* Now we need to check for supported channels. */ + ((ma_snd_pcm_hw_params_get_channels_min_proc)pContext->alsa.snd_pcm_hw_params_get_channels_min)(pHWParams, &minChannels); + ((ma_snd_pcm_hw_params_get_channels_max_proc)pContext->alsa.snd_pcm_hw_params_get_channels_max)(pHWParams, &maxChannels); + + if (minChannels > MA_MAX_CHANNELS) { + continue; /* Too many channels. */ + } + if (maxChannels < MA_MIN_CHANNELS) { + continue; /* Not enough channels. */ + } + + /* + Make sure the channel count is clamped. This is mainly intended for the max channels + because some devices can report an unbound maximum. + */ + minChannels = ma_clamp(minChannels, MA_MIN_CHANNELS, MA_MAX_CHANNELS); + maxChannels = ma_clamp(maxChannels, MA_MIN_CHANNELS, MA_MAX_CHANNELS); + + if (minChannels == MA_MIN_CHANNELS && maxChannels == MA_MAX_CHANNELS) { + /* The device supports all channels. Don't iterate over every single one. Instead just set the channels to 0 which means all channels are supported. */ + ma_context_iterate_rates_and_add_native_data_format__alsa(pContext, pPCM, pHWParams, format, 0, 0, pDeviceInfo); /* Intentionally setting the channel count to 0 as that means all channels are supported. */ + } else { + /* The device only supports a specific set of channels. We need to iterate over all of them. */ + for (iChannel = minChannels; iChannel <= maxChannels; iChannel += 1) { + /* Test the channel before applying it to the configuration space. */ + unsigned int channels = iChannel; + + /* Make sure our channel range is reset before testing again or else we'll always fail the test. */ + ((ma_snd_pcm_hw_params_any_proc)pContext->alsa.snd_pcm_hw_params_any)(pPCM, pHWParams); + ((ma_snd_pcm_hw_params_set_format_proc)pContext->alsa.snd_pcm_hw_params_set_format)(pPCM, pHWParams, ma_convert_ma_format_to_alsa_format(format)); + + if (((ma_snd_pcm_hw_params_test_channels_proc)pContext->alsa.snd_pcm_hw_params_test_channels)(pPCM, pHWParams, channels) == 0) { + /* The channel count is supported. */ + + /* The configuration space now needs to be restricted to the channel count before extracting the sample rate. */ + ((ma_snd_pcm_hw_params_set_channels_proc)pContext->alsa.snd_pcm_hw_params_set_channels)(pPCM, pHWParams, channels); + + /* Only after the configuration space has been restricted to the specific channel count should we iterate over our sample rates. */ + ma_context_iterate_rates_and_add_native_data_format__alsa(pContext, pPCM, pHWParams, format, channels, 0, pDeviceInfo); + } else { + /* The channel count is not supported. Skip. */ + } + } + } + } else { + /* The format is not supported. Skip. */ + } } - ((ma_snd_pcm_hw_params_get_format_mask_proc)pContext->alsa.snd_pcm_hw_params_get_format_mask)(pHWParams, pFormatMask); - - pDeviceInfo->formatCount = 0; - if (((ma_snd_pcm_format_mask_test_proc)pContext->alsa.snd_pcm_format_mask_test)(pFormatMask, MA_SND_PCM_FORMAT_U8)) { - pDeviceInfo->formats[pDeviceInfo->formatCount++] = ma_format_u8; - } - if (((ma_snd_pcm_format_mask_test_proc)pContext->alsa.snd_pcm_format_mask_test)(pFormatMask, MA_SND_PCM_FORMAT_S16_LE)) { - pDeviceInfo->formats[pDeviceInfo->formatCount++] = ma_format_s16; - } - if (((ma_snd_pcm_format_mask_test_proc)pContext->alsa.snd_pcm_format_mask_test)(pFormatMask, MA_SND_PCM_FORMAT_S24_3LE)) { - pDeviceInfo->formats[pDeviceInfo->formatCount++] = ma_format_s24; - } - if (((ma_snd_pcm_format_mask_test_proc)pContext->alsa.snd_pcm_format_mask_test)(pFormatMask, MA_SND_PCM_FORMAT_S32_LE)) { - pDeviceInfo->formats[pDeviceInfo->formatCount++] = ma_format_s32; - } - if (((ma_snd_pcm_format_mask_test_proc)pContext->alsa.snd_pcm_format_mask_test)(pFormatMask, MA_SND_PCM_FORMAT_FLOAT_LE)) { - pDeviceInfo->formats[pDeviceInfo->formatCount++] = ma_format_f32; - } - - ma__free_from_callbacks(pFormatMask, &pContext->allocationCallbacks); ma__free_from_callbacks(pHWParams, &pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pContext->alsa.snd_pcm_close)(pPCM); return MA_SUCCESS; } - -#if 0 -/* -Waits for a number of frames to become available for either capture or playback. The return -value is the number of frames available. - -This will return early if the main loop is broken with ma_device__break_main_loop(). -*/ -static ma_uint32 ma_device__wait_for_frames__alsa(ma_device* pDevice, ma_bool32* pRequiresRestart) -{ - MA_ASSERT(pDevice != NULL); - - if (pRequiresRestart) *pRequiresRestart = MA_FALSE; - - /* I want it so that this function returns the period size in frames. We just wait until that number of frames are available and then return. */ - ma_uint32 periodSizeInFrames = pDevice->bufferSizeInFrames / pDevice->periods; - while (!pDevice->alsa.breakFromMainLoop) { - ma_snd_pcm_sframes_t framesAvailable = ((ma_snd_pcm_avail_update_proc)pDevice->pContext->alsa.snd_pcm_avail_update)((ma_snd_pcm_t*)pDevice->alsa.pPCM); - if (framesAvailable < 0) { - if (framesAvailable == -EPIPE) { - if (((ma_snd_pcm_recover_proc)pDevice->pContext->alsa.snd_pcm_recover)((ma_snd_pcm_t*)pDevice->alsa.pPCM, framesAvailable, MA_TRUE) < 0) { - return 0; - } - - /* A device recovery means a restart for mmap mode. */ - if (pRequiresRestart) { - *pRequiresRestart = MA_TRUE; - } - - /* Try again, but if it fails this time just return an error. */ - framesAvailable = ((ma_snd_pcm_avail_update_proc)pDevice->pContext->alsa.snd_pcm_avail_update)((ma_snd_pcm_t*)pDevice->alsa.pPCM); - if (framesAvailable < 0) { - return 0; - } - } - } - - if (framesAvailable >= periodSizeInFrames) { - return periodSizeInFrames; - } - - if (framesAvailable < periodSizeInFrames) { - /* Less than a whole period is available so keep waiting. */ - int waitResult = ((ma_snd_pcm_wait_proc)pDevice->pContext->alsa.snd_pcm_wait)((ma_snd_pcm_t*)pDevice->alsa.pPCM, -1); - if (waitResult < 0) { - if (waitResult == -EPIPE) { - if (((ma_snd_pcm_recover_proc)pDevice->pContext->alsa.snd_pcm_recover)((ma_snd_pcm_t*)pDevice->alsa.pPCM, waitResult, MA_TRUE) < 0) { - return 0; - } - - /* A device recovery means a restart for mmap mode. */ - if (pRequiresRestart) { - *pRequiresRestart = MA_TRUE; - } - } - } - } - } - - /* We'll get here if the loop was terminated. Just return whatever's available. */ - ma_snd_pcm_sframes_t framesAvailable = ((ma_snd_pcm_avail_update_proc)pDevice->pContext->alsa.snd_pcm_avail_update)((ma_snd_pcm_t*)pDevice->alsa.pPCM); - if (framesAvailable < 0) { - return 0; - } - - return framesAvailable; -} - -static ma_bool32 ma_device_read_from_client_and_write__alsa(ma_device* pDevice) -{ - MA_ASSERT(pDevice != NULL); - if (!ma_device_is_started(pDevice) && ma_device_get_state(pDevice) != MA_STATE_STARTING) { - return MA_FALSE; - } - if (pDevice->alsa.breakFromMainLoop) { - return MA_FALSE; - } - - if (pDevice->alsa.isUsingMMap) { - /* mmap. */ - ma_bool32 requiresRestart; - ma_uint32 framesAvailable = ma_device__wait_for_frames__alsa(pDevice, &requiresRestart); - if (framesAvailable == 0) { - return MA_FALSE; - } - - /* Don't bother asking the client for more audio data if we're just stopping the device anyway. */ - if (pDevice->alsa.breakFromMainLoop) { - return MA_FALSE; - } - - const ma_snd_pcm_channel_area_t* pAreas; - ma_snd_pcm_uframes_t mappedOffset; - ma_snd_pcm_uframes_t mappedFrames = framesAvailable; - while (framesAvailable > 0) { - int result = ((ma_snd_pcm_mmap_begin_proc)pDevice->pContext->alsa.snd_pcm_mmap_begin)((ma_snd_pcm_t*)pDevice->alsa.pPCM, &pAreas, &mappedOffset, &mappedFrames); - if (result < 0) { - return MA_FALSE; - } - - if (mappedFrames > 0) { - void* pBuffer = (ma_uint8*)pAreas[0].addr + ((pAreas[0].first + (mappedOffset * pAreas[0].step)) / 8); - ma_device__read_frames_from_client(pDevice, mappedFrames, pBuffer); - } - - result = ((ma_snd_pcm_mmap_commit_proc)pDevice->pContext->alsa.snd_pcm_mmap_commit)((ma_snd_pcm_t*)pDevice->alsa.pPCM, mappedOffset, mappedFrames); - if (result < 0 || (ma_snd_pcm_uframes_t)result != mappedFrames) { - ((ma_snd_pcm_recover_proc)pDevice->pContext->alsa.snd_pcm_recover)((ma_snd_pcm_t*)pDevice->alsa.pPCM, result, MA_TRUE); - return MA_FALSE; - } - - if (requiresRestart) { - if (((ma_snd_pcm_start_proc)pDevice->pContext->alsa.snd_pcm_start)((ma_snd_pcm_t*)pDevice->alsa.pPCM) < 0) { - return MA_FALSE; - } - } - - if (framesAvailable >= mappedFrames) { - framesAvailable -= mappedFrames; - } else { - framesAvailable = 0; - } - } - } else { - /* readi/writei. */ - while (!pDevice->alsa.breakFromMainLoop) { - ma_uint32 framesAvailable = ma_device__wait_for_frames__alsa(pDevice, NULL); - if (framesAvailable == 0) { - continue; - } - - /* Don't bother asking the client for more audio data if we're just stopping the device anyway. */ - if (pDevice->alsa.breakFromMainLoop) { - return MA_FALSE; - } - - ma_device__read_frames_from_client(pDevice, framesAvailable, pDevice->alsa.pIntermediaryBuffer); - - ma_snd_pcm_sframes_t framesWritten = ((ma_snd_pcm_writei_proc)pDevice->pContext->alsa.snd_pcm_writei)((ma_snd_pcm_t*)pDevice->alsa.pPCM, pDevice->alsa.pIntermediaryBuffer, framesAvailable); - if (framesWritten < 0) { - if (framesWritten == -EAGAIN) { - continue; /* Just keep trying... */ - } else if (framesWritten == -EPIPE) { - /* Underrun. Just recover and try writing again. */ - if (((ma_snd_pcm_recover_proc)pDevice->pContext->alsa.snd_pcm_recover)((ma_snd_pcm_t*)pDevice->alsa.pPCM, framesWritten, MA_TRUE) < 0) { - ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to recover device after underrun.", MA_FAILED_TO_START_BACKEND_DEVICE); - return MA_FALSE; - } - - framesWritten = ((ma_snd_pcm_writei_proc)pDevice->pContext->alsa.snd_pcm_writei)((ma_snd_pcm_t*)pDevice->alsa.pPCM, pDevice->alsa.pIntermediaryBuffer, framesAvailable); - if (framesWritten < 0) { - ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to write data to the internal device.", ma_result_from_errno((int)-framesWritten)); - return MA_FALSE; - } - - break; /* Success. */ - } else { - ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] snd_pcm_writei() failed when writing initial data.", ma_result_from_errno((int)-framesWritten)); - return MA_FALSE; - } - } else { - break; /* Success. */ - } - } - } - - return MA_TRUE; -} - -static ma_bool32 ma_device_read_and_send_to_client__alsa(ma_device* pDevice) -{ - MA_ASSERT(pDevice != NULL); - if (!ma_device_is_started(pDevice)) { - return MA_FALSE; - } - if (pDevice->alsa.breakFromMainLoop) { - return MA_FALSE; - } - - ma_uint32 framesToSend = 0; - void* pBuffer = NULL; - if (pDevice->alsa.pIntermediaryBuffer == NULL) { - /* mmap. */ - ma_bool32 requiresRestart; - ma_uint32 framesAvailable = ma_device__wait_for_frames__alsa(pDevice, &requiresRestart); - if (framesAvailable == 0) { - return MA_FALSE; - } - - const ma_snd_pcm_channel_area_t* pAreas; - ma_snd_pcm_uframes_t mappedOffset; - ma_snd_pcm_uframes_t mappedFrames = framesAvailable; - while (framesAvailable > 0) { - int result = ((ma_snd_pcm_mmap_begin_proc)pDevice->pContext->alsa.snd_pcm_mmap_begin)((ma_snd_pcm_t*)pDevice->alsa.pPCM, &pAreas, &mappedOffset, &mappedFrames); - if (result < 0) { - return MA_FALSE; - } - - if (mappedFrames > 0) { - void* pBuffer = (ma_uint8*)pAreas[0].addr + ((pAreas[0].first + (mappedOffset * pAreas[0].step)) / 8); - ma_device__send_frames_to_client(pDevice, mappedFrames, pBuffer); - } - - result = ((ma_snd_pcm_mmap_commit_proc)pDevice->pContext->alsa.snd_pcm_mmap_commit)((ma_snd_pcm_t*)pDevice->alsa.pPCM, mappedOffset, mappedFrames); - if (result < 0 || (ma_snd_pcm_uframes_t)result != mappedFrames) { - ((ma_snd_pcm_recover_proc)pDevice->pContext->alsa.snd_pcm_recover)((ma_snd_pcm_t*)pDevice->alsa.pPCM, result, MA_TRUE); - return MA_FALSE; - } - - if (requiresRestart) { - if (((ma_snd_pcm_start_proc)pDevice->pContext->alsa.snd_pcm_start)((ma_snd_pcm_t*)pDevice->alsa.pPCM) < 0) { - return MA_FALSE; - } - } - - if (framesAvailable >= mappedFrames) { - framesAvailable -= mappedFrames; - } else { - framesAvailable = 0; - } - } - } else { - /* readi/writei. */ - ma_snd_pcm_sframes_t framesRead = 0; - while (!pDevice->alsa.breakFromMainLoop) { - ma_uint32 framesAvailable = ma_device__wait_for_frames__alsa(pDevice, NULL); - if (framesAvailable == 0) { - continue; - } - - framesRead = ((ma_snd_pcm_readi_proc)pDevice->pContext->alsa.snd_pcm_readi)((ma_snd_pcm_t*)pDevice->alsa.pPCM, pDevice->alsa.pIntermediaryBuffer, framesAvailable); - if (framesRead < 0) { - if (framesRead == -EAGAIN) { - continue; /* Just keep trying... */ - } else if (framesRead == -EPIPE) { - /* Overrun. Just recover and try reading again. */ - if (((ma_snd_pcm_recover_proc)pDevice->pContext->alsa.snd_pcm_recover)((ma_snd_pcm_t*)pDevice->alsa.pPCM, framesRead, MA_TRUE) < 0) { - ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to recover device after overrun.", MA_FAILED_TO_START_BACKEND_DEVICE); - return MA_FALSE; - } - - framesRead = ((ma_snd_pcm_readi_proc)pDevice->pContext->alsa.snd_pcm_readi)((ma_snd_pcm_t*)pDevice->alsa.pPCM, pDevice->alsa.pIntermediaryBuffer, framesAvailable); - if (framesRead < 0) { - ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to read data from the internal device.", ma_result_from_errno((int)-framesRead)); - return MA_FALSE; - } - - break; /* Success. */ - } else { - return MA_FALSE; - } - } else { - break; /* Success. */ - } - } - - framesToSend = framesRead; - pBuffer = pDevice->alsa.pIntermediaryBuffer; - } - - if (framesToSend > 0) { - ma_device__send_frames_to_client(pDevice, framesToSend, pBuffer); - } - - return MA_TRUE; -} -#endif /* 0 */ - -static void ma_device_uninit__alsa(ma_device* pDevice) +static ma_result ma_device_uninit__alsa(ma_device* pDevice) { MA_ASSERT(pDevice != NULL); @@ -19665,17 +20187,17 @@ static void ma_device_uninit__alsa(ma_device* pDevice) if ((ma_snd_pcm_t*)pDevice->alsa.pPCMPlayback) { ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)((ma_snd_pcm_t*)pDevice->alsa.pPCMPlayback); } + + return MA_SUCCESS; } -static ma_result ma_device_init_by_type__alsa(ma_context* pContext, const ma_device_config* pConfig, ma_device_type deviceType, ma_device* pDevice) +static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptor, ma_device_type deviceType) { ma_result result; int resultALSA; ma_snd_pcm_t* pPCM; ma_bool32 isUsingMMap; ma_snd_pcm_format_t formatALSA; - ma_share_mode shareMode; - const ma_device_id* pDeviceID; ma_format internalFormat; ma_uint32 internalChannels; ma_uint32 internalSampleRate; @@ -19686,16 +20208,12 @@ static ma_result ma_device_init_by_type__alsa(ma_context* pContext, const ma_dev ma_snd_pcm_hw_params_t* pHWParams; ma_snd_pcm_sw_params_t* pSWParams; ma_snd_pcm_uframes_t bufferBoundary; - float bufferSizeScaleFactor; - MA_ASSERT(pContext != NULL); MA_ASSERT(pConfig != NULL); MA_ASSERT(deviceType != ma_device_type_duplex); /* This function should only be called for playback _or_ capture, never duplex. */ MA_ASSERT(pDevice != NULL); - formatALSA = ma_convert_ma_format_to_alsa_format((deviceType == ma_device_type_capture) ? pConfig->capture.format : pConfig->playback.format); - shareMode = (deviceType == ma_device_type_capture) ? pConfig->capture.shareMode : pConfig->playback.shareMode; - pDeviceID = (deviceType == ma_device_type_capture) ? pConfig->capture.pDeviceID : pConfig->playback.pDeviceID; + formatALSA = ma_convert_ma_format_to_alsa_format(pDescriptor->format); openMode = 0; if (pConfig->alsa.noAutoResample) { @@ -19708,78 +20226,21 @@ static ma_result ma_device_init_by_type__alsa(ma_context* pContext, const ma_dev openMode |= MA_SND_PCM_NO_AUTO_FORMAT; } - result = ma_context_open_pcm__alsa(pContext, shareMode, deviceType, pDeviceID, openMode, &pPCM); + result = ma_context_open_pcm__alsa(pDevice->pContext, pDescriptor->shareMode, deviceType, pDescriptor->pDeviceID, openMode, &pPCM); if (result != MA_SUCCESS) { return result; } - /* If using the default buffer size we may want to apply some device-specific scaling for known devices that have peculiar latency characteristics */ - bufferSizeScaleFactor = 1; - if (pDevice->usingDefaultBufferSize) { - ma_snd_pcm_info_t* pInfo = (ma_snd_pcm_info_t*)ma__calloc_from_callbacks(((ma_snd_pcm_info_sizeof_proc)pContext->alsa.snd_pcm_info_sizeof)(), &pContext->allocationCallbacks); - if (pInfo == NULL) { - return MA_OUT_OF_MEMORY; - } - - /* We may need to scale the size of the buffer depending on the device. */ - if (((ma_snd_pcm_info_proc)pContext->alsa.snd_pcm_info)(pPCM, pInfo) == 0) { - const char* deviceName = ((ma_snd_pcm_info_get_name_proc)pContext->alsa.snd_pcm_info_get_name)(pInfo); - if (deviceName != NULL) { - if (ma_strcmp(deviceName, "default") == 0) { - char** ppDeviceHints; - char** ppNextDeviceHint; - - /* It's the default device. We need to use DESC from snd_device_name_hint(). */ - if (((ma_snd_device_name_hint_proc)pContext->alsa.snd_device_name_hint)(-1, "pcm", (void***)&ppDeviceHints) < 0) { - ma__free_from_callbacks(pInfo, &pContext->allocationCallbacks); - return MA_NO_BACKEND; - } - - ppNextDeviceHint = ppDeviceHints; - while (*ppNextDeviceHint != NULL) { - char* NAME = ((ma_snd_device_name_get_hint_proc)pContext->alsa.snd_device_name_get_hint)(*ppNextDeviceHint, "NAME"); - char* DESC = ((ma_snd_device_name_get_hint_proc)pContext->alsa.snd_device_name_get_hint)(*ppNextDeviceHint, "DESC"); - char* IOID = ((ma_snd_device_name_get_hint_proc)pContext->alsa.snd_device_name_get_hint)(*ppNextDeviceHint, "IOID"); - - ma_bool32 foundDevice = MA_FALSE; - if ((deviceType == ma_device_type_playback && (IOID == NULL || ma_strcmp(IOID, "Output") == 0)) || - (deviceType == ma_device_type_capture && (IOID != NULL && ma_strcmp(IOID, "Input" ) == 0))) { - if (ma_strcmp(NAME, deviceName) == 0) { - bufferSizeScaleFactor = ma_find_default_buffer_size_scale__alsa(DESC); - foundDevice = MA_TRUE; - } - } - - free(NAME); - free(DESC); - free(IOID); - ppNextDeviceHint += 1; - - if (foundDevice) { - break; - } - } - - ((ma_snd_device_name_free_hint_proc)pContext->alsa.snd_device_name_free_hint)((void**)ppDeviceHints); - } else { - bufferSizeScaleFactor = ma_find_default_buffer_size_scale__alsa(deviceName); - } - } - } - - ma__free_from_callbacks(pInfo, &pContext->allocationCallbacks); - } - /* Hardware parameters. */ - pHWParams = (ma_snd_pcm_hw_params_t*)ma__calloc_from_callbacks(((ma_snd_pcm_hw_params_sizeof_proc)pContext->alsa.snd_pcm_hw_params_sizeof)(), &pContext->allocationCallbacks); + pHWParams = (ma_snd_pcm_hw_params_t*)ma__calloc_from_callbacks(((ma_snd_pcm_hw_params_sizeof_proc)pDevice->pContext->alsa.snd_pcm_hw_params_sizeof)(), &pDevice->pContext->allocationCallbacks); if (pHWParams == NULL) { return MA_OUT_OF_MEMORY; } - resultALSA = ((ma_snd_pcm_hw_params_any_proc)pContext->alsa.snd_pcm_hw_params_any)(pPCM, pHWParams); + resultALSA = ((ma_snd_pcm_hw_params_any_proc)pDevice->pContext->alsa.snd_pcm_hw_params_any)(pPCM, pHWParams); if (resultALSA < 0) { - ma__free_from_callbacks(pHWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pHWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to initialize hardware parameters. snd_pcm_hw_params_any() failed.", ma_result_from_errno(-resultALSA)); } @@ -19789,7 +20250,7 @@ static ma_result ma_device_init_by_type__alsa(ma_context* pContext, const ma_dev #if 0 /* NOTE: MMAP mode temporarily disabled. */ if (deviceType != ma_device_type_capture) { /* <-- Disabling MMAP mode for capture devices because I apparently do not have a device that supports it which means I can't test it... Contributions welcome. */ if (!pConfig->alsa.noMMap && ma_device__is_async(pDevice)) { - if (((ma_snd_pcm_hw_params_set_access_proc)pContext->alsa.snd_pcm_hw_params_set_access)(pPCM, pHWParams, MA_SND_PCM_ACCESS_MMAP_INTERLEAVED) == 0) { + if (((ma_snd_pcm_hw_params_set_access_proc)pDevice->pContext->alsa.snd_pcm_hw_params_set_access)(pPCM, pHWParams, MA_SND_PCM_ACCESS_MMAP_INTERLEAVED) == 0) { pDevice->alsa.isUsingMMap = MA_TRUE; } } @@ -19797,9 +20258,9 @@ static ma_result ma_device_init_by_type__alsa(ma_context* pContext, const ma_dev #endif if (!isUsingMMap) { - resultALSA = ((ma_snd_pcm_hw_params_set_access_proc)pContext->alsa.snd_pcm_hw_params_set_access)(pPCM, pHWParams, MA_SND_PCM_ACCESS_RW_INTERLEAVED); + resultALSA = ((ma_snd_pcm_hw_params_set_access_proc)pDevice->pContext->alsa.snd_pcm_hw_params_set_access)(pPCM, pHWParams, MA_SND_PCM_ACCESS_RW_INTERLEAVED); if (resultALSA < 0) { - ma__free_from_callbacks(pHWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pHWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to set access mode to neither SND_PCM_ACCESS_MMAP_INTERLEAVED nor SND_PCM_ACCESS_RW_INTERLEAVED. snd_pcm_hw_params_set_access() failed.", ma_result_from_errno(-resultALSA)); } @@ -19812,70 +20273,39 @@ static ma_result ma_device_init_by_type__alsa(ma_context* pContext, const ma_dev /* Format. */ { - ma_snd_pcm_format_mask_t* pFormatMask; - - /* Try getting every supported format first. */ - pFormatMask = (ma_snd_pcm_format_mask_t*)ma__calloc_from_callbacks(((ma_snd_pcm_format_mask_sizeof_proc)pContext->alsa.snd_pcm_format_mask_sizeof)(), &pContext->allocationCallbacks); - if (pFormatMask == NULL) { - ma__free_from_callbacks(pHWParams, &pContext->allocationCallbacks); - ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); - return MA_OUT_OF_MEMORY; - } - - ((ma_snd_pcm_hw_params_get_format_mask_proc)pContext->alsa.snd_pcm_hw_params_get_format_mask)(pHWParams, pFormatMask); - /* At this point we should have a list of supported formats, so now we need to find the best one. We first check if the requested format is supported, and if so, use that one. If it's not supported, we just run though a list of formats and try to find the best one. */ - if (!((ma_snd_pcm_format_mask_test_proc)pContext->alsa.snd_pcm_format_mask_test)(pFormatMask, formatALSA)) { - size_t i; - - /* The requested format is not supported so now try running through the list of formats and return the best one. */ - ma_snd_pcm_format_t preferredFormatsALSA[] = { - MA_SND_PCM_FORMAT_S16_LE, /* ma_format_s16 */ - MA_SND_PCM_FORMAT_FLOAT_LE, /* ma_format_f32 */ - MA_SND_PCM_FORMAT_S32_LE, /* ma_format_s32 */ - MA_SND_PCM_FORMAT_S24_3LE, /* ma_format_s24 */ - MA_SND_PCM_FORMAT_U8 /* ma_format_u8 */ - }; - - if (ma_is_big_endian()) { - preferredFormatsALSA[0] = MA_SND_PCM_FORMAT_S16_BE; - preferredFormatsALSA[1] = MA_SND_PCM_FORMAT_FLOAT_BE; - preferredFormatsALSA[2] = MA_SND_PCM_FORMAT_S32_BE; - preferredFormatsALSA[3] = MA_SND_PCM_FORMAT_S24_3BE; - preferredFormatsALSA[4] = MA_SND_PCM_FORMAT_U8; - } + if (formatALSA == MA_SND_PCM_FORMAT_UNKNOWN || ((ma_snd_pcm_hw_params_test_format_proc)pDevice->pContext->alsa.snd_pcm_hw_params_test_format)(pPCM, pHWParams, formatALSA) != 0) { + /* We're either requesting the native format or the specified format is not supported. */ + size_t iFormat; formatALSA = MA_SND_PCM_FORMAT_UNKNOWN; - for (i = 0; i < (sizeof(preferredFormatsALSA) / sizeof(preferredFormatsALSA[0])); ++i) { - if (((ma_snd_pcm_format_mask_test_proc)pContext->alsa.snd_pcm_format_mask_test)(pFormatMask, preferredFormatsALSA[i])) { - formatALSA = preferredFormatsALSA[i]; + for (iFormat = 0; iFormat < ma_countof(g_maFormatPriorities); ++iFormat) { + if (((ma_snd_pcm_hw_params_test_format_proc)pDevice->pContext->alsa.snd_pcm_hw_params_test_format)(pPCM, pHWParams, ma_convert_ma_format_to_alsa_format(g_maFormatPriorities[iFormat])) == 0) { + formatALSA = ma_convert_ma_format_to_alsa_format(g_maFormatPriorities[iFormat]); break; } } if (formatALSA == MA_SND_PCM_FORMAT_UNKNOWN) { - ma__free_from_callbacks(pHWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pHWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Format not supported. The device does not support any miniaudio formats.", MA_FORMAT_NOT_SUPPORTED); } } - ma__free_from_callbacks(pFormatMask, &pContext->allocationCallbacks); - pFormatMask = NULL; - - resultALSA = ((ma_snd_pcm_hw_params_set_format_proc)pContext->alsa.snd_pcm_hw_params_set_format)(pPCM, pHWParams, formatALSA); + resultALSA = ((ma_snd_pcm_hw_params_set_format_proc)pDevice->pContext->alsa.snd_pcm_hw_params_set_format)(pPCM, pHWParams, formatALSA); if (resultALSA < 0) { - ma__free_from_callbacks(pHWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pHWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Format not supported. snd_pcm_hw_params_set_format() failed.", ma_result_from_errno(-resultALSA)); } internalFormat = ma_format_from_alsa(formatALSA); if (internalFormat == ma_format_unknown) { - ma__free_from_callbacks(pHWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pHWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] The chosen format is not supported by miniaudio.", MA_FORMAT_NOT_SUPPORTED); } @@ -19883,13 +20313,18 @@ static ma_result ma_device_init_by_type__alsa(ma_context* pContext, const ma_dev /* Channels. */ { - unsigned int channels = (deviceType == ma_device_type_capture) ? pConfig->capture.channels : pConfig->playback.channels; - resultALSA = ((ma_snd_pcm_hw_params_set_channels_near_proc)pContext->alsa.snd_pcm_hw_params_set_channels_near)(pPCM, pHWParams, &channels); + unsigned int channels = pDescriptor->channels; + if (channels == 0) { + channels = MA_DEFAULT_CHANNELS; + } + + resultALSA = ((ma_snd_pcm_hw_params_set_channels_near_proc)pDevice->pContext->alsa.snd_pcm_hw_params_set_channels_near)(pPCM, pHWParams, &channels); if (resultALSA < 0) { - ma__free_from_callbacks(pHWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pHWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to set channel count. snd_pcm_hw_params_set_channels_near() failed.", ma_result_from_errno(-resultALSA)); } + internalChannels = (ma_uint32)channels; } @@ -19914,80 +20349,85 @@ static ma_result ma_device_init_by_type__alsa(ma_context* pContext, const ma_dev I don't currently know if the dmix plugin is the only one with this error. Indeed, this is the only one I've been able to reproduce this error with. In the future, we may want to restrict the disabling of resampling to only known bad plugins. */ - ((ma_snd_pcm_hw_params_set_rate_resample_proc)pContext->alsa.snd_pcm_hw_params_set_rate_resample)(pPCM, pHWParams, 0); + ((ma_snd_pcm_hw_params_set_rate_resample_proc)pDevice->pContext->alsa.snd_pcm_hw_params_set_rate_resample)(pPCM, pHWParams, 0); - sampleRate = pConfig->sampleRate; - resultALSA = ((ma_snd_pcm_hw_params_set_rate_near_proc)pContext->alsa.snd_pcm_hw_params_set_rate_near)(pPCM, pHWParams, &sampleRate, 0); + sampleRate = pDescriptor->sampleRate; + if (sampleRate == 0) { + sampleRate = MA_DEFAULT_SAMPLE_RATE; + } + + resultALSA = ((ma_snd_pcm_hw_params_set_rate_near_proc)pDevice->pContext->alsa.snd_pcm_hw_params_set_rate_near)(pPCM, pHWParams, &sampleRate, 0); if (resultALSA < 0) { - ma__free_from_callbacks(pHWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pHWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Sample rate not supported. snd_pcm_hw_params_set_rate_near() failed.", ma_result_from_errno(-resultALSA)); } + internalSampleRate = (ma_uint32)sampleRate; } /* Periods. */ { - ma_uint32 periods = pConfig->periods; - resultALSA = ((ma_snd_pcm_hw_params_set_periods_near_proc)pContext->alsa.snd_pcm_hw_params_set_periods_near)(pPCM, pHWParams, &periods, NULL); + ma_uint32 periods = pDescriptor->periodCount; + + resultALSA = ((ma_snd_pcm_hw_params_set_periods_near_proc)pDevice->pContext->alsa.snd_pcm_hw_params_set_periods_near)(pPCM, pHWParams, &periods, NULL); if (resultALSA < 0) { - ma__free_from_callbacks(pHWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pHWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to set period count. snd_pcm_hw_params_set_periods_near() failed.", ma_result_from_errno(-resultALSA)); } + internalPeriods = periods; } /* Buffer Size */ { - ma_snd_pcm_uframes_t actualBufferSizeInFrames = pConfig->periodSizeInFrames * internalPeriods; - if (actualBufferSizeInFrames == 0) { - actualBufferSizeInFrames = ma_scale_buffer_size(ma_calculate_buffer_size_in_frames_from_milliseconds(pConfig->periodSizeInMilliseconds, internalSampleRate), bufferSizeScaleFactor) * internalPeriods; - } + ma_snd_pcm_uframes_t actualBufferSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptor, internalSampleRate, pConfig->performanceProfile) * internalPeriods; - resultALSA = ((ma_snd_pcm_hw_params_set_buffer_size_near_proc)pContext->alsa.snd_pcm_hw_params_set_buffer_size_near)(pPCM, pHWParams, &actualBufferSizeInFrames); + resultALSA = ((ma_snd_pcm_hw_params_set_buffer_size_near_proc)pDevice->pContext->alsa.snd_pcm_hw_params_set_buffer_size_near)(pPCM, pHWParams, &actualBufferSizeInFrames); if (resultALSA < 0) { - ma__free_from_callbacks(pHWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pHWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to set buffer size for device. snd_pcm_hw_params_set_buffer_size() failed.", ma_result_from_errno(-resultALSA)); } + internalPeriodSizeInFrames = actualBufferSizeInFrames / internalPeriods; } /* Apply hardware parameters. */ - resultALSA = ((ma_snd_pcm_hw_params_proc)pContext->alsa.snd_pcm_hw_params)(pPCM, pHWParams); + resultALSA = ((ma_snd_pcm_hw_params_proc)pDevice->pContext->alsa.snd_pcm_hw_params)(pPCM, pHWParams); if (resultALSA < 0) { - ma__free_from_callbacks(pHWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pHWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to set hardware parameters. snd_pcm_hw_params() failed.", ma_result_from_errno(-resultALSA)); } - ma__free_from_callbacks(pHWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pHWParams, &pDevice->pContext->allocationCallbacks); pHWParams = NULL; /* Software parameters. */ - pSWParams = (ma_snd_pcm_sw_params_t*)ma__calloc_from_callbacks(((ma_snd_pcm_sw_params_sizeof_proc)pContext->alsa.snd_pcm_sw_params_sizeof)(), &pContext->allocationCallbacks); + pSWParams = (ma_snd_pcm_sw_params_t*)ma__calloc_from_callbacks(((ma_snd_pcm_sw_params_sizeof_proc)pDevice->pContext->alsa.snd_pcm_sw_params_sizeof)(), &pDevice->pContext->allocationCallbacks); if (pSWParams == NULL) { ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return MA_OUT_OF_MEMORY; } - resultALSA = ((ma_snd_pcm_sw_params_current_proc)pContext->alsa.snd_pcm_sw_params_current)(pPCM, pSWParams); + resultALSA = ((ma_snd_pcm_sw_params_current_proc)pDevice->pContext->alsa.snd_pcm_sw_params_current)(pPCM, pSWParams); if (resultALSA < 0) { - ma__free_from_callbacks(pSWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pSWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to initialize software parameters. snd_pcm_sw_params_current() failed.", ma_result_from_errno(-resultALSA)); } - resultALSA = ((ma_snd_pcm_sw_params_set_avail_min_proc)pContext->alsa.snd_pcm_sw_params_set_avail_min)(pPCM, pSWParams, ma_prev_power_of_2(internalPeriodSizeInFrames)); + resultALSA = ((ma_snd_pcm_sw_params_set_avail_min_proc)pDevice->pContext->alsa.snd_pcm_sw_params_set_avail_min)(pPCM, pSWParams, ma_prev_power_of_2(internalPeriodSizeInFrames)); if (resultALSA < 0) { - ma__free_from_callbacks(pSWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pSWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] snd_pcm_sw_params_set_avail_min() failed.", ma_result_from_errno(-resultALSA)); } - resultALSA = ((ma_snd_pcm_sw_params_get_boundary_proc)pContext->alsa.snd_pcm_sw_params_get_boundary)(pSWParams, &bufferBoundary); + resultALSA = ((ma_snd_pcm_sw_params_get_boundary_proc)pDevice->pContext->alsa.snd_pcm_sw_params_get_boundary)(pSWParams, &bufferBoundary); if (resultALSA < 0) { bufferBoundary = internalPeriodSizeInFrames * internalPeriods; } @@ -19999,35 +20439,35 @@ static ma_result ma_device_init_by_type__alsa(ma_context* pContext, const ma_dev Subtle detail here with the start threshold. When in playback-only mode (no full-duplex) we can set the start threshold to the size of a period. But for full-duplex we need to set it such that it is at least two periods. */ - resultALSA = ((ma_snd_pcm_sw_params_set_start_threshold_proc)pContext->alsa.snd_pcm_sw_params_set_start_threshold)(pPCM, pSWParams, internalPeriodSizeInFrames*2); + resultALSA = ((ma_snd_pcm_sw_params_set_start_threshold_proc)pDevice->pContext->alsa.snd_pcm_sw_params_set_start_threshold)(pPCM, pSWParams, internalPeriodSizeInFrames*2); if (resultALSA < 0) { - ma__free_from_callbacks(pSWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pSWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to set start threshold for playback device. snd_pcm_sw_params_set_start_threshold() failed.", ma_result_from_errno(-resultALSA)); } - resultALSA = ((ma_snd_pcm_sw_params_set_stop_threshold_proc)pContext->alsa.snd_pcm_sw_params_set_stop_threshold)(pPCM, pSWParams, bufferBoundary); + resultALSA = ((ma_snd_pcm_sw_params_set_stop_threshold_proc)pDevice->pContext->alsa.snd_pcm_sw_params_set_stop_threshold)(pPCM, pSWParams, bufferBoundary); if (resultALSA < 0) { /* Set to boundary to loop instead of stop in the event of an xrun. */ - ma__free_from_callbacks(pSWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pSWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to set stop threshold for playback device. snd_pcm_sw_params_set_stop_threshold() failed.", ma_result_from_errno(-resultALSA)); } } - resultALSA = ((ma_snd_pcm_sw_params_proc)pContext->alsa.snd_pcm_sw_params)(pPCM, pSWParams); + resultALSA = ((ma_snd_pcm_sw_params_proc)pDevice->pContext->alsa.snd_pcm_sw_params)(pPCM, pSWParams); if (resultALSA < 0) { - ma__free_from_callbacks(pSWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pSWParams, &pDevice->pContext->allocationCallbacks); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to set software parameters. snd_pcm_sw_params() failed.", ma_result_from_errno(-resultALSA)); } - ma__free_from_callbacks(pSWParams, &pContext->allocationCallbacks); + ma__free_from_callbacks(pSWParams, &pDevice->pContext->allocationCallbacks); pSWParams = NULL; /* Grab the internal channel map. For now we're not going to bother trying to change the channel map and instead just do it ourselves. */ { - ma_snd_pcm_chmap_t* pChmap = ((ma_snd_pcm_get_chmap_proc)pContext->alsa.snd_pcm_get_chmap)(pPCM); + ma_snd_pcm_chmap_t* pChmap = ((ma_snd_pcm_get_chmap_proc)pDevice->pContext->alsa.snd_pcm_get_chmap)(pPCM); if (pChmap != NULL) { ma_uint32 iChannel; @@ -20089,29 +20529,26 @@ static ma_result ma_device_init_by_type__alsa(ma_context* pContext, const ma_dev if (deviceType == ma_device_type_capture) { - pDevice->alsa.pPCMCapture = (ma_ptr)pPCM; - pDevice->alsa.isUsingMMapCapture = isUsingMMap; - pDevice->capture.internalFormat = internalFormat; - pDevice->capture.internalChannels = internalChannels; - pDevice->capture.internalSampleRate = internalSampleRate; - ma_channel_map_copy(pDevice->capture.internalChannelMap, internalChannelMap, ma_min(internalChannels, MA_MAX_CHANNELS)); - pDevice->capture.internalPeriodSizeInFrames = internalPeriodSizeInFrames; - pDevice->capture.internalPeriods = internalPeriods; + pDevice->alsa.pPCMCapture = (ma_ptr)pPCM; + pDevice->alsa.isUsingMMapCapture = isUsingMMap; } else { - pDevice->alsa.pPCMPlayback = (ma_ptr)pPCM; - pDevice->alsa.isUsingMMapPlayback = isUsingMMap; - pDevice->playback.internalFormat = internalFormat; - pDevice->playback.internalChannels = internalChannels; - pDevice->playback.internalSampleRate = internalSampleRate; - ma_channel_map_copy(pDevice->playback.internalChannelMap, internalChannelMap, ma_min(internalChannels, MA_MAX_CHANNELS)); - pDevice->playback.internalPeriodSizeInFrames = internalPeriodSizeInFrames; - pDevice->playback.internalPeriods = internalPeriods; + pDevice->alsa.pPCMPlayback = (ma_ptr)pPCM; + pDevice->alsa.isUsingMMapPlayback = isUsingMMap; } + pDescriptor->format = internalFormat; + pDescriptor->channels = internalChannels; + pDescriptor->sampleRate = internalSampleRate; + ma_channel_map_copy(pDescriptor->channelMap, internalChannelMap, ma_min(internalChannels, MA_MAX_CHANNELS)); + pDescriptor->periodSizeInFrames = internalPeriodSizeInFrames; + pDescriptor->periodCount = internalPeriods; + + /*printf("format=%d; channels=%d; sampleRate=%d; periodSizeInFrames=%d; periodCount=%d\n", internalFormat, internalChannels, internalSampleRate, internalPeriodSizeInFrames, internalPeriods);*/ + return MA_SUCCESS; } -static ma_result ma_device_init__alsa(ma_context* pContext, const ma_device_config* pConfig, ma_device* pDevice) +static ma_result ma_device_init__alsa(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptorPlayback, ma_device_descriptor* pDescriptorCapture) { MA_ASSERT(pDevice != NULL); @@ -20122,14 +20559,14 @@ static ma_result ma_device_init__alsa(ma_context* pContext, const ma_device_conf } if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) { - ma_result result = ma_device_init_by_type__alsa(pContext, pConfig, ma_device_type_capture, pDevice); + ma_result result = ma_device_init_by_type__alsa(pDevice, pConfig, pDescriptorCapture, ma_device_type_capture); if (result != MA_SUCCESS) { return result; } } if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { - ma_result result = ma_device_init_by_type__alsa(pContext, pConfig, ma_device_type_playback, pDevice); + ma_result result = ma_device_init_by_type__alsa(pDevice, pConfig, pDescriptorPlayback, ma_device_type_playback); if (result != MA_SUCCESS) { return result; } @@ -20138,6 +20575,51 @@ static ma_result ma_device_init__alsa(ma_context* pContext, const ma_device_conf return MA_SUCCESS; } +static ma_result ma_device_start__alsa(ma_device* pDevice) +{ + int resultALSA; + + if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { + resultALSA = ((ma_snd_pcm_start_proc)pDevice->pContext->alsa.snd_pcm_start)((ma_snd_pcm_t*)pDevice->alsa.pPCMCapture); + if (resultALSA < 0) { + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to start capture device.", ma_result_from_errno(-resultALSA)); + } + } + + if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { + /* Don't need to do anything for playback because it'll be started automatically when enough data has been written. */ + } + + return MA_SUCCESS; +} + +static ma_result ma_device_stop__alsa(ma_device* pDevice) +{ + if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { + ((ma_snd_pcm_drain_proc)pDevice->pContext->alsa.snd_pcm_drain)((ma_snd_pcm_t*)pDevice->alsa.pPCMCapture); + + /* We need to prepare the device again, otherwise we won't be able to restart the device. */ + if (((ma_snd_pcm_prepare_proc)pDevice->pContext->alsa.snd_pcm_prepare)((ma_snd_pcm_t*)pDevice->alsa.pPCMCapture) < 0) { + #ifdef MA_DEBUG_OUTPUT + printf("[ALSA] Failed to prepare capture device after stopping.\n"); + #endif + } + } + + if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { + ((ma_snd_pcm_drain_proc)pDevice->pContext->alsa.snd_pcm_drain)((ma_snd_pcm_t*)pDevice->alsa.pPCMPlayback); + + /* We need to prepare the device again, otherwise we won't be able to restart the device. */ + if (((ma_snd_pcm_prepare_proc)pDevice->pContext->alsa.snd_pcm_prepare)((ma_snd_pcm_t*)pDevice->alsa.pPCMPlayback) < 0) { + #ifdef MA_DEBUG_OUTPUT + printf("[ALSA] Failed to prepare playback device after stopping.\n"); + #endif + } + } + + return MA_SUCCESS; +} + static ma_result ma_device_read__alsa(ma_device* pDevice, void* pFramesOut, ma_uint32 frameCount, ma_uint32* pFramesRead) { ma_snd_pcm_sframes_t resultALSA; @@ -20245,220 +20727,6 @@ static ma_result ma_device_write__alsa(ma_device* pDevice, const void* pFrames, return MA_SUCCESS; } -static ma_result ma_device_main_loop__alsa(ma_device* pDevice) -{ - ma_result result = MA_SUCCESS; - int resultALSA; - ma_bool32 exitLoop = MA_FALSE; - - MA_ASSERT(pDevice != NULL); - - /* Capture devices need to be started immediately. */ - if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { - resultALSA = ((ma_snd_pcm_start_proc)pDevice->pContext->alsa.snd_pcm_start)((ma_snd_pcm_t*)pDevice->alsa.pPCMCapture); - if (resultALSA < 0) { - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to start device in preparation for reading.", ma_result_from_errno(-resultALSA)); - } - } - - while (ma_device_get_state(pDevice) == MA_STATE_STARTED && !exitLoop) { - switch (pDevice->type) - { - case ma_device_type_duplex: - { - if (pDevice->alsa.isUsingMMapCapture || pDevice->alsa.isUsingMMapPlayback) { - /* MMAP */ - return MA_INVALID_OPERATION; /* Not yet implemented. */ - } else { - /* readi() and writei() */ - - /* The process is: device_read -> convert -> callback -> convert -> device_write */ - ma_uint32 totalCapturedDeviceFramesProcessed = 0; - ma_uint32 capturedDevicePeriodSizeInFrames = ma_min(pDevice->capture.internalPeriodSizeInFrames, pDevice->playback.internalPeriodSizeInFrames); - - while (totalCapturedDeviceFramesProcessed < capturedDevicePeriodSizeInFrames) { - ma_uint8 capturedDeviceData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint8 playbackDeviceData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 capturedDeviceDataCapInFrames = sizeof(capturedDeviceData) / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); - ma_uint32 playbackDeviceDataCapInFrames = sizeof(playbackDeviceData) / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); - ma_uint32 capturedDeviceFramesRemaining; - ma_uint32 capturedDeviceFramesProcessed; - ma_uint32 capturedDeviceFramesToProcess; - ma_uint32 capturedDeviceFramesToTryProcessing = capturedDevicePeriodSizeInFrames - totalCapturedDeviceFramesProcessed; - if (capturedDeviceFramesToTryProcessing > capturedDeviceDataCapInFrames) { - capturedDeviceFramesToTryProcessing = capturedDeviceDataCapInFrames; - } - - result = ma_device_read__alsa(pDevice, capturedDeviceData, capturedDeviceFramesToTryProcessing, &capturedDeviceFramesToProcess); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - capturedDeviceFramesRemaining = capturedDeviceFramesToProcess; - capturedDeviceFramesProcessed = 0; - - for (;;) { - ma_uint8 capturedClientData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint8 playbackClientData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 capturedClientDataCapInFrames = sizeof(capturedClientData) / ma_get_bytes_per_frame(pDevice->capture.format, pDevice->capture.channels); - ma_uint32 playbackClientDataCapInFrames = sizeof(playbackClientData) / ma_get_bytes_per_frame(pDevice->playback.format, pDevice->playback.channels); - ma_uint64 capturedClientFramesToProcessThisIteration = ma_min(capturedClientDataCapInFrames, playbackClientDataCapInFrames); - ma_uint64 capturedDeviceFramesToProcessThisIteration = capturedDeviceFramesRemaining; - ma_uint8* pRunningCapturedDeviceFrames = ma_offset_ptr(capturedDeviceData, capturedDeviceFramesProcessed * ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels)); - - /* Convert capture data from device format to client format. */ - result = ma_data_converter_process_pcm_frames(&pDevice->capture.converter, pRunningCapturedDeviceFrames, &capturedDeviceFramesToProcessThisIteration, capturedClientData, &capturedClientFramesToProcessThisIteration); - if (result != MA_SUCCESS) { - break; - } - - /* - If we weren't able to generate any output frames it must mean we've exhaused all of our input. The only time this would not be the case is if capturedClientData was too small - which should never be the case when it's of the size MA_DATA_CONVERTER_STACK_BUFFER_SIZE. - */ - if (capturedClientFramesToProcessThisIteration == 0) { - break; - } - - ma_device__on_data(pDevice, playbackClientData, capturedClientData, (ma_uint32)capturedClientFramesToProcessThisIteration); /* Safe cast .*/ - - capturedDeviceFramesProcessed += (ma_uint32)capturedDeviceFramesToProcessThisIteration; /* Safe cast. */ - capturedDeviceFramesRemaining -= (ma_uint32)capturedDeviceFramesToProcessThisIteration; /* Safe cast. */ - - /* At this point the playbackClientData buffer should be holding data that needs to be written to the device. */ - for (;;) { - ma_uint64 convertedClientFrameCount = capturedClientFramesToProcessThisIteration; - ma_uint64 convertedDeviceFrameCount = playbackDeviceDataCapInFrames; - result = ma_data_converter_process_pcm_frames(&pDevice->playback.converter, playbackClientData, &convertedClientFrameCount, playbackDeviceData, &convertedDeviceFrameCount); - if (result != MA_SUCCESS) { - break; - } - - result = ma_device_write__alsa(pDevice, playbackDeviceData, (ma_uint32)convertedDeviceFrameCount, NULL); /* Safe cast. */ - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - capturedClientFramesToProcessThisIteration -= (ma_uint32)convertedClientFrameCount; /* Safe cast. */ - if (capturedClientFramesToProcessThisIteration == 0) { - break; - } - } - - /* In case an error happened from ma_device_write__alsa()... */ - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - } - - totalCapturedDeviceFramesProcessed += capturedDeviceFramesProcessed; - } - } - } break; - - case ma_device_type_capture: - { - if (pDevice->alsa.isUsingMMapCapture) { - /* MMAP */ - return MA_INVALID_OPERATION; /* Not yet implemented. */ - } else { - /* readi() */ - - /* We read in chunks of the period size, but use a stack allocated buffer for the intermediary. */ - ma_uint8 intermediaryBuffer[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 intermediaryBufferSizeInFrames = sizeof(intermediaryBuffer) / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); - ma_uint32 periodSizeInFrames = pDevice->capture.internalPeriodSizeInFrames; - ma_uint32 framesReadThisPeriod = 0; - while (framesReadThisPeriod < periodSizeInFrames) { - ma_uint32 framesRemainingInPeriod = periodSizeInFrames - framesReadThisPeriod; - ma_uint32 framesProcessed; - ma_uint32 framesToReadThisIteration = framesRemainingInPeriod; - if (framesToReadThisIteration > intermediaryBufferSizeInFrames) { - framesToReadThisIteration = intermediaryBufferSizeInFrames; - } - - result = ma_device_read__alsa(pDevice, intermediaryBuffer, framesToReadThisIteration, &framesProcessed); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - ma_device__send_frames_to_client(pDevice, framesProcessed, intermediaryBuffer); - - framesReadThisPeriod += framesProcessed; - } - } - } break; - - case ma_device_type_playback: - { - if (pDevice->alsa.isUsingMMapPlayback) { - /* MMAP */ - return MA_INVALID_OPERATION; /* Not yet implemented. */ - } else { - /* writei() */ - - /* We write in chunks of the period size, but use a stack allocated buffer for the intermediary. */ - ma_uint8 intermediaryBuffer[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 intermediaryBufferSizeInFrames = sizeof(intermediaryBuffer) / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); - ma_uint32 periodSizeInFrames = pDevice->playback.internalPeriodSizeInFrames; - ma_uint32 framesWrittenThisPeriod = 0; - while (framesWrittenThisPeriod < periodSizeInFrames) { - ma_uint32 framesRemainingInPeriod = periodSizeInFrames - framesWrittenThisPeriod; - ma_uint32 framesProcessed; - ma_uint32 framesToWriteThisIteration = framesRemainingInPeriod; - if (framesToWriteThisIteration > intermediaryBufferSizeInFrames) { - framesToWriteThisIteration = intermediaryBufferSizeInFrames; - } - - ma_device__read_frames_from_client(pDevice, framesToWriteThisIteration, intermediaryBuffer); - - result = ma_device_write__alsa(pDevice, intermediaryBuffer, framesToWriteThisIteration, &framesProcessed); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - framesWrittenThisPeriod += framesProcessed; - } - } - } break; - - /* To silence a warning. Will never hit this. */ - case ma_device_type_loopback: - default: break; - } - } - - /* Here is where the device needs to be stopped. */ - if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { - ((ma_snd_pcm_drain_proc)pDevice->pContext->alsa.snd_pcm_drain)((ma_snd_pcm_t*)pDevice->alsa.pPCMCapture); - - /* We need to prepare the device again, otherwise we won't be able to restart the device. */ - if (((ma_snd_pcm_prepare_proc)pDevice->pContext->alsa.snd_pcm_prepare)((ma_snd_pcm_t*)pDevice->alsa.pPCMCapture) < 0) { - #ifdef MA_DEBUG_OUTPUT - printf("[ALSA] Failed to prepare capture device after stopping.\n"); - #endif - } - } - - if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { - ((ma_snd_pcm_drain_proc)pDevice->pContext->alsa.snd_pcm_drain)((ma_snd_pcm_t*)pDevice->alsa.pPCMPlayback); - - /* We need to prepare the device again, otherwise we won't be able to restart the device. */ - if (((ma_snd_pcm_prepare_proc)pDevice->pContext->alsa.snd_pcm_prepare)((ma_snd_pcm_t*)pDevice->alsa.pPCMPlayback) < 0) { - #ifdef MA_DEBUG_OUTPUT - printf("[ALSA] Failed to prepare playback device after stopping.\n"); - #endif - } - } - - return result; -} - static ma_result ma_context_uninit__alsa(ma_context* pContext) { MA_ASSERT(pContext != NULL); @@ -20476,7 +20744,7 @@ static ma_result ma_context_uninit__alsa(ma_context* pContext) return MA_SUCCESS; } -static ma_result ma_context_init__alsa(const ma_context_config* pConfig, ma_context* pContext) +static ma_result ma_context_init__alsa(ma_context* pContext, const ma_context_config* pConfig, ma_backend_callbacks* pCallbacks) { #ifndef MA_NO_RUNTIME_LINKING const char* libasoundNames[] = { @@ -20506,8 +20774,11 @@ static ma_result ma_context_init__alsa(const ma_context_config* pConfig, ma_cont pContext->alsa.snd_pcm_hw_params_set_format = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_set_format"); pContext->alsa.snd_pcm_hw_params_set_format_first = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_set_format_first"); pContext->alsa.snd_pcm_hw_params_get_format_mask = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_get_format_mask"); + pContext->alsa.snd_pcm_hw_params_set_channels = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_set_channels"); pContext->alsa.snd_pcm_hw_params_set_channels_near = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_set_channels_near"); + pContext->alsa.snd_pcm_hw_params_set_channels_minmax = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_set_channels_minmax"); pContext->alsa.snd_pcm_hw_params_set_rate_resample = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_set_rate_resample"); + pContext->alsa.snd_pcm_hw_params_set_rate = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_set_rate"); pContext->alsa.snd_pcm_hw_params_set_rate_near = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_set_rate_near"); pContext->alsa.snd_pcm_hw_params_set_buffer_size_near = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_set_buffer_size_near"); pContext->alsa.snd_pcm_hw_params_set_periods_near = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_set_periods_near"); @@ -20522,6 +20793,9 @@ static ma_result ma_context_init__alsa(const ma_context_config* pConfig, ma_cont pContext->alsa.snd_pcm_hw_params_get_buffer_size = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_get_buffer_size"); pContext->alsa.snd_pcm_hw_params_get_periods = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_get_periods"); pContext->alsa.snd_pcm_hw_params_get_access = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_get_access"); + pContext->alsa.snd_pcm_hw_params_test_format = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_test_format"); + pContext->alsa.snd_pcm_hw_params_test_channels = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_test_channels"); + pContext->alsa.snd_pcm_hw_params_test_rate = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params_test_rate"); pContext->alsa.snd_pcm_hw_params = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_hw_params"); pContext->alsa.snd_pcm_sw_params_sizeof = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_sw_params_sizeof"); pContext->alsa.snd_pcm_sw_params_current = (ma_proc)ma_dlsym(pContext, pContext->alsa.asoundSO, "snd_pcm_sw_params_current"); @@ -20563,9 +20837,12 @@ static ma_result ma_context_init__alsa(const ma_context_config* pConfig, ma_cont ma_snd_pcm_hw_params_set_format_proc _snd_pcm_hw_params_set_format = snd_pcm_hw_params_set_format; ma_snd_pcm_hw_params_set_format_first_proc _snd_pcm_hw_params_set_format_first = snd_pcm_hw_params_set_format_first; ma_snd_pcm_hw_params_get_format_mask_proc _snd_pcm_hw_params_get_format_mask = snd_pcm_hw_params_get_format_mask; + ma_snd_pcm_hw_params_set_channels_proc _snd_pcm_hw_params_set_channels = snd_pcm_hw_params_set_channels; ma_snd_pcm_hw_params_set_channels_near_proc _snd_pcm_hw_params_set_channels_near = snd_pcm_hw_params_set_channels_near; ma_snd_pcm_hw_params_set_rate_resample_proc _snd_pcm_hw_params_set_rate_resample = snd_pcm_hw_params_set_rate_resample; + ma_snd_pcm_hw_params_set_rate_near _snd_pcm_hw_params_set_rate = snd_pcm_hw_params_set_rate; ma_snd_pcm_hw_params_set_rate_near_proc _snd_pcm_hw_params_set_rate_near = snd_pcm_hw_params_set_rate_near; + ma_snd_pcm_hw_params_set_rate_minmax_proc _snd_pcm_hw_params_set_rate_minmax = snd_pcm_hw_params_set_rate_minmax; ma_snd_pcm_hw_params_set_buffer_size_near_proc _snd_pcm_hw_params_set_buffer_size_near = snd_pcm_hw_params_set_buffer_size_near; ma_snd_pcm_hw_params_set_periods_near_proc _snd_pcm_hw_params_set_periods_near = snd_pcm_hw_params_set_periods_near; ma_snd_pcm_hw_params_set_access_proc _snd_pcm_hw_params_set_access = snd_pcm_hw_params_set_access; @@ -20579,6 +20856,9 @@ static ma_result ma_context_init__alsa(const ma_context_config* pConfig, ma_cont ma_snd_pcm_hw_params_get_buffer_size_proc _snd_pcm_hw_params_get_buffer_size = snd_pcm_hw_params_get_buffer_size; ma_snd_pcm_hw_params_get_periods_proc _snd_pcm_hw_params_get_periods = snd_pcm_hw_params_get_periods; ma_snd_pcm_hw_params_get_access_proc _snd_pcm_hw_params_get_access = snd_pcm_hw_params_get_access; + ma_snd_pcm_hw_params_test_format_proc _snd_pcm_hw_params_test_format = snd_pcm_hw_params_test_format; + ma_snd_pcm_hw_params_test_channels_proc _snd_pcm_hw_params_test_channels = snd_pcm_hw_params_test_channels; + ma_snd_pcm_hw_params_test_rate_proc _snd_pcm_hw_params_test_rate = snd_pcm_hw_params_test_rate; ma_snd_pcm_hw_params_proc _snd_pcm_hw_params = snd_pcm_hw_params; ma_snd_pcm_sw_params_sizeof_proc _snd_pcm_sw_params_sizeof = snd_pcm_sw_params_sizeof; ma_snd_pcm_sw_params_current_proc _snd_pcm_sw_params_current = snd_pcm_sw_params_current; @@ -20619,8 +20899,11 @@ static ma_result ma_context_init__alsa(const ma_context_config* pConfig, ma_cont pContext->alsa.snd_pcm_hw_params_set_format = (ma_proc)_snd_pcm_hw_params_set_format; pContext->alsa.snd_pcm_hw_params_set_format_first = (ma_proc)_snd_pcm_hw_params_set_format_first; pContext->alsa.snd_pcm_hw_params_get_format_mask = (ma_proc)_snd_pcm_hw_params_get_format_mask; + pContext->alsa.snd_pcm_hw_params_set_channels = (ma_proc)_snd_pcm_hw_params_set_channels; pContext->alsa.snd_pcm_hw_params_set_channels_near = (ma_proc)_snd_pcm_hw_params_set_channels_near; + pContext->alsa.snd_pcm_hw_params_set_channels_minmax = (ma_proc)_snd_pcm_hw_params_set_channels_minmax; pContext->alsa.snd_pcm_hw_params_set_rate_resample = (ma_proc)_snd_pcm_hw_params_set_rate_resample; + pContext->alsa.snd_pcm_hw_params_set_rate = (ma_proc)_snd_pcm_hw_params_set_rate; pContext->alsa.snd_pcm_hw_params_set_rate_near = (ma_proc)_snd_pcm_hw_params_set_rate_near; pContext->alsa.snd_pcm_hw_params_set_buffer_size_near = (ma_proc)_snd_pcm_hw_params_set_buffer_size_near; pContext->alsa.snd_pcm_hw_params_set_periods_near = (ma_proc)_snd_pcm_hw_params_set_periods_near; @@ -20635,6 +20918,9 @@ static ma_result ma_context_init__alsa(const ma_context_config* pConfig, ma_cont pContext->alsa.snd_pcm_hw_params_get_buffer_size = (ma_proc)_snd_pcm_hw_params_get_buffer_size; pContext->alsa.snd_pcm_hw_params_get_periods = (ma_proc)_snd_pcm_hw_params_get_periods; pContext->alsa.snd_pcm_hw_params_get_access = (ma_proc)_snd_pcm_hw_params_get_access; + pContext->alsa.snd_pcm_hw_params_test_format = (ma_proc)_snd_pcm_hw_params_test_format; + pContext->alsa.snd_pcm_hw_params_test_channels = (ma_proc)_snd_pcm_hw_params_test_channels; + pContext->alsa.snd_pcm_hw_params_test_rate = (ma_proc)_snd_pcm_hw_params_test_rate; pContext->alsa.snd_pcm_hw_params = (ma_proc)_snd_pcm_hw_params; pContext->alsa.snd_pcm_sw_params_sizeof = (ma_proc)_snd_pcm_sw_params_sizeof; pContext->alsa.snd_pcm_sw_params_current = (ma_proc)_snd_pcm_sw_params_current; @@ -20675,14 +20961,17 @@ static ma_result ma_context_init__alsa(const ma_context_config* pConfig, ma_cont ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "[ALSA] WARNING: Failed to initialize mutex for internal device enumeration.", MA_ERROR); } - pContext->onUninit = ma_context_uninit__alsa; - pContext->onEnumDevices = ma_context_enumerate_devices__alsa; - pContext->onGetDeviceInfo = ma_context_get_device_info__alsa; - pContext->onDeviceInit = ma_device_init__alsa; - pContext->onDeviceUninit = ma_device_uninit__alsa; - pContext->onDeviceStart = NULL; /* Not used. Started in the main loop. */ - pContext->onDeviceStop = NULL; /* Not used. Started in the main loop. */ - pContext->onDeviceMainLoop = ma_device_main_loop__alsa; + pCallbacks->onContextInit = ma_context_init__alsa; + pCallbacks->onContextUninit = ma_context_uninit__alsa; + pCallbacks->onContextEnumerateDevices = ma_context_enumerate_devices__alsa; + pCallbacks->onContextGetDeviceInfo = ma_context_get_device_info__alsa; + pCallbacks->onDeviceInit = ma_device_init__alsa; + pCallbacks->onDeviceUninit = ma_device_uninit__alsa; + pCallbacks->onDeviceStart = ma_device_start__alsa; + pCallbacks->onDeviceStop = ma_device_stop__alsa; + pCallbacks->onDeviceRead = ma_device_read__alsa; + pCallbacks->onDeviceWrite = ma_device_write__alsa; + pCallbacks->onDeviceDataLoop = NULL; return MA_SUCCESS; } @@ -20726,6 +21015,9 @@ to the vtable with `pa_threaded_mainloop_get_api()` (the main loop vtable is cal main loop object entirely and just implement `pa_mainloop_api` directly, but there's no need for it unless you're doing something extremely specialized such as if you want to integrate it into your application's existing main loop infrastructure. +(EDIT 2021-01-26: miniaudio is no longer using `pa_threaded_mainloop` due to this issue: https://github.com/mackron/miniaudio/issues/262. +It is now using `pa_mainloop` which turns out to be a simpler solution anyway. The rest of this rant still applies, however.) + Once you have your main loop vtable (the `pa_mainloop_api` object) you can create the PulseAudio context. This is very similar to miniaudio's context and they map to each other quite well. You have one context to many streams, which is basically the same as miniaudio's one `ma_context` to many `ma_device`s. Here's where it starts to get annoying, however. When you first create the PulseAudio context, which @@ -21009,26 +21301,26 @@ typedef pa_sample_format_t ma_pa_sample_format_t; #define MA_PA_SAMPLE_S24_32LE PA_SAMPLE_S24_32LE #define MA_PA_SAMPLE_S24_32BE PA_SAMPLE_S24_32BE -typedef pa_mainloop ma_pa_mainloop; -typedef pa_threaded_mainloop ma_pa_threaded_mainloop; -typedef pa_mainloop_api ma_pa_mainloop_api; -typedef pa_context ma_pa_context; -typedef pa_operation ma_pa_operation; -typedef pa_stream ma_pa_stream; -typedef pa_spawn_api ma_pa_spawn_api; -typedef pa_buffer_attr ma_pa_buffer_attr; -typedef pa_channel_map ma_pa_channel_map; -typedef pa_cvolume ma_pa_cvolume; -typedef pa_sample_spec ma_pa_sample_spec; -typedef pa_sink_info ma_pa_sink_info; -typedef pa_source_info ma_pa_source_info; +typedef pa_mainloop ma_pa_mainloop; +typedef pa_threaded_mainloop ma_pa_threaded_mainloop; +typedef pa_mainloop_api ma_pa_mainloop_api; +typedef pa_context ma_pa_context; +typedef pa_operation ma_pa_operation; +typedef pa_stream ma_pa_stream; +typedef pa_spawn_api ma_pa_spawn_api; +typedef pa_buffer_attr ma_pa_buffer_attr; +typedef pa_channel_map ma_pa_channel_map; +typedef pa_cvolume ma_pa_cvolume; +typedef pa_sample_spec ma_pa_sample_spec; +typedef pa_sink_info ma_pa_sink_info; +typedef pa_source_info ma_pa_source_info; -typedef pa_context_notify_cb_t ma_pa_context_notify_cb_t; -typedef pa_sink_info_cb_t ma_pa_sink_info_cb_t; -typedef pa_source_info_cb_t ma_pa_source_info_cb_t; -typedef pa_stream_success_cb_t ma_pa_stream_success_cb_t; -typedef pa_stream_request_cb_t ma_pa_stream_request_cb_t; -typedef pa_free_cb_t ma_pa_free_cb_t; +typedef pa_context_notify_cb_t ma_pa_context_notify_cb_t; +typedef pa_sink_info_cb_t ma_pa_sink_info_cb_t; +typedef pa_source_info_cb_t ma_pa_source_info_cb_t; +typedef pa_stream_success_cb_t ma_pa_stream_success_cb_t; +typedef pa_stream_request_cb_t ma_pa_stream_request_cb_t; +typedef pa_free_cb_t ma_pa_free_cb_t; #else #define MA_PA_OK 0 #define MA_PA_ERR_ACCESS 1 @@ -21551,43 +21843,24 @@ static ma_pa_channel_position_t ma_channel_position_to_pulse(ma_channel position } #endif -static void ma_mainloop_lock__pulse(ma_context* pContext, const char* what) -{ - (void)what; - - MA_ASSERT(pContext != NULL); - - /*printf("locking mainloop by %s\n", what);*/ - ((ma_pa_threaded_mainloop_lock_proc)pContext->pulse.pa_threaded_mainloop_lock)((ma_pa_threaded_mainloop*)pContext->pulse.pMainLoop); -} - -static void ma_mainloop_unlock__pulse(ma_context* pContext, const char* what) -{ - (void)what; - - MA_ASSERT(pContext != NULL); - - /*printf("unlocking mainloop by %s\n", what);*/ - ((ma_pa_threaded_mainloop_unlock_proc)pContext->pulse.pa_threaded_mainloop_unlock)((ma_pa_threaded_mainloop*)pContext->pulse.pMainLoop); -} - static ma_result ma_wait_for_operation__pulse(ma_context* pContext, ma_pa_operation* pOP) { + int resultPA; ma_pa_operation_state_t state; MA_ASSERT(pContext != NULL); MA_ASSERT(pOP != NULL); for (;;) { - ma_mainloop_lock__pulse(pContext, "ma_wait_for_operation__pulse"); state = ((ma_pa_operation_get_state_proc)pContext->pulse.pa_operation_get_state)(pOP); - ma_mainloop_unlock__pulse(pContext, "ma_wait_for_operation__pulse"); - if (state != MA_PA_OPERATION_RUNNING) { break; /* Done. */ } - ma_yield(); + resultPA = ((ma_pa_mainloop_iterate_proc)pContext->pulse.pa_mainloop_iterate)((ma_pa_mainloop*)pContext->pulse.pMainLoop, 1, NULL); + if (resultPA < 0) { + return ma_result_from_pulse(resultPA); + } } return MA_SUCCESS; @@ -21609,13 +21882,11 @@ static ma_result ma_wait_for_operation_and_unref__pulse(ma_context* pContext, ma static ma_result ma_context_wait_for_pa_context_to_connect__pulse(ma_context* pContext) { + int resultPA; ma_pa_context_state_t state; for (;;) { - ma_mainloop_lock__pulse(pContext, "ma_context_wait_for_pa_context_to_connect__pulse"); state = ((ma_pa_context_get_state_proc)pContext->pulse.pa_context_get_state)((ma_pa_context*)pContext->pulse.pPulseContext); - ma_mainloop_unlock__pulse(pContext, "ma_context_wait_for_pa_context_to_connect__pulse"); - if (state == MA_PA_CONTEXT_READY) { break; /* Done. */ } @@ -21624,7 +21895,10 @@ static ma_result ma_context_wait_for_pa_context_to_connect__pulse(ma_context* pC return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "[PulseAudio] An error occurred while connecting the PulseAudio context.", MA_ERROR); } - ma_yield(); + resultPA = ((ma_pa_mainloop_iterate_proc)pContext->pulse.pa_mainloop_iterate)((ma_pa_mainloop*)pContext->pulse.pMainLoop, 1, NULL); + if (resultPA < 0) { + return ma_result_from_pulse(resultPA); + } } /* Should never get here. */ @@ -21633,13 +21907,11 @@ static ma_result ma_context_wait_for_pa_context_to_connect__pulse(ma_context* pC static ma_result ma_context_wait_for_pa_stream_to_connect__pulse(ma_context* pContext, ma_pa_stream* pStream) { + int resultPA; ma_pa_stream_state_t state; for (;;) { - ma_mainloop_lock__pulse(pContext, "ma_context_wait_for_pa_stream_to_connect__pulse"); state = ((ma_pa_stream_get_state_proc)pContext->pulse.pa_stream_get_state)(pStream); - ma_mainloop_unlock__pulse(pContext, "ma_context_wait_for_pa_stream_to_connect__pulse"); - if (state == MA_PA_STREAM_READY) { break; /* Done. */ } @@ -21648,7 +21920,10 @@ static ma_result ma_context_wait_for_pa_stream_to_connect__pulse(ma_context* pCo return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "[PulseAudio] An error occurred while connecting the PulseAudio stream.", MA_ERROR); } - ma_yield(); + resultPA = ((ma_pa_mainloop_iterate_proc)pContext->pulse.pa_mainloop_iterate)((ma_pa_mainloop*)pContext->pulse.pMainLoop, 1, NULL); + if (resultPA < 0) { + return ma_result_from_pulse(resultPA); + } } return MA_SUCCESS; @@ -21724,32 +21999,24 @@ static ma_result ma_context_get_sink_info__pulse(ma_context* pContext, const cha { ma_pa_operation* pOP; - ma_mainloop_lock__pulse(pContext, "ma_context_get_sink_info__pulse"); pOP = ((ma_pa_context_get_sink_info_by_name_proc)pContext->pulse.pa_context_get_sink_info_by_name)((ma_pa_context*)pContext->pulse.pPulseContext, pDeviceName, ma_device_sink_info_callback, pSinkInfo); - ma_mainloop_unlock__pulse(pContext, "ma_context_get_sink_info__pulse"); - if (pOP == NULL) { return MA_ERROR; } - ma_wait_for_operation_and_unref__pulse(pContext, pOP); - return MA_SUCCESS; + return ma_wait_for_operation_and_unref__pulse(pContext, pOP); } static ma_result ma_context_get_source_info__pulse(ma_context* pContext, const char* pDeviceName, ma_pa_source_info* pSourceInfo) { ma_pa_operation* pOP; - ma_mainloop_lock__pulse(pContext, "ma_context_get_source_info__pulse"); pOP = ((ma_pa_context_get_source_info_by_name_proc)pContext->pulse.pa_context_get_source_info_by_name)((ma_pa_context*)pContext->pulse.pPulseContext, pDeviceName, ma_device_source_info_callback, pSourceInfo); - ma_mainloop_unlock__pulse(pContext, "ma_context_get_source_info__pulse"); - if (pOP == NULL) { return MA_ERROR; } - ma_wait_for_operation_and_unref__pulse(pContext, pOP); - return MA_SUCCESS; + return ma_wait_for_operation_and_unref__pulse(pContext, pOP);; } static ma_result ma_context_get_default_device_index__pulse(ma_context* pContext, ma_device_type deviceType, ma_uint32* pIndex) @@ -21887,10 +22154,7 @@ static ma_result ma_context_enumerate_devices__pulse(ma_context* pContext, ma_en /* Playback. */ if (!callbackData.isTerminated) { - ma_mainloop_lock__pulse(pContext, "ma_context_enumerate_devices__pulse"); pOP = ((ma_pa_context_get_sink_info_list_proc)pContext->pulse.pa_context_get_sink_info_list)((ma_pa_context*)(pContext->pulse.pPulseContext), ma_context_enumerate_devices_sink_callback__pulse, &callbackData); - ma_mainloop_unlock__pulse(pContext, "ma_context_enumerate_devices__pulse"); - if (pOP == NULL) { result = MA_ERROR; goto done; @@ -21898,6 +22162,7 @@ static ma_result ma_context_enumerate_devices__pulse(ma_context* pContext, ma_en result = ma_wait_for_operation__pulse(pContext, pOP); ((ma_pa_operation_unref_proc)pContext->pulse.pa_operation_unref)(pOP); + if (result != MA_SUCCESS) { goto done; } @@ -21906,10 +22171,7 @@ static ma_result ma_context_enumerate_devices__pulse(ma_context* pContext, ma_en /* Capture. */ if (!callbackData.isTerminated) { - ma_mainloop_lock__pulse(pContext, "ma_context_enumerate_devices__pulse"); pOP = ((ma_pa_context_get_source_info_list_proc)pContext->pulse.pa_context_get_source_info_list)((ma_pa_context*)(pContext->pulse.pPulseContext), ma_context_enumerate_devices_source_callback__pulse, &callbackData); - ma_mainloop_unlock__pulse(pContext, "ma_context_enumerate_devices__pulse"); - if (pOP == NULL) { result = MA_ERROR; goto done; @@ -21917,6 +22179,7 @@ static ma_result ma_context_enumerate_devices__pulse(ma_context* pContext, ma_en result = ma_wait_for_operation__pulse(pContext, pOP); ((ma_pa_operation_unref_proc)pContext->pulse.pa_operation_unref)(pOP); + if (result != MA_SUCCESS) { goto done; } @@ -21953,12 +22216,16 @@ static void ma_context_get_device_info_sink_callback__pulse(ma_pa_context* pPuls ma_strncpy_s(pData->pDeviceInfo->name, sizeof(pData->pDeviceInfo->name), pInfo->description, (size_t)-1); } - pData->pDeviceInfo->minChannels = pInfo->sample_spec.channels; - pData->pDeviceInfo->maxChannels = pInfo->sample_spec.channels; - pData->pDeviceInfo->minSampleRate = pInfo->sample_spec.rate; - pData->pDeviceInfo->maxSampleRate = pInfo->sample_spec.rate; - pData->pDeviceInfo->formatCount = 1; - pData->pDeviceInfo->formats[0] = ma_format_from_pulse(pInfo->sample_spec.format); + /* + We're just reporting a single data format here. I think technically PulseAudio might support + all formats, but I don't trust that PulseAudio will do *anything* right, so I'm just going to + report the "native" device format. + */ + pData->pDeviceInfo->nativeDataFormats[0].format = ma_format_from_pulse(pInfo->sample_spec.format); + pData->pDeviceInfo->nativeDataFormats[0].channels = pInfo->sample_spec.channels; + pData->pDeviceInfo->nativeDataFormats[0].sampleRate = pInfo->sample_spec.rate; + pData->pDeviceInfo->nativeDataFormats[0].flags = 0; + pData->pDeviceInfo->nativeDataFormatCount = 1; if (pData->defaultDeviceIndex == pInfo->index) { pData->pDeviceInfo->isDefault = MA_TRUE; @@ -21986,12 +22253,16 @@ static void ma_context_get_device_info_source_callback__pulse(ma_pa_context* pPu ma_strncpy_s(pData->pDeviceInfo->name, sizeof(pData->pDeviceInfo->name), pInfo->description, (size_t)-1); } - pData->pDeviceInfo->minChannels = pInfo->sample_spec.channels; - pData->pDeviceInfo->maxChannels = pInfo->sample_spec.channels; - pData->pDeviceInfo->minSampleRate = pInfo->sample_spec.rate; - pData->pDeviceInfo->maxSampleRate = pInfo->sample_spec.rate; - pData->pDeviceInfo->formatCount = 1; - pData->pDeviceInfo->formats[0] = ma_format_from_pulse(pInfo->sample_spec.format); + /* + We're just reporting a single data format here. I think technically PulseAudio might support + all formats, but I don't trust that PulseAudio will do *anything* right, so I'm just going to + report the "native" device format. + */ + pData->pDeviceInfo->nativeDataFormats[0].format = ma_format_from_pulse(pInfo->sample_spec.format); + pData->pDeviceInfo->nativeDataFormats[0].channels = pInfo->sample_spec.channels; + pData->pDeviceInfo->nativeDataFormats[0].sampleRate = pInfo->sample_spec.rate; + pData->pDeviceInfo->nativeDataFormats[0].flags = 0; + pData->pDeviceInfo->nativeDataFormatCount = 1; if (pData->defaultDeviceIndex == pInfo->index) { pData->pDeviceInfo->isDefault = MA_TRUE; @@ -22000,7 +22271,7 @@ static void ma_context_get_device_info_source_callback__pulse(ma_pa_context* pPu (void)pPulseContext; /* Unused. */ } -static ma_result ma_context_get_device_info__pulse(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_share_mode shareMode, ma_device_info* pDeviceInfo) +static ma_result ma_context_get_device_info__pulse(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_device_info* pDeviceInfo) { ma_result result = MA_SUCCESS; ma_context_get_device_info_callback_data__pulse callbackData; @@ -22008,23 +22279,16 @@ static ma_result ma_context_get_device_info__pulse(ma_context* pContext, ma_devi MA_ASSERT(pContext != NULL); - /* No exclusive mode with the PulseAudio backend. */ - if (shareMode == ma_share_mode_exclusive) { - return MA_SHARE_MODE_NOT_SUPPORTED; - } - callbackData.pDeviceInfo = pDeviceInfo; callbackData.foundDevice = MA_FALSE; result = ma_context_get_default_device_index__pulse(pContext, deviceType, &callbackData.defaultDeviceIndex); - ma_mainloop_lock__pulse(pContext, "ma_context_get_device_info__pulse"); if (deviceType == ma_device_type_playback) { pOP = ((ma_pa_context_get_sink_info_by_name_proc)pContext->pulse.pa_context_get_sink_info_by_name)((ma_pa_context*)(pContext->pulse.pPulseContext), pDeviceID->pulse, ma_context_get_device_info_sink_callback__pulse, &callbackData); } else { pOP = ((ma_pa_context_get_source_info_by_name_proc)pContext->pulse.pa_context_get_source_info_by_name)((ma_pa_context*)(pContext->pulse.pPulseContext), pDeviceID->pulse, ma_context_get_device_info_source_callback__pulse, &callbackData); } - ma_mainloop_unlock__pulse(pContext, "ma_context_get_device_info__pulse"); if (pOP != NULL) { ma_wait_for_operation_and_unref__pulse(pContext, pOP); @@ -22042,7 +22306,7 @@ done: return result; } -static void ma_device_uninit__pulse(ma_device* pDevice) +static ma_result ma_device_uninit__pulse(ma_device* pDevice) { ma_context* pContext; @@ -22051,23 +22315,21 @@ static void ma_device_uninit__pulse(ma_device* pDevice) pContext = pDevice->pContext; MA_ASSERT(pContext != NULL); - ma_mainloop_lock__pulse(pContext, "ma_device_uninit__pulse"); - { - if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { - ((ma_pa_stream_disconnect_proc)pContext->pulse.pa_stream_disconnect)((ma_pa_stream*)pDevice->pulse.pStreamCapture); - ((ma_pa_stream_unref_proc)pContext->pulse.pa_stream_unref)((ma_pa_stream*)pDevice->pulse.pStreamCapture); - } + if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { + ((ma_pa_stream_disconnect_proc)pContext->pulse.pa_stream_disconnect)((ma_pa_stream*)pDevice->pulse.pStreamCapture); + ((ma_pa_stream_unref_proc)pContext->pulse.pa_stream_unref)((ma_pa_stream*)pDevice->pulse.pStreamCapture); + } - if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { - ((ma_pa_stream_disconnect_proc)pContext->pulse.pa_stream_disconnect)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); - ((ma_pa_stream_unref_proc)pContext->pulse.pa_stream_unref)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); - } + if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { + ((ma_pa_stream_disconnect_proc)pContext->pulse.pa_stream_disconnect)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); + ((ma_pa_stream_unref_proc)pContext->pulse.pa_stream_unref)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); } - ma_mainloop_unlock__pulse(pContext, "ma_device_uninit__pulse"); if (pDevice->type == ma_device_type_duplex) { - ma_pcm_rb_uninit(&pDevice->pulse.duplexRB); + ma_duplex_rb_uninit(&pDevice->duplexRB); } + + return MA_SUCCESS; } static ma_pa_buffer_attr ma_device__pa_buffer_attr_new(ma_uint32 periodSizeInFrames, ma_uint32 periods, const ma_pa_sample_spec* ss) @@ -22084,7 +22346,6 @@ static ma_pa_buffer_attr ma_device__pa_buffer_attr_new(ma_uint32 periodSizeInFra static ma_pa_stream* ma_context__pa_stream_new__pulse(ma_context* pContext, const char* pStreamName, const ma_pa_sample_spec* ss, const ma_pa_channel_map* cmap) { - ma_pa_stream* pStream; static int g_StreamCounter = 0; char actualStreamName[256]; @@ -22096,11 +22357,7 @@ static ma_pa_stream* ma_context__pa_stream_new__pulse(ma_context* pContext, cons } g_StreamCounter += 1; - ma_mainloop_lock__pulse(pContext, "ma_context__pa_stream_new__pulse"); - pStream = ((ma_pa_stream_new_proc)pContext->pulse.pa_stream_new)((ma_pa_context*)pContext->pulse.pPulseContext, actualStreamName, ss, cmap); - ma_mainloop_unlock__pulse(pContext, "ma_context__pa_stream_new__pulse"); - - return pStream; + return ((ma_pa_stream_new_proc)pContext->pulse.pa_stream_new)((ma_pa_context*)pContext->pulse.pPulseContext, actualStreamName, ss, cmap); } @@ -22132,11 +22389,7 @@ static void ma_device_on_read__pulse(ma_pa_stream* pStream, size_t byteCount, vo framesMapped = bytesMapped / bpf; if (framesMapped > 0) { if (pMappedPCMFrames != NULL) { - if (pDevice->type == ma_device_type_duplex) { - ma_device__handle_duplex_callback_capture(pDevice, framesMapped, pMappedPCMFrames, &pDevice->pulse.duplexRB); - } else { - ma_device__send_frames_to_client(pDevice, framesMapped, pMappedPCMFrames); - } + ma_device_handle_backend_data_callback(pDevice, NULL, pMappedPCMFrames, framesMapped); } else { /* It's a hole. */ #if defined(MA_DEBUG_OUTPUT) @@ -22188,11 +22441,7 @@ static ma_result ma_device_write_to_stream__pulse(ma_device* pDevice, ma_pa_stre framesMapped = bytesMapped / bpf; if (deviceState == MA_STATE_STARTED) { - if (pDevice->type == ma_device_type_duplex) { - ma_device__handle_duplex_callback_playback(pDevice, framesMapped, pMappedPCMFrames, &pDevice->pulse.duplexRB); - } else { - ma_device__read_frames_from_client(pDevice, framesMapped, pMappedPCMFrames); - } + ma_device_handle_backend_data_callback(pDevice, pMappedPCMFrames, NULL, framesMapped); } else { /* Device is not started. Don't write anything to it. */ } @@ -22227,10 +22476,20 @@ static void ma_device_on_write__pulse(ma_pa_stream* pStream, size_t byteCount, v ma_uint32 bpf; ma_uint64 frameCount; ma_uint64 framesProcessed; + ma_uint32 deviceState; ma_result result; MA_ASSERT(pDevice != NULL); + /* + Don't do anything if the device isn't initialized yet. Yes, this can happen because PulseAudio + can fire this callback before the stream has even started. Ridiculous. + */ + deviceState = ma_device_get_state(pDevice); + if (deviceState != MA_STATE_STARTING && deviceState != MA_STATE_STARTED) { + return; + } + bpf = ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); MA_ASSERT(bpf > 0); @@ -22239,7 +22498,6 @@ static void ma_device_on_write__pulse(ma_pa_stream* pStream, size_t byteCount, v while (framesProcessed < frameCount) { ma_uint64 framesProcessedThisIteration; - ma_uint32 deviceState; /* Don't keep trying to process frames if the device isn't started. */ deviceState = ma_device_get_state(pDevice); @@ -22256,13 +22514,31 @@ static void ma_device_on_write__pulse(ma_pa_stream* pStream, size_t byteCount, v } } -static ma_result ma_device_init__pulse(ma_context* pContext, const ma_device_config* pConfig, ma_device* pDevice) +static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptorPlayback, ma_device_descriptor* pDescriptorCapture) { + /* + Notes for PulseAudio: + + - We're always using native format/channels/rate regardless of whether or not PulseAudio + supports the format directly through their own data conversion system. I'm doing this to + reduce as much variability from the PulseAudio side as possible because it's seems to be + extremely unreliable at everything it does. + + - When both the period size in frames and milliseconds are 0, we default to miniaudio's + default buffer sizes rather than leaving it up to PulseAudio because I don't trust + PulseAudio to give us any kind of reasonable latency by default. + + - Do not ever, *ever* forget to use MA_PA_STREAM_ADJUST_LATENCY. If you don't specify this + flag, capture mode will just not work properly until you open another PulseAudio app. + */ + ma_result result = MA_SUCCESS; int error = 0; const char* devPlayback = NULL; const char* devCapture = NULL; - ma_uint32 periodSizeInMilliseconds; + ma_format format = ma_format_unknown; + ma_uint32 channels = 0; + ma_uint32 sampleRate = 0; ma_pa_sink_info sinkInfo; ma_pa_source_info sourceInfo; ma_pa_sample_spec ss; @@ -22287,20 +22563,28 @@ static ma_result ma_device_init__pulse(ma_context* pContext, const ma_device_con return MA_SHARE_MODE_NOT_SUPPORTED; } - if ((pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) && pConfig->playback.pDeviceID != NULL) { - devPlayback = pConfig->playback.pDeviceID->pulse; - } - if ((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) && pConfig->capture.pDeviceID != NULL) { - devCapture = pConfig->capture.pDeviceID->pulse; + if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { + if (pDescriptorPlayback->pDeviceID != NULL) { + devPlayback = pDescriptorPlayback->pDeviceID->pulse; + } + + format = pDescriptorPlayback->format; + channels = pDescriptorPlayback->channels; + sampleRate = pDescriptorPlayback->sampleRate; } - periodSizeInMilliseconds = pConfig->periodSizeInMilliseconds; - if (periodSizeInMilliseconds == 0) { - periodSizeInMilliseconds = ma_calculate_buffer_size_in_milliseconds_from_frames(pConfig->periodSizeInFrames, pConfig->sampleRate); + if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) { + if (pDescriptorCapture->pDeviceID != NULL) { + devCapture = pDescriptorCapture->pDeviceID->pulse; + } + + format = pDescriptorCapture->format; + channels = pDescriptorCapture->channels; + sampleRate = pDescriptorCapture->sampleRate; } if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) { - result = ma_context_get_source_info__pulse(pContext, devCapture, &sourceInfo); + result = ma_context_get_source_info__pulse(pDevice->pContext, devCapture, &sourceInfo); if (result != MA_SUCCESS) { ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to retrieve source info for capture device.", result); goto on_error0; @@ -22309,15 +22593,15 @@ static ma_result ma_device_init__pulse(ma_context* pContext, const ma_device_con ss = sourceInfo.sample_spec; cmap = sourceInfo.channel_map; - pDevice->capture.internalPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(periodSizeInMilliseconds, ss.rate); - pDevice->capture.internalPeriods = pConfig->periods; + /* We now have enough information to calculate our actual period size in frames. */ + pDescriptorCapture->periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptorCapture, ss.rate, pConfig->performanceProfile); - attr = ma_device__pa_buffer_attr_new(pDevice->capture.internalPeriodSizeInFrames, pConfig->periods, &ss); + attr = ma_device__pa_buffer_attr_new(pDescriptorCapture->periodSizeInFrames, pDescriptorCapture->periodCount, &ss); #ifdef MA_DEBUG_OUTPUT - printf("[PulseAudio] Capture attr: maxlength=%d, tlength=%d, prebuf=%d, minreq=%d, fragsize=%d; internalPeriodSizeInFrames=%d\n", attr.maxlength, attr.tlength, attr.prebuf, attr.minreq, attr.fragsize, pDevice->capture.internalPeriodSizeInFrames); + printf("[PulseAudio] Capture attr: maxlength=%d, tlength=%d, prebuf=%d, minreq=%d, fragsize=%d; periodSizeInFrames=%d\n", attr.maxlength, attr.tlength, attr.prebuf, attr.minreq, attr.fragsize, pDescriptorCapture->periodSizeInFrames); #endif - pDevice->pulse.pStreamCapture = ma_context__pa_stream_new__pulse(pContext, pConfig->pulse.pStreamNameCapture, &ss, &cmap); + pDevice->pulse.pStreamCapture = ma_context__pa_stream_new__pulse(pDevice->pContext, pConfig->pulse.pStreamNameCapture, &ss, &cmap); if (pDevice->pulse.pStreamCapture == NULL) { result = ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to create PulseAudio capture stream.", MA_FAILED_TO_OPEN_BACKEND_DEVICE); goto on_error0; @@ -22325,9 +22609,7 @@ static ma_result ma_device_init__pulse(ma_context* pContext, const ma_device_con /* The callback needs to be set before connecting the stream. */ - ma_mainloop_lock__pulse(pContext, "ma_device_init__pulse"); - ((ma_pa_stream_set_read_callback_proc)pContext->pulse.pa_stream_set_read_callback)((ma_pa_stream*)pDevice->pulse.pStreamCapture, ma_device_on_read__pulse, pDevice); - ma_mainloop_unlock__pulse(pContext, "ma_device_init__pulse"); + ((ma_pa_stream_set_read_callback_proc)pDevice->pContext->pulse.pa_stream_set_read_callback)((ma_pa_stream*)pDevice->pulse.pStreamCapture, ma_device_on_read__pulse, pDevice); /* Connect after we've got all of our internal state set up. */ @@ -22336,9 +22618,7 @@ static ma_result ma_device_init__pulse(ma_context* pContext, const ma_device_con streamFlags |= MA_PA_STREAM_DONT_MOVE; } - ma_mainloop_lock__pulse(pContext, "ma_device_init__pulse"); - error = ((ma_pa_stream_connect_record_proc)pContext->pulse.pa_stream_connect_record)((ma_pa_stream*)pDevice->pulse.pStreamCapture, devCapture, &attr, streamFlags); - ma_mainloop_unlock__pulse(pContext, "ma_device_init__pulse"); + error = ((ma_pa_stream_connect_record_proc)pDevice->pContext->pulse.pa_stream_connect_record)((ma_pa_stream*)pDevice->pulse.pStreamCapture, devCapture, &attr, streamFlags); if (error != MA_PA_OK) { result = ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to connect PulseAudio capture stream.", ma_result_from_pulse(error)); goto on_error1; @@ -22349,58 +22629,50 @@ static ma_result ma_device_init__pulse(ma_context* pContext, const ma_device_con goto on_error2; } - - ma_mainloop_lock__pulse(pContext, "ma_device_init__pulse"); - { - /* Internal format. */ - pActualSS = ((ma_pa_stream_get_sample_spec_proc)pContext->pulse.pa_stream_get_sample_spec)((ma_pa_stream*)pDevice->pulse.pStreamCapture); - if (pActualSS != NULL) { - ss = *pActualSS; - } - - pDevice->capture.internalFormat = ma_format_from_pulse(ss.format); - pDevice->capture.internalChannels = ss.channels; - pDevice->capture.internalSampleRate = ss.rate; - - /* Internal channel map. */ - pActualCMap = ((ma_pa_stream_get_channel_map_proc)pContext->pulse.pa_stream_get_channel_map)((ma_pa_stream*)pDevice->pulse.pStreamCapture); - if (pActualCMap != NULL) { - cmap = *pActualCMap; - } - for (iChannel = 0; iChannel < pDevice->capture.internalChannels; ++iChannel) { - pDevice->capture.internalChannelMap[iChannel] = ma_channel_position_from_pulse(cmap.map[iChannel]); - } - - /* Buffer. */ - pActualAttr = ((ma_pa_stream_get_buffer_attr_proc)pContext->pulse.pa_stream_get_buffer_attr)((ma_pa_stream*)pDevice->pulse.pStreamCapture); - if (pActualAttr != NULL) { - attr = *pActualAttr; - } - pDevice->capture.internalPeriods = attr.maxlength / attr.fragsize; - pDevice->capture.internalPeriodSizeInFrames = attr.maxlength / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels) / pDevice->capture.internalPeriods; - #ifdef MA_DEBUG_OUTPUT - printf("[PulseAudio] Capture actual attr: maxlength=%d, tlength=%d, prebuf=%d, minreq=%d, fragsize=%d; internalPeriodSizeInFrames=%d\n", attr.maxlength, attr.tlength, attr.prebuf, attr.minreq, attr.fragsize, pDevice->capture.internalPeriodSizeInFrames); - #endif + /* Internal format. */ + pActualSS = ((ma_pa_stream_get_sample_spec_proc)pDevice->pContext->pulse.pa_stream_get_sample_spec)((ma_pa_stream*)pDevice->pulse.pStreamCapture); + if (pActualSS != NULL) { + ss = *pActualSS; } - ma_mainloop_unlock__pulse(pContext, "ma_device_init__pulse"); + + pDescriptorCapture->format = ma_format_from_pulse(ss.format); + pDescriptorCapture->channels = ss.channels; + pDescriptorCapture->sampleRate = ss.rate; + + /* Internal channel map. */ + pActualCMap = ((ma_pa_stream_get_channel_map_proc)pDevice->pContext->pulse.pa_stream_get_channel_map)((ma_pa_stream*)pDevice->pulse.pStreamCapture); + if (pActualCMap != NULL) { + cmap = *pActualCMap; + } + + for (iChannel = 0; iChannel < pDevice->capture.internalChannels; ++iChannel) { + pDescriptorCapture->channelMap[iChannel] = ma_channel_position_from_pulse(cmap.map[iChannel]); + } + + + /* Buffer. */ + pActualAttr = ((ma_pa_stream_get_buffer_attr_proc)pDevice->pContext->pulse.pa_stream_get_buffer_attr)((ma_pa_stream*)pDevice->pulse.pStreamCapture); + if (pActualAttr != NULL) { + attr = *pActualAttr; + } + + pDescriptorCapture->periodCount = attr.maxlength / attr.fragsize; + pDescriptorCapture->periodSizeInFrames = attr.maxlength / ma_get_bytes_per_frame(pDescriptorCapture->format, pDescriptorCapture->channels) / pDescriptorCapture->periodCount; + #ifdef MA_DEBUG_OUTPUT + printf("[PulseAudio] Capture actual attr: maxlength=%d, tlength=%d, prebuf=%d, minreq=%d, fragsize=%d; periodSizeInFrames=%d\n", attr.maxlength, attr.tlength, attr.prebuf, attr.minreq, attr.fragsize, pDescriptorCapture->periodSizeInFrames); + #endif + /* Name. */ - ma_mainloop_lock__pulse(pContext, "ma_device_init__pulse"); - devCapture = ((ma_pa_stream_get_device_name_proc)pContext->pulse.pa_stream_get_device_name)((ma_pa_stream*)pDevice->pulse.pStreamCapture); - ma_mainloop_unlock__pulse(pContext, "ma_device_init__pulse"); + devCapture = ((ma_pa_stream_get_device_name_proc)pDevice->pContext->pulse.pa_stream_get_device_name)((ma_pa_stream*)pDevice->pulse.pStreamCapture); if (devCapture != NULL) { - ma_pa_operation* pOP; - - ma_mainloop_lock__pulse(pContext, "ma_device_init__pulse"); - pOP = ((ma_pa_context_get_source_info_by_name_proc)pContext->pulse.pa_context_get_source_info_by_name)((ma_pa_context*)pContext->pulse.pPulseContext, devCapture, ma_device_source_name_callback, pDevice); - ma_mainloop_unlock__pulse(pContext, "ma_device_init__pulse"); - - ma_wait_for_operation_and_unref__pulse(pContext, pOP); + ma_pa_operation* pOP = ((ma_pa_context_get_source_info_by_name_proc)pDevice->pContext->pulse.pa_context_get_source_info_by_name)((ma_pa_context*)pDevice->pContext->pulse.pPulseContext, devCapture, ma_device_source_name_callback, pDevice); + ma_wait_for_operation_and_unref__pulse(pDevice->pContext, pOP); } } if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { - result = ma_context_get_sink_info__pulse(pContext, devPlayback, &sinkInfo); + result = ma_context_get_sink_info__pulse(pDevice->pContext, devPlayback, &sinkInfo); if (result != MA_SUCCESS) { ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to retrieve sink info for playback device.", result); goto on_error2; @@ -22409,15 +22681,15 @@ static ma_result ma_device_init__pulse(ma_context* pContext, const ma_device_con ss = sinkInfo.sample_spec; cmap = sinkInfo.channel_map; - pDevice->playback.internalPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(periodSizeInMilliseconds, ss.rate); - pDevice->playback.internalPeriods = pConfig->periods; + /* We now have enough information to calculate the actual buffer size in frames. */ + pDescriptorPlayback->periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptorPlayback, ss.rate, pConfig->performanceProfile); - attr = ma_device__pa_buffer_attr_new(pDevice->playback.internalPeriodSizeInFrames, pConfig->periods, &ss); + attr = ma_device__pa_buffer_attr_new(pDescriptorPlayback->periodSizeInFrames, pDescriptorPlayback->periodCount, &ss); #ifdef MA_DEBUG_OUTPUT - printf("[PulseAudio] Playback attr: maxlength=%d, tlength=%d, prebuf=%d, minreq=%d, fragsize=%d; internalPeriodSizeInFrames=%d\n", attr.maxlength, attr.tlength, attr.prebuf, attr.minreq, attr.fragsize, pDevice->playback.internalPeriodSizeInFrames); + printf("[PulseAudio] Playback attr: maxlength=%d, tlength=%d, prebuf=%d, minreq=%d, fragsize=%d; periodSizeInFrames=%d\n", attr.maxlength, attr.tlength, attr.prebuf, attr.minreq, attr.fragsize, pDescriptorPlayback->periodSizeInFrames); #endif - pDevice->pulse.pStreamPlayback = ma_context__pa_stream_new__pulse(pContext, pConfig->pulse.pStreamNamePlayback, &ss, &cmap); + pDevice->pulse.pStreamPlayback = ma_context__pa_stream_new__pulse(pDevice->pContext, pConfig->pulse.pStreamNamePlayback, &ss, &cmap); if (pDevice->pulse.pStreamPlayback == NULL) { result = ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to create PulseAudio playback stream.", MA_FAILED_TO_OPEN_BACKEND_DEVICE); goto on_error2; @@ -22428,9 +22700,7 @@ static ma_result ma_device_init__pulse(ma_context* pContext, const ma_device_con Note that this callback will be fired as soon as the stream is connected, even though it's started as corked. The callback needs to handle a device state of MA_STATE_UNINITIALIZED. */ - ma_mainloop_lock__pulse(pContext, "ma_device_init__pulse"); - ((ma_pa_stream_set_write_callback_proc)pContext->pulse.pa_stream_set_write_callback)((ma_pa_stream*)pDevice->pulse.pStreamPlayback, ma_device_on_write__pulse, pDevice); - ma_mainloop_unlock__pulse(pContext, "ma_device_init__pulse"); + ((ma_pa_stream_set_write_callback_proc)pDevice->pContext->pulse.pa_stream_set_write_callback)((ma_pa_stream*)pDevice->pulse.pStreamPlayback, ma_device_on_write__pulse, pDevice); /* Connect after we've got all of our internal state set up. */ @@ -22439,9 +22709,7 @@ static ma_result ma_device_init__pulse(ma_context* pContext, const ma_device_con streamFlags |= MA_PA_STREAM_DONT_MOVE; } - ma_mainloop_lock__pulse(pContext, "ma_device_init__pulse"); - error = ((ma_pa_stream_connect_playback_proc)pContext->pulse.pa_stream_connect_playback)((ma_pa_stream*)pDevice->pulse.pStreamPlayback, devPlayback, &attr, streamFlags, NULL, NULL); - ma_mainloop_unlock__pulse(pContext, "ma_device_init__pulse"); + error = ((ma_pa_stream_connect_playback_proc)pDevice->pContext->pulse.pa_stream_connect_playback)((ma_pa_stream*)pDevice->pulse.pStreamPlayback, devPlayback, &attr, streamFlags, NULL, NULL); if (error != MA_PA_OK) { result = ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to connect PulseAudio playback stream.", ma_result_from_pulse(error)); goto on_error3; @@ -22453,75 +22721,61 @@ static ma_result ma_device_init__pulse(ma_context* pContext, const ma_device_con } - ma_mainloop_lock__pulse(pContext, "ma_device_init__pulse"); - { - /* Internal format. */ - pActualSS = ((ma_pa_stream_get_sample_spec_proc)pContext->pulse.pa_stream_get_sample_spec)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); - if (pActualSS != NULL) { - ss = *pActualSS; - } - - pDevice->playback.internalFormat = ma_format_from_pulse(ss.format); - pDevice->playback.internalChannels = ss.channels; - pDevice->playback.internalSampleRate = ss.rate; - - /* Internal channel map. */ - pActualCMap = ((ma_pa_stream_get_channel_map_proc)pContext->pulse.pa_stream_get_channel_map)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); - if (pActualCMap != NULL) { - cmap = *pActualCMap; - } - for (iChannel = 0; iChannel < pDevice->playback.internalChannels; ++iChannel) { - pDevice->playback.internalChannelMap[iChannel] = ma_channel_position_from_pulse(cmap.map[iChannel]); - } - - /* Buffer. */ - pActualAttr = ((ma_pa_stream_get_buffer_attr_proc)pContext->pulse.pa_stream_get_buffer_attr)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); - if (pActualAttr != NULL) { - attr = *pActualAttr; - } - pDevice->playback.internalPeriods = attr.maxlength / attr.tlength; - pDevice->playback.internalPeriodSizeInFrames = attr.maxlength / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels) / pDevice->playback.internalPeriods; - #ifdef MA_DEBUG_OUTPUT - printf("[PulseAudio] Playback actual attr: maxlength=%d, tlength=%d, prebuf=%d, minreq=%d, fragsize=%d; internalPeriodSizeInFrames=%d\n", attr.maxlength, attr.tlength, attr.prebuf, attr.minreq, attr.fragsize, pDevice->playback.internalPeriodSizeInFrames); - #endif + /* Internal format. */ + pActualSS = ((ma_pa_stream_get_sample_spec_proc)pDevice->pContext->pulse.pa_stream_get_sample_spec)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); + if (pActualSS != NULL) { + ss = *pActualSS; } - ma_mainloop_unlock__pulse(pContext, "ma_device_init__pulse"); + + pDescriptorPlayback->format = ma_format_from_pulse(ss.format); + pDescriptorPlayback->channels = ss.channels; + pDescriptorPlayback->sampleRate = ss.rate; + + /* Internal channel map. */ + pActualCMap = ((ma_pa_stream_get_channel_map_proc)pDevice->pContext->pulse.pa_stream_get_channel_map)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); + if (pActualCMap != NULL) { + cmap = *pActualCMap; + } + + for (iChannel = 0; iChannel < pDevice->playback.internalChannels; ++iChannel) { + pDescriptorPlayback->channelMap[iChannel] = ma_channel_position_from_pulse(cmap.map[iChannel]); + } + + + /* Buffer. */ + pActualAttr = ((ma_pa_stream_get_buffer_attr_proc)pDevice->pContext->pulse.pa_stream_get_buffer_attr)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); + if (pActualAttr != NULL) { + attr = *pActualAttr; + } + + pDescriptorPlayback->periodCount = attr.maxlength / attr.tlength; + pDescriptorPlayback->periodSizeInFrames = attr.maxlength / ma_get_bytes_per_frame(pDescriptorPlayback->format, pDescriptorPlayback->channels) / pDescriptorPlayback->periodCount; + #ifdef MA_DEBUG_OUTPUT + printf("[PulseAudio] Playback actual attr: maxlength=%d, tlength=%d, prebuf=%d, minreq=%d, fragsize=%d; internalPeriodSizeInFrames=%d\n", attr.maxlength, attr.tlength, attr.prebuf, attr.minreq, attr.fragsize, pDevice->playback.internalPeriodSizeInFrames); + #endif + /* Name. */ - ma_mainloop_lock__pulse(pContext, "ma_device_init__pulse"); - devPlayback = ((ma_pa_stream_get_device_name_proc)pContext->pulse.pa_stream_get_device_name)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); - ma_mainloop_unlock__pulse(pContext, "ma_device_init__pulse"); + devPlayback = ((ma_pa_stream_get_device_name_proc)pDevice->pContext->pulse.pa_stream_get_device_name)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); if (devPlayback != NULL) { - ma_pa_operation* pOP; - - ma_mainloop_lock__pulse(pContext, "ma_device_init__pulse"); - pOP = ((ma_pa_context_get_sink_info_by_name_proc)pContext->pulse.pa_context_get_sink_info_by_name)((ma_pa_context*)pContext->pulse.pPulseContext, devPlayback, ma_device_sink_name_callback, pDevice); - ma_mainloop_unlock__pulse(pContext, "ma_device_init__pulse"); - - ma_wait_for_operation_and_unref__pulse(pContext, pOP); + ma_pa_operation* pOP = ((ma_pa_context_get_sink_info_by_name_proc)pDevice->pContext->pulse.pa_context_get_sink_info_by_name)((ma_pa_context*)pDevice->pContext->pulse.pPulseContext, devPlayback, ma_device_sink_name_callback, pDevice); + ma_wait_for_operation_and_unref__pulse(pDevice->pContext, pOP); } } - /* We need a ring buffer for handling duplex mode. */ + /* + We need a ring buffer for handling duplex mode. We can use the main duplex ring buffer in the main + part of the ma_device struct. We cannot, however, depend on ma_device_init() initializing this for + us later on because that will only do it if it's a fully asynchronous backend - i.e. the + onDeviceDataLoop callback is NULL, which is not the case for PulseAudio. + */ if (pConfig->deviceType == ma_device_type_duplex) { - ma_uint32 rbSizeInFrames = (ma_uint32)ma_calculate_frame_count_after_resampling(pDevice->sampleRate, pDevice->capture.internalSampleRate, pDevice->capture.internalPeriodSizeInFrames * pDevice->capture.internalPeriods); - result = ma_pcm_rb_init(pDevice->capture.format, pDevice->capture.channels, rbSizeInFrames, NULL, &pDevice->pContext->allocationCallbacks, &pDevice->pulse.duplexRB); + result = ma_duplex_rb_init(format, channels, sampleRate, pDescriptorCapture->sampleRate, pDescriptorCapture->periodSizeInFrames, &pDevice->pContext->allocationCallbacks, &pDevice->duplexRB); if (result != MA_SUCCESS) { result = ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to initialize ring buffer.", result); goto on_error4; } - - /* We need a period to act as a buffer for cases where the playback and capture device's end up desyncing. */ - { - ma_uint32 marginSizeInFrames = rbSizeInFrames / pDevice->capture.internalPeriods; - void* pMarginData; - ma_pcm_rb_acquire_write(&pDevice->pulse.duplexRB, &marginSizeInFrames, &pMarginData); - { - MA_ZERO_MEMORY(pMarginData, marginSizeInFrames * ma_get_bytes_per_frame(pDevice->capture.format, pDevice->capture.channels)); - } - ma_pcm_rb_commit_write(&pDevice->pulse.duplexRB, marginSizeInFrames, pMarginData); - } } return MA_SUCCESS; @@ -22529,27 +22783,19 @@ static ma_result ma_device_init__pulse(ma_context* pContext, const ma_device_con on_error4: if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { - ma_mainloop_lock__pulse(pContext, "ma_device_init__pulse"); - ((ma_pa_stream_disconnect_proc)pContext->pulse.pa_stream_disconnect)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); - ma_mainloop_unlock__pulse(pContext, "ma_device_init__pulse"); + ((ma_pa_stream_disconnect_proc)pDevice->pContext->pulse.pa_stream_disconnect)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); } on_error3: if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { - ma_mainloop_lock__pulse(pContext, "ma_device_init__pulse"); - ((ma_pa_stream_unref_proc)pContext->pulse.pa_stream_unref)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); - ma_mainloop_unlock__pulse(pContext, "ma_device_init__pulse"); + ((ma_pa_stream_unref_proc)pDevice->pContext->pulse.pa_stream_unref)((ma_pa_stream*)pDevice->pulse.pStreamPlayback); } on_error2: if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) { - ma_mainloop_lock__pulse(pContext, "ma_device_init__pulse"); - ((ma_pa_stream_disconnect_proc)pContext->pulse.pa_stream_disconnect)((ma_pa_stream*)pDevice->pulse.pStreamCapture); - ma_mainloop_unlock__pulse(pContext, "ma_device_init__pulse"); + ((ma_pa_stream_disconnect_proc)pDevice->pContext->pulse.pa_stream_disconnect)((ma_pa_stream*)pDevice->pulse.pStreamCapture); } on_error1: if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) { - ma_mainloop_lock__pulse(pContext, "ma_device_init__pulse"); - ((ma_pa_stream_unref_proc)pContext->pulse.pa_stream_unref)((ma_pa_stream*)pDevice->pulse.pStreamCapture); - ma_mainloop_unlock__pulse(pContext, "ma_device_init__pulse"); + ((ma_pa_stream_unref_proc)pDevice->pContext->pulse.pa_stream_unref)((ma_pa_stream*)pDevice->pulse.pStreamCapture); } on_error0: return result; @@ -22584,10 +22830,7 @@ static ma_result ma_device__cork_stream__pulse(ma_device* pDevice, ma_device_typ pStream = (ma_pa_stream*)((deviceType == ma_device_type_capture) ? pDevice->pulse.pStreamCapture : pDevice->pulse.pStreamPlayback); MA_ASSERT(pStream != NULL); - ma_mainloop_lock__pulse(pContext, "ma_device__cork_stream__pulse"); pOP = ((ma_pa_stream_cork_proc)pContext->pulse.pa_stream_cork)(pStream, cork, ma_pulse_operation_complete_callback, &wasSuccessful); - ma_mainloop_unlock__pulse(pContext, "ma_device__cork_stream__pulse"); - if (pOP == NULL) { return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to cork PulseAudio stream.", (cork == 0) ? MA_FAILED_TO_START_BACKEND_DEVICE : MA_FAILED_TO_STOP_BACKEND_DEVICE); } @@ -22623,10 +22866,7 @@ static ma_result ma_device_start__pulse(ma_device* pDevice) if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { /* We need to fill some data before uncorking. Not doing this will result in the write callback never getting fired. */ - ma_mainloop_lock__pulse(pDevice->pContext, "ma_device_start__pulse"); result = ma_device_write_to_stream__pulse(pDevice, (ma_pa_stream*)(pDevice->pulse.pStreamPlayback), NULL); - ma_mainloop_unlock__pulse(pDevice->pContext, "ma_device_start__pulse"); - if (result != MA_SUCCESS) { return result; /* Failed to write data. Not sure what to do here... Just aborting. */ } @@ -22656,12 +22896,7 @@ static ma_result ma_device_stop__pulse(ma_device* pDevice) if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { /* The stream needs to be drained if it's a playback device. */ - ma_pa_operation* pOP; - - ma_mainloop_lock__pulse(pDevice->pContext, "ma_device_stop__pulse"); - pOP = ((ma_pa_stream_drain_proc)pDevice->pContext->pulse.pa_stream_drain)((ma_pa_stream*)pDevice->pulse.pStreamPlayback, ma_pulse_operation_complete_callback, &wasSuccessful); - ma_mainloop_unlock__pulse(pDevice->pContext, "ma_device_stop__pulse"); - + ma_pa_operation* pOP = ((ma_pa_stream_drain_proc)pDevice->pContext->pulse.pa_stream_drain)((ma_pa_stream*)pDevice->pulse.pStreamPlayback, ma_pulse_operation_complete_callback, &wasSuccessful); ma_wait_for_operation_and_unref__pulse(pDevice->pContext, pOP); result = ma_device__cork_stream__pulse(pDevice, ma_device_type_playback, 1); @@ -22670,10 +22905,38 @@ static ma_result ma_device_stop__pulse(ma_device* pDevice) } } - if (pDevice->onStop != NULL) { - pDevice->onStop(pDevice); + return MA_SUCCESS; +} + +static ma_result ma_device_data_loop__pulse(ma_device* pDevice) +{ + int resultPA; + + MA_ASSERT(pDevice != NULL); + + /* NOTE: Don't start the device here. It'll be done at a higher level. */ + + /* + All data is handled through callbacks. All we need to do is iterate over the main loop and let + the callbacks deal with it. + */ + while (ma_device_get_state(pDevice) == MA_STATE_STARTED) { + resultPA = ((ma_pa_mainloop_iterate_proc)pDevice->pContext->pulse.pa_mainloop_iterate)((ma_pa_mainloop*)pDevice->pContext->pulse.pMainLoop, 1, NULL); + if (resultPA < 0) { + break; + } } + /* NOTE: Don't stop the device here. It'll be done at a higher level. */ + return MA_SUCCESS; +} + +static ma_result ma_device_data_loop_wakeup__pulse(ma_device* pDevice) +{ + MA_ASSERT(pDevice != NULL); + + ((ma_pa_mainloop_wakeup_proc)pDevice->pContext->pulse.pa_mainloop_wakeup)((ma_pa_mainloop*)pDevice->pContext->pulse.pMainLoop); + return MA_SUCCESS; } @@ -22682,16 +22945,9 @@ static ma_result ma_context_uninit__pulse(ma_context* pContext) MA_ASSERT(pContext != NULL); MA_ASSERT(pContext->backend == ma_backend_pulseaudio); - ma_mainloop_lock__pulse(pContext, "ma_context_uninit__pulse"); - { - ((ma_pa_context_disconnect_proc)pContext->pulse.pa_context_disconnect)((ma_pa_context*)pContext->pulse.pPulseContext); - ((ma_pa_context_unref_proc)pContext->pulse.pa_context_unref)((ma_pa_context*)pContext->pulse.pPulseContext); - } - ma_mainloop_unlock__pulse(pContext, "ma_context_uninit__pulse"); - - /* The mainloop needs to be stopped before freeing. */ - ((ma_pa_threaded_mainloop_stop_proc)pContext->pulse.pa_threaded_mainloop_stop)((ma_pa_threaded_mainloop*)pContext->pulse.pMainLoop); - ((ma_pa_threaded_mainloop_free_proc)pContext->pulse.pa_threaded_mainloop_free)((ma_pa_threaded_mainloop*)pContext->pulse.pMainLoop); + ((ma_pa_context_disconnect_proc)pContext->pulse.pa_context_disconnect)((ma_pa_context*)pContext->pulse.pPulseContext); + ((ma_pa_context_unref_proc)pContext->pulse.pa_context_unref)((ma_pa_context*)pContext->pulse.pPulseContext); + ((ma_pa_mainloop_free_proc)pContext->pulse.pa_mainloop_free)((ma_pa_mainloop*)pContext->pulse.pMainLoop); #ifndef MA_NO_RUNTIME_LINKING ma_dlclose(pContext, pContext->pulse.pulseSO); @@ -22700,7 +22956,7 @@ static ma_result ma_context_uninit__pulse(ma_context* pContext) return MA_SUCCESS; } -static ma_result ma_context_init__pulse(const ma_context_config* pConfig, ma_context* pContext) +static ma_result ma_context_init__pulse(ma_context* pContext, const ma_context_config* pConfig, ma_backend_callbacks* pCallbacks) { ma_result result; #ifndef MA_NO_RUNTIME_LINKING @@ -22901,7 +23157,7 @@ static ma_result ma_context_init__pulse(const ma_context_config* pConfig, ma_con #endif /* The PulseAudio context maps well to miniaudio's notion of a context. The pa_context object will be initialized as part of the ma_context. */ - pContext->pulse.pMainLoop = ((ma_pa_threaded_mainloop_new_proc)pContext->pulse.pa_threaded_mainloop_new)(); + pContext->pulse.pMainLoop = ((ma_pa_mainloop_new_proc)pContext->pulse.pa_mainloop_new)(); if (pContext->pulse.pMainLoop == NULL) { result = ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to create mainloop.", MA_FAILED_TO_INIT_BACKEND); #ifndef MA_NO_RUNTIME_LINKING @@ -22910,28 +23166,10 @@ static ma_result ma_context_init__pulse(const ma_context_config* pConfig, ma_con return result; } - /* We should start the mainloop locked and unlock once ready to wait . */ - ma_mainloop_lock__pulse(pContext, "ma_context_init__pulse"); - - /* With the mainloop created we can now start it. */ - result = ma_result_from_pulse(((ma_pa_threaded_mainloop_start_proc)pContext->pulse.pa_threaded_mainloop_start)((ma_pa_threaded_mainloop*)pContext->pulse.pMainLoop)); - if (result != MA_SUCCESS) { - ma_mainloop_unlock__pulse(pContext, "ma_context_init__pulse"); - ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to start mainloop.", result); - ((ma_pa_context_unref_proc)pContext->pulse.pa_context_unref)((ma_pa_context*)pContext->pulse.pPulseContext); - ((ma_pa_threaded_mainloop_free_proc)pContext->pulse.pa_threaded_mainloop_free)((ma_pa_threaded_mainloop*)(pContext->pulse.pMainLoop)); - #ifndef MA_NO_RUNTIME_LINKING - ma_dlclose(pContext, pContext->pulse.pulseSO); - #endif - return result; - } - - pContext->pulse.pPulseContext = ((ma_pa_context_new_proc)pContext->pulse.pa_context_new)(((ma_pa_threaded_mainloop_get_api_proc)pContext->pulse.pa_threaded_mainloop_get_api)((ma_pa_threaded_mainloop*)pContext->pulse.pMainLoop), pConfig->pulse.pApplicationName); + pContext->pulse.pPulseContext = ((ma_pa_context_new_proc)pContext->pulse.pa_context_new)(((ma_pa_mainloop_get_api_proc)pContext->pulse.pa_mainloop_get_api)((ma_pa_mainloop*)pContext->pulse.pMainLoop), pConfig->pulse.pApplicationName); if (pContext->pulse.pPulseContext == NULL) { - ma_mainloop_unlock__pulse(pContext, "ma_context_init__pulse"); result = ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to create PulseAudio context.", MA_FAILED_TO_INIT_BACKEND); - ((ma_pa_threaded_mainloop_stop_proc)pContext->pulse.pa_threaded_mainloop_stop)((ma_pa_threaded_mainloop*)(pContext->pulse.pMainLoop)); - ((ma_pa_threaded_mainloop_free_proc)pContext->pulse.pa_threaded_mainloop_free)((ma_pa_threaded_mainloop*)(pContext->pulse.pMainLoop)); + ((ma_pa_mainloop_free_proc)pContext->pulse.pa_mainloop_free)((ma_pa_mainloop*)(pContext->pulse.pMainLoop)); #ifndef MA_NO_RUNTIME_LINKING ma_dlclose(pContext, pContext->pulse.pulseSO); #endif @@ -22941,40 +23179,38 @@ static ma_result ma_context_init__pulse(const ma_context_config* pConfig, ma_con /* Now we need to connect to the context. Everything is asynchronous so we need to wait for it to connect before returning. */ result = ma_result_from_pulse(((ma_pa_context_connect_proc)pContext->pulse.pa_context_connect)((ma_pa_context*)pContext->pulse.pPulseContext, pConfig->pulse.pServerName, (pConfig->pulse.tryAutoSpawn) ? 0 : MA_PA_CONTEXT_NOAUTOSPAWN, NULL)); if (result != MA_SUCCESS) { - ma_mainloop_unlock__pulse(pContext, "ma_context_init__pulse"); ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "[PulseAudio] Failed to connect PulseAudio context.", result); - ((ma_pa_threaded_mainloop_stop_proc)pContext->pulse.pa_threaded_mainloop_stop)((ma_pa_threaded_mainloop*)(pContext->pulse.pMainLoop)); - ((ma_pa_threaded_mainloop_free_proc)pContext->pulse.pa_threaded_mainloop_free)((ma_pa_threaded_mainloop*)(pContext->pulse.pMainLoop)); + ((ma_pa_mainloop_free_proc)pContext->pulse.pa_mainloop_free)((ma_pa_mainloop*)(pContext->pulse.pMainLoop)); #ifndef MA_NO_RUNTIME_LINKING ma_dlclose(pContext, pContext->pulse.pulseSO); #endif return result; } - /* Can now unlock. */ - ma_mainloop_unlock__pulse(pContext, "ma_context_init__pulse"); - /* Since ma_context_init() runs synchronously we need to wait for the PulseAudio context to connect before we return. */ result = ma_context_wait_for_pa_context_to_connect__pulse(pContext); if (result != MA_SUCCESS) { - ((ma_pa_threaded_mainloop_stop_proc)pContext->pulse.pa_threaded_mainloop_stop)((ma_pa_threaded_mainloop*)(pContext->pulse.pMainLoop)); - ((ma_pa_threaded_mainloop_free_proc)pContext->pulse.pa_threaded_mainloop_free)((ma_pa_threaded_mainloop*)(pContext->pulse.pMainLoop)); + ((ma_pa_mainloop_free_proc)pContext->pulse.pa_mainloop_free)((ma_pa_mainloop*)(pContext->pulse.pMainLoop)); #ifndef MA_NO_RUNTIME_LINKING ma_dlclose(pContext, pContext->pulse.pulseSO); #endif return result; } - pContext->isBackendAsynchronous = MA_TRUE; /* We are using PulseAudio in asynchronous mode. */ - pContext->onUninit = ma_context_uninit__pulse; - pContext->onEnumDevices = ma_context_enumerate_devices__pulse; - pContext->onGetDeviceInfo = ma_context_get_device_info__pulse; - pContext->onDeviceInit = ma_device_init__pulse; - pContext->onDeviceUninit = ma_device_uninit__pulse; - pContext->onDeviceStart = ma_device_start__pulse; - pContext->onDeviceStop = ma_device_stop__pulse; - pContext->onDeviceMainLoop = NULL; /* Set to null since this backend is asynchronous. */ + /* With pa_mainloop we run a synchronous backend, but we implement our own main loop. */ + pCallbacks->onContextInit = ma_context_init__pulse; + pCallbacks->onContextUninit = ma_context_uninit__pulse; + pCallbacks->onContextEnumerateDevices = ma_context_enumerate_devices__pulse; + pCallbacks->onContextGetDeviceInfo = ma_context_get_device_info__pulse; + pCallbacks->onDeviceInit = ma_device_init__pulse; + pCallbacks->onDeviceUninit = ma_device_uninit__pulse; + pCallbacks->onDeviceStart = ma_device_start__pulse; + pCallbacks->onDeviceStop = ma_device_stop__pulse; + pCallbacks->onDeviceRead = NULL; /* Not used because we're implementing onDeviceDataLoop. */ + pCallbacks->onDeviceWrite = NULL; /* Not used because we're implementing onDeviceDataLoop. */ + pCallbacks->onDeviceDataLoop = ma_device_data_loop__pulse; + pCallbacks->onDeviceDataLoopWakeup = ma_device_data_loop_wakeup__pulse; return MA_SUCCESS; } @@ -23497,7 +23733,8 @@ static ma_result ma_context_init__jack(ma_context* pContext, const ma_context_co #ifndef MA_NO_RUNTIME_LINKING const char* libjackNames[] = { #ifdef MA_WIN32 - "libjack.dll" + "libjack.dll", + "libjack64.dll" #else "libjack.so", "libjack.so.0" @@ -23606,7 +23843,7 @@ static ma_result ma_context_init__jack(ma_context* pContext, const ma_context_co pCallbacks->onDeviceStop = ma_device_stop__jack; pCallbacks->onDeviceRead = NULL; /* Not used because JACK is asynchronous. */ pCallbacks->onDeviceWrite = NULL; /* Not used because JACK is asynchronous. */ - pCallbacks->onDeviceAudioThread = NULL; /* Not used because JACK is asynchronous. */ + pCallbacks->onDeviceDataLoop = NULL; /* Not used because JACK is asynchronous. */ return MA_SUCCESS; } @@ -24579,7 +24816,7 @@ static ma_result ma_find_AudioObjectID(ma_context* pContext, ma_device_type devi } -static ma_result ma_find_best_format__coreaudio(ma_context* pContext, AudioObjectID deviceObjectID, ma_device_type deviceType, ma_format format, ma_uint32 channels, ma_uint32 sampleRate, ma_bool32 usingDefaultFormat, ma_bool32 usingDefaultChannels, ma_bool32 usingDefaultSampleRate, const AudioStreamBasicDescription* pOrigFormat, AudioStreamBasicDescription* pFormat) +static ma_result ma_find_best_format__coreaudio(ma_context* pContext, AudioObjectID deviceObjectID, ma_device_type deviceType, ma_format format, ma_uint32 channels, ma_uint32 sampleRate, const AudioStreamBasicDescription* pOrigFormat, AudioStreamBasicDescription* pFormat) { UInt32 deviceFormatDescriptionCount; AudioStreamRangedDescription* pDeviceFormatDescriptions; @@ -24597,17 +24834,17 @@ static ma_result ma_find_best_format__coreaudio(ma_context* pContext, AudioObjec } desiredSampleRate = sampleRate; - if (usingDefaultSampleRate) { + if (desiredSampleRate == 0) { desiredSampleRate = pOrigFormat->mSampleRate; } desiredChannelCount = channels; - if (usingDefaultChannels) { + if (desiredChannelCount == 0) { desiredChannelCount = pOrigFormat->mChannelsPerFrame; } desiredFormat = format; - if (usingDefaultFormat) { + if (desiredFormat == ma_format_unknown) { result = ma_format_from_AudioStreamBasicDescription(pOrigFormat, &desiredFormat); if (result != MA_SUCCESS || desiredFormat == ma_format_unknown) { desiredFormat = g_maFormatPriorities[0]; @@ -24889,17 +25126,12 @@ static ma_result ma_context_enumerate_devices__coreaudio(ma_context* pContext, m return MA_SUCCESS; } -static ma_result ma_context_get_device_info__coreaudio(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_share_mode shareMode, ma_device_info* pDeviceInfo) +static ma_result ma_context_get_device_info__coreaudio(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_device_info* pDeviceInfo) { ma_result result; MA_ASSERT(pContext != NULL); - /* No exclusive mode with the Core Audio backend for now. */ - if (shareMode == ma_share_mode_exclusive) { - return MA_SHARE_MODE_NOT_SUPPORTED; - } - #if defined(MA_APPLE_DESKTOP) /* Desktop */ { @@ -24931,67 +25163,101 @@ static ma_result ma_context_get_device_info__coreaudio(ma_context* pContext, ma_ if (deviceObjectID == defaultDeviceObjectID) { pDeviceInfo->isDefault = MA_TRUE; } - + + /* + There could be a large number of permutations here. Fortunately there is only a single channel count + being reported which reduces this quite a bit. For sample rates we're only reporting those that are + one of miniaudio's recognized "standard" rates. If there are still more formats than can fit into + our fixed sized array we'll just need to truncate them. This is unlikely and will probably only happen + if some driver performs software data conversion and therefore reports every possible format and + sample rate. + */ + pDeviceInfo->nativeDataFormatCount = 0; + /* Formats. */ - result = ma_get_AudioObject_stream_descriptions(pContext, deviceObjectID, deviceType, &streamDescriptionCount, &pStreamDescriptions); - if (result != MA_SUCCESS) { - return result; - } - - for (iStreamDescription = 0; iStreamDescription < streamDescriptionCount; ++iStreamDescription) { - ma_format format; - ma_bool32 formatExists = MA_FALSE; - ma_uint32 iOutputFormat; - - result = ma_format_from_AudioStreamBasicDescription(&pStreamDescriptions[iStreamDescription].mFormat, &format); + { + ma_format uniqueFormats[ma_format_count]; + ma_uint32 uniqueFormatCount = 0; + ma_uint32 channels; + + /* Channels. */ + result = ma_get_AudioObject_channel_count(pContext, deviceObjectID, deviceType, &channels); if (result != MA_SUCCESS) { - continue; + return result; + } + + /* Formats. */ + result = ma_get_AudioObject_stream_descriptions(pContext, deviceObjectID, deviceType, &streamDescriptionCount, &pStreamDescriptions); + if (result != MA_SUCCESS) { + return result; } - MA_ASSERT(format != ma_format_unknown); + for (iStreamDescription = 0; iStreamDescription < streamDescriptionCount; ++iStreamDescription) { + ma_format format; + ma_bool32 hasFormatBeenHandled = MA_FALSE; + ma_uint32 iOutputFormat; + ma_uint32 iSampleRate; - /* Make sure the format isn't already in the output list. */ - for (iOutputFormat = 0; iOutputFormat < pDeviceInfo->formatCount; ++iOutputFormat) { - if (pDeviceInfo->formats[iOutputFormat] == format) { - formatExists = MA_TRUE; - break; + result = ma_format_from_AudioStreamBasicDescription(&pStreamDescriptions[iStreamDescription].mFormat, &format); + if (result != MA_SUCCESS) { + continue; + } + + MA_ASSERT(format != ma_format_unknown); + + /* Make sure the format isn't already in the output list. */ + for (iOutputFormat = 0; iOutputFormat < uniqueFormatCount; ++iOutputFormat) { + if (uniqueFormats[iOutputFormat] == format) { + hasFormatBeenHandled = MA_TRUE; + break; + } + } + + /* If we've already handled this format just skip it. */ + if (hasFormatBeenHandled) { + continue; + } + + uniqueFormatCount += 1; + + + /* Sample Rates */ + result = ma_get_AudioObject_sample_rates(pContext, deviceObjectID, deviceType, &sampleRateRangeCount, &pSampleRateRanges); + if (result != MA_SUCCESS) { + return result; + } + + /* + Annoyingly Core Audio reports a sample rate range. We just get all the standard rates that are + between this range. + */ + for (iSampleRate = 0; iSampleRate < sampleRateRangeCount; ++iSampleRate) { + ma_uint32 iStandardSampleRate; + for (iStandardSampleRate = 0; iStandardSampleRate < ma_countof(g_maStandardSampleRatePriorities); iStandardSampleRate += 1) { + ma_uint32 standardSampleRate = g_maStandardSampleRatePriorities[iStandardSampleRate]; + if (standardSampleRate >= pSampleRateRanges[iSampleRate].mMinimum && standardSampleRate <= pSampleRateRanges[iSampleRate].mMaximum) { + /* We have a new data format. Add it to the list. */ + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].format = format; + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].channels = channels; + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].sampleRate = standardSampleRate; + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].flags = 0; + pDeviceInfo->nativeDataFormatCount += 1; + + if (pDeviceInfo->nativeDataFormatCount >= ma_countof(pDeviceInfo->nativeDataFormats)) { + break; /* No more room for any more formats. */ + } + } + } + } + + ma_free(pSampleRateRanges, &pContext->allocationCallbacks); + + if (pDeviceInfo->nativeDataFormatCount >= ma_countof(pDeviceInfo->nativeDataFormats)) { + break; /* No more room for any more formats. */ } } - if (!formatExists) { - pDeviceInfo->formats[pDeviceInfo->formatCount++] = format; - } - } - - ma_free(pStreamDescriptions, &pContext->allocationCallbacks); - - - /* Channels. */ - result = ma_get_AudioObject_channel_count(pContext, deviceObjectID, deviceType, &pDeviceInfo->minChannels); - if (result != MA_SUCCESS) { - return result; - } - pDeviceInfo->maxChannels = pDeviceInfo->minChannels; - - - /* Sample rates. */ - result = ma_get_AudioObject_sample_rates(pContext, deviceObjectID, deviceType, &sampleRateRangeCount, &pSampleRateRanges); - if (result != MA_SUCCESS) { - return result; - } - - if (sampleRateRangeCount > 0) { - UInt32 iSampleRate; - pDeviceInfo->minSampleRate = UINT32_MAX; - pDeviceInfo->maxSampleRate = 0; - for (iSampleRate = 0; iSampleRate < sampleRateRangeCount; ++iSampleRate) { - if (pDeviceInfo->minSampleRate > pSampleRateRanges[iSampleRate].mMinimum) { - pDeviceInfo->minSampleRate = pSampleRateRanges[iSampleRate].mMinimum; - } - if (pDeviceInfo->maxSampleRate < pSampleRateRanges[iSampleRate].mMaximum) { - pDeviceInfo->maxSampleRate = pSampleRateRanges[iSampleRate].mMaximum; - } - } + ma_free(pStreamDescriptions, &pContext->allocationCallbacks); } } #else @@ -25075,15 +25341,15 @@ static ma_result ma_context_get_device_info__coreaudio(ma_context* pContext, ma_ ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(audioUnit); audioUnit = NULL; - - pDeviceInfo->minChannels = bestFormat.mChannelsPerFrame; - pDeviceInfo->maxChannels = bestFormat.mChannelsPerFrame; - - pDeviceInfo->formatCount = 1; - result = ma_format_from_AudioStreamBasicDescription(&bestFormat, &pDeviceInfo->formats[0]); + /* Only a single format is being reported for iOS. */ + pDeviceInfo->nativeDataFormatCount = 1; + + result = ma_format_from_AudioStreamBasicDescription(&bestFormat, &pDeviceInfo->nativeDataFormats[0].format); if (result != MA_SUCCESS) { return result; } + + pDeviceInfo->nativeDataFormats[0].channels = bestFormat.mChannelsPerFrame; /* It looks like Apple are wanting to push the whole AVAudioSession thing. Thus, we need to use that to determine device settings. To do @@ -25093,8 +25359,7 @@ static ma_result ma_context_get_device_info__coreaudio(ma_context* pContext, ma_ AVAudioSession* pAudioSession = [AVAudioSession sharedInstance]; MA_ASSERT(pAudioSession != NULL); - pDeviceInfo->minSampleRate = (ma_uint32)pAudioSession.sampleRate; - pDeviceInfo->maxSampleRate = pDeviceInfo->minSampleRate; + pDeviceInfo->nativeDataFormats[0].sampleRate = (ma_uint32)pAudioSession.sampleRate; } } #endif @@ -25199,11 +25464,7 @@ static OSStatus ma_on_output__coreaudio(void* pUserData, AudioUnitRenderActionFl if (pBufferList->mBuffers[iBuffer].mNumberChannels == pDevice->playback.internalChannels) { ma_uint32 frameCountForThisBuffer = pBufferList->mBuffers[iBuffer].mDataByteSize / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); if (frameCountForThisBuffer > 0) { - if (pDevice->type == ma_device_type_duplex) { - ma_device__handle_duplex_callback_playback(pDevice, frameCountForThisBuffer, pBufferList->mBuffers[iBuffer].mData, &pDevice->coreaudio.duplexRB); - } else { - ma_device__read_frames_from_client(pDevice, frameCountForThisBuffer, pBufferList->mBuffers[iBuffer].mData); - } + ma_device_handle_backend_data_callback(pDevice, pBufferList->mBuffers[iBuffer].mData, NULL, frameCountForThisBuffer); } #if defined(MA_DEBUG_OUTPUT) @@ -25245,12 +25506,8 @@ static OSStatus ma_on_output__coreaudio(void* pUserData, AudioUnitRenderActionFl if (framesToRead > framesRemaining) { framesToRead = framesRemaining; } - - if (pDevice->type == ma_device_type_duplex) { - ma_device__handle_duplex_callback_playback(pDevice, framesToRead, tempBuffer, &pDevice->coreaudio.duplexRB); - } else { - ma_device__read_frames_from_client(pDevice, framesToRead, tempBuffer); - } + + ma_device_handle_backend_data_callback(pDevice, tempBuffer, NULL, framesToRead); for (iChannel = 0; iChannel < pDevice->playback.internalChannels; ++iChannel) { ppDeinterleavedBuffers[iChannel] = (void*)ma_offset_ptr(pBufferList->mBuffers[iBuffer+iChannel].mData, (frameCountPerBuffer - framesRemaining) * ma_get_bytes_per_sample(pDevice->playback.internalFormat)); @@ -25333,11 +25590,8 @@ static OSStatus ma_on_input__coreaudio(void* pUserData, AudioUnitRenderActionFla if (layout == ma_stream_layout_interleaved) { for (iBuffer = 0; iBuffer < pRenderedBufferList->mNumberBuffers; ++iBuffer) { if (pRenderedBufferList->mBuffers[iBuffer].mNumberChannels == pDevice->capture.internalChannels) { - if (pDevice->type == ma_device_type_duplex) { - ma_device__handle_duplex_callback_capture(pDevice, frameCount, pRenderedBufferList->mBuffers[iBuffer].mData, &pDevice->coreaudio.duplexRB); - } else { - ma_device__send_frames_to_client(pDevice, frameCount, pRenderedBufferList->mBuffers[iBuffer].mData); - } + ma_device_handle_backend_data_callback(pDevice, NULL, pRenderedBufferList->mBuffers[iBuffer].mData, frameCount); + #if defined(MA_DEBUG_OUTPUT) printf(" mDataByteSize=%d\n", pRenderedBufferList->mBuffers[iBuffer].mDataByteSize); #endif @@ -25357,12 +25611,8 @@ static OSStatus ma_on_input__coreaudio(void* pUserData, AudioUnitRenderActionFla if (framesToSend > framesRemaining) { framesToSend = framesRemaining; } - - if (pDevice->type == ma_device_type_duplex) { - ma_device__handle_duplex_callback_capture(pDevice, framesToSend, silentBuffer, &pDevice->coreaudio.duplexRB); - } else { - ma_device__send_frames_to_client(pDevice, framesToSend, silentBuffer); - } + + ma_device_handle_backend_data_callback(pDevice, NULL, silentBuffer, framesToSend); framesRemaining -= framesToSend; } @@ -25387,7 +25637,7 @@ static OSStatus ma_on_input__coreaudio(void* pUserData, AudioUnitRenderActionFla while (framesRemaining > 0) { void* ppDeinterleavedBuffers[MA_MAX_CHANNELS]; ma_uint32 iChannel; - ma_uint32 framesToSend = sizeof(tempBuffer) / ma_get_bytes_per_sample(pDevice->capture.internalFormat); + ma_uint32 framesToSend = sizeof(tempBuffer) / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); if (framesToSend > framesRemaining) { framesToSend = framesRemaining; } @@ -25397,12 +25647,7 @@ static OSStatus ma_on_input__coreaudio(void* pUserData, AudioUnitRenderActionFla } ma_interleave_pcm_frames(pDevice->capture.internalFormat, pDevice->capture.internalChannels, framesToSend, (const void**)ppDeinterleavedBuffers, tempBuffer); - - if (pDevice->type == ma_device_type_duplex) { - ma_device__handle_duplex_callback_capture(pDevice, framesToSend, tempBuffer, &pDevice->coreaudio.duplexRB); - } else { - ma_device__send_frames_to_client(pDevice, framesToSend, tempBuffer); - } + ma_device_handle_backend_data_callback(pDevice, NULL, tempBuffer, framesToSend); framesRemaining -= framesToSend; } @@ -25725,7 +25970,7 @@ static ma_result ma_device__untrack__coreaudio(ma_device* pDevice) -(void)remove_handler { - [[NSNotificationCenter defaultCenter] removeObserver:self name:@"AVAudioSessionRouteChangeNotification" object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:AVAudioSessionRouteChangeNotification object:nil]; } -(void)handle_route_change:(NSNotification*)pNotification @@ -25786,21 +26031,35 @@ static ma_result ma_device__untrack__coreaudio(ma_device* pDevice) } break; } - m_pDevice->sampleRate = (ma_uint32)pSession.sampleRate; +#if defined(MA_DEBUG_OUTPUT) + printf("[Core Audio] Changing Route. inputNumberChannels=%d; outputNumberOfChannels=%d\n", (int)pSession.inputNumberOfChannels, (int)pSession.outputNumberOfChannels); +#endif + + ma_uint32 previousState = ma_device_get_state(m_pDevice); + + if (previousState == MA_STATE_STARTED) { + ma_device_stop(m_pDevice); + } if (m_pDevice->type == ma_device_type_capture || m_pDevice->type == ma_device_type_duplex) { - m_pDevice->capture.internalChannels = (ma_uint32)pSession.inputNumberOfChannels; + m_pDevice->capture.internalChannels = (ma_uint32)pSession.inputNumberOfChannels; + m_pDevice->capture.internalSampleRate = (ma_uint32)pSession.sampleRate; ma_device__post_init_setup(m_pDevice, ma_device_type_capture); } if (m_pDevice->type == ma_device_type_playback || m_pDevice->type == ma_device_type_duplex) { - m_pDevice->playback.internalChannels = (ma_uint32)pSession.outputNumberOfChannels; + m_pDevice->playback.internalChannels = (ma_uint32)pSession.outputNumberOfChannels; + m_pDevice->playback.internalSampleRate = (ma_uint32)pSession.sampleRate; ma_device__post_init_setup(m_pDevice, ma_device_type_playback); } + + if (previousState == MA_STATE_STARTED) { + ma_device_start(m_pDevice); + } } @end #endif -static void ma_device_uninit__coreaudio(ma_device* pDevice) +static ma_result ma_device_uninit__coreaudio(ma_device* pDevice) { MA_ASSERT(pDevice != NULL); MA_ASSERT(ma_device_get_state(pDevice) == MA_STATE_UNINITIALIZED); @@ -25830,9 +26089,7 @@ static void ma_device_uninit__coreaudio(ma_device* pDevice) ma__free_from_callbacks(pDevice->coreaudio.pAudioBufferList, &pDevice->pContext->allocationCallbacks); } - if (pDevice->type == ma_device_type_duplex) { - ma_pcm_rb_uninit(&pDevice->coreaudio.duplexRB); - } + return MA_SUCCESS; } typedef struct @@ -25847,11 +26104,8 @@ typedef struct ma_uint32 periodSizeInFramesIn; ma_uint32 periodSizeInMillisecondsIn; ma_uint32 periodsIn; - ma_bool32 usingDefaultFormat; - ma_bool32 usingDefaultChannels; - ma_bool32 usingDefaultSampleRate; - ma_bool32 usingDefaultChannelMap; ma_share_mode shareMode; + ma_performance_profile performanceProfile; ma_bool32 registerStopEvent; /* Output. */ @@ -26005,7 +26259,7 @@ static ma_result ma_device_init_internal__coreaudio(ma_context* pContext, ma_dev } #if defined(MA_APPLE_DESKTOP) - result = ma_find_best_format__coreaudio(pContext, deviceObjectID, deviceType, pData->formatIn, pData->channelsIn, pData->sampleRateIn, pData->usingDefaultFormat, pData->usingDefaultChannels, pData->usingDefaultSampleRate, &origFormat, &bestFormat); + result = ma_find_best_format__coreaudio(pContext, deviceObjectID, deviceType, pData->formatIn, pData->channelsIn, pData->sampleRateIn, &origFormat, &bestFormat); if (result != MA_SUCCESS) { ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit); return result; @@ -26145,13 +26399,21 @@ static ma_result ma_device_init_internal__coreaudio(ma_context* pContext, ma_dev /* Buffer size. Not allowing this to be configurable on iOS. */ - actualPeriodSizeInFrames = pData->periodSizeInFramesIn; - -#if defined(MA_APPLE_DESKTOP) - if (actualPeriodSizeInFrames == 0) { - actualPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(pData->periodSizeInMillisecondsIn, pData->sampleRateOut); + if (pData->periodSizeInFramesIn == 0) { + if (pData->periodSizeInMillisecondsIn == 0) { + if (pData->performanceProfile == ma_performance_profile_low_latency) { + actualPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(MA_DEFAULT_PERIOD_SIZE_IN_MILLISECONDS_LOW_LATENCY, pData->sampleRateOut); + } else { + actualPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(MA_DEFAULT_PERIOD_SIZE_IN_MILLISECONDS_CONSERVATIVE, pData->sampleRateOut); + } + } else { + actualPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(pData->periodSizeInMillisecondsIn, pData->sampleRateOut); + } + } else { + actualPeriodSizeInFrames = pData->periodSizeInFramesIn; } +#if defined(MA_APPLE_DESKTOP) result = ma_set_AudioObject_buffer_size_in_frames(pContext, deviceObjectID, deviceType, &actualPeriodSizeInFrames); if (result != MA_SUCCESS) { return result; @@ -26267,11 +26529,8 @@ static ma_result ma_device_reinit_internal__coreaudio(ma_device* pDevice, ma_dev data.channelsIn = pDevice->capture.channels; data.sampleRateIn = pDevice->sampleRate; MA_COPY_MEMORY(data.channelMapIn, pDevice->capture.channelMap, sizeof(pDevice->capture.channelMap)); - data.usingDefaultFormat = pDevice->capture.usingDefaultFormat; - data.usingDefaultChannels = pDevice->capture.usingDefaultChannels; - data.usingDefaultSampleRate = pDevice->usingDefaultSampleRate; - data.usingDefaultChannelMap = pDevice->capture.usingDefaultChannelMap; data.shareMode = pDevice->capture.shareMode; + data.performanceProfile = pDevice->coreaudio.originalPerformanceProfile; data.registerStopEvent = MA_TRUE; if (disposePreviousAudioUnit) { @@ -26286,11 +26545,8 @@ static ma_result ma_device_reinit_internal__coreaudio(ma_device* pDevice, ma_dev data.channelsIn = pDevice->playback.channels; data.sampleRateIn = pDevice->sampleRate; MA_COPY_MEMORY(data.channelMapIn, pDevice->playback.channelMap, sizeof(pDevice->playback.channelMap)); - data.usingDefaultFormat = pDevice->playback.usingDefaultFormat; - data.usingDefaultChannels = pDevice->playback.usingDefaultChannels; - data.usingDefaultSampleRate = pDevice->usingDefaultSampleRate; - data.usingDefaultChannelMap = pDevice->playback.usingDefaultChannelMap; data.shareMode = pDevice->playback.shareMode; + data.performanceProfile = pDevice->coreaudio.originalPerformanceProfile; data.registerStopEvent = (pDevice->type != ma_device_type_duplex); if (disposePreviousAudioUnit) { @@ -26344,21 +26600,20 @@ static ma_result ma_device_reinit_internal__coreaudio(ma_device* pDevice, ma_dev } #endif /* MA_APPLE_DESKTOP */ -static ma_result ma_device_init__coreaudio(ma_context* pContext, const ma_device_config* pConfig, ma_device* pDevice) +static ma_result ma_device_init__coreaudio(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptorPlayback, ma_device_descriptor* pDescriptorCapture) { ma_result result; - MA_ASSERT(pContext != NULL); - MA_ASSERT(pConfig != NULL); MA_ASSERT(pDevice != NULL); + MA_ASSERT(pConfig != NULL); if (pConfig->deviceType == ma_device_type_loopback) { return MA_DEVICE_TYPE_NOT_SUPPORTED; } /* No exclusive mode with the Core Audio backend for now. */ - if (((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) && pConfig->capture.shareMode == ma_share_mode_exclusive) || - ((pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) && pConfig->playback.shareMode == ma_share_mode_exclusive)) { + if (((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) && pDescriptorCapture->shareMode == ma_share_mode_exclusive) || + ((pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) && pDescriptorPlayback->shareMode == ma_share_mode_exclusive)) { return MA_SHARE_MODE_NOT_SUPPORTED; } @@ -26366,18 +26621,15 @@ static ma_result ma_device_init__coreaudio(ma_context* pContext, const ma_device if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) { ma_device_init_internal_data__coreaudio data; data.allowNominalSampleRateChange = pConfig->coreaudio.allowNominalSampleRateChange; - data.formatIn = pConfig->capture.format; - data.channelsIn = pConfig->capture.channels; - data.sampleRateIn = pConfig->sampleRate; - MA_COPY_MEMORY(data.channelMapIn, pConfig->capture.channelMap, sizeof(pConfig->capture.channelMap)); - data.usingDefaultFormat = pDevice->capture.usingDefaultFormat; - data.usingDefaultChannels = pDevice->capture.usingDefaultChannels; - data.usingDefaultSampleRate = pDevice->usingDefaultSampleRate; - data.usingDefaultChannelMap = pDevice->capture.usingDefaultChannelMap; - data.shareMode = pConfig->capture.shareMode; - data.periodSizeInFramesIn = pConfig->periodSizeInFrames; - data.periodSizeInMillisecondsIn = pConfig->periodSizeInMilliseconds; - data.periodsIn = pConfig->periods; + data.formatIn = pDescriptorCapture->format; + data.channelsIn = pDescriptorCapture->channels; + data.sampleRateIn = pDescriptorCapture->sampleRate; + MA_COPY_MEMORY(data.channelMapIn, pDescriptorCapture->channelMap, sizeof(pDescriptorCapture->channelMap)); + data.periodSizeInFramesIn = pDescriptorCapture->periodSizeInFrames; + data.periodSizeInMillisecondsIn = pDescriptorCapture->periodSizeInMilliseconds; + data.periodsIn = pDescriptorCapture->periodCount; + data.shareMode = pDescriptorCapture->shareMode; + data.performanceProfile = pConfig->performanceProfile; data.registerStopEvent = MA_TRUE; /* Need at least 3 periods for duplex. */ @@ -26385,25 +26637,29 @@ static ma_result ma_device_init__coreaudio(ma_context* pContext, const ma_device data.periodsIn = 3; } - result = ma_device_init_internal__coreaudio(pDevice->pContext, ma_device_type_capture, pConfig->capture.pDeviceID, &data, (void*)pDevice); + result = ma_device_init_internal__coreaudio(pDevice->pContext, ma_device_type_capture, pDescriptorCapture->pDeviceID, &data, (void*)pDevice); if (result != MA_SUCCESS) { return result; } - pDevice->coreaudio.isDefaultCaptureDevice = (pConfig->capture.pDeviceID == NULL); + pDevice->coreaudio.isDefaultCaptureDevice = (pConfig->capture.pDeviceID == NULL); #if defined(MA_APPLE_DESKTOP) - pDevice->coreaudio.deviceObjectIDCapture = (ma_uint32)data.deviceObjectID; + pDevice->coreaudio.deviceObjectIDCapture = (ma_uint32)data.deviceObjectID; #endif - pDevice->coreaudio.audioUnitCapture = (ma_ptr)data.audioUnit; - pDevice->coreaudio.pAudioBufferList = (ma_ptr)data.pAudioBufferList; - pDevice->coreaudio.audioBufferCapInFrames = data.periodSizeInFramesOut; + pDevice->coreaudio.audioUnitCapture = (ma_ptr)data.audioUnit; + pDevice->coreaudio.pAudioBufferList = (ma_ptr)data.pAudioBufferList; + pDevice->coreaudio.audioBufferCapInFrames = data.periodSizeInFramesOut; + pDevice->coreaudio.originalPeriodSizeInFrames = pDescriptorCapture->periodSizeInFrames; + pDevice->coreaudio.originalPeriodSizeInMilliseconds = pDescriptorCapture->periodSizeInMilliseconds; + pDevice->coreaudio.originalPeriods = pDescriptorCapture->periodCount; + pDevice->coreaudio.originalPerformanceProfile = pConfig->performanceProfile; - pDevice->capture.internalFormat = data.formatOut; - pDevice->capture.internalChannels = data.channelsOut; - pDevice->capture.internalSampleRate = data.sampleRateOut; - MA_COPY_MEMORY(pDevice->capture.internalChannelMap, data.channelMapOut, sizeof(data.channelMapOut)); - pDevice->capture.internalPeriodSizeInFrames = data.periodSizeInFramesOut; - pDevice->capture.internalPeriods = data.periodsOut; + pDescriptorCapture->format = data.formatOut; + pDescriptorCapture->channels = data.channelsOut; + pDescriptorCapture->sampleRate = data.sampleRateOut; + MA_COPY_MEMORY(pDescriptorCapture->channelMap, data.channelMapOut, sizeof(data.channelMapOut)); + pDescriptorCapture->periodSizeInFrames = data.periodSizeInFramesOut; + pDescriptorCapture->periodCount = data.periodsOut; #if defined(MA_APPLE_DESKTOP) /* @@ -26419,30 +26675,27 @@ static ma_result ma_device_init__coreaudio(ma_context* pContext, const ma_device /* Playback. */ if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { ma_device_init_internal_data__coreaudio data; - data.allowNominalSampleRateChange = pConfig->coreaudio.allowNominalSampleRateChange; - data.formatIn = pConfig->playback.format; - data.channelsIn = pConfig->playback.channels; - data.sampleRateIn = pConfig->sampleRate; - MA_COPY_MEMORY(data.channelMapIn, pConfig->playback.channelMap, sizeof(pConfig->playback.channelMap)); - data.usingDefaultFormat = pDevice->playback.usingDefaultFormat; - data.usingDefaultChannels = pDevice->playback.usingDefaultChannels; - data.usingDefaultSampleRate = pDevice->usingDefaultSampleRate; - data.usingDefaultChannelMap = pDevice->playback.usingDefaultChannelMap; - data.shareMode = pConfig->playback.shareMode; + data.allowNominalSampleRateChange = pConfig->coreaudio.allowNominalSampleRateChange; + data.formatIn = pDescriptorPlayback->format; + data.channelsIn = pDescriptorPlayback->channels; + data.sampleRateIn = pDescriptorPlayback->sampleRate; + MA_COPY_MEMORY(data.channelMapIn, pDescriptorPlayback->channelMap, sizeof(pDescriptorPlayback->channelMap)); + data.shareMode = pDescriptorPlayback->shareMode; + data.performanceProfile = pConfig->performanceProfile; /* In full-duplex mode we want the playback buffer to be the same size as the capture buffer. */ if (pConfig->deviceType == ma_device_type_duplex) { - data.periodSizeInFramesIn = pDevice->capture.internalPeriodSizeInFrames; - data.periodsIn = pDevice->capture.internalPeriods; + data.periodSizeInFramesIn = pDescriptorCapture->periodSizeInFrames; + data.periodsIn = pDescriptorCapture->periodCount; data.registerStopEvent = MA_FALSE; } else { - data.periodSizeInFramesIn = pConfig->periodSizeInFrames; - data.periodSizeInMillisecondsIn = pConfig->periodSizeInMilliseconds; - data.periodsIn = pConfig->periods; + data.periodSizeInFramesIn = pDescriptorPlayback->periodSizeInFrames; + data.periodSizeInMillisecondsIn = pDescriptorPlayback->periodSizeInMilliseconds; + data.periodsIn = pDescriptorPlayback->periodCount; data.registerStopEvent = MA_TRUE; } - result = ma_device_init_internal__coreaudio(pDevice->pContext, ma_device_type_playback, pConfig->playback.pDeviceID, &data, (void*)pDevice); + result = ma_device_init_internal__coreaudio(pDevice->pContext, ma_device_type_playback, pDescriptorPlayback->pDeviceID, &data, (void*)pDevice); if (result != MA_SUCCESS) { if (pConfig->deviceType == ma_device_type_duplex) { ((ma_AudioComponentInstanceDispose_proc)pDevice->pContext->coreaudio.AudioComponentInstanceDispose)((AudioUnit)pDevice->coreaudio.audioUnitCapture); @@ -26453,33 +26706,35 @@ static ma_result ma_device_init__coreaudio(ma_context* pContext, const ma_device return result; } - pDevice->coreaudio.isDefaultPlaybackDevice = (pConfig->playback.pDeviceID == NULL); + pDevice->coreaudio.isDefaultPlaybackDevice = (pConfig->playback.pDeviceID == NULL); #if defined(MA_APPLE_DESKTOP) - pDevice->coreaudio.deviceObjectIDPlayback = (ma_uint32)data.deviceObjectID; + pDevice->coreaudio.deviceObjectIDPlayback = (ma_uint32)data.deviceObjectID; #endif - pDevice->coreaudio.audioUnitPlayback = (ma_ptr)data.audioUnit; + pDevice->coreaudio.audioUnitPlayback = (ma_ptr)data.audioUnit; + pDevice->coreaudio.originalPeriodSizeInFrames = pDescriptorPlayback->periodSizeInFrames; + pDevice->coreaudio.originalPeriodSizeInMilliseconds = pDescriptorPlayback->periodSizeInMilliseconds; + pDevice->coreaudio.originalPeriods = pDescriptorPlayback->periodCount; + pDevice->coreaudio.originalPerformanceProfile = pConfig->performanceProfile; - pDevice->playback.internalFormat = data.formatOut; - pDevice->playback.internalChannels = data.channelsOut; - pDevice->playback.internalSampleRate = data.sampleRateOut; - MA_COPY_MEMORY(pDevice->playback.internalChannelMap, data.channelMapOut, sizeof(data.channelMapOut)); - pDevice->playback.internalPeriodSizeInFrames = data.periodSizeInFramesOut; - pDevice->playback.internalPeriods = data.periodsOut; + pDescriptorPlayback->format = data.formatOut; + pDescriptorPlayback->channels = data.channelsOut; + pDescriptorPlayback->sampleRate = data.sampleRateOut; + MA_COPY_MEMORY(pDescriptorPlayback->channelMap, data.channelMapOut, sizeof(data.channelMapOut)); + pDescriptorPlayback->periodSizeInFrames = data.periodSizeInFramesOut; + pDescriptorPlayback->periodCount = data.periodsOut; #if defined(MA_APPLE_DESKTOP) /* If we are using the default device we'll need to listen for changes to the system's default device so we can seemlessly switch the device in the background. */ - if (pConfig->playback.pDeviceID == NULL && (pConfig->deviceType != ma_device_type_duplex || pConfig->capture.pDeviceID != NULL)) { + if (pDescriptorPlayback->pDeviceID == NULL && (pConfig->deviceType != ma_device_type_duplex || pDescriptorCapture->pDeviceID != NULL)) { ma_device__track__coreaudio(pDevice); } #endif } - pDevice->coreaudio.originalPeriodSizeInFrames = pConfig->periodSizeInFrames; - pDevice->coreaudio.originalPeriodSizeInMilliseconds = pConfig->periodSizeInMilliseconds; - pDevice->coreaudio.originalPeriods = pConfig->periods; + /* When stopping the device, a callback is called on another thread. We need to wait for this callback @@ -26487,26 +26742,6 @@ static ma_result ma_device_init__coreaudio(ma_context* pContext, const ma_device */ ma_event_init(&pDevice->coreaudio.stopEvent); - /* Need a ring buffer for duplex mode. */ - if (pConfig->deviceType == ma_device_type_duplex) { - ma_uint32 rbSizeInFrames = (ma_uint32)ma_calculate_frame_count_after_resampling(pDevice->sampleRate, pDevice->capture.internalSampleRate, pDevice->capture.internalPeriodSizeInFrames * pDevice->capture.internalPeriods); - ma_result result = ma_pcm_rb_init(pDevice->capture.format, pDevice->capture.channels, rbSizeInFrames, NULL, &pDevice->pContext->allocationCallbacks, &pDevice->coreaudio.duplexRB); - if (result != MA_SUCCESS) { - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[Core Audio] Failed to initialize ring buffer.", result); - } - - /* We need a period to act as a buffer for cases where the playback and capture device's end up desyncing. */ - { - ma_uint32 bufferSizeInFrames = rbSizeInFrames / pDevice->capture.internalPeriods; - void* pBufferData; - ma_pcm_rb_acquire_write(&pDevice->coreaudio.duplexRB, &bufferSizeInFrames, &pBufferData); - { - MA_ZERO_MEMORY(pBufferData, bufferSizeInFrames * ma_get_bytes_per_frame(pDevice->capture.format, pDevice->capture.channels)); - } - ma_pcm_rb_commit_write(&pDevice->coreaudio.duplexRB, bufferSizeInFrames, pBufferData); - } - } - /* We need to detect when a route has changed so we can update the data conversion pipeline accordingly. This is done differently on non-Desktop Apple platforms. @@ -26617,7 +26852,7 @@ static AVAudioSessionCategory ma_to_AVAudioSessionCategory(ma_ios_session_catego } #endif -static ma_result ma_context_init__coreaudio(const ma_context_config* pConfig, ma_context* pContext) +static ma_result ma_context_init__coreaudio(ma_context* pContext, const ma_context_config* pConfig, ma_backend_callbacks* pCallbacks) { #if !defined(MA_APPLE_MOBILE) ma_result result; @@ -26786,16 +27021,18 @@ static ma_result ma_context_init__coreaudio(const ma_context_config* pConfig, ma #endif pContext->coreaudio.noAudioSessionDeactivate = pConfig->coreaudio.noAudioSessionDeactivate; - - pContext->isBackendAsynchronous = MA_TRUE; - - pContext->onUninit = ma_context_uninit__coreaudio; - pContext->onEnumDevices = ma_context_enumerate_devices__coreaudio; - pContext->onGetDeviceInfo = ma_context_get_device_info__coreaudio; - pContext->onDeviceInit = ma_device_init__coreaudio; - pContext->onDeviceUninit = ma_device_uninit__coreaudio; - pContext->onDeviceStart = ma_device_start__coreaudio; - pContext->onDeviceStop = ma_device_stop__coreaudio; + + pCallbacks->onContextInit = ma_context_init__coreaudio; + pCallbacks->onContextUninit = ma_context_uninit__coreaudio; + pCallbacks->onContextEnumerateDevices = ma_context_enumerate_devices__coreaudio; + pCallbacks->onContextGetDeviceInfo = ma_context_get_device_info__coreaudio; + pCallbacks->onDeviceInit = ma_device_init__coreaudio; + pCallbacks->onDeviceUninit = ma_device_uninit__coreaudio; + pCallbacks->onDeviceStart = ma_device_start__coreaudio; + pCallbacks->onDeviceStop = ma_device_stop__coreaudio; + pCallbacks->onDeviceRead = NULL; + pCallbacks->onDeviceWrite = NULL; + pCallbacks->onDeviceDataLoop = NULL; return MA_SUCCESS; } @@ -27186,7 +27423,7 @@ static ma_result ma_context_enumerate_devices__sndio(ma_context* pContext, ma_en return MA_SUCCESS; } -static ma_result ma_context_get_device_info__sndio(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_share_mode shareMode, ma_device_info* pDeviceInfo) +static ma_result ma_context_get_device_info__sndio(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_device_info* pDeviceInfo) { char devid[256]; struct ma_sio_hdl* handle; @@ -27194,7 +27431,6 @@ static ma_result ma_context_get_device_info__sndio(ma_context* pContext, ma_devi unsigned int iConfig; MA_ASSERT(pContext != NULL); - (void)shareMode; /* We need to open the device before we can get information about it. */ if (pDeviceID == NULL) { @@ -27214,6 +27450,8 @@ static ma_result ma_context_get_device_info__sndio(ma_context* pContext, ma_devi return MA_ERROR; } + pDeviceInfo->nativeDataFormatCount = 0; + for (iConfig = 0; iConfig < caps.nconf; iConfig += 1) { /* The main thing we care about is that the encoding is supported by miniaudio. If it is, we want to give @@ -27230,8 +27468,6 @@ static ma_result ma_context_get_device_info__sndio(ma_context* pContext, ma_devi unsigned int le; unsigned int msb; ma_format format; - ma_bool32 formatExists = MA_FALSE; - ma_uint32 iExistingFormat; if ((caps.confs[iConfig].enc & (1UL << iEncoding)) == 0) { continue; @@ -27247,57 +27483,34 @@ static ma_result ma_context_get_device_info__sndio(ma_context* pContext, ma_devi continue; /* Format not supported. */ } - /* Add this format if it doesn't already exist. */ - for (iExistingFormat = 0; iExistingFormat < pDeviceInfo->formatCount; iExistingFormat += 1) { - if (pDeviceInfo->formats[iExistingFormat] == format) { - formatExists = MA_TRUE; - break; + + /* Channels. */ + for (iChannel = 0; iChannel < MA_SIO_NCHAN; iChannel += 1) { + unsigned int chan = 0; + unsigned int channels; + + if (deviceType == ma_device_type_playback) { + chan = caps.confs[iConfig].pchan; + } else { + chan = caps.confs[iConfig].rchan; } - } - if (!formatExists) { - pDeviceInfo->formats[pDeviceInfo->formatCount++] = format; - } - } - - /* Channels. */ - for (iChannel = 0; iChannel < MA_SIO_NCHAN; iChannel += 1) { - unsigned int chan = 0; - unsigned int channels; - - if (deviceType == ma_device_type_playback) { - chan = caps.confs[iConfig].pchan; - } else { - chan = caps.confs[iConfig].rchan; - } - - if ((chan & (1UL << iChannel)) == 0) { - continue; - } - - if (deviceType == ma_device_type_playback) { - channels = caps.pchan[iChannel]; - } else { - channels = caps.rchan[iChannel]; - } - - if (pDeviceInfo->minChannels > channels) { - pDeviceInfo->minChannels = channels; - } - if (pDeviceInfo->maxChannels < channels) { - pDeviceInfo->maxChannels = channels; - } - } - - /* Sample rates. */ - for (iRate = 0; iRate < MA_SIO_NRATE; iRate += 1) { - if ((caps.confs[iConfig].rate & (1UL << iRate)) != 0) { - unsigned int rate = caps.rate[iRate]; - if (pDeviceInfo->minSampleRate > rate) { - pDeviceInfo->minSampleRate = rate; + if ((chan & (1UL << iChannel)) == 0) { + continue; } - if (pDeviceInfo->maxSampleRate < rate) { - pDeviceInfo->maxSampleRate = rate; + + if (deviceType == ma_device_type_playback) { + channels = caps.pchan[iChannel]; + } else { + channels = caps.rchan[iChannel]; + } + + + /* Sample Rates. */ + for (iRate = 0; iRate < MA_SIO_NRATE; iRate += 1) { + if ((caps.confs[iConfig].rate & (1UL << iRate)) != 0) { + ma_device_info_add_native_data_format(pDeviceInfo, format, channels, caps.rate[iRate], 0); + } } } } @@ -27307,7 +27520,7 @@ static ma_result ma_context_get_device_info__sndio(ma_context* pContext, ma_devi return MA_SUCCESS; } -static void ma_device_uninit__sndio(ma_device* pDevice) +static ma_result ma_device_uninit__sndio(ma_device* pDevice) { MA_ASSERT(pDevice != NULL); @@ -27318,9 +27531,11 @@ static void ma_device_uninit__sndio(ma_device* pDevice) if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { ((ma_sio_close_proc)pDevice->pContext->sndio.sio_close)((struct ma_sio_hdl*)pDevice->sndio.handlePlayback); } + + return MA_SUCCESS; } -static ma_result ma_device_init_handle__sndio(ma_context* pContext, const ma_device_config* pConfig, ma_device_type deviceType, ma_device* pDevice) +static ma_result ma_device_init_handle__sndio(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptor, ma_device_type deviceType) { const char* pDeviceName; ma_ptr handle; @@ -27337,38 +27552,34 @@ static ma_result ma_device_init_handle__sndio(ma_context* pContext, const ma_dev ma_uint32 internalPeriodSizeInFrames; ma_uint32 internalPeriods; - MA_ASSERT(pContext != NULL); MA_ASSERT(pConfig != NULL); MA_ASSERT(deviceType != ma_device_type_duplex); MA_ASSERT(pDevice != NULL); if (deviceType == ma_device_type_capture) { openFlags = MA_SIO_REC; - pDeviceID = pConfig->capture.pDeviceID; - format = pConfig->capture.format; - channels = pConfig->capture.channels; - sampleRate = pConfig->sampleRate; } else { openFlags = MA_SIO_PLAY; - pDeviceID = pConfig->playback.pDeviceID; - format = pConfig->playback.format; - channels = pConfig->playback.channels; - sampleRate = pConfig->sampleRate; } + pDeviceID = pDescriptor->pDeviceID; + format = pDescriptor->format; + channels = pDescriptor->channels; + sampleRate = pDescriptor->sampleRate; + pDeviceName = MA_SIO_DEVANY; if (pDeviceID != NULL) { pDeviceName = pDeviceID->sndio; } - handle = (ma_ptr)((ma_sio_open_proc)pContext->sndio.sio_open)(pDeviceName, openFlags, 0); + handle = (ma_ptr)((ma_sio_open_proc)pDevice->pContext->sndio.sio_open)(pDeviceName, openFlags, 0); if (handle == NULL) { return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[sndio] Failed to open device.", MA_FAILED_TO_OPEN_BACKEND_DEVICE); } /* We need to retrieve the device caps to determine the most appropriate format to use. */ - if (((ma_sio_getcap_proc)pContext->sndio.sio_getcap)((struct ma_sio_hdl*)handle, &caps) == 0) { - ((ma_sio_close_proc)pContext->sndio.sio_close)((struct ma_sio_hdl*)handle); + if (((ma_sio_getcap_proc)pDevice->pContext->sndio.sio_getcap)((struct ma_sio_hdl*)handle, &caps) == 0) { + ((ma_sio_close_proc)pDevice->pContext->sndio.sio_close)((struct ma_sio_hdl*)handle); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[sndio] Failed to retrieve device caps.", MA_ERROR); } @@ -27381,26 +27592,32 @@ static ma_result ma_device_init_handle__sndio(ma_context* pContext, const ma_dev value returned by ma_find_best_channels_from_sio_cap__sndio(). */ if (deviceType == ma_device_type_capture) { - if (pDevice->capture.usingDefaultFormat) { + if (format == ma_format_unknown) { format = ma_find_best_format_from_sio_cap__sndio(&caps); } - if (pDevice->capture.usingDefaultChannels) { + + if (channels == 0) { if (strlen(pDeviceName) > strlen("rsnd/") && strncmp(pDeviceName, "rsnd/", strlen("rsnd/")) == 0) { channels = ma_find_best_channels_from_sio_cap__sndio(&caps, deviceType, format); + } else { + channels = MA_DEFAULT_CHANNELS; } } } else { - if (pDevice->playback.usingDefaultFormat) { + if (format == ma_format_unknown) { format = ma_find_best_format_from_sio_cap__sndio(&caps); } - if (pDevice->playback.usingDefaultChannels) { + + if (channels == 0) { if (strlen(pDeviceName) > strlen("rsnd/") && strncmp(pDeviceName, "rsnd/", strlen("rsnd/")) == 0) { channels = ma_find_best_channels_from_sio_cap__sndio(&caps, deviceType, format); + } else { + channels = MA_DEFAULT_CHANNELS; } } } - if (pDevice->usingDefaultSampleRate) { + if (sampleRate == 0) { sampleRate = ma_find_best_sample_rate_from_sio_cap__sndio(&caps, pConfig->deviceType, format, channels); } @@ -27433,6 +27650,7 @@ static ma_result ma_device_init_handle__sndio(ma_context* pContext, const ma_dev case ma_format_s16: case ma_format_f32: + case ma_format_unknown: default: { par.bits = 16; @@ -27440,7 +27658,7 @@ static ma_result ma_device_init_handle__sndio(ma_context* pContext, const ma_dev par.sig = 1; } break; } - + if (deviceType == ma_device_type_capture) { par.rchan = channels; } else { @@ -27449,20 +27667,18 @@ static ma_result ma_device_init_handle__sndio(ma_context* pContext, const ma_dev par.rate = sampleRate; - internalPeriodSizeInFrames = pConfig->periodSizeInFrames; - if (internalPeriodSizeInFrames == 0) { - internalPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(pConfig->periodSizeInMilliseconds, par.rate); - } + internalPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptor, par.rate, pConfig->performanceProfile); par.round = internalPeriodSizeInFrames; - par.appbufsz = par.round * pConfig->periods; + par.appbufsz = par.round * pDescriptor->periodCount; - if (((ma_sio_setpar_proc)pContext->sndio.sio_setpar)((struct ma_sio_hdl*)handle, &par) == 0) { - ((ma_sio_close_proc)pContext->sndio.sio_close)((struct ma_sio_hdl*)handle); + if (((ma_sio_setpar_proc)pDevice->pContext->sndio.sio_setpar)((struct ma_sio_hdl*)handle, &par) == 0) { + ((ma_sio_close_proc)pDevice->pContext->sndio.sio_close)((struct ma_sio_hdl*)handle); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[sndio] Failed to set buffer size.", MA_FORMAT_NOT_SUPPORTED); } - if (((ma_sio_getpar_proc)pContext->sndio.sio_getpar)((struct ma_sio_hdl*)handle, &par) == 0) { - ((ma_sio_close_proc)pContext->sndio.sio_close)((struct ma_sio_hdl*)handle); + + if (((ma_sio_getpar_proc)pDevice->pContext->sndio.sio_getpar)((struct ma_sio_hdl*)handle, &par) == 0) { + ((ma_sio_close_proc)pDevice->pContext->sndio.sio_close)((struct ma_sio_hdl*)handle); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[sndio] Failed to retrieve buffer size.", MA_FORMAT_NOT_SUPPORTED); } @@ -27473,23 +27689,18 @@ static ma_result ma_device_init_handle__sndio(ma_context* pContext, const ma_dev internalPeriodSizeInFrames = par.round; if (deviceType == ma_device_type_capture) { - pDevice->sndio.handleCapture = handle; - pDevice->capture.internalFormat = internalFormat; - pDevice->capture.internalChannels = internalChannels; - pDevice->capture.internalSampleRate = internalSampleRate; - ma_get_standard_channel_map(ma_standard_channel_map_sndio, pDevice->capture.internalChannels, pDevice->capture.internalChannelMap); - pDevice->capture.internalPeriodSizeInFrames = internalPeriodSizeInFrames; - pDevice->capture.internalPeriods = internalPeriods; + pDevice->sndio.handleCapture = handle; } else { - pDevice->sndio.handlePlayback = handle; - pDevice->playback.internalFormat = internalFormat; - pDevice->playback.internalChannels = internalChannels; - pDevice->playback.internalSampleRate = internalSampleRate; - ma_get_standard_channel_map(ma_standard_channel_map_sndio, pDevice->playback.internalChannels, pDevice->playback.internalChannelMap); - pDevice->playback.internalPeriodSizeInFrames = internalPeriodSizeInFrames; - pDevice->playback.internalPeriods = internalPeriods; + pDevice->sndio.handlePlayback = handle; } + pDescriptor->format = internalFormat; + pDescriptor->channels = internalChannels; + pDescriptor->sampleRate = internalSampleRate; + ma_get_standard_channel_map(ma_standard_channel_map_sndio, pDevice->playback.internalChannels, pDevice->playback.internalChannelMap); + pDescriptor->periodSizeInFrames = internalPeriodSizeInFrames; + pDescriptor->periodCount = internalPeriods; + #ifdef MA_DEBUG_OUTPUT printf("DEVICE INFO\n"); printf(" Format: %s\n", ma_get_format_name(internalFormat)); @@ -27504,7 +27715,7 @@ static ma_result ma_device_init_handle__sndio(ma_context* pContext, const ma_dev return MA_SUCCESS; } -static ma_result ma_device_init__sndio(ma_context* pContext, const ma_device_config* pConfig, ma_device* pDevice) +static ma_result ma_device_init__sndio(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptorPlayback, ma_device_descriptor* pDescriptorCapture) { MA_ASSERT(pDevice != NULL); @@ -27515,14 +27726,14 @@ static ma_result ma_device_init__sndio(ma_context* pContext, const ma_device_con } if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) { - ma_result result = ma_device_init_handle__sndio(pContext, pConfig, ma_device_type_capture, pDevice); + ma_result result = ma_device_init_handle__sndio(pDevice, pConfig, pDescriptorCapture, ma_device_type_capture); if (result != MA_SUCCESS) { return result; } } if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { - ma_result result = ma_device_init_handle__sndio(pContext, pConfig, ma_device_type_playback, pDevice); + ma_result result = ma_device_init_handle__sndio(pDevice, pConfig, pDescriptorPlayback, ma_device_type_playback); if (result != MA_SUCCESS) { return result; } @@ -27531,6 +27742,21 @@ static ma_result ma_device_init__sndio(ma_context* pContext, const ma_device_con return MA_SUCCESS; } +static ma_result ma_device_start__sndio(ma_device* pDevice) +{ + MA_ASSERT(pDevice != NULL); + + if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { + ((ma_sio_start_proc)pDevice->pContext->sndio.sio_start)((struct ma_sio_hdl*)pDevice->sndio.handleCapture); + } + + if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { + ((ma_sio_start_proc)pDevice->pContext->sndio.sio_start)((struct ma_sio_hdl*)pDevice->sndio.handlePlayback); /* <-- Doesn't actually playback until data is written. */ + } + + return MA_SUCCESS; +} + static ma_result ma_device_stop__sndio(ma_device* pDevice) { MA_ASSERT(pDevice != NULL); @@ -27596,177 +27822,6 @@ static ma_result ma_device_read__sndio(ma_device* pDevice, void* pPCMFrames, ma_ return MA_SUCCESS; } -static ma_result ma_device_main_loop__sndio(ma_device* pDevice) -{ - ma_result result = MA_SUCCESS; - ma_bool32 exitLoop = MA_FALSE; - - /* Devices need to be started here. */ - if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { - ((ma_sio_start_proc)pDevice->pContext->sndio.sio_start)((struct ma_sio_hdl*)pDevice->sndio.handleCapture); - } - if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { - ((ma_sio_start_proc)pDevice->pContext->sndio.sio_start)((struct ma_sio_hdl*)pDevice->sndio.handlePlayback); /* <-- Doesn't actually playback until data is written. */ - } - - while (ma_device_get_state(pDevice) == MA_STATE_STARTED && !exitLoop) { - switch (pDevice->type) - { - case ma_device_type_duplex: - { - /* The process is: device_read -> convert -> callback -> convert -> device_write */ - ma_uint32 totalCapturedDeviceFramesProcessed = 0; - ma_uint32 capturedDevicePeriodSizeInFrames = ma_min(pDevice->capture.internalPeriodSizeInFrames, pDevice->playback.internalPeriodSizeInFrames); - - while (totalCapturedDeviceFramesProcessed < capturedDevicePeriodSizeInFrames) { - ma_uint8 capturedDeviceData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint8 playbackDeviceData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 capturedDeviceDataCapInFrames = sizeof(capturedDeviceData) / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); - ma_uint32 playbackDeviceDataCapInFrames = sizeof(playbackDeviceData) / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); - ma_uint32 capturedDeviceFramesRemaining; - ma_uint32 capturedDeviceFramesProcessed; - ma_uint32 capturedDeviceFramesToProcess; - ma_uint32 capturedDeviceFramesToTryProcessing = capturedDevicePeriodSizeInFrames - totalCapturedDeviceFramesProcessed; - if (capturedDeviceFramesToTryProcessing > capturedDeviceDataCapInFrames) { - capturedDeviceFramesToTryProcessing = capturedDeviceDataCapInFrames; - } - - result = ma_device_read__sndio(pDevice, capturedDeviceData, capturedDeviceFramesToTryProcessing, &capturedDeviceFramesToProcess); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - capturedDeviceFramesRemaining = capturedDeviceFramesToProcess; - capturedDeviceFramesProcessed = 0; - - for (;;) { - ma_uint8 capturedClientData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint8 playbackClientData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 capturedClientDataCapInFrames = sizeof(capturedClientData) / ma_get_bytes_per_frame(pDevice->capture.format, pDevice->capture.channels); - ma_uint32 playbackClientDataCapInFrames = sizeof(playbackClientData) / ma_get_bytes_per_frame(pDevice->playback.format, pDevice->playback.channels); - ma_uint64 capturedClientFramesToProcessThisIteration = ma_min(capturedClientDataCapInFrames, playbackClientDataCapInFrames); - ma_uint64 capturedDeviceFramesToProcessThisIteration = capturedDeviceFramesRemaining; - ma_uint8* pRunningCapturedDeviceFrames = ma_offset_ptr(capturedDeviceData, capturedDeviceFramesProcessed * ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels)); - - /* Convert capture data from device format to client format. */ - result = ma_data_converter_process_pcm_frames(&pDevice->capture.converter, pRunningCapturedDeviceFrames, &capturedDeviceFramesToProcessThisIteration, capturedClientData, &capturedClientFramesToProcessThisIteration); - if (result != MA_SUCCESS) { - break; - } - - /* - If we weren't able to generate any output frames it must mean we've exhaused all of our input. The only time this would not be the case is if capturedClientData was too small - which should never be the case when it's of the size MA_DATA_CONVERTER_STACK_BUFFER_SIZE. - */ - if (capturedClientFramesToProcessThisIteration == 0) { - break; - } - - ma_device__on_data(pDevice, playbackClientData, capturedClientData, (ma_uint32)capturedClientFramesToProcessThisIteration); /* Safe cast .*/ - - capturedDeviceFramesProcessed += (ma_uint32)capturedDeviceFramesToProcessThisIteration; /* Safe cast. */ - capturedDeviceFramesRemaining -= (ma_uint32)capturedDeviceFramesToProcessThisIteration; /* Safe cast. */ - - /* At this point the playbackClientData buffer should be holding data that needs to be written to the device. */ - for (;;) { - ma_uint64 convertedClientFrameCount = capturedClientFramesToProcessThisIteration; - ma_uint64 convertedDeviceFrameCount = playbackDeviceDataCapInFrames; - result = ma_data_converter_process_pcm_frames(&pDevice->playback.converter, playbackClientData, &convertedClientFrameCount, playbackDeviceData, &convertedDeviceFrameCount); - if (result != MA_SUCCESS) { - break; - } - - result = ma_device_write__sndio(pDevice, playbackDeviceData, (ma_uint32)convertedDeviceFrameCount, NULL); /* Safe cast. */ - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - capturedClientFramesToProcessThisIteration -= (ma_uint32)convertedClientFrameCount; /* Safe cast. */ - if (capturedClientFramesToProcessThisIteration == 0) { - break; - } - } - - /* In case an error happened from ma_device_write__sndio()... */ - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - } - - totalCapturedDeviceFramesProcessed += capturedDeviceFramesProcessed; - } - } break; - - case ma_device_type_capture: - { - /* We read in chunks of the period size, but use a stack allocated buffer for the intermediary. */ - ma_uint8 intermediaryBuffer[8192]; - ma_uint32 intermediaryBufferSizeInFrames = sizeof(intermediaryBuffer) / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); - ma_uint32 periodSizeInFrames = pDevice->capture.internalPeriodSizeInFrames; - ma_uint32 framesReadThisPeriod = 0; - while (framesReadThisPeriod < periodSizeInFrames) { - ma_uint32 framesRemainingInPeriod = periodSizeInFrames - framesReadThisPeriod; - ma_uint32 framesProcessed; - ma_uint32 framesToReadThisIteration = framesRemainingInPeriod; - if (framesToReadThisIteration > intermediaryBufferSizeInFrames) { - framesToReadThisIteration = intermediaryBufferSizeInFrames; - } - - result = ma_device_read__sndio(pDevice, intermediaryBuffer, framesToReadThisIteration, &framesProcessed); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - ma_device__send_frames_to_client(pDevice, framesProcessed, intermediaryBuffer); - - framesReadThisPeriod += framesProcessed; - } - } break; - - case ma_device_type_playback: - { - /* We write in chunks of the period size, but use a stack allocated buffer for the intermediary. */ - ma_uint8 intermediaryBuffer[8192]; - ma_uint32 intermediaryBufferSizeInFrames = sizeof(intermediaryBuffer) / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); - ma_uint32 periodSizeInFrames = pDevice->playback.internalPeriodSizeInFrames; - ma_uint32 framesWrittenThisPeriod = 0; - while (framesWrittenThisPeriod < periodSizeInFrames) { - ma_uint32 framesRemainingInPeriod = periodSizeInFrames - framesWrittenThisPeriod; - ma_uint32 framesProcessed; - ma_uint32 framesToWriteThisIteration = framesRemainingInPeriod; - if (framesToWriteThisIteration > intermediaryBufferSizeInFrames) { - framesToWriteThisIteration = intermediaryBufferSizeInFrames; - } - - ma_device__read_frames_from_client(pDevice, framesToWriteThisIteration, intermediaryBuffer); - - result = ma_device_write__sndio(pDevice, intermediaryBuffer, framesToWriteThisIteration, &framesProcessed); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - framesWrittenThisPeriod += framesProcessed; - } - } break; - - /* To silence a warning. Will never hit this. */ - case ma_device_type_loopback: - default: break; - } - } - - - /* Here is where the device is stopped. */ - ma_device_stop__sndio(pDevice); - - return result; -} - static ma_result ma_context_uninit__sndio(ma_context* pContext) { MA_ASSERT(pContext != NULL); @@ -27776,7 +27831,7 @@ static ma_result ma_context_uninit__sndio(ma_context* pContext) return MA_SUCCESS; } -static ma_result ma_context_init__sndio(const ma_context_config* pConfig, ma_context* pContext) +static ma_result ma_context_init__sndio(ma_context* pContext, const ma_context_config* pConfig, ma_backend_callbacks* pCallbacks) { #ifndef MA_NO_RUNTIME_LINKING const char* libsndioNames[] = { @@ -27818,14 +27873,17 @@ static ma_result ma_context_init__sndio(const ma_context_config* pConfig, ma_con pContext->sndio.sio_initpar = sio_initpar; #endif - pContext->onUninit = ma_context_uninit__sndio; - pContext->onEnumDevices = ma_context_enumerate_devices__sndio; - pContext->onGetDeviceInfo = ma_context_get_device_info__sndio; - pContext->onDeviceInit = ma_device_init__sndio; - pContext->onDeviceUninit = ma_device_uninit__sndio; - pContext->onDeviceStart = NULL; /* Not required for synchronous backends. */ - pContext->onDeviceStop = NULL; /* Not required for synchronous backends. */ - pContext->onDeviceMainLoop = ma_device_main_loop__sndio; + pCallbacks->onContextInit = ma_context_init__sndio; + pCallbacks->onContextUninit = ma_context_uninit__sndio; + pCallbacks->onContextEnumerateDevices = ma_context_enumerate_devices__sndio; + pCallbacks->onContextGetDeviceInfo = ma_context_get_device_info__sndio; + pCallbacks->onDeviceInit = ma_device_init__sndio; + pCallbacks->onDeviceUninit = ma_device_uninit__sndio; + pCallbacks->onDeviceStart = ma_device_start__sndio; + pCallbacks->onDeviceStop = ma_device_stop__sndio; + pCallbacks->onDeviceRead = ma_device_read__sndio; + pCallbacks->onDeviceWrite = ma_device_write__sndio; + pCallbacks->onDeviceDataLoop = NULL; (void)pConfig; return MA_SUCCESS; @@ -27933,7 +27991,6 @@ static ma_format ma_format_from_encoding__audio4(unsigned int encoding, unsigned static void ma_encoding_from_format__audio4(ma_format format, unsigned int* pEncoding, unsigned int* pPrecision) { - MA_ASSERT(format != ma_format_unknown); MA_ASSERT(pEncoding != NULL); MA_ASSERT(pPrecision != NULL); @@ -27959,6 +28016,7 @@ static void ma_encoding_from_format__audio4(ma_format format, unsigned int* pEnc case ma_format_s16: case ma_format_f32: + case ma_format_unknown: default: { *pEncoding = (ma_is_little_endian()) ? AUDIO_ENCODING_SLINEAR_LE : AUDIO_ENCODING_SLINEAR_BE; @@ -27971,6 +28029,56 @@ static ma_format ma_format_from_prinfo__audio4(struct audio_prinfo* prinfo) { return ma_format_from_encoding__audio4(prinfo->encoding, prinfo->precision); } + +static ma_format ma_best_format_from_fd__audio4(int fd, ma_format preferredFormat) +{ + audio_encoding_t encoding; + ma_uint32 iFormat; + int counter = 0; + + /* First check to see if the preferred format is supported. */ + if (preferredFormat != ma_format_unknown) { + counter = 0; + for (;;) { + MA_ZERO_OBJECT(&encoding); + encoding.index = counter; + if (ioctl(fd, AUDIO_GETENC, &encoding) < 0) { + break; + } + + if (preferredFormat == ma_format_from_encoding__audio4(encoding.encoding, encoding.precision)) { + return preferredFormat; /* Found the preferred format. */ + } + + /* Getting here means this encoding does not match our preferred format so we need to more on to the next encoding. */ + counter += 1; + } + } + + /* Getting here means our preferred format is not supported, so fall back to our standard priorities. */ + for (iFormat = 0; iFormat < ma_countof(g_maFormatPriorities); iFormat += 1) { + ma_format format = g_maFormatPriorities[iFormat]; + + counter = 0; + for (;;) { + MA_ZERO_OBJECT(&encoding); + encoding.index = counter; + if (ioctl(fd, AUDIO_GETENC, &encoding) < 0) { + break; + } + + if (format == ma_format_from_encoding__audio4(encoding.encoding, encoding.precision)) { + return format; /* Found a workable format. */ + } + + /* Getting here means this encoding does not match our preferred format so we need to more on to the next encoding. */ + counter += 1; + } + } + + /* Getting here means not appropriate format was found. */ + return ma_format_unknown; +} #else static ma_format ma_format_from_swpar__audio4(struct audio_swpar* par) { @@ -27992,20 +28100,13 @@ static ma_format ma_format_from_swpar__audio4(struct audio_swpar* par) } #endif -static ma_result ma_context_get_device_info_from_fd__audio4(ma_context* pContext, ma_device_type deviceType, int fd, ma_device_info* pInfoOut) +static ma_result ma_context_get_device_info_from_fd__audio4(ma_context* pContext, ma_device_type deviceType, int fd, ma_device_info* pDeviceInfo) { audio_device_t fdDevice; -#if !defined(MA_AUDIO4_USE_NEW_API) - int counter = 0; - audio_info_t fdInfo; -#else - struct audio_swpar fdPar; - ma_format format; -#endif MA_ASSERT(pContext != NULL); MA_ASSERT(fd >= 0); - MA_ASSERT(pInfoOut != NULL); + MA_ASSERT(pDeviceInfo != NULL); (void)pContext; (void)deviceType; @@ -28015,65 +28116,75 @@ static ma_result ma_context_get_device_info_from_fd__audio4(ma_context* pContext } /* Name. */ - ma_strcpy_s(pInfoOut->name, sizeof(pInfoOut->name), fdDevice.name); + ma_strcpy_s(pDeviceInfo->name, sizeof(pDeviceInfo->name), fdDevice.name); -#if !defined(MA_AUDIO4_USE_NEW_API) - /* Supported formats. We get this by looking at the encodings. */ - for (;;) { - audio_encoding_t encoding; + #if !defined(MA_AUDIO4_USE_NEW_API) + { + audio_info_t fdInfo; + int counter = 0; + ma_uint32 channels; + ma_uint32 sampleRate; + + if (ioctl(fd, AUDIO_GETINFO, &fdInfo) < 0) { + return MA_ERROR; + } + + if (deviceType == ma_device_type_playback) { + channels = fdInfo.play.channels; + sampleRate = fdInfo.play.sample_rate; + } else { + channels = fdInfo.record.channels; + sampleRate = fdInfo.record.sample_rate; + } + + /* Supported formats. We get this by looking at the encodings. */ + pDeviceInfo->nativeDataFormatCount = 0; + for (;;) { + audio_encoding_t encoding; + ma_format format; + + MA_ZERO_OBJECT(&encoding); + encoding.index = counter; + if (ioctl(fd, AUDIO_GETENC, &encoding) < 0) { + break; + } + + format = ma_format_from_encoding__audio4(encoding.encoding, encoding.precision); + if (format != ma_format_unknown) { + ma_device_info_add_native_data_format(pDeviceInfo, format, channels, sampleRate, 0); + } + + counter += 1; + } + } + #else + { + struct audio_swpar fdPar; ma_format format; + ma_uint32 channels; + ma_uint32 sampleRate; - MA_ZERO_OBJECT(&encoding); - encoding.index = counter; - if (ioctl(fd, AUDIO_GETENC, &encoding) < 0) { - break; + if (ioctl(fd, AUDIO_GETPAR, &fdPar) < 0) { + return MA_ERROR; } - format = ma_format_from_encoding__audio4(encoding.encoding, encoding.precision); - if (format != ma_format_unknown) { - pInfoOut->formats[pInfoOut->formatCount++] = format; + format = ma_format_from_swpar__audio4(&fdPar); + if (format == ma_format_unknown) { + return MA_FORMAT_NOT_SUPPORTED; } - counter += 1; - } + if (deviceType == ma_device_type_playback) { + channels = fdPar.pchan; + } else { + channels = fdPar.rchan; + } - if (ioctl(fd, AUDIO_GETINFO, &fdInfo) < 0) { - return MA_ERROR; - } + sampleRate = fdPar.rate; - if (deviceType == ma_device_type_playback) { - pInfoOut->minChannels = fdInfo.play.channels; - pInfoOut->maxChannels = fdInfo.play.channels; - pInfoOut->minSampleRate = fdInfo.play.sample_rate; - pInfoOut->maxSampleRate = fdInfo.play.sample_rate; - } else { - pInfoOut->minChannels = fdInfo.record.channels; - pInfoOut->maxChannels = fdInfo.record.channels; - pInfoOut->minSampleRate = fdInfo.record.sample_rate; - pInfoOut->maxSampleRate = fdInfo.record.sample_rate; + pDeviceInfo->nativeDataFormatCount = 0; + ma_device_info_add_native_data_format(pDeviceInfo, format, channels, sampleRate, 0); } -#else - if (ioctl(fd, AUDIO_GETPAR, &fdPar) < 0) { - return MA_ERROR; - } - - format = ma_format_from_swpar__audio4(&fdPar); - if (format == ma_format_unknown) { - return MA_FORMAT_NOT_SUPPORTED; - } - pInfoOut->formats[pInfoOut->formatCount++] = format; - - if (deviceType == ma_device_type_playback) { - pInfoOut->minChannels = fdPar.pchan; - pInfoOut->maxChannels = fdPar.pchan; - } else { - pInfoOut->minChannels = fdPar.rchan; - pInfoOut->maxChannels = fdPar.rchan; - } - - pInfoOut->minSampleRate = fdPar.rate; - pInfoOut->maxSampleRate = fdPar.rate; -#endif + #endif return MA_SUCCESS; } @@ -28145,7 +28256,7 @@ static ma_result ma_context_enumerate_devices__audio4(ma_context* pContext, ma_e return MA_SUCCESS; } -static ma_result ma_context_get_device_info__audio4(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_share_mode shareMode, ma_device_info* pDeviceInfo) +static ma_result ma_context_get_device_info__audio4(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_device_info* pDeviceInfo) { int fd = -1; int deviceIndex = -1; @@ -28153,7 +28264,6 @@ static ma_result ma_context_get_device_info__audio4(ma_context* pContext, ma_dev ma_result result; MA_ASSERT(pContext != NULL); - (void)shareMode; /* We need to open the "/dev/audioctlN" device to get the info. To do this we need to extract the number @@ -28189,7 +28299,7 @@ static ma_result ma_context_get_device_info__audio4(ma_context* pContext, ma_dev return result; } -static void ma_device_uninit__audio4(ma_device* pDevice) +static ma_result ma_device_uninit__audio4(ma_device* pDevice) { MA_ASSERT(pDevice != NULL); @@ -28200,9 +28310,11 @@ static void ma_device_uninit__audio4(ma_device* pDevice) if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { close(pDevice->audio4.fdPlayback); } + + return MA_SUCCESS; } -static ma_result ma_device_init_fd__audio4(ma_context* pContext, const ma_device_config* pConfig, ma_device_type deviceType, ma_device* pDevice) +static ma_result ma_device_init_fd__audio4(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptor, ma_device_type deviceType) { const char* pDefaultDeviceNames[] = { "/dev/audio", @@ -28210,24 +28322,16 @@ static ma_result ma_device_init_fd__audio4(ma_context* pContext, const ma_device }; int fd; int fdFlags = 0; -#if !defined(MA_AUDIO4_USE_NEW_API) /* Old API */ - audio_info_t fdInfo; -#else - struct audio_swpar fdPar; -#endif ma_format internalFormat; ma_uint32 internalChannels; ma_uint32 internalSampleRate; ma_uint32 internalPeriodSizeInFrames; ma_uint32 internalPeriods; - MA_ASSERT(pContext != NULL); MA_ASSERT(pConfig != NULL); MA_ASSERT(deviceType != ma_device_type_duplex); MA_ASSERT(pDevice != NULL); - (void)pContext; - /* The first thing to do is open the file. */ if (deviceType == ma_device_type_capture) { fdFlags = O_RDONLY; @@ -28236,7 +28340,7 @@ static ma_result ma_device_init_fd__audio4(ma_context* pContext, const ma_device } /*fdFlags |= O_NONBLOCK;*/ - if ((deviceType == ma_device_type_capture && pConfig->capture.pDeviceID == NULL) || (deviceType == ma_device_type_playback && pConfig->playback.pDeviceID == NULL)) { + if (pDescriptor->pDeviceID == NULL) { /* Default device. */ size_t iDevice; for (iDevice = 0; iDevice < ma_countof(pDefaultDeviceNames); ++iDevice) { @@ -28247,137 +28351,167 @@ static ma_result ma_device_init_fd__audio4(ma_context* pContext, const ma_device } } else { /* Specific device. */ - fd = open((deviceType == ma_device_type_capture) ? pConfig->capture.pDeviceID->audio4 : pConfig->playback.pDeviceID->audio4, fdFlags, 0); + fd = open(pDescriptor->pDeviceID->audio4, fdFlags, 0); } if (fd == -1) { return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] Failed to open device.", ma_result_from_errno(errno)); } -#if !defined(MA_AUDIO4_USE_NEW_API) /* Old API */ - AUDIO_INITINFO(&fdInfo); - - /* We get the driver to do as much of the data conversion as possible. */ - if (deviceType == ma_device_type_capture) { - fdInfo.mode = AUMODE_RECORD; - ma_encoding_from_format__audio4(pConfig->capture.format, &fdInfo.record.encoding, &fdInfo.record.precision); - fdInfo.record.channels = pConfig->capture.channels; - fdInfo.record.sample_rate = pConfig->sampleRate; - } else { - fdInfo.mode = AUMODE_PLAY; - ma_encoding_from_format__audio4(pConfig->playback.format, &fdInfo.play.encoding, &fdInfo.play.precision); - fdInfo.play.channels = pConfig->playback.channels; - fdInfo.play.sample_rate = pConfig->sampleRate; - } - - if (ioctl(fd, AUDIO_SETINFO, &fdInfo) < 0) { - close(fd); - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] Failed to set device format. AUDIO_SETINFO failed.", MA_FORMAT_NOT_SUPPORTED); - } - - if (ioctl(fd, AUDIO_GETINFO, &fdInfo) < 0) { - close(fd); - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] AUDIO_GETINFO failed.", MA_FORMAT_NOT_SUPPORTED); - } - - if (deviceType == ma_device_type_capture) { - internalFormat = ma_format_from_prinfo__audio4(&fdInfo.record); - internalChannels = fdInfo.record.channels; - internalSampleRate = fdInfo.record.sample_rate; - } else { - internalFormat = ma_format_from_prinfo__audio4(&fdInfo.play); - internalChannels = fdInfo.play.channels; - internalSampleRate = fdInfo.play.sample_rate; - } - - if (internalFormat == ma_format_unknown) { - close(fd); - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] The device's internal device format is not supported by miniaudio. The device is unusable.", MA_FORMAT_NOT_SUPPORTED); - } - - /* Buffer. */ + #if !defined(MA_AUDIO4_USE_NEW_API) /* Old API */ { - ma_uint32 internalPeriodSizeInBytes; + audio_info_t fdInfo; - internalPeriodSizeInFrames = pConfig->periodSizeInFrames; - if (internalPeriodSizeInFrames == 0) { - internalPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(pConfig->periodSizeInMilliseconds, internalSampleRate); - } + /* + The documentation is a little bit unclear to me as to how it handles formats. It says the + following: - internalPeriodSizeInBytes = internalPeriodSizeInFrames * ma_get_bytes_per_frame(internalFormat, internalChannels); - if (internalPeriodSizeInBytes < 16) { - internalPeriodSizeInBytes = 16; - } + Regardless of formats supported by underlying driver, the audio driver accepts the + following formats. - internalPeriods = pConfig->periods; - if (internalPeriods < 2) { - internalPeriods = 2; - } + By then the next sentence says this: - /* What miniaudio calls a period, audio4 calls a block. */ + `encoding` and `precision` are one of the values obtained by AUDIO_GETENC. + + It sounds like a direct contradiction to me. I'm going to play this safe any only use the + best sample format returned by AUDIO_GETENC. If the requested format is supported we'll + use that, but otherwise we'll just use our standard format priorities to pick an + appropriate one. + */ AUDIO_INITINFO(&fdInfo); - fdInfo.hiwat = internalPeriods; - fdInfo.lowat = internalPeriods-1; - fdInfo.blocksize = internalPeriodSizeInBytes; + + /* We get the driver to do as much of the data conversion as possible. */ + if (deviceType == ma_device_type_capture) { + fdInfo.mode = AUMODE_RECORD; + ma_encoding_from_format__audio4(ma_best_format_from_fd__audio4(fd, pDescriptor->format), &fdInfo.record.encoding, &fdInfo.record.precision); + + if (pDescriptor->channels != 0) { + fdInfo.record.channels = ma_clamp(pDescriptor->channels, 1, 12); /* From the documentation: `channels` ranges from 1 to 12. */ + } + + if (pDescriptor->sampleRate != 0) { + fdInfo.record.sample_rate = ma_clamp(pDescriptor->sampleRate, 1000, 192000); /* From the documentation: `frequency` ranges from 1000Hz to 192000Hz. (They mean `sample_rate` instead of `frequency`.) */ + } + } else { + fdInfo.mode = AUMODE_PLAY; + ma_encoding_from_format__audio4(ma_best_format_from_fd__audio4(fd, pDescriptor->format), &fdInfo.play.encoding, &fdInfo.play.precision); + + if (pDescriptor->channels != 0) { + fdInfo.play.channels = ma_clamp(pDescriptor->channels, 1, 12); /* From the documentation: `channels` ranges from 1 to 12. */ + } + + if (pDescriptor->sampleRate != 0) { + fdInfo.play.sample_rate = ma_clamp(pDescriptor->sampleRate, 1000, 192000); /* From the documentation: `frequency` ranges from 1000Hz to 192000Hz. (They mean `sample_rate` instead of `frequency`.) */ + } + } + if (ioctl(fd, AUDIO_SETINFO, &fdInfo) < 0) { close(fd); - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] Failed to set internal buffer size. AUDIO_SETINFO failed.", MA_FORMAT_NOT_SUPPORTED); + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] Failed to set device format. AUDIO_SETINFO failed.", MA_FORMAT_NOT_SUPPORTED); } - internalPeriods = fdInfo.hiwat; - internalPeriodSizeInFrames = fdInfo.blocksize / ma_get_bytes_per_frame(internalFormat, internalChannels); - } -#else - /* We need to retrieve the format of the device so we can know the channel count and sample rate. Then we can calculate the buffer size. */ - if (ioctl(fd, AUDIO_GETPAR, &fdPar) < 0) { - close(fd); - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] Failed to retrieve initial device parameters.", MA_FORMAT_NOT_SUPPORTED); - } - - internalFormat = ma_format_from_swpar__audio4(&fdPar); - internalChannels = (deviceType == ma_device_type_capture) ? fdPar.rchan : fdPar.pchan; - internalSampleRate = fdPar.rate; - - if (internalFormat == ma_format_unknown) { - close(fd); - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] The device's internal device format is not supported by miniaudio. The device is unusable.", MA_FORMAT_NOT_SUPPORTED); - } - - /* Buffer. */ - { - ma_uint32 internalPeriodSizeInBytes; - - internalPeriodSizeInFrames = pConfig->periodSizeInFrames; - if (internalPeriodSizeInFrames == 0) { - internalPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(pConfig->periodSizeInMilliseconds, internalSampleRate); - } - - /* What miniaudio calls a period, audio4 calls a block. */ - internalPeriodSizeInBytes = internalPeriodSizeInFrames * ma_get_bytes_per_frame(internalFormat, internalChannels); - if (internalPeriodSizeInBytes < 16) { - internalPeriodSizeInBytes = 16; - } - - fdPar.nblks = pConfig->periods; - fdPar.round = internalPeriodSizeInBytes; - - if (ioctl(fd, AUDIO_SETPAR, &fdPar) < 0) { + if (ioctl(fd, AUDIO_GETINFO, &fdInfo) < 0) { close(fd); - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] Failed to set device parameters.", MA_FORMAT_NOT_SUPPORTED); + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] AUDIO_GETINFO failed.", MA_FORMAT_NOT_SUPPORTED); } + if (deviceType == ma_device_type_capture) { + internalFormat = ma_format_from_prinfo__audio4(&fdInfo.record); + internalChannels = fdInfo.record.channels; + internalSampleRate = fdInfo.record.sample_rate; + } else { + internalFormat = ma_format_from_prinfo__audio4(&fdInfo.play); + internalChannels = fdInfo.play.channels; + internalSampleRate = fdInfo.play.sample_rate; + } + + if (internalFormat == ma_format_unknown) { + close(fd); + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] The device's internal device format is not supported by miniaudio. The device is unusable.", MA_FORMAT_NOT_SUPPORTED); + } + + /* Buffer. */ + { + ma_uint32 internalPeriodSizeInBytes; + + internalPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptor, internalSampleRate, pConfig->performanceProfile); + + internalPeriodSizeInBytes = internalPeriodSizeInFrames * ma_get_bytes_per_frame(internalFormat, internalChannels); + if (internalPeriodSizeInBytes < 16) { + internalPeriodSizeInBytes = 16; + } + + internalPeriods = pDescriptor->periodCount; + if (internalPeriods < 2) { + internalPeriods = 2; + } + + /* What miniaudio calls a period, audio4 calls a block. */ + AUDIO_INITINFO(&fdInfo); + fdInfo.hiwat = internalPeriods; + fdInfo.lowat = internalPeriods-1; + fdInfo.blocksize = internalPeriodSizeInBytes; + if (ioctl(fd, AUDIO_SETINFO, &fdInfo) < 0) { + close(fd); + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] Failed to set internal buffer size. AUDIO_SETINFO failed.", MA_FORMAT_NOT_SUPPORTED); + } + + internalPeriods = fdInfo.hiwat; + internalPeriodSizeInFrames = fdInfo.blocksize / ma_get_bytes_per_frame(internalFormat, internalChannels); + } + } + #else + { + struct audio_swpar fdPar; + + /* We need to retrieve the format of the device so we can know the channel count and sample rate. Then we can calculate the buffer size. */ if (ioctl(fd, AUDIO_GETPAR, &fdPar) < 0) { close(fd); - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] Failed to retrieve actual device parameters.", MA_FORMAT_NOT_SUPPORTED); + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] Failed to retrieve initial device parameters.", MA_FORMAT_NOT_SUPPORTED); } - } - internalFormat = ma_format_from_swpar__audio4(&fdPar); - internalChannels = (deviceType == ma_device_type_capture) ? fdPar.rchan : fdPar.pchan; - internalSampleRate = fdPar.rate; - internalPeriods = fdPar.nblks; - internalPeriodSizeInFrames = fdPar.round / ma_get_bytes_per_frame(internalFormat, internalChannels); -#endif + internalFormat = ma_format_from_swpar__audio4(&fdPar); + internalChannels = (deviceType == ma_device_type_capture) ? fdPar.rchan : fdPar.pchan; + internalSampleRate = fdPar.rate; + + if (internalFormat == ma_format_unknown) { + close(fd); + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] The device's internal device format is not supported by miniaudio. The device is unusable.", MA_FORMAT_NOT_SUPPORTED); + } + + /* Buffer. */ + { + ma_uint32 internalPeriodSizeInBytes; + + internalPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptor, internalSampleRate, pConfig->performanceProfile); + + /* What miniaudio calls a period, audio4 calls a block. */ + internalPeriodSizeInBytes = internalPeriodSizeInFrames * ma_get_bytes_per_frame(internalFormat, internalChannels); + if (internalPeriodSizeInBytes < 16) { + internalPeriodSizeInBytes = 16; + } + + fdPar.nblks = pDescriptor->periodCount; + fdPar.round = internalPeriodSizeInBytes; + + if (ioctl(fd, AUDIO_SETPAR, &fdPar) < 0) { + close(fd); + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] Failed to set device parameters.", MA_FORMAT_NOT_SUPPORTED); + } + + if (ioctl(fd, AUDIO_GETPAR, &fdPar) < 0) { + close(fd); + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[audio4] Failed to retrieve actual device parameters.", MA_FORMAT_NOT_SUPPORTED); + } + } + + internalFormat = ma_format_from_swpar__audio4(&fdPar); + internalChannels = (deviceType == ma_device_type_capture) ? fdPar.rchan : fdPar.pchan; + internalSampleRate = fdPar.rate; + internalPeriods = fdPar.nblks; + internalPeriodSizeInFrames = fdPar.round / ma_get_bytes_per_frame(internalFormat, internalChannels); + } + #endif if (internalFormat == ma_format_unknown) { close(fd); @@ -28385,27 +28519,22 @@ static ma_result ma_device_init_fd__audio4(ma_context* pContext, const ma_device } if (deviceType == ma_device_type_capture) { - pDevice->audio4.fdCapture = fd; - pDevice->capture.internalFormat = internalFormat; - pDevice->capture.internalChannels = internalChannels; - pDevice->capture.internalSampleRate = internalSampleRate; - ma_get_standard_channel_map(ma_standard_channel_map_sound4, internalChannels, pDevice->capture.internalChannelMap); - pDevice->capture.internalPeriodSizeInFrames = internalPeriodSizeInFrames; - pDevice->capture.internalPeriods = internalPeriods; + pDevice->audio4.fdCapture = fd; } else { - pDevice->audio4.fdPlayback = fd; - pDevice->playback.internalFormat = internalFormat; - pDevice->playback.internalChannels = internalChannels; - pDevice->playback.internalSampleRate = internalSampleRate; - ma_get_standard_channel_map(ma_standard_channel_map_sound4, internalChannels, pDevice->playback.internalChannelMap); - pDevice->playback.internalPeriodSizeInFrames = internalPeriodSizeInFrames; - pDevice->playback.internalPeriods = internalPeriods; + pDevice->audio4.fdPlayback = fd; } + pDescriptor->format = internalFormat; + pDescriptor->channels = internalChannels; + pDescriptor->sampleRate = internalSampleRate; + ma_get_standard_channel_map(ma_standard_channel_map_sound4, internalChannels, pDescriptor->channelMap); + pDescriptor->periodSizeInFrames = internalPeriodSizeInFrames; + pDescriptor->periodCount = internalPeriods; + return MA_SUCCESS; } -static ma_result ma_device_init__audio4(ma_context* pContext, const ma_device_config* pConfig, ma_device* pDevice) +static ma_result ma_device_init__audio4(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptorPlayback, ma_device_descriptor* pDescriptorCapture) { MA_ASSERT(pDevice != NULL); @@ -28425,8 +28554,8 @@ static ma_result ma_device_init__audio4(ma_context* pContext, const ma_device_co */ #if defined(__NetBSD_Version__) && __NetBSD_Version__ >= 800000000 /* NetBSD 8.0+ */ - if (((pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) && pConfig->playback.shareMode == ma_share_mode_exclusive) || - ((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) && pConfig->capture.shareMode == ma_share_mode_exclusive)) { + if (((pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) && pDescriptorPlayback->shareMode == ma_share_mode_exclusive) || + ((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) && pDescriptorCapture->shareMode == ma_share_mode_exclusive)) { return MA_SHARE_MODE_NOT_SUPPORTED; } #else @@ -28434,14 +28563,14 @@ static ma_result ma_device_init__audio4(ma_context* pContext, const ma_device_co #endif if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) { - ma_result result = ma_device_init_fd__audio4(pContext, pConfig, ma_device_type_capture, pDevice); + ma_result result = ma_device_init_fd__audio4(pDevice, pConfig, pDescriptorCapture, ma_device_type_capture); if (result != MA_SUCCESS) { return result; } } if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { - ma_result result = ma_device_init_fd__audio4(pContext, pConfig, ma_device_type_playback, pDevice); + ma_result result = ma_device_init_fd__audio4(pDevice, pConfig, pDescriptorPlayback, ma_device_type_playback); if (result != MA_SUCCESS) { if (pConfig->deviceType == ma_device_type_duplex) { close(pDevice->audio4.fdCapture); @@ -28453,7 +28582,6 @@ static ma_result ma_device_init__audio4(ma_context* pContext, const ma_device_co return MA_SUCCESS; } -#if 0 static ma_result ma_device_start__audio4(ma_device* pDevice) { MA_ASSERT(pDevice != NULL); @@ -28472,7 +28600,6 @@ static ma_result ma_device_start__audio4(ma_device* pDevice) return MA_SUCCESS; } -#endif static ma_result ma_device_stop_fd__audio4(ma_device* pDevice, int fd) { @@ -28564,171 +28691,6 @@ static ma_result ma_device_read__audio4(ma_device* pDevice, void* pPCMFrames, ma return MA_SUCCESS; } -static ma_result ma_device_main_loop__audio4(ma_device* pDevice) -{ - ma_result result = MA_SUCCESS; - ma_bool32 exitLoop = MA_FALSE; - - /* No need to explicitly start the device like the other backends. */ - - while (ma_device_get_state(pDevice) == MA_STATE_STARTED && !exitLoop) { - switch (pDevice->type) - { - case ma_device_type_duplex: - { - /* The process is: device_read -> convert -> callback -> convert -> device_write */ - ma_uint32 totalCapturedDeviceFramesProcessed = 0; - ma_uint32 capturedDevicePeriodSizeInFrames = ma_min(pDevice->capture.internalPeriodSizeInFrames, pDevice->playback.internalPeriodSizeInFrames); - - while (totalCapturedDeviceFramesProcessed < capturedDevicePeriodSizeInFrames) { - ma_uint8 capturedDeviceData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint8 playbackDeviceData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 capturedDeviceDataCapInFrames = sizeof(capturedDeviceData) / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); - ma_uint32 playbackDeviceDataCapInFrames = sizeof(playbackDeviceData) / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); - ma_uint32 capturedDeviceFramesRemaining; - ma_uint32 capturedDeviceFramesProcessed; - ma_uint32 capturedDeviceFramesToProcess; - ma_uint32 capturedDeviceFramesToTryProcessing = capturedDevicePeriodSizeInFrames - totalCapturedDeviceFramesProcessed; - if (capturedDeviceFramesToTryProcessing > capturedDeviceDataCapInFrames) { - capturedDeviceFramesToTryProcessing = capturedDeviceDataCapInFrames; - } - - result = ma_device_read__audio4(pDevice, capturedDeviceData, capturedDeviceFramesToTryProcessing, &capturedDeviceFramesToProcess); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - capturedDeviceFramesRemaining = capturedDeviceFramesToProcess; - capturedDeviceFramesProcessed = 0; - - for (;;) { - ma_uint8 capturedClientData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint8 playbackClientData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 capturedClientDataCapInFrames = sizeof(capturedClientData) / ma_get_bytes_per_frame(pDevice->capture.format, pDevice->capture.channels); - ma_uint32 playbackClientDataCapInFrames = sizeof(playbackClientData) / ma_get_bytes_per_frame(pDevice->playback.format, pDevice->playback.channels); - ma_uint64 capturedClientFramesToProcessThisIteration = ma_min(capturedClientDataCapInFrames, playbackClientDataCapInFrames); - ma_uint64 capturedDeviceFramesToProcessThisIteration = capturedDeviceFramesRemaining; - ma_uint8* pRunningCapturedDeviceFrames = ma_offset_ptr(capturedDeviceData, capturedDeviceFramesProcessed * ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels)); - - /* Convert capture data from device format to client format. */ - result = ma_data_converter_process_pcm_frames(&pDevice->capture.converter, pRunningCapturedDeviceFrames, &capturedDeviceFramesToProcessThisIteration, capturedClientData, &capturedClientFramesToProcessThisIteration); - if (result != MA_SUCCESS) { - break; - } - - /* - If we weren't able to generate any output frames it must mean we've exhaused all of our input. The only time this would not be the case is if capturedClientData was too small - which should never be the case when it's of the size MA_DATA_CONVERTER_STACK_BUFFER_SIZE. - */ - if (capturedClientFramesToProcessThisIteration == 0) { - break; - } - - ma_device__on_data(pDevice, playbackClientData, capturedClientData, (ma_uint32)capturedClientFramesToProcessThisIteration); /* Safe cast .*/ - - capturedDeviceFramesProcessed += (ma_uint32)capturedDeviceFramesToProcessThisIteration; /* Safe cast. */ - capturedDeviceFramesRemaining -= (ma_uint32)capturedDeviceFramesToProcessThisIteration; /* Safe cast. */ - - /* At this point the playbackClientData buffer should be holding data that needs to be written to the device. */ - for (;;) { - ma_uint64 convertedClientFrameCount = capturedClientFramesToProcessThisIteration; - ma_uint64 convertedDeviceFrameCount = playbackDeviceDataCapInFrames; - result = ma_data_converter_process_pcm_frames(&pDevice->playback.converter, playbackClientData, &convertedClientFrameCount, playbackDeviceData, &convertedDeviceFrameCount); - if (result != MA_SUCCESS) { - break; - } - - result = ma_device_write__audio4(pDevice, playbackDeviceData, (ma_uint32)convertedDeviceFrameCount, NULL); /* Safe cast. */ - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - capturedClientFramesToProcessThisIteration -= (ma_uint32)convertedClientFrameCount; /* Safe cast. */ - if (capturedClientFramesToProcessThisIteration == 0) { - break; - } - } - - /* In case an error happened from ma_device_write__audio4()... */ - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - } - - totalCapturedDeviceFramesProcessed += capturedDeviceFramesProcessed; - } - } break; - - case ma_device_type_capture: - { - /* We read in chunks of the period size, but use a stack allocated buffer for the intermediary. */ - ma_uint8 intermediaryBuffer[8192]; - ma_uint32 intermediaryBufferSizeInFrames = sizeof(intermediaryBuffer) / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); - ma_uint32 periodSizeInFrames = pDevice->capture.internalPeriodSizeInFrames; - ma_uint32 framesReadThisPeriod = 0; - while (framesReadThisPeriod < periodSizeInFrames) { - ma_uint32 framesRemainingInPeriod = periodSizeInFrames - framesReadThisPeriod; - ma_uint32 framesProcessed; - ma_uint32 framesToReadThisIteration = framesRemainingInPeriod; - if (framesToReadThisIteration > intermediaryBufferSizeInFrames) { - framesToReadThisIteration = intermediaryBufferSizeInFrames; - } - - result = ma_device_read__audio4(pDevice, intermediaryBuffer, framesToReadThisIteration, &framesProcessed); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - ma_device__send_frames_to_client(pDevice, framesProcessed, intermediaryBuffer); - - framesReadThisPeriod += framesProcessed; - } - } break; - - case ma_device_type_playback: - { - /* We write in chunks of the period size, but use a stack allocated buffer for the intermediary. */ - ma_uint8 intermediaryBuffer[8192]; - ma_uint32 intermediaryBufferSizeInFrames = sizeof(intermediaryBuffer) / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); - ma_uint32 periodSizeInFrames = pDevice->playback.internalPeriodSizeInFrames; - ma_uint32 framesWrittenThisPeriod = 0; - while (framesWrittenThisPeriod < periodSizeInFrames) { - ma_uint32 framesRemainingInPeriod = periodSizeInFrames - framesWrittenThisPeriod; - ma_uint32 framesProcessed; - ma_uint32 framesToWriteThisIteration = framesRemainingInPeriod; - if (framesToWriteThisIteration > intermediaryBufferSizeInFrames) { - framesToWriteThisIteration = intermediaryBufferSizeInFrames; - } - - ma_device__read_frames_from_client(pDevice, framesToWriteThisIteration, intermediaryBuffer); - - result = ma_device_write__audio4(pDevice, intermediaryBuffer, framesToWriteThisIteration, &framesProcessed); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - framesWrittenThisPeriod += framesProcessed; - } - } break; - - /* To silence a warning. Will never hit this. */ - case ma_device_type_loopback: - default: break; - } - } - - - /* Here is where the device is stopped. */ - ma_device_stop__audio4(pDevice); - - return result; -} - static ma_result ma_context_uninit__audio4(ma_context* pContext) { MA_ASSERT(pContext != NULL); @@ -28738,20 +28700,23 @@ static ma_result ma_context_uninit__audio4(ma_context* pContext) return MA_SUCCESS; } -static ma_result ma_context_init__audio4(const ma_context_config* pConfig, ma_context* pContext) +static ma_result ma_context_init__audio4(ma_context* pContext, const ma_context_config* pConfig, ma_backend_callbacks* pCallbacks) { MA_ASSERT(pContext != NULL); (void)pConfig; - pContext->onUninit = ma_context_uninit__audio4; - pContext->onEnumDevices = ma_context_enumerate_devices__audio4; - pContext->onGetDeviceInfo = ma_context_get_device_info__audio4; - pContext->onDeviceInit = ma_device_init__audio4; - pContext->onDeviceUninit = ma_device_uninit__audio4; - pContext->onDeviceStart = NULL; /* Not required for synchronous backends. */ - pContext->onDeviceStop = NULL; /* Not required for synchronous backends. */ - pContext->onDeviceMainLoop = ma_device_main_loop__audio4; + pCallbacks->onContextInit = ma_context_init__audio4; + pCallbacks->onContextUninit = ma_context_uninit__audio4; + pCallbacks->onContextEnumerateDevices = ma_context_enumerate_devices__audio4; + pCallbacks->onContextGetDeviceInfo = ma_context_get_device_info__audio4; + pCallbacks->onDeviceInit = ma_device_init__audio4; + pCallbacks->onDeviceUninit = ma_device_uninit__audio4; + pCallbacks->onDeviceStart = ma_device_start__audio4; + pCallbacks->onDeviceStop = ma_device_stop__audio4; + pCallbacks->onDeviceRead = ma_device_read__audio4; + pCallbacks->onDeviceWrite = ma_device_write__audio4; + pCallbacks->onDeviceDataLoop = NULL; return MA_SUCCESS; } @@ -28885,7 +28850,57 @@ static ma_result ma_context_enumerate_devices__oss(ma_context* pContext, ma_enum return MA_SUCCESS; } -static ma_result ma_context_get_device_info__oss(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_share_mode shareMode, ma_device_info* pDeviceInfo) +static void ma_context_add_native_data_format__oss(ma_context* pContext, oss_audioinfo* pAudioInfo, ma_format format, ma_device_info* pDeviceInfo) +{ + unsigned int minChannels; + unsigned int maxChannels; + unsigned int iRate; + + MA_ASSERT(pContext != NULL); + MA_ASSERT(pAudioInfo != NULL); + MA_ASSERT(pDeviceInfo != NULL); + + /* If we support all channels we just report 0. */ + minChannels = ma_clamp(pAudioInfo->min_channels, MA_MIN_CHANNELS, MA_MAX_CHANNELS); + maxChannels = ma_clamp(pAudioInfo->max_channels, MA_MIN_CHANNELS, MA_MAX_CHANNELS); + + /* + OSS has this annoying thing where sample rates can be reported in two ways. We prefer explicitness, + which OSS has in the form of nrates/rates, however there are times where nrates can be 0, in which + case we'll need to use min_rate and max_rate and report only standard rates. + */ + if (pAudioInfo->nrates > 0) { + for (iRate = 0; iRate < pAudioInfo->nrates; iRate += 1) { + unsigned int rate = pAudioInfo->rates[iRate]; + + if (minChannels == MA_MIN_CHANNELS && maxChannels == MA_MAX_CHANNELS) { + ma_device_info_add_native_data_format(pDeviceInfo, format, 0, rate, 0); /* Set the channel count to 0 to indicate that all channel counts are supported. */ + } else { + unsigned int iChannel; + for (iChannel = minChannels; iChannel <= maxChannels; iChannel += 1) { + ma_device_info_add_native_data_format(pDeviceInfo, format, iChannel, rate, 0); + } + } + } + } else { + for (iRate = 0; iRate < ma_countof(g_maStandardSampleRatePriorities); iRate += 1) { + ma_uint32 standardRate = g_maStandardSampleRatePriorities[iRate]; + + if (standardRate >= (ma_uint32)pAudioInfo->min_rate && standardRate <= (ma_uint32)pAudioInfo->max_rate) { + if (minChannels == MA_MIN_CHANNELS && maxChannels == MA_MAX_CHANNELS) { + ma_device_info_add_native_data_format(pDeviceInfo, format, 0, standardRate, 0); /* Set the channel count to 0 to indicate that all channel counts are supported. */ + } else { + unsigned int iChannel; + for (iChannel = minChannels; iChannel <= maxChannels; iChannel += 1) { + ma_device_info_add_native_data_format(pDeviceInfo, format, iChannel, standardRate, 0); + } + } + } + } + } +} + +static ma_result ma_context_get_device_info__oss(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_device_info* pDeviceInfo) { ma_bool32 foundDevice; int fdTemp; @@ -28893,7 +28908,6 @@ static ma_result ma_context_get_device_info__oss(ma_context* pContext, ma_device int result; MA_ASSERT(pContext != NULL); - (void)shareMode; /* Handle the default device a little differently. */ if (pDeviceID == NULL) { @@ -28943,11 +28957,8 @@ static ma_result ma_context_get_device_info__oss(ma_context* pContext, ma_device ma_strncpy_s(pDeviceInfo->name, sizeof(pDeviceInfo->name), ai.name, (size_t)-1); } - pDeviceInfo->minChannels = ai.min_channels; - pDeviceInfo->maxChannels = ai.max_channels; - pDeviceInfo->minSampleRate = ai.min_rate; - pDeviceInfo->maxSampleRate = ai.max_rate; - pDeviceInfo->formatCount = 0; + + pDeviceInfo->nativeDataFormatCount = 0; if (deviceType == ma_device_type_playback) { formatMask = ai.oformats; @@ -28955,14 +28966,14 @@ static ma_result ma_context_get_device_info__oss(ma_context* pContext, ma_device formatMask = ai.iformats; } - if ((formatMask & AFMT_U8) != 0) { - pDeviceInfo->formats[pDeviceInfo->formatCount++] = ma_format_u8; - } if (((formatMask & AFMT_S16_LE) != 0 && ma_is_little_endian()) || (AFMT_S16_BE && ma_is_big_endian())) { - pDeviceInfo->formats[pDeviceInfo->formatCount++] = ma_format_s16; + ma_context_add_native_data_format__oss(pContext, &ai, ma_format_s16, pDeviceInfo); } if (((formatMask & AFMT_S32_LE) != 0 && ma_is_little_endian()) || (AFMT_S32_BE && ma_is_big_endian())) { - pDeviceInfo->formats[pDeviceInfo->formatCount++] = ma_format_s32; + ma_context_add_native_data_format__oss(pContext, &ai, ma_format_s32, pDeviceInfo); + } + if ((formatMask & AFMT_U8) != 0) { + ma_context_add_native_data_format__oss(pContext, &ai, ma_format_u8, pDeviceInfo); } foundDevice = MA_TRUE; @@ -28986,7 +28997,7 @@ static ma_result ma_context_get_device_info__oss(ma_context* pContext, ma_device return MA_SUCCESS; } -static void ma_device_uninit__oss(ma_device* pDevice) +static ma_result ma_device_uninit__oss(ma_device* pDevice) { MA_ASSERT(pDevice != NULL); @@ -28997,6 +29008,8 @@ static void ma_device_uninit__oss(ma_device* pDevice) if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { close(pDevice->oss.fdPlayback); } + + return MA_SUCCESS; } static int ma_format_to_oss(ma_format format) @@ -29037,7 +29050,7 @@ static ma_format ma_format_from_oss(int ossFormat) return ma_format_unknown; } -static ma_result ma_device_init_fd__oss(ma_context* pContext, const ma_device_config* pConfig, ma_device_type deviceType, ma_device* pDevice) +static ma_result ma_device_init_fd__oss(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptor, ma_device_type deviceType) { ma_result result; int ossResult; @@ -29049,28 +29062,17 @@ static ma_result ma_device_init_fd__oss(ma_context* pContext, const ma_device_co int ossSampleRate; int ossFragment; - MA_ASSERT(pContext != NULL); + MA_ASSERT(pDevice != NULL); MA_ASSERT(pConfig != NULL); MA_ASSERT(deviceType != ma_device_type_duplex); - MA_ASSERT(pDevice != NULL); + + pDeviceID = pDescriptor->pDeviceID; + shareMode = pDescriptor->shareMode; + ossFormat = ma_format_to_oss((pDescriptor->format != ma_format_unknown) ? pDescriptor->format : ma_format_s16); /* Use s16 by default because OSS doesn't like floating point. */ + ossChannels = (int)(pDescriptor->channels > 0) ? pDescriptor->channels : MA_DEFAULT_CHANNELS; + ossSampleRate = (int)(pDescriptor->sampleRate > 0) ? pDescriptor->sampleRate : MA_DEFAULT_SAMPLE_RATE; - (void)pContext; - - if (deviceType == ma_device_type_capture) { - pDeviceID = pConfig->capture.pDeviceID; - shareMode = pConfig->capture.shareMode; - ossFormat = ma_format_to_oss(pConfig->capture.format); - ossChannels = (int)pConfig->capture.channels; - ossSampleRate = (int)pConfig->sampleRate; - } else { - pDeviceID = pConfig->playback.pDeviceID; - shareMode = pConfig->playback.shareMode; - ossFormat = ma_format_to_oss(pConfig->playback.format); - ossChannels = (int)pConfig->playback.channels; - ossSampleRate = (int)pConfig->sampleRate; - } - - result = ma_context_open_device__oss(pContext, deviceType, pDeviceID, shareMode, &fd); + result = ma_context_open_device__oss(pDevice->pContext, deviceType, pDeviceID, shareMode, &fd); if (result != MA_SUCCESS) { return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OSS] Failed to open device.", result); } @@ -29117,10 +29119,7 @@ static ma_result ma_device_init_fd__oss(ma_context* pContext, const ma_device_co ma_uint32 periodSizeInBytes; ma_uint32 ossFragmentSizePower; - periodSizeInFrames = pConfig->periodSizeInFrames; - if (periodSizeInFrames == 0) { - periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(pConfig->periodSizeInMilliseconds, (ma_uint32)ossSampleRate); - } + periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptor, (ma_uint32)ossSampleRate, pConfig->performanceProfile); periodSizeInBytes = ma_round_to_power_of_2(periodSizeInFrames * ma_get_bytes_per_frame(ma_format_from_oss(ossFormat), ossChannels)); if (periodSizeInBytes < 16) { @@ -29143,39 +29142,29 @@ static ma_result ma_device_init_fd__oss(ma_context* pContext, const ma_device_co /* Internal settings. */ if (deviceType == ma_device_type_capture) { - pDevice->oss.fdCapture = fd; - pDevice->capture.internalFormat = ma_format_from_oss(ossFormat); - pDevice->capture.internalChannels = ossChannels; - pDevice->capture.internalSampleRate = ossSampleRate; - ma_get_standard_channel_map(ma_standard_channel_map_sound4, pDevice->capture.internalChannels, pDevice->capture.internalChannelMap); - pDevice->capture.internalPeriods = (ma_uint32)(ossFragment >> 16); - pDevice->capture.internalPeriodSizeInFrames = (ma_uint32)(1 << (ossFragment & 0xFFFF)) / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); - - if (pDevice->capture.internalFormat == ma_format_unknown) { - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OSS] The device's internal format is not supported by miniaudio.", MA_FORMAT_NOT_SUPPORTED); - } + pDevice->oss.fdCapture = fd; } else { - pDevice->oss.fdPlayback = fd; - pDevice->playback.internalFormat = ma_format_from_oss(ossFormat); - pDevice->playback.internalChannels = ossChannels; - pDevice->playback.internalSampleRate = ossSampleRate; - ma_get_standard_channel_map(ma_standard_channel_map_sound4, pDevice->playback.internalChannels, pDevice->playback.internalChannelMap); - pDevice->playback.internalPeriods = (ma_uint32)(ossFragment >> 16); - pDevice->playback.internalPeriodSizeInFrames = (ma_uint32)(1 << (ossFragment & 0xFFFF)) / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); + pDevice->oss.fdPlayback = fd; + } - if (pDevice->playback.internalFormat == ma_format_unknown) { - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OSS] The device's internal format is not supported by miniaudio.", MA_FORMAT_NOT_SUPPORTED); - } + pDescriptor->format = ma_format_from_oss(ossFormat); + pDescriptor->channels = ossChannels; + pDescriptor->sampleRate = ossSampleRate; + ma_get_standard_channel_map(ma_standard_channel_map_sound4, pDescriptor->channels, pDescriptor->channelMap); + pDescriptor->periodCount = (ma_uint32)(ossFragment >> 16); + pDescriptor->periodSizeInFrames = (ma_uint32)(1 << (ossFragment & 0xFFFF)) / ma_get_bytes_per_frame(pDescriptor->format, pDescriptor->channels); + + if (pDescriptor->format == ma_format_unknown) { + return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OSS] The device's internal format is not supported by miniaudio.", MA_FORMAT_NOT_SUPPORTED); } return MA_SUCCESS; } -static ma_result ma_device_init__oss(ma_context* pContext, const ma_device_config* pConfig, ma_device* pDevice) +static ma_result ma_device_init__oss(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptorPlayback, ma_device_descriptor* pDescriptorCapture) { - MA_ASSERT(pContext != NULL); - MA_ASSERT(pConfig != NULL); MA_ASSERT(pDevice != NULL); + MA_ASSERT(pConfig != NULL); MA_ZERO_OBJECT(&pDevice->oss); @@ -29184,14 +29173,14 @@ static ma_result ma_device_init__oss(ma_context* pContext, const ma_device_confi } if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) { - ma_result result = ma_device_init_fd__oss(pContext, pConfig, ma_device_type_capture, pDevice); + ma_result result = ma_device_init_fd__oss(pDevice, pConfig, pDescriptorCapture, ma_device_type_capture); if (result != MA_SUCCESS) { return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OSS] Failed to open device.", result); } } if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { - ma_result result = ma_device_init_fd__oss(pContext, pConfig, ma_device_type_playback, pDevice); + ma_result result = ma_device_init_fd__oss(pDevice, pConfig, pDescriptorPlayback, ma_device_type_playback); if (result != MA_SUCCESS) { return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OSS] Failed to open device.", result); } @@ -29200,36 +29189,41 @@ static ma_result ma_device_init__oss(ma_context* pContext, const ma_device_confi return MA_SUCCESS; } +/* +Note on Starting and Stopping +============================= +In the past I was using SNDCTL_DSP_HALT to stop the device, however this results in issues when +trying to resume the device again. If we use SNDCTL_DSP_HALT, the next write() or read() will +fail. Instead what we need to do is just not write or read to and from the device when the +device is not running. + +As a result, both the start and stop functions for OSS are just empty stubs. The starting and +stopping logic is handled by ma_device_write__oss() and ma_device_read__oss(). These will check +the device state, and if the device is stopped they will simply not do any kind of processing. + +The downside to this technique is that I've noticed a fairly lengthy delay in stopping the +device, up to a second. This is on a virtual machine, and as such might just be due to the +virtual drivers, but I'm not fully sure. I am not sure how to work around this problem so for +the moment that's just how it's going to have to be. + +When starting the device, OSS will automatically start it when write() or read() is called. +*/ +static ma_result ma_device_start__oss(ma_device* pDevice) +{ + MA_ASSERT(pDevice != NULL); + + /* The device is automatically started with reading and writing. */ + (void)pDevice; + + return MA_SUCCESS; +} + static ma_result ma_device_stop__oss(ma_device* pDevice) { MA_ASSERT(pDevice != NULL); - /* - We want to use SNDCTL_DSP_HALT. From the documentation: - - In multithreaded applications SNDCTL_DSP_HALT (SNDCTL_DSP_RESET) must only be called by the thread - that actually reads/writes the audio device. It must not be called by some master thread to kill the - audio thread. The audio thread will not stop or get any kind of notification that the device was - stopped by the master thread. The device gets stopped but the next read or write call will silently - restart the device. - - This is actually safe in our case, because this function is only ever called from within our worker - thread anyway. Just keep this in mind, though... - */ - - if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { - int result = ioctl(pDevice->oss.fdCapture, SNDCTL_DSP_HALT, 0); - if (result == -1) { - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OSS] Failed to stop device. SNDCTL_DSP_HALT failed.", ma_result_from_errno(errno)); - } - } - - if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { - int result = ioctl(pDevice->oss.fdPlayback, SNDCTL_DSP_HALT, 0); - if (result == -1) { - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OSS] Failed to stop device. SNDCTL_DSP_HALT failed.", ma_result_from_errno(errno)); - } - } + /* See note above on why this is empty. */ + (void)pDevice; return MA_SUCCESS; } @@ -29237,11 +29231,18 @@ static ma_result ma_device_stop__oss(ma_device* pDevice) static ma_result ma_device_write__oss(ma_device* pDevice, const void* pPCMFrames, ma_uint32 frameCount, ma_uint32* pFramesWritten) { int resultOSS; + ma_uint32 deviceState; if (pFramesWritten != NULL) { *pFramesWritten = 0; } + /* Don't do any processing if the device is stopped. */ + deviceState = ma_device_get_state(pDevice); + if (deviceState != MA_STATE_STARTED && deviceState != MA_STATE_STARTING) { + return MA_SUCCESS; + } + resultOSS = write(pDevice->oss.fdPlayback, pPCMFrames, frameCount * ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels)); if (resultOSS < 0) { return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OSS] Failed to send data from the client to the device.", ma_result_from_errno(errno)); @@ -29257,11 +29258,18 @@ static ma_result ma_device_write__oss(ma_device* pDevice, const void* pPCMFrames static ma_result ma_device_read__oss(ma_device* pDevice, void* pPCMFrames, ma_uint32 frameCount, ma_uint32* pFramesRead) { int resultOSS; + ma_uint32 deviceState; if (pFramesRead != NULL) { *pFramesRead = 0; } + /* Don't do any processing if the device is stopped. */ + deviceState = ma_device_get_state(pDevice); + if (deviceState != MA_STATE_STARTED && deviceState != MA_STATE_STARTING) { + return MA_SUCCESS; + } + resultOSS = read(pDevice->oss.fdCapture, pPCMFrames, frameCount * ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels)); if (resultOSS < 0) { return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OSS] Failed to read data from the device to be sent to the client.", ma_result_from_errno(errno)); @@ -29274,171 +29282,6 @@ static ma_result ma_device_read__oss(ma_device* pDevice, void* pPCMFrames, ma_ui return MA_SUCCESS; } -static ma_result ma_device_main_loop__oss(ma_device* pDevice) -{ - ma_result result = MA_SUCCESS; - ma_bool32 exitLoop = MA_FALSE; - - /* No need to explicitly start the device like the other backends. */ - - while (ma_device_get_state(pDevice) == MA_STATE_STARTED && !exitLoop) { - switch (pDevice->type) - { - case ma_device_type_duplex: - { - /* The process is: device_read -> convert -> callback -> convert -> device_write */ - ma_uint32 totalCapturedDeviceFramesProcessed = 0; - ma_uint32 capturedDevicePeriodSizeInFrames = ma_min(pDevice->capture.internalPeriodSizeInFrames, pDevice->playback.internalPeriodSizeInFrames); - - while (totalCapturedDeviceFramesProcessed < capturedDevicePeriodSizeInFrames) { - ma_uint8 capturedDeviceData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint8 playbackDeviceData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 capturedDeviceDataCapInFrames = sizeof(capturedDeviceData) / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); - ma_uint32 playbackDeviceDataCapInFrames = sizeof(playbackDeviceData) / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); - ma_uint32 capturedDeviceFramesRemaining; - ma_uint32 capturedDeviceFramesProcessed; - ma_uint32 capturedDeviceFramesToProcess; - ma_uint32 capturedDeviceFramesToTryProcessing = capturedDevicePeriodSizeInFrames - totalCapturedDeviceFramesProcessed; - if (capturedDeviceFramesToTryProcessing > capturedDeviceDataCapInFrames) { - capturedDeviceFramesToTryProcessing = capturedDeviceDataCapInFrames; - } - - result = ma_device_read__oss(pDevice, capturedDeviceData, capturedDeviceFramesToTryProcessing, &capturedDeviceFramesToProcess); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - capturedDeviceFramesRemaining = capturedDeviceFramesToProcess; - capturedDeviceFramesProcessed = 0; - - for (;;) { - ma_uint8 capturedClientData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint8 playbackClientData[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 capturedClientDataCapInFrames = sizeof(capturedClientData) / ma_get_bytes_per_frame(pDevice->capture.format, pDevice->capture.channels); - ma_uint32 playbackClientDataCapInFrames = sizeof(playbackClientData) / ma_get_bytes_per_frame(pDevice->playback.format, pDevice->playback.channels); - ma_uint64 capturedClientFramesToProcessThisIteration = ma_min(capturedClientDataCapInFrames, playbackClientDataCapInFrames); - ma_uint64 capturedDeviceFramesToProcessThisIteration = capturedDeviceFramesRemaining; - ma_uint8* pRunningCapturedDeviceFrames = ma_offset_ptr(capturedDeviceData, capturedDeviceFramesProcessed * ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels)); - - /* Convert capture data from device format to client format. */ - result = ma_data_converter_process_pcm_frames(&pDevice->capture.converter, pRunningCapturedDeviceFrames, &capturedDeviceFramesToProcessThisIteration, capturedClientData, &capturedClientFramesToProcessThisIteration); - if (result != MA_SUCCESS) { - break; - } - - /* - If we weren't able to generate any output frames it must mean we've exhaused all of our input. The only time this would not be the case is if capturedClientData was too small - which should never be the case when it's of the size MA_DATA_CONVERTER_STACK_BUFFER_SIZE. - */ - if (capturedClientFramesToProcessThisIteration == 0) { - break; - } - - ma_device__on_data(pDevice, playbackClientData, capturedClientData, (ma_uint32)capturedClientFramesToProcessThisIteration); /* Safe cast .*/ - - capturedDeviceFramesProcessed += (ma_uint32)capturedDeviceFramesToProcessThisIteration; /* Safe cast. */ - capturedDeviceFramesRemaining -= (ma_uint32)capturedDeviceFramesToProcessThisIteration; /* Safe cast. */ - - /* At this point the playbackClientData buffer should be holding data that needs to be written to the device. */ - for (;;) { - ma_uint64 convertedClientFrameCount = capturedClientFramesToProcessThisIteration; - ma_uint64 convertedDeviceFrameCount = playbackDeviceDataCapInFrames; - result = ma_data_converter_process_pcm_frames(&pDevice->playback.converter, playbackClientData, &convertedClientFrameCount, playbackDeviceData, &convertedDeviceFrameCount); - if (result != MA_SUCCESS) { - break; - } - - result = ma_device_write__oss(pDevice, playbackDeviceData, (ma_uint32)convertedDeviceFrameCount, NULL); /* Safe cast. */ - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - capturedClientFramesToProcessThisIteration -= (ma_uint32)convertedClientFrameCount; /* Safe cast. */ - if (capturedClientFramesToProcessThisIteration == 0) { - break; - } - } - - /* In case an error happened from ma_device_write__oss()... */ - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - } - - totalCapturedDeviceFramesProcessed += capturedDeviceFramesProcessed; - } - } break; - - case ma_device_type_capture: - { - /* We read in chunks of the period size, but use a stack allocated buffer for the intermediary. */ - ma_uint8 intermediaryBuffer[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 intermediaryBufferSizeInFrames = sizeof(intermediaryBuffer) / ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); - ma_uint32 periodSizeInFrames = pDevice->capture.internalPeriodSizeInFrames; - ma_uint32 framesReadThisPeriod = 0; - while (framesReadThisPeriod < periodSizeInFrames) { - ma_uint32 framesRemainingInPeriod = periodSizeInFrames - framesReadThisPeriod; - ma_uint32 framesProcessed; - ma_uint32 framesToReadThisIteration = framesRemainingInPeriod; - if (framesToReadThisIteration > intermediaryBufferSizeInFrames) { - framesToReadThisIteration = intermediaryBufferSizeInFrames; - } - - result = ma_device_read__oss(pDevice, intermediaryBuffer, framesToReadThisIteration, &framesProcessed); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - ma_device__send_frames_to_client(pDevice, framesProcessed, intermediaryBuffer); - - framesReadThisPeriod += framesProcessed; - } - } break; - - case ma_device_type_playback: - { - /* We write in chunks of the period size, but use a stack allocated buffer for the intermediary. */ - ma_uint8 intermediaryBuffer[MA_DATA_CONVERTER_STACK_BUFFER_SIZE]; - ma_uint32 intermediaryBufferSizeInFrames = sizeof(intermediaryBuffer) / ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); - ma_uint32 periodSizeInFrames = pDevice->playback.internalPeriodSizeInFrames; - ma_uint32 framesWrittenThisPeriod = 0; - while (framesWrittenThisPeriod < periodSizeInFrames) { - ma_uint32 framesRemainingInPeriod = periodSizeInFrames - framesWrittenThisPeriod; - ma_uint32 framesProcessed; - ma_uint32 framesToWriteThisIteration = framesRemainingInPeriod; - if (framesToWriteThisIteration > intermediaryBufferSizeInFrames) { - framesToWriteThisIteration = intermediaryBufferSizeInFrames; - } - - ma_device__read_frames_from_client(pDevice, framesToWriteThisIteration, intermediaryBuffer); - - result = ma_device_write__oss(pDevice, intermediaryBuffer, framesToWriteThisIteration, &framesProcessed); - if (result != MA_SUCCESS) { - exitLoop = MA_TRUE; - break; - } - - framesWrittenThisPeriod += framesProcessed; - } - } break; - - /* To silence a warning. Will never hit this. */ - case ma_device_type_loopback: - default: break; - } - } - - - /* Here is where the device is stopped. */ - ma_device_stop__oss(pDevice); - - return result; -} - static ma_result ma_context_uninit__oss(ma_context* pContext) { MA_ASSERT(pContext != NULL); @@ -29448,7 +29291,7 @@ static ma_result ma_context_uninit__oss(ma_context* pContext) return MA_SUCCESS; } -static ma_result ma_context_init__oss(const ma_context_config* pConfig, ma_context* pContext) +static ma_result ma_context_init__oss(ma_context* pContext, const ma_context_config* pConfig, ma_backend_callbacks* pCallbacks) { int fd; int ossVersion; @@ -29478,14 +29321,17 @@ static ma_result ma_context_init__oss(const ma_context_config* pConfig, ma_conte pContext->oss.versionMajor = ((ossVersion & 0xFF0000) >> 16); pContext->oss.versionMinor = ((ossVersion & 0x00FF00) >> 8); - pContext->onUninit = ma_context_uninit__oss; - pContext->onEnumDevices = ma_context_enumerate_devices__oss; - pContext->onGetDeviceInfo = ma_context_get_device_info__oss; - pContext->onDeviceInit = ma_device_init__oss; - pContext->onDeviceUninit = ma_device_uninit__oss; - pContext->onDeviceStart = NULL; /* Not required for synchronous backends. */ - pContext->onDeviceStop = NULL; /* Not required for synchronous backends. */ - pContext->onDeviceMainLoop = ma_device_main_loop__oss; + pCallbacks->onContextInit = ma_context_init__oss; + pCallbacks->onContextUninit = ma_context_uninit__oss; + pCallbacks->onContextEnumerateDevices = ma_context_enumerate_devices__oss; + pCallbacks->onContextGetDeviceInfo = ma_context_get_device_info__oss; + pCallbacks->onDeviceInit = ma_device_init__oss; + pCallbacks->onDeviceUninit = ma_device_uninit__oss; + pCallbacks->onDeviceStart = ma_device_start__oss; + pCallbacks->onDeviceStop = ma_device_stop__oss; + pCallbacks->onDeviceRead = ma_device_read__oss; + pCallbacks->onDeviceWrite = ma_device_write__oss; + pCallbacks->onDeviceDataLoop = NULL; return MA_SUCCESS; } @@ -29712,11 +29558,7 @@ static ma_aaudio_data_callback_result_t ma_stream_data_callback_capture__aaudio( ma_device* pDevice = (ma_device*)pUserData; MA_ASSERT(pDevice != NULL); - if (pDevice->type == ma_device_type_duplex) { - ma_device__handle_duplex_callback_capture(pDevice, frameCount, pAudioData, &pDevice->aaudio.duplexRB); - } else { - ma_device__send_frames_to_client(pDevice, frameCount, pAudioData); /* Send directly to the client. */ - } + ma_device_handle_backend_data_callback(pDevice, NULL, pAudioData, frameCount); (void)pStream; return MA_AAUDIO_CALLBACK_RESULT_CONTINUE; @@ -29727,24 +29569,20 @@ static ma_aaudio_data_callback_result_t ma_stream_data_callback_playback__aaudio ma_device* pDevice = (ma_device*)pUserData; MA_ASSERT(pDevice != NULL); - if (pDevice->type == ma_device_type_duplex) { - ma_device__handle_duplex_callback_playback(pDevice, frameCount, pAudioData, &pDevice->aaudio.duplexRB); - } else { - ma_device__read_frames_from_client(pDevice, frameCount, pAudioData); /* Read directly from the client. */ - } + ma_device_handle_backend_data_callback(pDevice, pAudioData, NULL, frameCount); (void)pStream; return MA_AAUDIO_CALLBACK_RESULT_CONTINUE; } -static ma_result ma_open_stream__aaudio(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_share_mode shareMode, const ma_device_config* pConfig, const ma_device* pDevice, ma_AAudioStream** ppStream) +static ma_result ma_create_and_configure_AAudioStreamBuilder__aaudio(ma_context* pContext, const ma_device_id* pDeviceID, ma_device_type deviceType, ma_share_mode shareMode, const ma_device_descriptor* pDescriptor, const ma_device_config* pConfig, ma_device* pDevice, ma_AAudioStreamBuilder** ppBuilder) { ma_AAudioStreamBuilder* pBuilder; ma_aaudio_result_t resultAA; + ma_uint32 bufferCapacityInFrames; - MA_ASSERT(deviceType != ma_device_type_duplex); /* This function should not be called for a full-duplex device type. */ - - *ppStream = NULL; + /* Safety. */ + *ppBuilder = NULL; resultAA = ((MA_PFN_AAudio_createStreamBuilder)pContext->aaudio.AAudio_createStreamBuilder)(&pBuilder); if (resultAA != MA_AAUDIO_OK) { @@ -29758,36 +29596,42 @@ static ma_result ma_open_stream__aaudio(ma_context* pContext, ma_device_type dev ((MA_PFN_AAudioStreamBuilder_setDirection)pContext->aaudio.AAudioStreamBuilder_setDirection)(pBuilder, (deviceType == ma_device_type_playback) ? MA_AAUDIO_DIRECTION_OUTPUT : MA_AAUDIO_DIRECTION_INPUT); ((MA_PFN_AAudioStreamBuilder_setSharingMode)pContext->aaudio.AAudioStreamBuilder_setSharingMode)(pBuilder, (shareMode == ma_share_mode_shared) ? MA_AAUDIO_SHARING_MODE_SHARED : MA_AAUDIO_SHARING_MODE_EXCLUSIVE); - if (pConfig != NULL) { - ma_uint32 bufferCapacityInFrames; - if (pDevice == NULL || !pDevice->usingDefaultSampleRate) { - ((MA_PFN_AAudioStreamBuilder_setSampleRate)pContext->aaudio.AAudioStreamBuilder_setSampleRate)(pBuilder, pConfig->sampleRate); + /* If we have a device descriptor make sure we configure the stream builder to take our requested parameters. */ + if (pDescriptor != NULL) { + MA_ASSERT(pConfig != NULL); /* We must have a device config if we also have a descriptor. The config is required for AAudio specific configuration options. */ + + if (pDescriptor->sampleRate != 0) { + ((MA_PFN_AAudioStreamBuilder_setSampleRate)pContext->aaudio.AAudioStreamBuilder_setSampleRate)(pBuilder, pDescriptor->sampleRate); } if (deviceType == ma_device_type_capture) { - if (pDevice == NULL || !pDevice->capture.usingDefaultChannels) { - ((MA_PFN_AAudioStreamBuilder_setChannelCount)pContext->aaudio.AAudioStreamBuilder_setChannelCount)(pBuilder, pConfig->capture.channels); + if (pDescriptor->channels != 0) { + ((MA_PFN_AAudioStreamBuilder_setChannelCount)pContext->aaudio.AAudioStreamBuilder_setChannelCount)(pBuilder, pDescriptor->channels); } - if (pDevice == NULL || !pDevice->capture.usingDefaultFormat) { - ((MA_PFN_AAudioStreamBuilder_setFormat)pContext->aaudio.AAudioStreamBuilder_setFormat)(pBuilder, (pConfig->capture.format == ma_format_s16) ? MA_AAUDIO_FORMAT_PCM_I16 : MA_AAUDIO_FORMAT_PCM_FLOAT); + if (pDescriptor->format != ma_format_unknown) { + ((MA_PFN_AAudioStreamBuilder_setFormat)pContext->aaudio.AAudioStreamBuilder_setFormat)(pBuilder, (pDescriptor->format == ma_format_s16) ? MA_AAUDIO_FORMAT_PCM_I16 : MA_AAUDIO_FORMAT_PCM_FLOAT); } } else { - if (pDevice == NULL || !pDevice->playback.usingDefaultChannels) { - ((MA_PFN_AAudioStreamBuilder_setChannelCount)pContext->aaudio.AAudioStreamBuilder_setChannelCount)(pBuilder, pConfig->playback.channels); + if (pDescriptor->channels != 0) { + ((MA_PFN_AAudioStreamBuilder_setChannelCount)pContext->aaudio.AAudioStreamBuilder_setChannelCount)(pBuilder, pDescriptor->channels); } - if (pDevice == NULL || !pDevice->playback.usingDefaultFormat) { - ((MA_PFN_AAudioStreamBuilder_setFormat)pContext->aaudio.AAudioStreamBuilder_setFormat)(pBuilder, (pConfig->playback.format == ma_format_s16) ? MA_AAUDIO_FORMAT_PCM_I16 : MA_AAUDIO_FORMAT_PCM_FLOAT); + if (pDescriptor->format != ma_format_unknown) { + ((MA_PFN_AAudioStreamBuilder_setFormat)pContext->aaudio.AAudioStreamBuilder_setFormat)(pBuilder, (pDescriptor->format == ma_format_s16) ? MA_AAUDIO_FORMAT_PCM_I16 : MA_AAUDIO_FORMAT_PCM_FLOAT); } } - bufferCapacityInFrames = pConfig->periodSizeInFrames * pConfig->periods; - if (bufferCapacityInFrames == 0) { - bufferCapacityInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(pConfig->periodSizeInMilliseconds, pConfig->sampleRate) * pConfig->periods; - } + /* + AAudio is annoying when it comes to it's buffer calculation stuff because it doesn't let you + retrieve the actual sample rate until after you've opened the stream. But you need to configure + the buffer capacity before you open the stream... :/ + + To solve, we're just going to assume MA_DEFAULT_SAMPLE_RATE (48000) and move on. + */ + bufferCapacityInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptor, pDescriptor->sampleRate, pConfig->performanceProfile) * pDescriptor->periodCount; ((MA_PFN_AAudioStreamBuilder_setBufferCapacityInFrames)pContext->aaudio.AAudioStreamBuilder_setBufferCapacityInFrames)(pBuilder, bufferCapacityInFrames); - ((MA_PFN_AAudioStreamBuilder_setFramesPerDataCallback)pContext->aaudio.AAudioStreamBuilder_setFramesPerDataCallback)(pBuilder, bufferCapacityInFrames / pConfig->periods); + ((MA_PFN_AAudioStreamBuilder_setFramesPerDataCallback)pContext->aaudio.AAudioStreamBuilder_setFramesPerDataCallback)(pBuilder, bufferCapacityInFrames / pDescriptor->periodCount); if (deviceType == ma_device_type_capture) { if (pConfig->aaudio.inputPreset != ma_aaudio_input_preset_default && pContext->aaudio.AAudioStreamBuilder_setInputPreset != NULL) { @@ -29809,21 +29653,61 @@ static ma_result ma_open_stream__aaudio(ma_context* pContext, ma_device_type dev /* Not sure how this affects things, but since there's a mapping between miniaudio's performance profiles and AAudio's performance modes, let go ahead and set it. */ ((MA_PFN_AAudioStreamBuilder_setPerformanceMode)pContext->aaudio.AAudioStreamBuilder_setPerformanceMode)(pBuilder, (pConfig->performanceProfile == ma_performance_profile_low_latency) ? MA_AAUDIO_PERFORMANCE_MODE_LOW_LATENCY : MA_AAUDIO_PERFORMANCE_MODE_NONE); + + /* We need to set an error callback to detect device changes. */ + if (pDevice != NULL) { /* <-- pDevice should never be null if pDescriptor is not null, which is always the case if we hit this branch. Check anyway for safety. */ + ((MA_PFN_AAudioStreamBuilder_setErrorCallback)pContext->aaudio.AAudioStreamBuilder_setErrorCallback)(pBuilder, ma_stream_error_callback__aaudio, (void*)pDevice); + } } - ((MA_PFN_AAudioStreamBuilder_setErrorCallback)pContext->aaudio.AAudioStreamBuilder_setErrorCallback)(pBuilder, ma_stream_error_callback__aaudio, (void*)pDevice); + *ppBuilder = pBuilder; - resultAA = ((MA_PFN_AAudioStreamBuilder_openStream)pContext->aaudio.AAudioStreamBuilder_openStream)(pBuilder, ppStream); - if (resultAA != MA_AAUDIO_OK) { - *ppStream = NULL; - ((MA_PFN_AAudioStreamBuilder_delete)pContext->aaudio.AAudioStreamBuilder_delete)(pBuilder); - return ma_result_from_aaudio(resultAA); - } - - ((MA_PFN_AAudioStreamBuilder_delete)pContext->aaudio.AAudioStreamBuilder_delete)(pBuilder); return MA_SUCCESS; } +static ma_result ma_open_stream_and_close_builder__aaudio(ma_context* pContext, ma_AAudioStreamBuilder* pBuilder, ma_AAudioStream** ppStream) +{ + ma_result result; + + result = ma_result_from_aaudio(((MA_PFN_AAudioStreamBuilder_openStream)pContext->aaudio.AAudioStreamBuilder_openStream)(pBuilder, ppStream)); + ((MA_PFN_AAudioStreamBuilder_delete)pContext->aaudio.AAudioStreamBuilder_delete)(pBuilder); + + return result; +} + +static ma_result ma_open_stream_basic__aaudio(ma_context* pContext, const ma_device_id* pDeviceID, ma_device_type deviceType, ma_share_mode shareMode, ma_AAudioStream** ppStream) +{ + ma_result result; + ma_AAudioStreamBuilder* pBuilder; + + *ppStream = NULL; + + result = ma_create_and_configure_AAudioStreamBuilder__aaudio(pContext, pDeviceID, deviceType, shareMode, NULL, NULL, NULL, &pBuilder); + if (result != MA_SUCCESS) { + return result; + } + + return ma_open_stream_and_close_builder__aaudio(pContext, pBuilder, ppStream); +} + +static ma_result ma_open_stream__aaudio(ma_device* pDevice, const ma_device_config* pConfig, ma_device_type deviceType, const ma_device_descriptor* pDescriptor, ma_AAudioStream** ppStream) +{ + ma_result result; + ma_AAudioStreamBuilder* pBuilder; + + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pConfig->deviceType != ma_device_type_duplex); /* This function should not be called for a full-duplex device type. */ + + *ppStream = NULL; + + result = ma_create_and_configure_AAudioStreamBuilder__aaudio(pDevice->pContext, pDescriptor->pDeviceID, deviceType, pDescriptor->shareMode, pDescriptor, pConfig, pDevice, &pBuilder); + if (result != MA_SUCCESS) { + return result; + } + + return ma_open_stream_and_close_builder__aaudio(pDevice->pContext, pBuilder, ppStream); +} + static ma_result ma_close_stream__aaudio(ma_context* pContext, ma_AAudioStream* pStream) { return ma_result_from_aaudio(((MA_PFN_AAudioStream_close)pContext->aaudio.AAudioStream_close)(pStream)); @@ -29833,7 +29717,7 @@ static ma_bool32 ma_has_default_device__aaudio(ma_context* pContext, ma_device_t { /* The only way to know this is to try creating a stream. */ ma_AAudioStream* pStream; - ma_result result = ma_open_stream__aaudio(pContext, deviceType, NULL, ma_share_mode_shared, NULL, NULL, &pStream); + ma_result result = ma_open_stream_basic__aaudio(pContext, NULL, deviceType, ma_share_mode_shared, &pStream); if (result != MA_SUCCESS) { return MA_FALSE; } @@ -29894,18 +29778,33 @@ static ma_result ma_context_enumerate_devices__aaudio(ma_context* pContext, ma_e return MA_SUCCESS; } -static ma_result ma_context_get_device_info__aaudio(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_share_mode shareMode, ma_device_info* pDeviceInfo) +static void ma_context_add_native_data_format_from_AAudioStream_ex__aaudio(ma_context* pContext, ma_AAudioStream* pStream, ma_format format, ma_uint32 flags, ma_device_info* pDeviceInfo) +{ + MA_ASSERT(pContext != NULL); + MA_ASSERT(pStream != NULL); + MA_ASSERT(pDeviceInfo != NULL); + + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].format = format; + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].channels = ((MA_PFN_AAudioStream_getChannelCount)pContext->aaudio.AAudioStream_getChannelCount)(pStream); + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].sampleRate = ((MA_PFN_AAudioStream_getSampleRate)pContext->aaudio.AAudioStream_getSampleRate)(pStream); + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].flags = flags; + pDeviceInfo->nativeDataFormatCount += 1; +} + +static void ma_context_add_native_data_format_from_AAudioStream__aaudio(ma_context* pContext, ma_AAudioStream* pStream, ma_uint32 flags, ma_device_info* pDeviceInfo) +{ + /* AAudio supports s16 and f32. */ + ma_context_add_native_data_format_from_AAudioStream_ex__aaudio(pContext, pStream, ma_format_f32, flags, pDeviceInfo); + ma_context_add_native_data_format_from_AAudioStream_ex__aaudio(pContext, pStream, ma_format_s16, flags, pDeviceInfo); +} + +static ma_result ma_context_get_device_info__aaudio(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_device_info* pDeviceInfo) { ma_AAudioStream* pStream; ma_result result; MA_ASSERT(pContext != NULL); - /* No exclusive mode with AAudio. */ - if (shareMode == ma_share_mode_exclusive) { - return MA_SHARE_MODE_NOT_SUPPORTED; - } - /* ID */ if (pDeviceID != NULL) { pDeviceInfo->id.aaudio = pDeviceID->aaudio; @@ -29921,31 +29820,24 @@ static ma_result ma_context_get_device_info__aaudio(ma_context* pContext, ma_dev } + pDeviceInfo->nativeDataFormatCount = 0; + /* We'll need to open the device to get accurate sample rate and channel count information. */ - result = ma_open_stream__aaudio(pContext, deviceType, pDeviceID, shareMode, NULL, NULL, &pStream); + result = ma_open_stream_basic__aaudio(pContext, pDeviceID, deviceType, ma_share_mode_shared, &pStream); if (result != MA_SUCCESS) { return result; } - pDeviceInfo->minChannels = ((MA_PFN_AAudioStream_getChannelCount)pContext->aaudio.AAudioStream_getChannelCount)(pStream); - pDeviceInfo->maxChannels = pDeviceInfo->minChannels; - pDeviceInfo->minSampleRate = ((MA_PFN_AAudioStream_getSampleRate)pContext->aaudio.AAudioStream_getSampleRate)(pStream); - pDeviceInfo->maxSampleRate = pDeviceInfo->minSampleRate; + ma_context_add_native_data_format_from_AAudioStream__aaudio(pContext, pStream, 0, pDeviceInfo); ma_close_stream__aaudio(pContext, pStream); pStream = NULL; - - /* AAudio supports s16 and f32. */ - pDeviceInfo->formatCount = 2; - pDeviceInfo->formats[0] = ma_format_s16; - pDeviceInfo->formats[1] = ma_format_f32; - return MA_SUCCESS; } -static void ma_device_uninit__aaudio(ma_device* pDevice) +static ma_result ma_device_uninit__aaudio(ma_device* pDevice) { MA_ASSERT(pDevice != NULL); @@ -29959,12 +29851,57 @@ static void ma_device_uninit__aaudio(ma_device* pDevice) pDevice->aaudio.pStreamPlayback = NULL; } - if (pDevice->type == ma_device_type_duplex) { - ma_pcm_rb_uninit(&pDevice->aaudio.duplexRB); - } + return MA_SUCCESS; } -static ma_result ma_device_init__aaudio(ma_context* pContext, const ma_device_config* pConfig, ma_device* pDevice) +static ma_result ma_device_init_by_type__aaudio(ma_device* pDevice, const ma_device_config* pConfig, ma_device_type deviceType, ma_device_descriptor* pDescriptor, ma_AAudioStream** ppStream) +{ + ma_result result; + int32_t bufferCapacityInFrames; + int32_t framesPerDataCallback; + ma_AAudioStream* pStream; + + MA_ASSERT(pDevice != NULL); + MA_ASSERT(pConfig != NULL); + MA_ASSERT(pDescriptor != NULL); + + *ppStream = NULL; /* Safety. */ + + /* First step is to open the stream. From there we'll be able to extract the internal configuration. */ + result = ma_open_stream__aaudio(pDevice, pConfig, deviceType, pDescriptor, &pStream); + if (result != MA_SUCCESS) { + return result; /* Failed to open the AAudio stream. */ + } + + /* Now extract the internal configuration. */ + pDescriptor->format = (((MA_PFN_AAudioStream_getFormat)pDevice->pContext->aaudio.AAudioStream_getFormat)(pStream) == MA_AAUDIO_FORMAT_PCM_I16) ? ma_format_s16 : ma_format_f32; + pDescriptor->channels = ((MA_PFN_AAudioStream_getChannelCount)pDevice->pContext->aaudio.AAudioStream_getChannelCount)(pStream); + pDescriptor->sampleRate = ((MA_PFN_AAudioStream_getSampleRate)pDevice->pContext->aaudio.AAudioStream_getSampleRate)(pStream); + + /* For the channel map we need to be sure we don't overflow any buffers. */ + if (pDescriptor->channels <= MA_MAX_CHANNELS) { + ma_get_standard_channel_map(ma_standard_channel_map_default, pDescriptor->channels, pDescriptor->channelMap); /* <-- Cannot find info on channel order, so assuming a default. */ + } else { + ma_channel_map_init_blank(MA_MAX_CHANNELS, pDescriptor->channelMap); /* Too many channels. Use a blank channel map. */ + } + + bufferCapacityInFrames = ((MA_PFN_AAudioStream_getBufferCapacityInFrames)pDevice->pContext->aaudio.AAudioStream_getBufferCapacityInFrames)(pStream); + framesPerDataCallback = ((MA_PFN_AAudioStream_getFramesPerDataCallback)pDevice->pContext->aaudio.AAudioStream_getFramesPerDataCallback)(pStream); + + if (framesPerDataCallback > 0) { + pDescriptor->periodSizeInFrames = framesPerDataCallback; + pDescriptor->periodCount = bufferCapacityInFrames / framesPerDataCallback; + } else { + pDescriptor->periodSizeInFrames = bufferCapacityInFrames; + pDescriptor->periodCount = 1; + } + + *ppStream = pStream; + + return MA_SUCCESS; +} + +static ma_result ma_device_init__aaudio(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptorPlayback, ma_device_descriptor* pDescriptorCapture) { ma_result result; @@ -29975,86 +29912,22 @@ static ma_result ma_device_init__aaudio(ma_context* pContext, const ma_device_co } /* No exclusive mode with AAudio. */ - if (((pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) && pConfig->playback.shareMode == ma_share_mode_exclusive) || - ((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) && pConfig->capture.shareMode == ma_share_mode_exclusive)) { + if (((pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) && pDescriptorPlayback->shareMode == ma_share_mode_exclusive) || + ((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) && pDescriptorCapture->shareMode == ma_share_mode_exclusive)) { return MA_SHARE_MODE_NOT_SUPPORTED; } - /* We first need to try opening the stream. */ if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) { - int32_t bufferCapacityInFrames; - int32_t framesPerDataCallback; - - result = ma_open_stream__aaudio(pContext, ma_device_type_capture, pConfig->capture.pDeviceID, pConfig->capture.shareMode, pConfig, pDevice, (ma_AAudioStream**)&pDevice->aaudio.pStreamCapture); + result = ma_device_init_by_type__aaudio(pDevice, pConfig, ma_device_type_capture, pDescriptorCapture, (ma_AAudioStream**)&pDevice->aaudio.pStreamCapture); if (result != MA_SUCCESS) { - return result; /* Failed to open the AAudio stream. */ - } - - pDevice->capture.internalFormat = (((MA_PFN_AAudioStream_getFormat)pContext->aaudio.AAudioStream_getFormat)((ma_AAudioStream*)pDevice->aaudio.pStreamCapture) == MA_AAUDIO_FORMAT_PCM_I16) ? ma_format_s16 : ma_format_f32; - pDevice->capture.internalChannels = ((MA_PFN_AAudioStream_getChannelCount)pContext->aaudio.AAudioStream_getChannelCount)((ma_AAudioStream*)pDevice->aaudio.pStreamCapture); - pDevice->capture.internalSampleRate = ((MA_PFN_AAudioStream_getSampleRate)pContext->aaudio.AAudioStream_getSampleRate)((ma_AAudioStream*)pDevice->aaudio.pStreamCapture); - ma_get_standard_channel_map(ma_standard_channel_map_default, pDevice->capture.internalChannels, pDevice->capture.internalChannelMap); /* <-- Cannot find info on channel order, so assuming a default. */ - - bufferCapacityInFrames = ((MA_PFN_AAudioStream_getBufferCapacityInFrames)pContext->aaudio.AAudioStream_getBufferCapacityInFrames)((ma_AAudioStream*)pDevice->aaudio.pStreamCapture); - framesPerDataCallback = ((MA_PFN_AAudioStream_getFramesPerDataCallback)pContext->aaudio.AAudioStream_getFramesPerDataCallback)((ma_AAudioStream*)pDevice->aaudio.pStreamCapture); - - if (framesPerDataCallback > 0) { - pDevice->capture.internalPeriodSizeInFrames = framesPerDataCallback; - pDevice->capture.internalPeriods = bufferCapacityInFrames / framesPerDataCallback; - } else { - pDevice->capture.internalPeriodSizeInFrames = bufferCapacityInFrames; - pDevice->capture.internalPeriods = 1; + return result; } } if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { - int32_t bufferCapacityInFrames; - int32_t framesPerDataCallback; - - result = ma_open_stream__aaudio(pContext, ma_device_type_playback, pConfig->playback.pDeviceID, pConfig->playback.shareMode, pConfig, pDevice, (ma_AAudioStream**)&pDevice->aaudio.pStreamPlayback); + result = ma_device_init_by_type__aaudio(pDevice, pConfig, ma_device_type_playback, pDescriptorPlayback, (ma_AAudioStream**)&pDevice->aaudio.pStreamPlayback); if (result != MA_SUCCESS) { - return result; /* Failed to open the AAudio stream. */ - } - - pDevice->playback.internalFormat = (((MA_PFN_AAudioStream_getFormat)pContext->aaudio.AAudioStream_getFormat)((ma_AAudioStream*)pDevice->aaudio.pStreamPlayback) == MA_AAUDIO_FORMAT_PCM_I16) ? ma_format_s16 : ma_format_f32; - pDevice->playback.internalChannels = ((MA_PFN_AAudioStream_getChannelCount)pContext->aaudio.AAudioStream_getChannelCount)((ma_AAudioStream*)pDevice->aaudio.pStreamPlayback); - pDevice->playback.internalSampleRate = ((MA_PFN_AAudioStream_getSampleRate)pContext->aaudio.AAudioStream_getSampleRate)((ma_AAudioStream*)pDevice->aaudio.pStreamPlayback); - ma_get_standard_channel_map(ma_standard_channel_map_default, pDevice->playback.internalChannels, pDevice->playback.internalChannelMap); /* <-- Cannot find info on channel order, so assuming a default. */ - - bufferCapacityInFrames = ((MA_PFN_AAudioStream_getBufferCapacityInFrames)pContext->aaudio.AAudioStream_getBufferCapacityInFrames)((ma_AAudioStream*)pDevice->aaudio.pStreamPlayback); - framesPerDataCallback = ((MA_PFN_AAudioStream_getFramesPerDataCallback)pContext->aaudio.AAudioStream_getFramesPerDataCallback)((ma_AAudioStream*)pDevice->aaudio.pStreamPlayback); - - if (framesPerDataCallback > 0) { - pDevice->playback.internalPeriodSizeInFrames = framesPerDataCallback; - pDevice->playback.internalPeriods = bufferCapacityInFrames / framesPerDataCallback; - } else { - pDevice->playback.internalPeriodSizeInFrames = bufferCapacityInFrames; - pDevice->playback.internalPeriods = 1; - } - } - - if (pConfig->deviceType == ma_device_type_duplex) { - ma_uint32 rbSizeInFrames = (ma_uint32)ma_calculate_frame_count_after_resampling(pDevice->sampleRate, pDevice->capture.internalSampleRate, pDevice->capture.internalPeriodSizeInFrames) * pDevice->capture.internalPeriods; - ma_result result = ma_pcm_rb_init(pDevice->capture.format, pDevice->capture.channels, rbSizeInFrames, NULL, &pDevice->pContext->allocationCallbacks, &pDevice->aaudio.duplexRB); - if (result != MA_SUCCESS) { - if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { - ma_close_stream__aaudio(pDevice->pContext, (ma_AAudioStream*)pDevice->aaudio.pStreamCapture); - } - if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { - ma_close_stream__aaudio(pDevice->pContext, (ma_AAudioStream*)pDevice->aaudio.pStreamPlayback); - } - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[AAudio] Failed to initialize ring buffer.", result); - } - - /* We need a period to act as a buffer for cases where the playback and capture device's end up desyncing. */ - { - ma_uint32 marginSizeInFrames = rbSizeInFrames / pDevice->capture.internalPeriods; - void* pMarginData; - ma_pcm_rb_acquire_write(&pDevice->aaudio.duplexRB, &marginSizeInFrames, &pMarginData); - { - MA_ZERO_MEMORY(pMarginData, marginSizeInFrames * ma_get_bytes_per_frame(pDevice->capture.format, pDevice->capture.channels)); - } - ma_pcm_rb_commit_write(&pDevice->aaudio.duplexRB, marginSizeInFrames, pMarginData); + return result; } } @@ -30195,7 +30068,7 @@ static ma_result ma_context_uninit__aaudio(ma_context* pContext) return MA_SUCCESS; } -static ma_result ma_context_init__aaudio(const ma_context_config* pConfig, ma_context* pContext) +static ma_result ma_context_init__aaudio(ma_context* pContext, const ma_context_config* pConfig, ma_backend_callbacks* pCallbacks) { size_t i; const char* libNames[] = { @@ -30242,15 +30115,18 @@ static ma_result ma_context_init__aaudio(const ma_context_config* pConfig, ma_co pContext->aaudio.AAudioStream_requestStart = (ma_proc)ma_dlsym(pContext, pContext->aaudio.hAAudio, "AAudioStream_requestStart"); pContext->aaudio.AAudioStream_requestStop = (ma_proc)ma_dlsym(pContext, pContext->aaudio.hAAudio, "AAudioStream_requestStop"); - pContext->isBackendAsynchronous = MA_TRUE; - pContext->onUninit = ma_context_uninit__aaudio; - pContext->onEnumDevices = ma_context_enumerate_devices__aaudio; - pContext->onGetDeviceInfo = ma_context_get_device_info__aaudio; - pContext->onDeviceInit = ma_device_init__aaudio; - pContext->onDeviceUninit = ma_device_uninit__aaudio; - pContext->onDeviceStart = ma_device_start__aaudio; - pContext->onDeviceStop = ma_device_stop__aaudio; + pCallbacks->onContextInit = ma_context_init__aaudio; + pCallbacks->onContextUninit = ma_context_uninit__aaudio; + pCallbacks->onContextEnumerateDevices = ma_context_enumerate_devices__aaudio; + pCallbacks->onContextGetDeviceInfo = ma_context_get_device_info__aaudio; + pCallbacks->onDeviceInit = ma_device_init__aaudio; + pCallbacks->onDeviceUninit = ma_device_uninit__aaudio; + pCallbacks->onDeviceStart = ma_device_start__aaudio; + pCallbacks->onDeviceStop = ma_device_stop__aaudio; + pCallbacks->onDeviceRead = NULL; /* Not used because AAudio is asynchronous. */ + pCallbacks->onDeviceWrite = NULL; /* Not used because AAudio is asynchronous. */ + pCallbacks->onDeviceDataLoop = NULL; /* Not used because AAudio is asynchronous. */ (void)pConfig; return MA_SUCCESS; @@ -30596,7 +30472,45 @@ return_default_device:; return MA_SUCCESS; } -static ma_result ma_context_get_device_info__opensl(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_share_mode shareMode, ma_device_info* pDeviceInfo) +static void ma_context_add_data_format_ex__opensl(ma_context* pContext, ma_format format, ma_uint32 channels, ma_uint32 sampleRate, ma_device_info* pDeviceInfo) +{ + MA_ASSERT(pContext != NULL); + MA_ASSERT(pDeviceInfo != NULL); + + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].format = format; + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].channels = channels; + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].sampleRate = sampleRate; + pDeviceInfo->nativeDataFormats[pDeviceInfo->nativeDataFormatCount].flags = 0; + pDeviceInfo->nativeDataFormatCount += 1; +} + +static void ma_context_add_data_format__opensl(ma_context* pContext, ma_format format, ma_device_info* pDeviceInfo) +{ + ma_uint32 minChannels = 1; + ma_uint32 maxChannels = 2; + ma_uint32 minSampleRate = (ma_uint32)ma_standard_sample_rate_8000; + ma_uint32 maxSampleRate = (ma_uint32)ma_standard_sample_rate_48000; + ma_uint32 iChannel; + ma_uint32 iSampleRate; + + MA_ASSERT(pContext != NULL); + MA_ASSERT(pDeviceInfo != NULL); + + /* + Each sample format can support mono and stereo, and we'll support a small subset of standard + rates (up to 48000). A better solution would be to somehow find a native sample rate. + */ + for (iChannel = minChannels; iChannel < maxChannels; iChannel += 1) { + for (iSampleRate = 0; iSampleRate < ma_countof(g_maStandardSampleRatePriorities); iSampleRate += 1) { + ma_uint32 standardSampleRate = g_maStandardSampleRatePriorities[iSampleRate]; + if (standardSampleRate >= minSampleRate && standardSampleRate <= maxSampleRate) { + ma_context_add_data_format_ex__opensl(pContext, format, iChannel, standardSampleRate, pDeviceInfo); + } + } + } +} + +static ma_result ma_context_get_device_info__opensl(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_device_info* pDeviceInfo) { MA_ASSERT(pContext != NULL); @@ -30605,11 +30519,6 @@ static ma_result ma_context_get_device_info__opensl(ma_context* pContext, ma_dev return MA_INVALID_OPERATION; } - /* No exclusive mode with OpenSL|ES. */ - if (shareMode == ma_share_mode_exclusive) { - return MA_SHARE_MODE_NOT_SUPPORTED; - } - /* TODO: Test Me. @@ -30661,6 +30570,8 @@ return_default_device: ma_strncpy_s(pDeviceInfo->name, sizeof(pDeviceInfo->name), MA_DEFAULT_CAPTURE_DEVICE_NAME, (size_t)-1); } + pDeviceInfo->isDefault = MA_TRUE; + goto return_detailed_info; @@ -30671,17 +30582,12 @@ return_detailed_info: by the device natively. Later on we should work on this so that it more closely reflects the device's actual native format. */ - pDeviceInfo->minChannels = 1; - pDeviceInfo->maxChannels = 2; - pDeviceInfo->minSampleRate = 8000; - pDeviceInfo->maxSampleRate = 48000; - pDeviceInfo->formatCount = 2; - pDeviceInfo->formats[0] = ma_format_u8; - pDeviceInfo->formats[1] = ma_format_s16; + pDeviceInfo->nativeDataFormatCount = 0; #if defined(MA_ANDROID) && __ANDROID_API__ >= 21 - pDeviceInfo->formats[pDeviceInfo->formatCount] = ma_format_f32; - pDeviceInfo->formatCount += 1; + ma_context_add_data_format__opensl(pContext, ma_format_f32, pDeviceInfo); #endif + ma_context_add_data_format__opensl(pContext, ma_format_s16, pDeviceInfo); + ma_context_add_data_format__opensl(pContext, ma_format_u8, pDeviceInfo); return MA_SUCCESS; } @@ -30719,11 +30625,7 @@ static void ma_buffer_queue_callback_capture__opensl_android(SLAndroidSimpleBuff periodSizeInBytes = pDevice->capture.internalPeriodSizeInFrames * ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels); pBuffer = pDevice->opensl.pBufferCapture + (pDevice->opensl.currentBufferIndexCapture * periodSizeInBytes); - if (pDevice->type == ma_device_type_duplex) { - ma_device__handle_duplex_callback_capture(pDevice, pDevice->capture.internalPeriodSizeInFrames, pBuffer, &pDevice->opensl.duplexRB); - } else { - ma_device__send_frames_to_client(pDevice, pDevice->capture.internalPeriodSizeInFrames, pBuffer); - } + ma_device_handle_backend_data_callback(pDevice, NULL, pBuffer, pDevice->capture.internalPeriodSizeInFrames); resultSL = MA_OPENSL_BUFFERQUEUE(pDevice->opensl.pBufferQueueCapture)->Enqueue((SLAndroidSimpleBufferQueueItf)pDevice->opensl.pBufferQueueCapture, pBuffer, periodSizeInBytes); if (resultSL != SL_RESULT_SUCCESS) { @@ -30757,11 +30659,7 @@ static void ma_buffer_queue_callback_playback__opensl_android(SLAndroidSimpleBuf periodSizeInBytes = pDevice->playback.internalPeriodSizeInFrames * ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels); pBuffer = pDevice->opensl.pBufferPlayback + (pDevice->opensl.currentBufferIndexPlayback * periodSizeInBytes); - if (pDevice->type == ma_device_type_duplex) { - ma_device__handle_duplex_callback_playback(pDevice, pDevice->playback.internalPeriodSizeInFrames, pBuffer, &pDevice->opensl.duplexRB); - } else { - ma_device__read_frames_from_client(pDevice, pDevice->playback.internalPeriodSizeInFrames, pBuffer); - } + ma_device_handle_backend_data_callback(pDevice, pBuffer, NULL, pDevice->playback.internalPeriodSizeInFrames); resultSL = MA_OPENSL_BUFFERQUEUE(pDevice->opensl.pBufferQueuePlayback)->Enqueue((SLAndroidSimpleBufferQueueItf)pDevice->opensl.pBufferQueuePlayback, pBuffer, periodSizeInBytes); if (resultSL != SL_RESULT_SUCCESS) { @@ -30772,13 +30670,13 @@ static void ma_buffer_queue_callback_playback__opensl_android(SLAndroidSimpleBuf } #endif -static void ma_device_uninit__opensl(ma_device* pDevice) +static ma_result ma_device_uninit__opensl(ma_device* pDevice) { MA_ASSERT(pDevice != NULL); MA_ASSERT(g_maOpenSLInitCounter > 0); /* <-- If you trigger this it means you've either not initialized the context, or you've uninitialized it before uninitializing the device. */ if (g_maOpenSLInitCounter == 0) { - return; + return MA_INVALID_OPERATION; } if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { @@ -30800,9 +30698,7 @@ static void ma_device_uninit__opensl(ma_device* pDevice) ma__free_from_callbacks(pDevice->opensl.pBufferPlayback, &pDevice->pContext->allocationCallbacks); } - if (pDevice->type == ma_device_type_duplex) { - ma_pcm_rb_uninit(&pDevice->opensl.duplexRB); - } + return MA_SUCCESS; } #if defined(MA_ANDROID) && __ANDROID_API__ >= 21 @@ -30813,6 +30709,17 @@ typedef SLDataFormat_PCM ma_SLDataFormat_PCM; static ma_result ma_SLDataFormat_PCM_init__opensl(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, const ma_channel* channelMap, ma_SLDataFormat_PCM* pDataFormat) { + /* We need to convert our format/channels/rate so that they aren't set to default. */ + if (format == ma_format_unknown) { + format = MA_DEFAULT_FORMAT; + } + if (channels == 0) { + channels = MA_DEFAULT_CHANNELS; + } + if (sampleRate == 0) { + sampleRate = MA_DEFAULT_SAMPLE_RATE; + } + #if defined(MA_ANDROID) && __ANDROID_API__ >= 21 if (format == ma_format_f32) { pDataFormat->formatType = SL_ANDROID_DATAFORMAT_PCM_EX; @@ -30825,7 +30732,7 @@ static ma_result ma_SLDataFormat_PCM_init__opensl(ma_format format, ma_uint32 ch #endif pDataFormat->numChannels = channels; - ((SLDataFormat_PCM*)pDataFormat)->samplesPerSec = ma_round_to_standard_sample_rate__opensl(sampleRate * 1000); /* In millihertz. Annoyingly, the sample rate variable is named differently between SLAndroidDataFormat_PCM_EX and SLDataFormat_PCM */ + ((SLDataFormat_PCM*)pDataFormat)->samplesPerSec = ma_round_to_standard_sample_rate__opensl(sampleRate) * 1000; /* In millihertz. Annoyingly, the sample rate variable is named differently between SLAndroidDataFormat_PCM_EX and SLDataFormat_PCM */ pDataFormat->bitsPerSample = ma_get_bytes_per_sample(format)*8; pDataFormat->channelMask = ma_channel_map_to_channel_mask__opensl(channelMap, channels); pDataFormat->endianness = (ma_is_little_endian()) ? SL_BYTEORDER_LITTLEENDIAN : SL_BYTEORDER_BIGENDIAN; @@ -30899,19 +30806,16 @@ static ma_result ma_deconstruct_SLDataFormat_PCM__opensl(ma_SLDataFormat_PCM* pD return MA_SUCCESS; } -static ma_result ma_device_init__opensl(ma_context* pContext, const ma_device_config* pConfig, ma_device* pDevice) +static ma_result ma_device_init__opensl(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptorPlayback, ma_device_descriptor* pDescriptorCapture) { #ifdef MA_ANDROID SLDataLocator_AndroidSimpleBufferQueue queue; SLresult resultSL; - ma_uint32 periodSizeInFrames; size_t bufferSizeInBytes; SLInterfaceID itfIDs1[1]; const SLboolean itfIDsRequired1[] = {SL_BOOLEAN_TRUE}; #endif - (void)pContext; - MA_ASSERT(g_maOpenSLInitCounter > 0); /* <-- If you trigger this it means you've either not initialized the context, or you've uninitialized it and then attempted to initialize a new device. */ if (g_maOpenSLInitCounter == 0) { return MA_INVALID_OPERATION; @@ -30927,11 +30831,11 @@ static ma_result ma_device_init__opensl(ma_context* pContext, const ma_device_co queues). */ #ifdef MA_ANDROID - itfIDs1[0] = (SLInterfaceID)pContext->opensl.SL_IID_ANDROIDSIMPLEBUFFERQUEUE; + itfIDs1[0] = (SLInterfaceID)pDevice->pContext->opensl.SL_IID_ANDROIDSIMPLEBUFFERQUEUE; /* No exclusive mode with OpenSL|ES. */ - if (((pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) && pConfig->playback.shareMode == ma_share_mode_exclusive) || - ((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) && pConfig->capture.shareMode == ma_share_mode_exclusive)) { + if (((pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) && pDescriptorPlayback->shareMode == ma_share_mode_exclusive) || + ((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) && pDescriptorCapture->shareMode == ma_share_mode_exclusive)) { return MA_SHARE_MODE_NOT_SUPPORTED; } @@ -30940,8 +30844,6 @@ static ma_result ma_device_init__opensl(ma_context* pContext, const ma_device_co MA_ZERO_OBJECT(&pDevice->opensl); queue.locatorType = SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE; - queue.numBuffers = pConfig->periods; - if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) { ma_SLDataFormat_PCM pcm; @@ -30950,16 +30852,18 @@ static ma_result ma_device_init__opensl(ma_context* pContext, const ma_device_co SLDataSink sink; SLAndroidConfigurationItf pRecorderConfig; - ma_SLDataFormat_PCM_init__opensl(pConfig->capture.format, pConfig->capture.channels, pConfig->sampleRate, pConfig->capture.channelMap, &pcm); + ma_SLDataFormat_PCM_init__opensl(pDescriptorCapture->format, pDescriptorCapture->channels, pDescriptorCapture->sampleRate, pDescriptorCapture->channelMap, &pcm); locatorDevice.locatorType = SL_DATALOCATOR_IODEVICE; locatorDevice.deviceType = SL_IODEVICE_AUDIOINPUT; - locatorDevice.deviceID = (pConfig->capture.pDeviceID == NULL) ? SL_DEFAULTDEVICEID_AUDIOINPUT : pConfig->capture.pDeviceID->opensl; + locatorDevice.deviceID = (pDescriptorCapture->pDeviceID == NULL) ? SL_DEFAULTDEVICEID_AUDIOINPUT : pDescriptorCapture->pDeviceID->opensl; locatorDevice.device = NULL; source.pLocator = &locatorDevice; source.pFormat = NULL; + queue.numBuffers = pDescriptorCapture->periodCount; + sink.pLocator = &queue; sink.pFormat = (SLDataFormat_PCM*)&pcm; @@ -30983,7 +30887,7 @@ static ma_result ma_device_init__opensl(ma_context* pContext, const ma_device_co /* Set the recording preset before realizing the player. */ if (pConfig->opensl.recordingPreset != ma_opensl_recording_preset_default) { - resultSL = MA_OPENSL_OBJ(pDevice->opensl.pAudioPlayerObj)->GetInterface((SLObjectItf)pDevice->opensl.pAudioPlayerObj, (SLInterfaceID)pContext->opensl.SL_IID_ANDROIDCONFIGURATION, &pRecorderConfig); + resultSL = MA_OPENSL_OBJ(pDevice->opensl.pAudioPlayerObj)->GetInterface((SLObjectItf)pDevice->opensl.pAudioPlayerObj, (SLInterfaceID)pDevice->pContext->opensl.SL_IID_ANDROIDCONFIGURATION, &pRecorderConfig); if (resultSL == SL_RESULT_SUCCESS) { SLint32 recordingPreset = ma_to_recording_preset__opensl(pConfig->opensl.recordingPreset); resultSL = (*pRecorderConfig)->SetConfiguration(pRecorderConfig, SL_ANDROID_KEY_RECORDING_PRESET, &recordingPreset, sizeof(SLint32)); @@ -30999,13 +30903,13 @@ static ma_result ma_device_init__opensl(ma_context* pContext, const ma_device_co return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OpenSL] Failed to realize audio recorder.", ma_result_from_OpenSL(resultSL)); } - resultSL = MA_OPENSL_OBJ(pDevice->opensl.pAudioRecorderObj)->GetInterface((SLObjectItf)pDevice->opensl.pAudioRecorderObj, (SLInterfaceID)pContext->opensl.SL_IID_RECORD, &pDevice->opensl.pAudioRecorder); + resultSL = MA_OPENSL_OBJ(pDevice->opensl.pAudioRecorderObj)->GetInterface((SLObjectItf)pDevice->opensl.pAudioRecorderObj, (SLInterfaceID)pDevice->pContext->opensl.SL_IID_RECORD, &pDevice->opensl.pAudioRecorder); if (resultSL != SL_RESULT_SUCCESS) { ma_device_uninit__opensl(pDevice); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OpenSL] Failed to retrieve SL_IID_RECORD interface.", ma_result_from_OpenSL(resultSL)); } - resultSL = MA_OPENSL_OBJ(pDevice->opensl.pAudioRecorderObj)->GetInterface((SLObjectItf)pDevice->opensl.pAudioRecorderObj, (SLInterfaceID)pContext->opensl.SL_IID_ANDROIDSIMPLEBUFFERQUEUE, &pDevice->opensl.pBufferQueueCapture); + resultSL = MA_OPENSL_OBJ(pDevice->opensl.pAudioRecorderObj)->GetInterface((SLObjectItf)pDevice->opensl.pAudioRecorderObj, (SLInterfaceID)pDevice->pContext->opensl.SL_IID_ANDROIDSIMPLEBUFFERQUEUE, &pDevice->opensl.pBufferQueueCapture); if (resultSL != SL_RESULT_SUCCESS) { ma_device_uninit__opensl(pDevice); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OpenSL] Failed to retrieve SL_IID_ANDROIDSIMPLEBUFFERQUEUE interface.", ma_result_from_OpenSL(resultSL)); @@ -31018,19 +30922,14 @@ static ma_result ma_device_init__opensl(ma_context* pContext, const ma_device_co } /* The internal format is determined by the "pcm" object. */ - ma_deconstruct_SLDataFormat_PCM__opensl(&pcm, &pDevice->capture.internalFormat, &pDevice->capture.internalChannels, &pDevice->capture.internalSampleRate, pDevice->capture.internalChannelMap, ma_countof(pDevice->capture.internalChannelMap)); + ma_deconstruct_SLDataFormat_PCM__opensl(&pcm, &pDescriptorCapture->format, &pDescriptorCapture->channels, &pDescriptorCapture->sampleRate, pDescriptorCapture->channelMap, ma_countof(pDescriptorCapture->channelMap)); /* Buffer. */ - periodSizeInFrames = pConfig->periodSizeInFrames; - if (periodSizeInFrames == 0) { - periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(pConfig->periodSizeInMilliseconds, pDevice->capture.internalSampleRate); - } - pDevice->capture.internalPeriods = pConfig->periods; - pDevice->capture.internalPeriodSizeInFrames = periodSizeInFrames; - pDevice->opensl.currentBufferIndexCapture = 0; + pDescriptorCapture->periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptorCapture, pDescriptorCapture->sampleRate, pConfig->performanceProfile); + pDevice->opensl.currentBufferIndexCapture = 0; - bufferSizeInBytes = pDevice->capture.internalPeriodSizeInFrames * ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels) * pDevice->capture.internalPeriods; - pDevice->opensl.pBufferCapture = (ma_uint8*)ma__calloc_from_callbacks(bufferSizeInBytes, &pContext->allocationCallbacks); + bufferSizeInBytes = pDescriptorCapture->periodSizeInFrames * ma_get_bytes_per_frame(pDescriptorCapture->format, pDescriptorCapture->channels) * pDescriptorCapture->periodCount; + pDevice->opensl.pBufferCapture = (ma_uint8*)ma__calloc_from_callbacks(bufferSizeInBytes, &pDevice->pContext->allocationCallbacks); if (pDevice->opensl.pBufferCapture == NULL) { ma_device_uninit__opensl(pDevice); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OpenSL] Failed to allocate memory for data buffer.", MA_OUT_OF_MEMORY); @@ -31045,7 +30944,7 @@ static ma_result ma_device_init__opensl(ma_context* pContext, const ma_device_co SLDataSink sink; SLAndroidConfigurationItf pPlayerConfig; - ma_SLDataFormat_PCM_init__opensl(pConfig->playback.format, pConfig->playback.channels, pConfig->sampleRate, pConfig->playback.channelMap, &pcm); + ma_SLDataFormat_PCM_init__opensl(pDescriptorPlayback->format, pDescriptorPlayback->channels, pDescriptorPlayback->sampleRate, pDescriptorPlayback->channelMap, &pcm); resultSL = (*g_maEngineSL)->CreateOutputMix(g_maEngineSL, (SLObjectItf*)&pDevice->opensl.pOutputMixObj, 0, NULL, NULL); if (resultSL != SL_RESULT_SUCCESS) { @@ -31059,18 +30958,20 @@ static ma_result ma_device_init__opensl(ma_context* pContext, const ma_device_co return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OpenSL] Failed to realize output mix object.", ma_result_from_OpenSL(resultSL)); } - resultSL = MA_OPENSL_OBJ(pDevice->opensl.pOutputMixObj)->GetInterface((SLObjectItf)pDevice->opensl.pOutputMixObj, (SLInterfaceID)pContext->opensl.SL_IID_OUTPUTMIX, &pDevice->opensl.pOutputMix); + resultSL = MA_OPENSL_OBJ(pDevice->opensl.pOutputMixObj)->GetInterface((SLObjectItf)pDevice->opensl.pOutputMixObj, (SLInterfaceID)pDevice->pContext->opensl.SL_IID_OUTPUTMIX, &pDevice->opensl.pOutputMix); if (resultSL != SL_RESULT_SUCCESS) { ma_device_uninit__opensl(pDevice); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OpenSL] Failed to retrieve SL_IID_OUTPUTMIX interface.", ma_result_from_OpenSL(resultSL)); } /* Set the output device. */ - if (pConfig->playback.pDeviceID != NULL) { - SLuint32 deviceID_OpenSL = pConfig->playback.pDeviceID->opensl; + if (pDescriptorPlayback->pDeviceID != NULL) { + SLuint32 deviceID_OpenSL = pDescriptorPlayback->pDeviceID->opensl; MA_OPENSL_OUTPUTMIX(pDevice->opensl.pOutputMix)->ReRoute((SLOutputMixItf)pDevice->opensl.pOutputMix, 1, &deviceID_OpenSL); } + queue.numBuffers = pDescriptorPlayback->periodCount; + source.pLocator = &queue; source.pFormat = (SLDataFormat_PCM*)&pcm; @@ -31100,7 +31001,7 @@ static ma_result ma_device_init__opensl(ma_context* pContext, const ma_device_co /* Set the stream type before realizing the player. */ if (pConfig->opensl.streamType != ma_opensl_stream_type_default) { - resultSL = MA_OPENSL_OBJ(pDevice->opensl.pAudioPlayerObj)->GetInterface((SLObjectItf)pDevice->opensl.pAudioPlayerObj, (SLInterfaceID)pContext->opensl.SL_IID_ANDROIDCONFIGURATION, &pPlayerConfig); + resultSL = MA_OPENSL_OBJ(pDevice->opensl.pAudioPlayerObj)->GetInterface((SLObjectItf)pDevice->opensl.pAudioPlayerObj, (SLInterfaceID)pDevice->pContext->opensl.SL_IID_ANDROIDCONFIGURATION, &pPlayerConfig); if (resultSL == SL_RESULT_SUCCESS) { SLint32 streamType = ma_to_stream_type__opensl(pConfig->opensl.streamType); resultSL = (*pPlayerConfig)->SetConfiguration(pPlayerConfig, SL_ANDROID_KEY_STREAM_TYPE, &streamType, sizeof(SLint32)); @@ -31116,13 +31017,13 @@ static ma_result ma_device_init__opensl(ma_context* pContext, const ma_device_co return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OpenSL] Failed to realize audio player.", ma_result_from_OpenSL(resultSL)); } - resultSL = MA_OPENSL_OBJ(pDevice->opensl.pAudioPlayerObj)->GetInterface((SLObjectItf)pDevice->opensl.pAudioPlayerObj, (SLInterfaceID)pContext->opensl.SL_IID_PLAY, &pDevice->opensl.pAudioPlayer); + resultSL = MA_OPENSL_OBJ(pDevice->opensl.pAudioPlayerObj)->GetInterface((SLObjectItf)pDevice->opensl.pAudioPlayerObj, (SLInterfaceID)pDevice->pContext->opensl.SL_IID_PLAY, &pDevice->opensl.pAudioPlayer); if (resultSL != SL_RESULT_SUCCESS) { ma_device_uninit__opensl(pDevice); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OpenSL] Failed to retrieve SL_IID_PLAY interface.", ma_result_from_OpenSL(resultSL)); } - resultSL = MA_OPENSL_OBJ(pDevice->opensl.pAudioPlayerObj)->GetInterface((SLObjectItf)pDevice->opensl.pAudioPlayerObj, (SLInterfaceID)pContext->opensl.SL_IID_ANDROIDSIMPLEBUFFERQUEUE, &pDevice->opensl.pBufferQueuePlayback); + resultSL = MA_OPENSL_OBJ(pDevice->opensl.pAudioPlayerObj)->GetInterface((SLObjectItf)pDevice->opensl.pAudioPlayerObj, (SLInterfaceID)pDevice->pContext->opensl.SL_IID_ANDROIDSIMPLEBUFFERQUEUE, &pDevice->opensl.pBufferQueuePlayback); if (resultSL != SL_RESULT_SUCCESS) { ma_device_uninit__opensl(pDevice); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OpenSL] Failed to retrieve SL_IID_ANDROIDSIMPLEBUFFERQUEUE interface.", ma_result_from_OpenSL(resultSL)); @@ -31135,19 +31036,14 @@ static ma_result ma_device_init__opensl(ma_context* pContext, const ma_device_co } /* The internal format is determined by the "pcm" object. */ - ma_deconstruct_SLDataFormat_PCM__opensl(&pcm, &pDevice->playback.internalFormat, &pDevice->playback.internalChannels, &pDevice->playback.internalSampleRate, pDevice->playback.internalChannelMap, ma_countof(pDevice->playback.internalChannelMap)); + ma_deconstruct_SLDataFormat_PCM__opensl(&pcm, &pDescriptorPlayback->format, &pDescriptorPlayback->channels, &pDescriptorPlayback->sampleRate, pDescriptorPlayback->channelMap, ma_countof(pDescriptorPlayback->channelMap)); /* Buffer. */ - periodSizeInFrames = pConfig->periodSizeInFrames; - if (periodSizeInFrames == 0) { - periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(pConfig->periodSizeInMilliseconds, pDevice->playback.internalSampleRate); - } - pDevice->playback.internalPeriods = pConfig->periods; - pDevice->playback.internalPeriodSizeInFrames = periodSizeInFrames; + pDescriptorPlayback->periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptorPlayback, pDescriptorPlayback->sampleRate, pConfig->performanceProfile); pDevice->opensl.currentBufferIndexPlayback = 0; - bufferSizeInBytes = pDevice->playback.internalPeriodSizeInFrames * ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels) * pDevice->playback.internalPeriods; - pDevice->opensl.pBufferPlayback = (ma_uint8*)ma__calloc_from_callbacks(bufferSizeInBytes, &pContext->allocationCallbacks); + bufferSizeInBytes = pDescriptorPlayback->periodSizeInFrames * ma_get_bytes_per_frame(pDescriptorPlayback->format, pDescriptorPlayback->channels) * pDescriptorPlayback->periodCount; + pDevice->opensl.pBufferPlayback = (ma_uint8*)ma__calloc_from_callbacks(bufferSizeInBytes, &pDevice->pContext->allocationCallbacks); if (pDevice->opensl.pBufferPlayback == NULL) { ma_device_uninit__opensl(pDevice); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OpenSL] Failed to allocate memory for data buffer.", MA_OUT_OF_MEMORY); @@ -31155,26 +31051,6 @@ static ma_result ma_device_init__opensl(ma_context* pContext, const ma_device_co MA_ZERO_MEMORY(pDevice->opensl.pBufferPlayback, bufferSizeInBytes); } - if (pConfig->deviceType == ma_device_type_duplex) { - ma_uint32 rbSizeInFrames = (ma_uint32)ma_calculate_frame_count_after_resampling(pDevice->sampleRate, pDevice->capture.internalSampleRate, pDevice->capture.internalPeriodSizeInFrames) * pDevice->capture.internalPeriods; - ma_result result = ma_pcm_rb_init(pDevice->capture.format, pDevice->capture.channels, rbSizeInFrames, NULL, &pDevice->pContext->allocationCallbacks, &pDevice->opensl.duplexRB); - if (result != MA_SUCCESS) { - ma_device_uninit__opensl(pDevice); - return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[OpenSL] Failed to initialize ring buffer.", result); - } - - /* We need a period to act as a buffer for cases where the playback and capture device's end up desyncing. */ - { - ma_uint32 marginSizeInFrames = rbSizeInFrames / pDevice->capture.internalPeriods; - void* pMarginData; - ma_pcm_rb_acquire_write(&pDevice->opensl.duplexRB, &marginSizeInFrames, &pMarginData); - { - MA_ZERO_MEMORY(pMarginData, marginSizeInFrames * ma_get_bytes_per_frame(pDevice->capture.format, pDevice->capture.channels)); - } - ma_pcm_rb_commit_write(&pDevice->opensl.duplexRB, marginSizeInFrames, pMarginData); - } - } - return MA_SUCCESS; #else return MA_NO_BACKEND; /* Non-Android implementations are not supported. */ @@ -31373,7 +31249,7 @@ static ma_result ma_context_init_engine_nolock__opensl(ma_context* pContext) return MA_SUCCESS; } -static ma_result ma_context_init__opensl(const ma_context_config* pConfig, ma_context* pContext) +static ma_result ma_context_init__opensl(ma_context* pContext, const ma_context_config* pConfig, ma_backend_callbacks* pCallbacks) { ma_result result; @@ -31480,16 +31356,17 @@ static ma_result ma_context_init__opensl(const ma_context_config* pConfig, ma_co return result; } - - pContext->isBackendAsynchronous = MA_TRUE; - - pContext->onUninit = ma_context_uninit__opensl; - pContext->onEnumDevices = ma_context_enumerate_devices__opensl; - pContext->onGetDeviceInfo = ma_context_get_device_info__opensl; - pContext->onDeviceInit = ma_device_init__opensl; - pContext->onDeviceUninit = ma_device_uninit__opensl; - pContext->onDeviceStart = ma_device_start__opensl; - pContext->onDeviceStop = ma_device_stop__opensl; + pCallbacks->onContextInit = ma_context_init__opensl; + pCallbacks->onContextUninit = ma_context_uninit__opensl; + pCallbacks->onContextEnumerateDevices = ma_context_enumerate_devices__opensl; + pCallbacks->onContextGetDeviceInfo = ma_context_get_device_info__opensl; + pCallbacks->onDeviceInit = ma_device_init__opensl; + pCallbacks->onDeviceUninit = ma_device_uninit__opensl; + pCallbacks->onDeviceStart = ma_device_start__opensl; + pCallbacks->onDeviceStop = ma_device_stop__opensl; + pCallbacks->onDeviceRead = NULL; /* Not needed because OpenSL|ES is asynchronous. */ + pCallbacks->onDeviceWrite = NULL; /* Not needed because OpenSL|ES is asynchronous. */ + pCallbacks->onDeviceDataLoop = NULL; /* Not needed because OpenSL|ES is asynchronous. */ return MA_SUCCESS; } @@ -31658,23 +31535,27 @@ static ma_result ma_device_uninit__webaudio(ma_device* pDevice) return MA_SUCCESS; } -static ma_uint32 ma_calculate_period_size_in_frames__dsound(ma_uint32 periodSizeInFrames, ma_uint32 periodSizeInMilliseconds, ma_uint32 sampleRate, ma_performance_profile performanceProfile) +static ma_uint32 ma_calculate_period_size_in_frames_from_descriptor__webaudio(const ma_device_descriptor* pDescriptor, ma_uint32 nativeSampleRate, ma_performance_profile performanceProfile) { /* There have been reports of the default buffer size being too small on some browsers. There have been reports of the default buffer size being too small on some browsers. If we're using default buffer size, we'll make sure the period size is a big biffer than our standard defaults. */ - if (periodSizeInFrames == 0) { - if (periodSizeInMilliseconds == 0) { + ma_uint32 periodSizeInFrames; + + if (pDescriptor->periodSizeInFrames == 0) { + if (pDescriptor->periodSizeInMilliseconds == 0) { if (performanceProfile == ma_performance_profile_low_latency) { - periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(33, sampleRate); /* 1 frame @ 30 FPS */ + periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(33, nativeSampleRate); /* 1 frame @ 30 FPS */ } else { - periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(333, sampleRate); + periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(333, nativeSampleRate); } } else { - periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(periodSizeInMilliseconds, sampleRate); + periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(pDescriptor->periodSizeInMilliseconds, nativeSampleRate); } + } else { + periodSizeInFrames = pDescriptor->periodSizeInFrames; } /* The size of the buffer must be a power of 2 and between 256 and 16384. */ @@ -31707,7 +31588,7 @@ static ma_result ma_device_init_by_type__webaudio(ma_device* pDevice, const ma_d /* We're going to calculate some stuff in C just to simplify the JS code. */ channels = (pDescriptor->channels > 0) ? pDescriptor->channels : MA_DEFAULT_CHANNELS; sampleRate = (pDescriptor->sampleRate > 0) ? pDescriptor->sampleRate : MA_DEFAULT_SAMPLE_RATE; - periodSizeInFrames = ma_calculate_period_size_in_frames__dsound(pDescriptor->periodSizeInFrames, pDescriptor->periodSizeInMilliseconds, pDescriptor->sampleRate, pConfig->performanceProfile); + periodSizeInFrames = ma_calculate_period_size_in_frames_from_descriptor__webaudio(pDescriptor, sampleRate, pConfig->performanceProfile); /* We create the device on the JavaScript side and reference it using an index. We use this to make it possible to reference the device between JavaScript and C. */ @@ -31727,6 +31608,7 @@ static ma_result ma_device_init_by_type__webaudio(ma_device* pDevice, const ma_d /* The AudioContext must be created in a suspended state. */ device.webaudio = new (window.AudioContext || window.webkitAudioContext)({sampleRate:sampleRate}); device.webaudio.suspend(); + device.state = 1; /* MA_STATE_STOPPED */ /* We need an intermediary buffer which we use for JavaScript and C interop. This buffer stores interleaved f32 PCM data. Because it's passed between @@ -31934,13 +31816,17 @@ static ma_result ma_device_start__webaudio(ma_device* pDevice) if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { EM_ASM({ - miniaudio.get_device_by_index($0).webaudio.resume(); + var device = miniaudio.get_device_by_index($0); + device.webaudio.resume(); + device.state = 2; /* MA_STATE_STARTED */ }, pDevice->webaudio.indexCapture); } if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { EM_ASM({ - miniaudio.get_device_by_index($0).webaudio.resume(); + var device = miniaudio.get_device_by_index($0); + device.webaudio.resume(); + device.state = 2; /* MA_STATE_STARTED */ }, pDevice->webaudio.indexPlayback); } @@ -31963,13 +31849,17 @@ static ma_result ma_device_stop__webaudio(ma_device* pDevice) if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { EM_ASM({ - miniaudio.get_device_by_index($0).webaudio.suspend(); + var device = miniaudio.get_device_by_index($0); + device.webaudio.suspend(); + device.state = 1; /* MA_STATE_STOPPED */ }, pDevice->webaudio.indexCapture); } if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { EM_ASM({ - miniaudio.get_device_by_index($0).webaudio.suspend(); + var device = miniaudio.get_device_by_index($0); + device.webaudio.suspend(); + device.state = 1; /* MA_STATE_STOPPED */ }, pDevice->webaudio.indexPlayback); } @@ -32049,6 +31939,26 @@ static ma_result ma_context_init__webaudio(ma_context* pContext, const ma_contex miniaudio.get_device_by_index = function(deviceIndex) { return miniaudio.devices[deviceIndex]; }; + + miniaudio.unlock_event_types = (function(){ + return ['touchstart', 'touchend', 'click']; + })(); + + miniaudio.unlock = function() { + for(var i = 0; i < miniaudio.devices.length; ++i) { + var device = miniaudio.devices[i]; + if (device != null && device.webaudio != null && device.state === 2 /* MA_STATE_STARTED */) { + device.webaudio.resume(); + } + } + miniaudio.unlock_event_types.map(function(event_type) { + document.removeEventListener(event_type, miniaudio.unlock, true); + }); + }; + + miniaudio.unlock_event_types.map(function(event_type) { + document.addEventListener(event_type, miniaudio.unlock, true); + }); } return 1; @@ -32068,7 +31978,7 @@ static ma_result ma_context_init__webaudio(ma_context* pContext, const ma_contex pCallbacks->onDeviceStop = ma_device_stop__webaudio; pCallbacks->onDeviceRead = NULL; /* Not needed because WebAudio is asynchronous. */ pCallbacks->onDeviceWrite = NULL; /* Not needed because WebAudio is asynchronous. */ - pCallbacks->onDeviceAudioThread = NULL; /* Not needed because WebAudio is asynchronous. */ + pCallbacks->onDeviceDataLoop = NULL; /* Not needed because WebAudio is asynchronous. */ return MA_SUCCESS; } @@ -32108,13 +32018,13 @@ static ma_result ma_device__post_init_setup(ma_device* pDevice, ma_device_type d MA_ASSERT(pDevice != NULL); if (deviceType == ma_device_type_capture || deviceType == ma_device_type_duplex) { - if (pDevice->capture.usingDefaultFormat) { + if (pDevice->capture.format == ma_format_unknown) { pDevice->capture.format = pDevice->capture.internalFormat; } - if (pDevice->capture.usingDefaultChannels) { + if (pDevice->capture.channels == 0) { pDevice->capture.channels = pDevice->capture.internalChannels; } - if (pDevice->capture.usingDefaultChannelMap) { + if (pDevice->capture.channelMap[0] == MA_CHANNEL_NONE) { MA_ASSERT(pDevice->capture.channels <= MA_MAX_CHANNELS); if (pDevice->capture.internalChannels == pDevice->capture.channels) { ma_channel_map_copy(pDevice->capture.channelMap, pDevice->capture.internalChannelMap, pDevice->capture.channels); @@ -32129,13 +32039,13 @@ static ma_result ma_device__post_init_setup(ma_device* pDevice, ma_device_type d } if (deviceType == ma_device_type_playback || deviceType == ma_device_type_duplex) { - if (pDevice->playback.usingDefaultFormat) { + if (pDevice->playback.format == ma_format_unknown) { pDevice->playback.format = pDevice->playback.internalFormat; } - if (pDevice->playback.usingDefaultChannels) { + if (pDevice->playback.channels == 0) { pDevice->playback.channels = pDevice->playback.internalChannels; } - if (pDevice->playback.usingDefaultChannelMap) { + if (pDevice->playback.channelMap[0] == MA_CHANNEL_NONE) { MA_ASSERT(pDevice->playback.channels <= MA_MAX_CHANNELS); if (pDevice->playback.internalChannels == pDevice->playback.channels) { ma_channel_map_copy(pDevice->playback.channelMap, pDevice->playback.internalChannelMap, pDevice->playback.channels); @@ -32149,7 +32059,7 @@ static ma_result ma_device__post_init_setup(ma_device* pDevice, ma_device_type d } } - if (pDevice->usingDefaultSampleRate) { + if (pDevice->sampleRate == 0) { if (deviceType == ma_device_type_capture || deviceType == ma_device_type_duplex) { pDevice->sampleRate = pDevice->capture.internalSampleRate; } else { @@ -32208,15 +32118,6 @@ static ma_result ma_device__post_init_setup(ma_device* pDevice, ma_device_type d } -/* TEMP: Helper for determining whether or not a context is using the new callback system. Eventually all backends will be using the new callback system. */ -static ma_bool32 ma_context__is_using_new_callbacks(ma_context* pContext) -{ - MA_ASSERT(pContext != NULL); - - return pContext->callbacks.onContextInit != NULL; -} - - static ma_thread_result MA_THREADCALL ma_worker_thread(void* pData) { ma_device* pDevice = (ma_device*)pData; @@ -32268,19 +32169,11 @@ static ma_thread_result MA_THREADCALL ma_worker_thread(void* pData) ma_device__set_state(pDevice, MA_STATE_STARTED); ma_event_signal(&pDevice->startEvent); - if (ma_context__is_using_new_callbacks(pDevice->pContext)) { - if (pDevice->pContext->callbacks.onDeviceAudioThread != NULL) { - pDevice->pContext->callbacks.onDeviceAudioThread(pDevice); - } else { - /* The backend is not using a custom main loop implementation, so now fall back to the blocking read-write implementation. */ - ma_device_audio_thread__default_read_write(pDevice, &pDevice->pContext->callbacks); - } + if (pDevice->pContext->callbacks.onDeviceDataLoop != NULL) { + pDevice->pContext->callbacks.onDeviceDataLoop(pDevice); } else { - if (pDevice->pContext->onDeviceMainLoop != NULL) { - pDevice->pContext->onDeviceMainLoop(pDevice); - } else { - ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "No main loop implementation.", MA_API_NOT_FOUND); - } + /* The backend is not using a custom main loop implementation, so now fall back to the blocking read-write implementation. */ + ma_device_audio_thread__default_read_write(pDevice); } /* @@ -32289,14 +32182,8 @@ static ma_thread_result MA_THREADCALL ma_worker_thread(void* pData) don't want to be doing this a second time. */ if (ma_device_get_state(pDevice) != MA_STATE_UNINITIALIZED) { - if (ma_context__is_using_new_callbacks(pDevice->pContext)) { - if (pDevice->pContext->callbacks.onDeviceStop != NULL) { - pDevice->pContext->callbacks.onDeviceStop(pDevice); - } - } else { - if (pDevice->pContext->onDeviceStop != NULL) { - pDevice->pContext->onDeviceStop(pDevice); - } + if (pDevice->pContext->callbacks.onDeviceStop != NULL) { + pDevice->pContext->callbacks.onDeviceStop(pDevice); } } @@ -32493,18 +32380,14 @@ static ma_bool32 ma_context_is_backend_asynchronous(ma_context* pContext) { MA_ASSERT(pContext != NULL); - if (ma_context__is_using_new_callbacks(pContext)) { - if (pContext->callbacks.onDeviceRead == NULL && pContext->callbacks.onDeviceWrite == NULL) { - if (pContext->callbacks.onDeviceAudioThread == NULL) { - return MA_TRUE; - } else { - return MA_FALSE; - } + if (pContext->callbacks.onDeviceRead == NULL && pContext->callbacks.onDeviceWrite == NULL) { + if (pContext->callbacks.onDeviceDataLoop == NULL) { + return MA_TRUE; } else { return MA_FALSE; } } else { - return pContext->isBackendAsynchronous; + return MA_FALSE; } } @@ -32567,20 +32450,11 @@ MA_API ma_result ma_context_init(const ma_backend backends[], ma_uint32 backendC MA_ASSERT(pBackendsToIterate != NULL); - for (iBackend = 0; iBackend < backendsToIterateCount; ++iBackend) { + for (iBackend = 0; iBackend < backendsToIterateCount; iBackend += 1) { ma_backend backend = pBackendsToIterate[iBackend]; - /* - I've had a subtle bug where some state is set by the backend's ma_context_init__*() function, but then later failed because - a setting in the context that was set in the prior failed attempt was left unchanged in the next attempt which resulted in - inconsistent state. Specifically what happened was the PulseAudio backend set the pContext->isBackendAsynchronous flag to true, - but since ALSA is not an asynchronous backend (it's a blocking read-write backend) it just left it unmodified with the assumption - that it would be initialized to false. This assumption proved to be incorrect because of the fact that the PulseAudio backend set - it earlier. For safety I'm going to reset this flag for each iteration. - - TODO: Remove this comment when the isBackendAsynchronous flag is removed. - */ - pContext->isBackendAsynchronous = MA_FALSE; + /* Make sure all callbacks are reset so we don't accidentally drag in any from previously failed initialization attempts. */ + MA_ZERO_OBJECT(&pContext->callbacks); /* These backends are using the new callback system. */ switch (backend) { @@ -32602,12 +32476,60 @@ MA_API ma_result ma_context_init(const ma_backend backends[], ma_uint32 backendC pContext->callbacks.onContextInit = ma_context_init__winmm; } break; #endif + #ifdef MA_HAS_COREAUDIO + case ma_backend_coreaudio: + { + pContext->callbacks.onContextInit = ma_context_init__coreaudio; + } break; + #endif + #ifdef MA_HAS_SNDIO + case ma_backend_sndio: + { + pContext->callbacks.onContextInit = ma_context_init__sndio; + } break; + #endif + #ifdef MA_HAS_AUDIO4 + case ma_backend_audio4: + { + pContext->callbacks.onContextInit = ma_context_init__audio4; + } break; + #endif + #ifdef MA_HAS_OSS + case ma_backend_oss: + { + pContext->callbacks.onContextInit = ma_context_init__oss; + } break; + #endif + #ifdef MA_HAS_PULSEAUDIO + case ma_backend_pulseaudio: + { + pContext->callbacks.onContextInit = ma_context_init__pulse; + } break; + #endif + #ifdef MA_HAS_ALSA + case ma_backend_alsa: + { + pContext->callbacks.onContextInit = ma_context_init__alsa; + } break; + #endif #ifdef MA_HAS_JACK case ma_backend_jack: { pContext->callbacks.onContextInit = ma_context_init__jack; } break; #endif + #ifdef MA_HAS_AAUDIO + case ma_backend_aaudio: + { + pContext->callbacks.onContextInit = ma_context_init__aaudio; + } break; + #endif + #ifdef MA_HAS_OPENSL + case ma_backend_opensl: + { + pContext->callbacks.onContextInit = ma_context_init__opensl; + } break; + #endif #ifdef MA_HAS_WEBAUDIO case ma_backend_webaudio: { @@ -32636,110 +32558,6 @@ MA_API ma_result ma_context_init(const ma_backend backends[], ma_uint32 backendC result = pContext->callbacks.onContextInit(pContext, pConfig, &pContext->callbacks); } else { result = MA_NO_BACKEND; - - /* TEMP. Try falling back to the old callback system. Eventually this switch will be removed completely. */ - switch (backend) { - #ifdef MA_HAS_WASAPI - case ma_backend_wasapi: - { - /*result = ma_context_init__wasapi(&config, pContext);*/ - } break; - #endif - #ifdef MA_HAS_DSOUND - case ma_backend_dsound: - { - /*result = ma_context_init__dsound(pConfig, pContext);*/ - } break; - #endif - #ifdef MA_HAS_WINMM - case ma_backend_winmm: - { - /*result = ma_context_init__winmm(pConfig, pContext);*/ - } break; - #endif - #ifdef MA_HAS_ALSA - case ma_backend_alsa: - { - ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize ALSA backend..."); - result = ma_context_init__alsa(pConfig, pContext); - } break; - #endif - #ifdef MA_HAS_PULSEAUDIO - case ma_backend_pulseaudio: - { - ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize PulseAudio backend..."); - result = ma_context_init__pulse(pConfig, pContext); - } break; - #endif - #ifdef MA_HAS_JACK - case ma_backend_jack: - { - /*result = ma_context_init__jack(pConfig, pContext);*/ - } break; - #endif - #ifdef MA_HAS_COREAUDIO - case ma_backend_coreaudio: - { - ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize CoreAudio backend..."); - result = ma_context_init__coreaudio(pConfig, pContext); - } break; - #endif - #ifdef MA_HAS_SNDIO - case ma_backend_sndio: - { - ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize sndio backend..."); - result = ma_context_init__sndio(pConfig, pContext); - } break; - #endif - #ifdef MA_HAS_AUDIO4 - case ma_backend_audio4: - { - ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize audio(4) backend..."); - result = ma_context_init__audio4(pConfig, pContext); - } break; - #endif - #ifdef MA_HAS_OSS - case ma_backend_oss: - { - ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize OSS backend..."); - result = ma_context_init__oss(pConfig, pContext); - } break; - #endif - #ifdef MA_HAS_AAUDIO - case ma_backend_aaudio: - { - ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize AAudio backend..."); - result = ma_context_init__aaudio(pConfig, pContext); - } break; - #endif - #ifdef MA_HAS_OPENSL - case ma_backend_opensl: - { - ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize OpenSL backend..."); - result = ma_context_init__opensl(pConfig, pContext); - } break; - #endif - #ifdef MA_HAS_WEBAUDIO - case ma_backend_webaudio: - { - /*result = ma_context_init__webaudio(pConfig, pContext);*/ - } break; - #endif - #ifdef MA_HAS_CUSTOM - case ma_backend_custom: - { - /*result = ma_context_init__custom(pConfig, pContext);*/ - } break; - #endif - #ifdef MA_HAS_NULL - case ma_backend_null: - { - /*result = ma_context_init__null(pConfig, pContext);*/ - } break; - #endif - - default: break; - } } /* If this iteration was successful, return. */ @@ -32748,18 +32566,21 @@ MA_API ma_result ma_context_init(const ma_backend backends[], ma_uint32 backendC if (result != MA_SUCCESS) { ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_WARNING, "Failed to initialize mutex for device enumeration. ma_context_get_devices() is not thread safe.", result); } + result = ma_mutex_init(&pContext->deviceInfoLock); if (result != MA_SUCCESS) { ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_WARNING, "Failed to initialize mutex for device info retrieval. ma_context_get_device_info() is not thread safe.", result); } -#ifdef MA_DEBUG_OUTPUT - printf("[miniaudio] Endian: %s\n", ma_is_little_endian() ? "LE" : "BE"); - printf("[miniaudio] SSE2: %s\n", ma_has_sse2() ? "YES" : "NO"); - printf("[miniaudio] AVX2: %s\n", ma_has_avx2() ? "YES" : "NO"); - printf("[miniaudio] AVX512F: %s\n", ma_has_avx512f() ? "YES" : "NO"); - printf("[miniaudio] NEON: %s\n", ma_has_neon() ? "YES" : "NO"); -#endif + #ifdef MA_DEBUG_OUTPUT + { + printf("[miniaudio] Endian: %s\n", ma_is_little_endian() ? "LE" : "BE"); + printf("[miniaudio] SSE2: %s\n", ma_has_sse2() ? "YES" : "NO"); + printf("[miniaudio] AVX2: %s\n", ma_has_avx2() ? "YES" : "NO"); + printf("[miniaudio] AVX512F: %s\n", ma_has_avx512f() ? "YES" : "NO"); + printf("[miniaudio] NEON: %s\n", ma_has_neon() ? "YES" : "NO"); + } + #endif pContext->backend = backend; return result; @@ -32779,14 +32600,8 @@ MA_API ma_result ma_context_uninit(ma_context* pContext) return MA_INVALID_ARGS; } - if (ma_context__is_using_new_callbacks(pContext)) { - if (pContext->callbacks.onContextUninit != NULL) { - pContext->callbacks.onContextUninit(pContext); - } - } else { - if (pContext->onUninit != NULL) { - pContext->onUninit(pContext); - } + if (pContext->callbacks.onContextUninit != NULL) { + pContext->callbacks.onContextUninit(pContext); } ma_mutex_uninit(&pContext->deviceEnumLock); @@ -32811,28 +32626,16 @@ MA_API ma_result ma_context_enumerate_devices(ma_context* pContext, ma_enum_devi return MA_INVALID_ARGS; } - if (ma_context__is_using_new_callbacks(pContext)) { - if (pContext->callbacks.onContextEnumerateDevices == NULL) { - return MA_INVALID_OPERATION; - } - - ma_mutex_lock(&pContext->deviceEnumLock); - { - result = pContext->callbacks.onContextEnumerateDevices(pContext, callback, pUserData); - } - ma_mutex_unlock(&pContext->deviceEnumLock); - } else { - if (pContext->onEnumDevices == NULL) { - return MA_INVALID_OPERATION; - } - - ma_mutex_lock(&pContext->deviceEnumLock); - { - result = pContext->onEnumDevices(pContext, callback, pUserData); - } - ma_mutex_unlock(&pContext->deviceEnumLock); + if (pContext->callbacks.onContextEnumerateDevices == NULL) { + return MA_INVALID_OPERATION; } + ma_mutex_lock(&pContext->deviceEnumLock); + { + result = pContext->callbacks.onContextEnumerateDevices(pContext, callback, pUserData); + } + ma_mutex_unlock(&pContext->deviceEnumLock); + return result; } @@ -32900,14 +32703,8 @@ MA_API ma_result ma_context_get_devices(ma_context* pContext, ma_device_info** p return MA_INVALID_ARGS; } - if (ma_context__is_using_new_callbacks(pContext)) { - if (pContext->callbacks.onContextEnumerateDevices == NULL) { - return MA_INVALID_OPERATION; - } - } else { - if (pContext->onEnumDevices == NULL) { - return MA_INVALID_OPERATION; - } + if (pContext->callbacks.onContextEnumerateDevices == NULL) { + return MA_INVALID_OPERATION; } /* Note that we don't use ma_context_enumerate_devices() here because we want to do locking at a higher level. */ @@ -32918,12 +32715,7 @@ MA_API ma_result ma_context_get_devices(ma_context* pContext, ma_device_info** p pContext->captureDeviceInfoCount = 0; /* Now enumerate over available devices. */ - if (ma_context__is_using_new_callbacks(pContext)) { - result = pContext->callbacks.onContextEnumerateDevices(pContext, ma_context_get_devices__enum_callback, NULL); - } else { - result = pContext->onEnumDevices(pContext, ma_context_get_devices__enum_callback, NULL); - } - + result = pContext->callbacks.onContextEnumerateDevices(pContext, ma_context_get_devices__enum_callback, NULL); if (result == MA_SUCCESS) { /* Playback devices. */ if (ppPlaybackDeviceInfos != NULL) { @@ -32952,6 +32744,8 @@ MA_API ma_result ma_context_get_device_info(ma_context* pContext, ma_device_type ma_result result; ma_device_info deviceInfo; + (void)shareMode; /* Unused. This parameter will be removed in version 0.11. */ + /* NOTE: Do not clear pDeviceInfo on entry. The reason is the pDeviceID may actually point to pDeviceInfo->id which will break things. */ if (pContext == NULL || pDeviceInfo == NULL) { return MA_INVALID_ARGS; @@ -32964,23 +32758,13 @@ MA_API ma_result ma_context_get_device_info(ma_context* pContext, ma_device_type MA_COPY_MEMORY(&deviceInfo.id, pDeviceID, sizeof(*pDeviceID)); } - if (ma_context__is_using_new_callbacks(pContext)) { - if (pContext->callbacks.onContextGetDeviceInfo == NULL) { - return MA_INVALID_OPERATION; - } - } else { - if (pContext->onGetDeviceInfo == NULL) { - return MA_INVALID_OPERATION; - } + if (pContext->callbacks.onContextGetDeviceInfo == NULL) { + return MA_INVALID_OPERATION; } ma_mutex_lock(&pContext->deviceInfoLock); { - if (ma_context__is_using_new_callbacks(pContext)) { - result = pContext->callbacks.onContextGetDeviceInfo(pContext, deviceType, pDeviceID, &deviceInfo); - } else { - result = pContext->onGetDeviceInfo(pContext, deviceType, pDeviceID, shareMode, &deviceInfo); - } + result = pContext->callbacks.onContextGetDeviceInfo(pContext, deviceType, pDeviceID, &deviceInfo); } ma_mutex_unlock(&pContext->deviceInfoLock); @@ -33039,8 +32823,8 @@ MA_API ma_result ma_context_get_device_info(ma_context* pContext, ma_device_type /* Sample rate. */ if (deviceInfo.nativeDataFormats[iNativeFormat].sampleRate == 0) { /* All sample rates supported. */ - deviceInfo.minSampleRate = MA_MIN_SAMPLE_RATE; - deviceInfo.maxSampleRate = MA_MAX_SAMPLE_RATE; + deviceInfo.minSampleRate = (ma_uint32)ma_standard_sample_rate_min; + deviceInfo.maxSampleRate = (ma_uint32)ma_standard_sample_rate_max; } else { if (deviceInfo.minSampleRate > deviceInfo.nativeDataFormats[iNativeFormat].sampleRate) { deviceInfo.minSampleRate = deviceInfo.nativeDataFormats[iNativeFormat].sampleRate; @@ -33056,8 +32840,8 @@ MA_API ma_result ma_context_get_device_info(ma_context* pContext, ma_device_type /* Clamp ranges. */ deviceInfo.minChannels = ma_max(deviceInfo.minChannels, MA_MIN_CHANNELS); deviceInfo.maxChannels = ma_min(deviceInfo.maxChannels, MA_MAX_CHANNELS); - deviceInfo.minSampleRate = ma_max(deviceInfo.minSampleRate, MA_MIN_SAMPLE_RATE); - deviceInfo.maxSampleRate = ma_min(deviceInfo.maxSampleRate, MA_MAX_SAMPLE_RATE); + deviceInfo.minSampleRate = ma_max(deviceInfo.minSampleRate, (ma_uint32)ma_standard_sample_rate_min); + deviceInfo.maxSampleRate = ma_min(deviceInfo.maxSampleRate, (ma_uint32)ma_standard_sample_rate_max); *pDeviceInfo = deviceInfo; return result; @@ -33090,7 +32874,8 @@ MA_API ma_device_config ma_device_config_init(ma_device_type deviceType) MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pConfig, ma_device* pDevice) { ma_result result; - ma_device_config config; + ma_device_descriptor descriptorPlayback; + ma_device_descriptor descriptorCapture; /* The context can be null, in which case we self-manage it. */ if (pContext == NULL) { @@ -33109,39 +32894,30 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC /* Check that we have our callbacks defined. */ - if (ma_context__is_using_new_callbacks(pContext)) { - if (pContext->callbacks.onDeviceInit == NULL) { - return MA_INVALID_OPERATION; - } - } else { - if (pContext->onDeviceInit == NULL) { - return MA_INVALID_OPERATION; - } + if (pContext->callbacks.onDeviceInit == NULL) { + return MA_INVALID_OPERATION; } - /* We need to make a copy of the config so we can set default values if they were left unset in the input config. */ - config = *pConfig; - /* Basic config validation. */ - if (config.deviceType != ma_device_type_playback && config.deviceType != ma_device_type_capture && config.deviceType != ma_device_type_duplex && config.deviceType != ma_device_type_loopback) { + if (pConfig->deviceType != ma_device_type_playback && pConfig->deviceType != ma_device_type_capture && pConfig->deviceType != ma_device_type_duplex && pConfig->deviceType != ma_device_type_loopback) { return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "ma_device_init() called with an invalid config. Device type is invalid. Make sure the device type has been set in the config.", MA_INVALID_DEVICE_CONFIG); } - if (config.deviceType == ma_device_type_capture || config.deviceType == ma_device_type_duplex) { - if (config.capture.channels > MA_MAX_CHANNELS) { + if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) { + if (pConfig->capture.channels > MA_MAX_CHANNELS) { return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "ma_device_init() called with an invalid config. Capture channel count cannot exceed 32.", MA_INVALID_DEVICE_CONFIG); } - if (!ma__is_channel_map_valid(config.capture.channelMap, config.capture.channels)) { + if (!ma__is_channel_map_valid(pConfig->capture.channelMap, pConfig->capture.channels)) { return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "ma_device_init() called with invalid config. Capture channel map is invalid.", MA_INVALID_DEVICE_CONFIG); } } - if (config.deviceType == ma_device_type_playback || config.deviceType == ma_device_type_duplex || config.deviceType == ma_device_type_loopback) { - if (config.playback.channels > MA_MAX_CHANNELS) { + if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex || pConfig->deviceType == ma_device_type_loopback) { + if (pConfig->playback.channels > MA_MAX_CHANNELS) { return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "ma_device_init() called with an invalid config. Playback channel count cannot exceed 32.", MA_INVALID_DEVICE_CONFIG); } - if (!ma__is_channel_map_valid(config.playback.channelMap, config.playback.channels)) { + if (!ma__is_channel_map_valid(pConfig->playback.channelMap, pConfig->playback.channels)) { return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "ma_device_init() called with invalid config. Playback channel map is invalid.", MA_INVALID_DEVICE_CONFIG); } } @@ -33149,9 +32925,9 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC pDevice->pContext = pContext; /* Set the user data and log callback ASAP to ensure it is available for the entire initialization process. */ - pDevice->pUserData = config.pUserData; - pDevice->onData = config.dataCallback; - pDevice->onStop = config.stopCallback; + pDevice->pUserData = pConfig->pUserData; + pDevice->onData = pConfig->dataCallback; + pDevice->onStop = pConfig->stopCallback; if (((ma_uintptr)pDevice % sizeof(pDevice)) != 0) { if (pContext->logCallback) { @@ -33159,107 +32935,38 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC } } - if (config.playback.pDeviceID != NULL) { - MA_COPY_MEMORY(&pDevice->playback.id, config.playback.pDeviceID, sizeof(pDevice->playback.id)); + if (pConfig->playback.pDeviceID != NULL) { + MA_COPY_MEMORY(&pDevice->playback.id, pConfig->playback.pDeviceID, sizeof(pDevice->playback.id)); } - if (config.capture.pDeviceID != NULL) { - MA_COPY_MEMORY(&pDevice->capture.id, config.capture.pDeviceID, sizeof(pDevice->capture.id)); + if (pConfig->capture.pDeviceID != NULL) { + MA_COPY_MEMORY(&pDevice->capture.id, pConfig->capture.pDeviceID, sizeof(pDevice->capture.id)); } - pDevice->noPreZeroedOutputBuffer = config.noPreZeroedOutputBuffer; - pDevice->noClip = config.noClip; + pDevice->noPreZeroedOutputBuffer = pConfig->noPreZeroedOutputBuffer; + pDevice->noClip = pConfig->noClip; pDevice->masterVolumeFactor = 1; - /* - When passing in 0 for the format/channels/rate/chmap it means the device will be using whatever is chosen by the backend. If everything is set - to defaults it means the format conversion pipeline will run on a fast path where data transfer is just passed straight through to the backend. - */ - if (config.sampleRate == 0) { - config.sampleRate = MA_DEFAULT_SAMPLE_RATE; - pDevice->usingDefaultSampleRate = MA_TRUE; - } + pDevice->type = pConfig->deviceType; + pDevice->sampleRate = pConfig->sampleRate; + pDevice->resampling.algorithm = pConfig->resampling.algorithm; + pDevice->resampling.linear.lpfOrder = pConfig->resampling.linear.lpfOrder; + pDevice->resampling.speex.quality = pConfig->resampling.speex.quality; - if (config.capture.format == ma_format_unknown) { - config.capture.format = MA_DEFAULT_FORMAT; - pDevice->capture.usingDefaultFormat = MA_TRUE; - } - if (config.capture.channels == 0) { - config.capture.channels = MA_DEFAULT_CHANNELS; - pDevice->capture.usingDefaultChannels = MA_TRUE; - } - if (config.capture.channelMap[0] == MA_CHANNEL_NONE) { - pDevice->capture.usingDefaultChannelMap = MA_TRUE; - } - - if (config.playback.format == ma_format_unknown) { - config.playback.format = MA_DEFAULT_FORMAT; - pDevice->playback.usingDefaultFormat = MA_TRUE; - } - if (config.playback.channels == 0) { - config.playback.channels = MA_DEFAULT_CHANNELS; - pDevice->playback.usingDefaultChannels = MA_TRUE; - } - if (config.playback.channelMap[0] == MA_CHANNEL_NONE) { - pDevice->playback.usingDefaultChannelMap = MA_TRUE; - } - - - /* Default periods. */ - if (config.periods == 0) { - config.periods = MA_DEFAULT_PERIODS; - pDevice->usingDefaultPeriods = MA_TRUE; - } - - /* - Must have at least 3 periods for full-duplex mode. The idea is that the playback and capture positions hang out in the middle period, with the surrounding - periods acting as a buffer in case the capture and playback devices get's slightly out of sync. - */ - if (config.deviceType == ma_device_type_duplex && config.periods < 3) { - config.periods = 3; - } - - /* Default buffer size. */ - if (config.periodSizeInMilliseconds == 0 && config.periodSizeInFrames == 0) { - config.periodSizeInMilliseconds = (config.performanceProfile == ma_performance_profile_low_latency) ? MA_DEFAULT_PERIOD_SIZE_IN_MILLISECONDS_LOW_LATENCY : MA_DEFAULT_PERIOD_SIZE_IN_MILLISECONDS_CONSERVATIVE; - pDevice->usingDefaultBufferSize = MA_TRUE; - } - - MA_ASSERT(config.capture.channels <= MA_MAX_CHANNELS); - MA_ASSERT(config.playback.channels <= MA_MAX_CHANNELS); - - pDevice->type = config.deviceType; - pDevice->sampleRate = config.sampleRate; - pDevice->resampling.algorithm = config.resampling.algorithm; - pDevice->resampling.linear.lpfOrder = config.resampling.linear.lpfOrder; - pDevice->resampling.speex.quality = config.resampling.speex.quality; - - pDevice->capture.shareMode = config.capture.shareMode; - pDevice->capture.format = config.capture.format; - pDevice->capture.channels = config.capture.channels; - ma_channel_map_copy(pDevice->capture.channelMap, config.capture.channelMap, config.capture.channels); - pDevice->capture.channelMixMode = config.capture.channelMixMode; + pDevice->capture.shareMode = pConfig->capture.shareMode; + pDevice->capture.format = pConfig->capture.format; + pDevice->capture.channels = pConfig->capture.channels; + ma_channel_map_copy(pDevice->capture.channelMap, pConfig->capture.channelMap, pConfig->capture.channels); + pDevice->capture.channelMixMode = pConfig->capture.channelMixMode; - pDevice->playback.shareMode = config.playback.shareMode; - pDevice->playback.format = config.playback.format; - pDevice->playback.channels = config.playback.channels; - ma_channel_map_copy(pDevice->playback.channelMap, config.playback.channelMap, config.playback.channels); - pDevice->playback.channelMixMode = config.playback.channelMixMode; + pDevice->playback.shareMode = pConfig->playback.shareMode; + pDevice->playback.format = pConfig->playback.format; + pDevice->playback.channels = pConfig->playback.channels; + ma_channel_map_copy(pDevice->playback.channelMap, pConfig->playback.channelMap, pConfig->playback.channels); + pDevice->playback.channelMixMode = pConfig->playback.channelMixMode; - - /* The internal format, channel count and sample rate can be modified by the backend. */ - pDevice->capture.internalFormat = pDevice->capture.format; - pDevice->capture.internalChannels = pDevice->capture.channels; - pDevice->capture.internalSampleRate = pDevice->sampleRate; - ma_channel_map_copy(pDevice->capture.internalChannelMap, pDevice->capture.channelMap, pDevice->capture.channels); - - pDevice->playback.internalFormat = pDevice->playback.format; - pDevice->playback.internalChannels = pDevice->playback.channels; - pDevice->playback.internalSampleRate = pDevice->sampleRate; - ma_channel_map_copy(pDevice->playback.internalChannelMap, pDevice->playback.channelMap, pDevice->playback.channels); - - result = ma_mutex_init(&pDevice->lock); + result = ma_mutex_init(&pDevice->startStopLock); if (result != MA_SUCCESS) { return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "Failed to create mutex.", result); } @@ -33273,14 +32980,14 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC */ result = ma_event_init(&pDevice->wakeupEvent); if (result != MA_SUCCESS) { - ma_mutex_uninit(&pDevice->lock); + ma_mutex_uninit(&pDevice->startStopLock); return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "Failed to create worker thread wakeup event.", result); } result = ma_event_init(&pDevice->startEvent); if (result != MA_SUCCESS) { ma_event_uninit(&pDevice->wakeupEvent); - ma_mutex_uninit(&pDevice->lock); + ma_mutex_uninit(&pDevice->startStopLock); return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "Failed to create worker thread start event.", result); } @@ -33288,138 +32995,126 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC if (result != MA_SUCCESS) { ma_event_uninit(&pDevice->startEvent); ma_event_uninit(&pDevice->wakeupEvent); - ma_mutex_uninit(&pDevice->lock); + ma_mutex_uninit(&pDevice->startStopLock); return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "Failed to create worker thread stop event.", result); } - if (ma_context__is_using_new_callbacks(pContext)) { - ma_device_descriptor descriptorPlayback; - ma_device_descriptor descriptorCapture; + MA_ZERO_OBJECT(&descriptorPlayback); + descriptorPlayback.pDeviceID = pConfig->playback.pDeviceID; + descriptorPlayback.shareMode = pConfig->playback.shareMode; + descriptorPlayback.format = pConfig->playback.format; + descriptorPlayback.channels = pConfig->playback.channels; + descriptorPlayback.sampleRate = pConfig->sampleRate; + ma_channel_map_copy(descriptorPlayback.channelMap, pConfig->playback.channelMap, pConfig->playback.channels); + descriptorPlayback.periodSizeInFrames = pConfig->periodSizeInFrames; + descriptorPlayback.periodSizeInMilliseconds = pConfig->periodSizeInMilliseconds; + descriptorPlayback.periodCount = pConfig->periods; - MA_ZERO_OBJECT(&descriptorPlayback); - descriptorPlayback.pDeviceID = pConfig->playback.pDeviceID; - descriptorPlayback.shareMode = pConfig->playback.shareMode; - descriptorPlayback.format = pConfig->playback.format; - descriptorPlayback.channels = pConfig->playback.channels; - descriptorPlayback.sampleRate = pConfig->sampleRate; - ma_channel_map_copy(descriptorPlayback.channelMap, pConfig->playback.channelMap, pConfig->playback.channels); - descriptorPlayback.periodSizeInFrames = pConfig->periodSizeInFrames; - descriptorPlayback.periodSizeInMilliseconds = pConfig->periodSizeInMilliseconds; - descriptorPlayback.periodCount = pConfig->periods; + if (descriptorPlayback.periodCount == 0) { + descriptorPlayback.periodCount = MA_DEFAULT_PERIODS; + } - if (descriptorPlayback.periodCount == 0) { - descriptorPlayback.periodCount = MA_DEFAULT_PERIODS; + + MA_ZERO_OBJECT(&descriptorCapture); + descriptorCapture.pDeviceID = pConfig->capture.pDeviceID; + descriptorCapture.shareMode = pConfig->capture.shareMode; + descriptorCapture.format = pConfig->capture.format; + descriptorCapture.channels = pConfig->capture.channels; + descriptorCapture.sampleRate = pConfig->sampleRate; + ma_channel_map_copy(descriptorCapture.channelMap, pConfig->capture.channelMap, pConfig->capture.channels); + descriptorCapture.periodSizeInFrames = pConfig->periodSizeInFrames; + descriptorCapture.periodSizeInMilliseconds = pConfig->periodSizeInMilliseconds; + descriptorCapture.periodCount = pConfig->periods; + + if (descriptorCapture.periodCount == 0) { + descriptorCapture.periodCount = MA_DEFAULT_PERIODS; + } + + + result = pContext->callbacks.onDeviceInit(pDevice, pConfig, &descriptorPlayback, &descriptorCapture); + if (result != MA_SUCCESS) { + ma_event_uninit(&pDevice->startEvent); + ma_event_uninit(&pDevice->wakeupEvent); + ma_mutex_uninit(&pDevice->startStopLock); + return result; + } + + + /* + On output the descriptors will contain the *actual* data format of the device. We need this to know how to convert the data between + the requested format and the internal format. + */ + if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex || pConfig->deviceType == ma_device_type_loopback) { + if (!ma_device_descriptor_is_valid(&descriptorCapture)) { + ma_device_uninit(pDevice); + return MA_INVALID_ARGS; } + pDevice->capture.internalFormat = descriptorCapture.format; + pDevice->capture.internalChannels = descriptorCapture.channels; + pDevice->capture.internalSampleRate = descriptorCapture.sampleRate; + ma_channel_map_copy(pDevice->capture.internalChannelMap, descriptorCapture.channelMap, descriptorCapture.channels); + pDevice->capture.internalPeriodSizeInFrames = descriptorCapture.periodSizeInFrames; + pDevice->capture.internalPeriods = descriptorCapture.periodCount; - MA_ZERO_OBJECT(&descriptorCapture); - descriptorCapture.pDeviceID = pConfig->capture.pDeviceID; - descriptorCapture.shareMode = pConfig->capture.shareMode; - descriptorCapture.format = pConfig->capture.format; - descriptorCapture.channels = pConfig->capture.channels; - descriptorCapture.sampleRate = pConfig->sampleRate; - ma_channel_map_copy(descriptorCapture.channelMap, pConfig->capture.channelMap, pConfig->capture.channels); - descriptorCapture.periodSizeInFrames = pConfig->periodSizeInFrames; - descriptorCapture.periodSizeInMilliseconds = pConfig->periodSizeInMilliseconds; - descriptorCapture.periodCount = pConfig->periods; + if (pDevice->capture.internalPeriodSizeInFrames == 0) { + pDevice->capture.internalPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(descriptorCapture.periodSizeInMilliseconds, descriptorCapture.sampleRate); + } + } - if (descriptorCapture.periodCount == 0) { - descriptorCapture.periodCount = MA_DEFAULT_PERIODS; + if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { + if (!ma_device_descriptor_is_valid(&descriptorPlayback)) { + ma_device_uninit(pDevice); + return MA_INVALID_ARGS; } + pDevice->playback.internalFormat = descriptorPlayback.format; + pDevice->playback.internalChannels = descriptorPlayback.channels; + pDevice->playback.internalSampleRate = descriptorPlayback.sampleRate; + ma_channel_map_copy(pDevice->playback.internalChannelMap, descriptorPlayback.channelMap, descriptorPlayback.channels); + pDevice->playback.internalPeriodSizeInFrames = descriptorPlayback.periodSizeInFrames; + pDevice->playback.internalPeriods = descriptorPlayback.periodCount; - result = pContext->callbacks.onDeviceInit(pDevice, pConfig, &descriptorPlayback, &descriptorCapture); - if (result != MA_SUCCESS) { - ma_event_uninit(&pDevice->startEvent); - ma_event_uninit(&pDevice->wakeupEvent); - ma_mutex_uninit(&pDevice->lock); - return result; + if (pDevice->playback.internalPeriodSizeInFrames == 0) { + pDevice->playback.internalPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(descriptorPlayback.periodSizeInMilliseconds, descriptorPlayback.sampleRate); } + } + + + /* + The name of the device can be retrieved from device info. This may be temporary and replaced with a `ma_device_get_info(pDevice, deviceType)` instead. + For loopback devices, we need to retrieve the name of the playback device. + */ + { + ma_device_info deviceInfo; - /* - On output the descriptors will contain the *actual* data format of the device. We need this to know how to convert the data between - the requested format and the internal format. - */ if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex || pConfig->deviceType == ma_device_type_loopback) { - if (!ma_device_descriptor_is_valid(&descriptorCapture)) { - ma_device_uninit(pDevice); - return MA_INVALID_ARGS; - } - - pDevice->capture.internalFormat = descriptorCapture.format; - pDevice->capture.internalChannels = descriptorCapture.channels; - pDevice->capture.internalSampleRate = descriptorCapture.sampleRate; - ma_channel_map_copy(pDevice->capture.internalChannelMap, descriptorCapture.channelMap, descriptorCapture.channels); - pDevice->capture.internalPeriodSizeInFrames = descriptorCapture.periodSizeInFrames; - pDevice->capture.internalPeriods = descriptorCapture.periodCount; - - if (pDevice->capture.internalPeriodSizeInFrames == 0) { - pDevice->capture.internalPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(descriptorCapture.periodSizeInMilliseconds, descriptorCapture.sampleRate); + result = ma_context_get_device_info(pContext, (pConfig->deviceType == ma_device_type_loopback) ? ma_device_type_playback : ma_device_type_capture, descriptorCapture.pDeviceID, descriptorCapture.shareMode, &deviceInfo); + if (result == MA_SUCCESS) { + ma_strncpy_s(pDevice->capture.name, sizeof(pDevice->capture.name), deviceInfo.name, (size_t)-1); + } else { + /* We failed to retrieve the device info. Fall back to a default name. */ + if (descriptorCapture.pDeviceID == NULL) { + ma_strncpy_s(pDevice->capture.name, sizeof(pDevice->capture.name), MA_DEFAULT_CAPTURE_DEVICE_NAME, (size_t)-1); + } else { + ma_strncpy_s(pDevice->capture.name, sizeof(pDevice->capture.name), "Capture Device", (size_t)-1); + } } } if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { - if (!ma_device_descriptor_is_valid(&descriptorPlayback)) { - ma_device_uninit(pDevice); - return MA_INVALID_ARGS; - } - - pDevice->playback.internalFormat = descriptorPlayback.format; - pDevice->playback.internalChannels = descriptorPlayback.channels; - pDevice->playback.internalSampleRate = descriptorPlayback.sampleRate; - ma_channel_map_copy(pDevice->playback.internalChannelMap, descriptorPlayback.channelMap, descriptorPlayback.channels); - pDevice->playback.internalPeriodSizeInFrames = descriptorPlayback.periodSizeInFrames; - pDevice->playback.internalPeriods = descriptorPlayback.periodCount; - - if (pDevice->playback.internalPeriodSizeInFrames == 0) { - pDevice->playback.internalPeriodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(descriptorPlayback.periodSizeInMilliseconds, descriptorPlayback.sampleRate); - } - } - - - /* - The name of the device can be retrieved from device info. This may be temporary and replaced with a `ma_device_get_info(pDevice, deviceType)` instead. - For loopback devices, we need to retrieve the name of the playback device. - */ - { - ma_device_info deviceInfo; - - if (pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex || pConfig->deviceType == ma_device_type_loopback) { - result = ma_context_get_device_info(pContext, (pConfig->deviceType == ma_device_type_loopback) ? ma_device_type_playback : ma_device_type_capture, descriptorCapture.pDeviceID, descriptorCapture.shareMode, &deviceInfo); - if (result == MA_SUCCESS) { - ma_strncpy_s(pDevice->capture.name, sizeof(pDevice->capture.name), deviceInfo.name, (size_t)-1); + result = ma_context_get_device_info(pContext, ma_device_type_playback, descriptorPlayback.pDeviceID, descriptorPlayback.shareMode, &deviceInfo); + if (result == MA_SUCCESS) { + ma_strncpy_s(pDevice->playback.name, sizeof(pDevice->playback.name), deviceInfo.name, (size_t)-1); + } else { + /* We failed to retrieve the device info. Fall back to a default name. */ + if (descriptorPlayback.pDeviceID == NULL) { + ma_strncpy_s(pDevice->playback.name, sizeof(pDevice->playback.name), MA_DEFAULT_PLAYBACK_DEVICE_NAME, (size_t)-1); } else { - /* We failed to retrieve the device info. Fall back to a default name. */ - if (descriptorCapture.pDeviceID == NULL) { - ma_strncpy_s(pDevice->capture.name, sizeof(pDevice->capture.name), MA_DEFAULT_CAPTURE_DEVICE_NAME, (size_t)-1); - } else { - ma_strncpy_s(pDevice->capture.name, sizeof(pDevice->capture.name), "Capture Device", (size_t)-1); - } + ma_strncpy_s(pDevice->playback.name, sizeof(pDevice->playback.name), "Playback Device", (size_t)-1); } } - - if (pConfig->deviceType == ma_device_type_playback || pConfig->deviceType == ma_device_type_duplex) { - result = ma_context_get_device_info(pContext, ma_device_type_playback, descriptorPlayback.pDeviceID, descriptorPlayback.shareMode, &deviceInfo); - if (result == MA_SUCCESS) { - ma_strncpy_s(pDevice->playback.name, sizeof(pDevice->playback.name), deviceInfo.name, (size_t)-1); - } else { - /* We failed to retrieve the device info. Fall back to a default name. */ - if (descriptorPlayback.pDeviceID == NULL) { - ma_strncpy_s(pDevice->playback.name, sizeof(pDevice->playback.name), MA_DEFAULT_PLAYBACK_DEVICE_NAME, (size_t)-1); - } else { - ma_strncpy_s(pDevice->playback.name, sizeof(pDevice->playback.name), "Playback Device", (size_t)-1); - } - } - } - } - } else { - result = pContext->onDeviceInit(pContext, &config, pDevice); - if (result != MA_SUCCESS) { - ma_event_uninit(&pDevice->startEvent); - ma_event_uninit(&pDevice->wakeupEvent); - ma_mutex_uninit(&pDevice->lock); - return result; } } @@ -33444,14 +33139,12 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC If the backend is asynchronous and the device is duplex, we'll need an intermediary ring buffer. Note that this needs to be done after ma_device__post_init_setup(). */ - if (ma_context__is_using_new_callbacks(pContext)) { /* <-- TEMP: Will be removed once all asynchronous backends have been converted to the new callbacks. */ - if (ma_context_is_backend_asynchronous(pContext)) { - if (pConfig->deviceType == ma_device_type_duplex) { - result = ma_duplex_rb_init(pDevice->sampleRate, pDevice->capture.internalFormat, pDevice->capture.internalChannels, pDevice->capture.internalSampleRate, pDevice->capture.internalPeriodSizeInFrames, &pDevice->pContext->allocationCallbacks, &pDevice->duplexRB); - if (result != MA_SUCCESS) { - ma_device_uninit(pDevice); - return result; - } + if (ma_context_is_backend_asynchronous(pContext)) { + if (pConfig->deviceType == ma_device_type_duplex) { + result = ma_duplex_rb_init(pDevice->capture.format, pDevice->capture.channels, pDevice->sampleRate, pDevice->capture.internalSampleRate, pDevice->capture.internalPeriodSizeInFrames, &pDevice->pContext->allocationCallbacks, &pDevice->duplexRB); + if (result != MA_SUCCESS) { + ma_device_uninit(pDevice); + return result; } } } @@ -33463,9 +33156,9 @@ MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pC ma_post_log_messagef(pContext, pDevice, MA_LOG_LEVEL_INFO, "[%s]", ma_get_backend_name(pDevice->pContext->backend)); if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) { ma_post_log_messagef(pContext, pDevice, MA_LOG_LEVEL_INFO, " %s (%s)", pDevice->capture.name, "Capture"); - ma_post_log_messagef(pContext, pDevice, MA_LOG_LEVEL_INFO, " Format: %s -> %s", ma_get_format_name(pDevice->capture.format), ma_get_format_name(pDevice->capture.internalFormat)); - ma_post_log_messagef(pContext, pDevice, MA_LOG_LEVEL_INFO, " Channels: %d -> %d", pDevice->capture.channels, pDevice->capture.internalChannels); - ma_post_log_messagef(pContext, pDevice, MA_LOG_LEVEL_INFO, " Sample Rate: %d -> %d", pDevice->sampleRate, pDevice->capture.internalSampleRate); + ma_post_log_messagef(pContext, pDevice, MA_LOG_LEVEL_INFO, " Format: %s -> %s", ma_get_format_name(pDevice->capture.internalFormat), ma_get_format_name(pDevice->capture.format)); + ma_post_log_messagef(pContext, pDevice, MA_LOG_LEVEL_INFO, " Channels: %d -> %d", pDevice->capture.internalChannels, pDevice->capture.channels); + ma_post_log_messagef(pContext, pDevice, MA_LOG_LEVEL_INFO, " Sample Rate: %d -> %d", pDevice->capture.internalSampleRate, pDevice->sampleRate); ma_post_log_messagef(pContext, pDevice, MA_LOG_LEVEL_INFO, " Buffer Size: %d*%d (%d)", pDevice->capture.internalPeriodSizeInFrames, pDevice->capture.internalPeriods, (pDevice->capture.internalPeriodSizeInFrames * pDevice->capture.internalPeriods)); ma_post_log_messagef(pContext, pDevice, MA_LOG_LEVEL_INFO, " Conversion:"); ma_post_log_messagef(pContext, pDevice, MA_LOG_LEVEL_INFO, " Pre Format Conversion: %s", pDevice->capture.converter.hasPreFormatConversion ? "YES" : "NO"); @@ -33575,21 +33268,21 @@ MA_API void ma_device_uninit(ma_device* pDevice) ma_thread_wait(&pDevice->thread); } - if (ma_context__is_using_new_callbacks(pDevice->pContext)) { - if (pDevice->pContext->callbacks.onDeviceUninit != NULL) { - pDevice->pContext->callbacks.onDeviceUninit(pDevice); - } - } else { - if (pDevice->pContext->onDeviceUninit != NULL) { - pDevice->pContext->onDeviceUninit(pDevice); - } + if (pDevice->pContext->callbacks.onDeviceUninit != NULL) { + pDevice->pContext->callbacks.onDeviceUninit(pDevice); } ma_event_uninit(&pDevice->stopEvent); ma_event_uninit(&pDevice->startEvent); ma_event_uninit(&pDevice->wakeupEvent); - ma_mutex_uninit(&pDevice->lock); + ma_mutex_uninit(&pDevice->startStopLock); + + if (ma_context_is_backend_asynchronous(pDevice->pContext)) { + if (pDevice->type == ma_device_type_duplex) { + ma_duplex_rb_uninit(&pDevice->duplexRB); + } + } if (pDevice->isOwnerOfContext) { ma_allocation_callbacks allocationCallbacks = pDevice->pContext->allocationCallbacks; @@ -33617,7 +33310,7 @@ MA_API ma_result ma_device_start(ma_device* pDevice) return ma_post_error(pDevice, MA_LOG_LEVEL_WARNING, "ma_device_start() called when the device is already started.", MA_INVALID_OPERATION); /* Already started. Returning an error to let the application know because it probably means they're doing something wrong. */ } - ma_mutex_lock(&pDevice->lock); + ma_mutex_lock(&pDevice->startStopLock); { /* Starting and stopping are wrapped in a mutex which means we can assert that the device is in a stopped or paused state. */ MA_ASSERT(ma_device_get_state(pDevice) == MA_STATE_STOPPED); @@ -33626,18 +33319,10 @@ MA_API ma_result ma_device_start(ma_device* pDevice) /* Asynchronous backends need to be handled differently. */ if (ma_context_is_backend_asynchronous(pDevice->pContext)) { - if (ma_context__is_using_new_callbacks(pDevice->pContext)) { - if (pDevice->pContext->callbacks.onDeviceStart != NULL) { - result = pDevice->pContext->callbacks.onDeviceStart(pDevice); - } else { - result = MA_INVALID_OPERATION; - } + if (pDevice->pContext->callbacks.onDeviceStart != NULL) { + result = pDevice->pContext->callbacks.onDeviceStart(pDevice); } else { - if (pDevice->pContext->onDeviceStart != NULL) { - result = pDevice->pContext->onDeviceStart(pDevice); - } else { - result = MA_INVALID_OPERATION; - } + result = MA_INVALID_OPERATION; } if (result == MA_SUCCESS) { @@ -33663,7 +33348,7 @@ MA_API ma_result ma_device_start(ma_device* pDevice) ma_device__set_state(pDevice, MA_STATE_STOPPED); } } - ma_mutex_unlock(&pDevice->lock); + ma_mutex_unlock(&pDevice->startStopLock); return result; } @@ -33684,7 +33369,7 @@ MA_API ma_result ma_device_stop(ma_device* pDevice) return ma_post_error(pDevice, MA_LOG_LEVEL_WARNING, "ma_device_stop() called when the device is already stopped.", MA_INVALID_OPERATION); /* Already stopped. Returning an error to let the application know because it probably means they're doing something wrong. */ } - ma_mutex_lock(&pDevice->lock); + ma_mutex_lock(&pDevice->startStopLock); { /* Starting and stopping are wrapped in a mutex which means we can assert that the device is in a started or paused state. */ MA_ASSERT(ma_device_get_state(pDevice) == MA_STATE_STARTED); @@ -33694,23 +33379,25 @@ MA_API ma_result ma_device_stop(ma_device* pDevice) /* Asynchronous backends need to be handled differently. */ if (ma_context_is_backend_asynchronous(pDevice->pContext)) { /* Asynchronous backends must have a stop operation. */ - if (ma_context__is_using_new_callbacks(pDevice->pContext)) { - if (pDevice->pContext->callbacks.onDeviceStop != NULL) { - result = pDevice->pContext->callbacks.onDeviceStop(pDevice); - } else { - result = MA_INVALID_OPERATION; - } + if (pDevice->pContext->callbacks.onDeviceStop != NULL) { + result = pDevice->pContext->callbacks.onDeviceStop(pDevice); } else { - if (pDevice->pContext->onDeviceStop != NULL) { - result = pDevice->pContext->onDeviceStop(pDevice); - } else { - result = MA_INVALID_OPERATION; - } + result = MA_INVALID_OPERATION; } ma_device__set_state(pDevice, MA_STATE_STOPPED); } else { - /* Synchronous backends. The stop callback is always called from the worker thread. Do not call the stop callback here. */ + /* + Synchronous backends. The stop callback is always called from the worker thread. Do not call the stop callback here. If + the backend is implementing it's own audio thread loop we'll need to wake it up if required. Note that we need to make + sure the state of the device is *not* playing right now, which it shouldn't be since we set it above. This is super + important though, so I'm asserting it here as well for extra safety in case we accidentally change something later. + */ + MA_ASSERT(ma_device_get_state(pDevice) != MA_STATE_STARTED); + + if (pDevice->pContext->callbacks.onDeviceDataLoopWakeup != NULL) { + pDevice->pContext->callbacks.onDeviceDataLoopWakeup(pDevice); + } /* We need to wait for the worker thread to become available for work before returning. Note that the worker thread will be @@ -33720,7 +33407,7 @@ MA_API ma_result ma_device_stop(ma_device* pDevice) result = MA_SUCCESS; } } - ma_mutex_unlock(&pDevice->lock); + ma_mutex_unlock(&pDevice->startStopLock); return result; } @@ -33838,6 +33525,42 @@ MA_API ma_result ma_device_handle_backend_data_callback(ma_device* pDevice, void return MA_SUCCESS; } + +MA_API ma_uint32 ma_calculate_buffer_size_in_frames_from_descriptor(const ma_device_descriptor* pDescriptor, ma_uint32 nativeSampleRate, ma_performance_profile performanceProfile) +{ + if (pDescriptor == NULL) { + return 0; + } + + /* + We must have a non-0 native sample rate, but some backends don't allow retrieval of this at the + time when the size of the buffer needs to be determined. In this case we need to just take a best + guess and move on. We'll try using the sample rate in pDescriptor first. If that's not set we'll + just fall back to MA_DEFAULT_SAMPLE_RATE. + */ + if (nativeSampleRate == 0) { + nativeSampleRate = pDescriptor->sampleRate; + } + if (nativeSampleRate == 0) { + nativeSampleRate = MA_DEFAULT_SAMPLE_RATE; + } + + MA_ASSERT(nativeSampleRate != 0); + + if (pDescriptor->periodSizeInFrames == 0) { + if (pDescriptor->periodSizeInMilliseconds == 0) { + if (performanceProfile == ma_performance_profile_low_latency) { + return ma_calculate_buffer_size_in_frames_from_milliseconds(MA_DEFAULT_PERIOD_SIZE_IN_MILLISECONDS_LOW_LATENCY, nativeSampleRate); + } else { + return ma_calculate_buffer_size_in_frames_from_milliseconds(MA_DEFAULT_PERIOD_SIZE_IN_MILLISECONDS_CONSERVATIVE, nativeSampleRate); + } + } else { + return ma_calculate_buffer_size_in_frames_from_milliseconds(pDescriptor->periodSizeInMilliseconds, nativeSampleRate); + } + } else { + return pDescriptor->periodSizeInFrames; + } +} #endif /* MA_NO_DEVICE_IO */ @@ -33848,12 +33571,22 @@ MA_API ma_uint32 ma_scale_buffer_size(ma_uint32 baseBufferSize, float scale) MA_API ma_uint32 ma_calculate_buffer_size_in_milliseconds_from_frames(ma_uint32 bufferSizeInFrames, ma_uint32 sampleRate) { - return bufferSizeInFrames / (sampleRate/1000); + /* Prevent a division by zero. */ + if (sampleRate == 0) { + return 0; + } + + return bufferSizeInFrames*1000 / sampleRate; } MA_API ma_uint32 ma_calculate_buffer_size_in_frames_from_milliseconds(ma_uint32 bufferSizeInMilliseconds, ma_uint32 sampleRate) { - return bufferSizeInMilliseconds * (sampleRate/1000); + /* Prevent a division by zero. */ + if (sampleRate == 0) { + return 0; + } + + return bufferSizeInMilliseconds*sampleRate / 1000; } MA_API void ma_copy_pcm_frames(void* dst, const void* src, ma_uint64 frameCount, ma_format format, ma_uint32 channels) @@ -36585,13 +36318,15 @@ MA_API ma_result ma_biquad_reinit(const ma_biquad_config* pConfig, ma_biquad* pB static MA_INLINE void ma_biquad_process_pcm_frame_f32__direct_form_2_transposed(ma_biquad* pBQ, float* pY, const float* pX) { ma_uint32 c; + const ma_uint32 channels = pBQ->channels; const float b0 = pBQ->b0.f32; const float b1 = pBQ->b1.f32; const float b2 = pBQ->b2.f32; const float a1 = pBQ->a1.f32; const float a2 = pBQ->a2.f32; - for (c = 0; c < pBQ->channels; c += 1) { + MA_ASSUME(channels >= MA_MIN_CHANNELS && channels <= MA_MAX_CHANNELS); + for (c = 0; c < channels; c += 1) { float r1 = pBQ->r1[c].f32; float r2 = pBQ->r2[c].f32; float x = pX[c]; @@ -36615,13 +36350,15 @@ static MA_INLINE void ma_biquad_process_pcm_frame_f32(ma_biquad* pBQ, float* pY, static MA_INLINE void ma_biquad_process_pcm_frame_s16__direct_form_2_transposed(ma_biquad* pBQ, ma_int16* pY, const ma_int16* pX) { ma_uint32 c; + const ma_uint32 channels = pBQ->channels; const ma_int32 b0 = pBQ->b0.s32; const ma_int32 b1 = pBQ->b1.s32; const ma_int32 b2 = pBQ->b2.s32; const ma_int32 a1 = pBQ->a1.s32; const ma_int32 a2 = pBQ->a2.s32; - for (c = 0; c < pBQ->channels; c += 1) { + MA_ASSUME(channels >= MA_MIN_CHANNELS && channels <= MA_MAX_CHANNELS); + for (c = 0; c < channels; c += 1) { ma_int32 r1 = pBQ->r1[c].s32; ma_int32 r2 = pBQ->r2[c].s32; ma_int32 x = pX[c]; @@ -36678,7 +36415,7 @@ MA_API ma_result ma_biquad_process_pcm_frames(ma_biquad* pBQ, void* pFramesOut, return MA_SUCCESS; } -MA_API ma_uint32 ma_biquad_get_latency(ma_biquad* pBQ) +MA_API ma_uint32 ma_biquad_get_latency(const ma_biquad* pBQ) { if (pBQ == NULL) { return 0; @@ -36785,10 +36522,12 @@ MA_API ma_result ma_lpf1_reinit(const ma_lpf1_config* pConfig, ma_lpf1* pLPF) static MA_INLINE void ma_lpf1_process_pcm_frame_f32(ma_lpf1* pLPF, float* pY, const float* pX) { ma_uint32 c; + const ma_uint32 channels = pLPF->channels; const float a = pLPF->a.f32; const float b = 1 - a; - for (c = 0; c < pLPF->channels; c += 1) { + MA_ASSUME(channels >= MA_MIN_CHANNELS && channels <= MA_MAX_CHANNELS); + for (c = 0; c < channels; c += 1) { float r1 = pLPF->r1[c].f32; float x = pX[c]; float y; @@ -36803,10 +36542,12 @@ static MA_INLINE void ma_lpf1_process_pcm_frame_f32(ma_lpf1* pLPF, float* pY, co static MA_INLINE void ma_lpf1_process_pcm_frame_s16(ma_lpf1* pLPF, ma_int16* pY, const ma_int16* pX) { ma_uint32 c; + const ma_uint32 channels = pLPF->channels; const ma_int32 a = pLPF->a.s32; const ma_int32 b = ((1 << MA_BIQUAD_FIXED_POINT_SHIFT) - a); - for (c = 0; c < pLPF->channels; c += 1) { + MA_ASSUME(channels >= MA_MIN_CHANNELS && channels <= MA_MAX_CHANNELS); + for (c = 0; c < channels; c += 1) { ma_int32 r1 = pLPF->r1[c].s32; ma_int32 x = pX[c]; ma_int32 y; @@ -36854,7 +36595,7 @@ MA_API ma_result ma_lpf1_process_pcm_frames(ma_lpf1* pLPF, void* pFramesOut, con return MA_SUCCESS; } -MA_API ma_uint32 ma_lpf1_get_latency(ma_lpf1* pLPF) +MA_API ma_uint32 ma_lpf1_get_latency(const ma_lpf1* pLPF) { if (pLPF == NULL) { return 0; @@ -36955,7 +36696,7 @@ MA_API ma_result ma_lpf2_process_pcm_frames(ma_lpf2* pLPF, void* pFramesOut, con return ma_biquad_process_pcm_frames(&pLPF->bq, pFramesOut, pFramesIn, frameCount); } -MA_API ma_uint32 ma_lpf2_get_latency(ma_lpf2* pLPF) +MA_API ma_uint32 ma_lpf2_get_latency(const ma_lpf2* pLPF) { if (pLPF == NULL) { return 0; @@ -37186,7 +36927,7 @@ MA_API ma_result ma_lpf_process_pcm_frames(ma_lpf* pLPF, void* pFramesOut, const return MA_SUCCESS; } -MA_API ma_uint32 ma_lpf_get_latency(ma_lpf* pLPF) +MA_API ma_uint32 ma_lpf_get_latency(const ma_lpf* pLPF) { if (pLPF == NULL) { return 0; @@ -37292,10 +37033,12 @@ MA_API ma_result ma_hpf1_reinit(const ma_hpf1_config* pConfig, ma_hpf1* pHPF) static MA_INLINE void ma_hpf1_process_pcm_frame_f32(ma_hpf1* pHPF, float* pY, const float* pX) { ma_uint32 c; + const ma_uint32 channels = pHPF->channels; const float a = 1 - pHPF->a.f32; const float b = 1 - a; - for (c = 0; c < pHPF->channels; c += 1) { + MA_ASSUME(channels >= MA_MIN_CHANNELS && channels <= MA_MAX_CHANNELS); + for (c = 0; c < channels; c += 1) { float r1 = pHPF->r1[c].f32; float x = pX[c]; float y; @@ -37310,10 +37053,12 @@ static MA_INLINE void ma_hpf1_process_pcm_frame_f32(ma_hpf1* pHPF, float* pY, co static MA_INLINE void ma_hpf1_process_pcm_frame_s16(ma_hpf1* pHPF, ma_int16* pY, const ma_int16* pX) { ma_uint32 c; + const ma_uint32 channels = pHPF->channels; const ma_int32 a = ((1 << MA_BIQUAD_FIXED_POINT_SHIFT) - pHPF->a.s32); const ma_int32 b = ((1 << MA_BIQUAD_FIXED_POINT_SHIFT) - a); - for (c = 0; c < pHPF->channels; c += 1) { + MA_ASSUME(channels >= MA_MIN_CHANNELS && channels <= MA_MAX_CHANNELS); + for (c = 0; c < channels; c += 1) { ma_int32 r1 = pHPF->r1[c].s32; ma_int32 x = pX[c]; ma_int32 y; @@ -37361,7 +37106,7 @@ MA_API ma_result ma_hpf1_process_pcm_frames(ma_hpf1* pHPF, void* pFramesOut, con return MA_SUCCESS; } -MA_API ma_uint32 ma_hpf1_get_latency(ma_hpf1* pHPF) +MA_API ma_uint32 ma_hpf1_get_latency(const ma_hpf1* pHPF) { if (pHPF == NULL) { return 0; @@ -37462,7 +37207,7 @@ MA_API ma_result ma_hpf2_process_pcm_frames(ma_hpf2* pHPF, void* pFramesOut, con return ma_biquad_process_pcm_frames(&pHPF->bq, pFramesOut, pFramesIn, frameCount); } -MA_API ma_uint32 ma_hpf2_get_latency(ma_hpf2* pHPF) +MA_API ma_uint32 ma_hpf2_get_latency(const ma_hpf2* pHPF) { if (pHPF == NULL) { return 0; @@ -37675,7 +37420,7 @@ MA_API ma_result ma_hpf_process_pcm_frames(ma_hpf* pHPF, void* pFramesOut, const return MA_SUCCESS; } -MA_API ma_uint32 ma_hpf_get_latency(ma_hpf* pHPF) +MA_API ma_uint32 ma_hpf_get_latency(const ma_hpf* pHPF) { if (pHPF == NULL) { return 0; @@ -37801,7 +37546,7 @@ MA_API ma_result ma_bpf2_process_pcm_frames(ma_bpf2* pBPF, void* pFramesOut, con return ma_biquad_process_pcm_frames(&pBPF->bq, pFramesOut, pFramesIn, frameCount); } -MA_API ma_uint32 ma_bpf2_get_latency(ma_bpf2* pBPF) +MA_API ma_uint32 ma_bpf2_get_latency(const ma_bpf2* pBPF) { if (pBPF == NULL) { return 0; @@ -37977,7 +37722,7 @@ MA_API ma_result ma_bpf_process_pcm_frames(ma_bpf* pBPF, void* pFramesOut, const return MA_SUCCESS; } -MA_API ma_uint32 ma_bpf_get_latency(ma_bpf* pBPF) +MA_API ma_uint32 ma_bpf_get_latency(const ma_bpf* pBPF) { if (pBPF == NULL) { return 0; @@ -38102,7 +37847,7 @@ MA_API ma_result ma_notch2_process_pcm_frames(ma_notch2* pFilter, void* pFramesO return ma_biquad_process_pcm_frames(&pFilter->bq, pFramesOut, pFramesIn, frameCount); } -MA_API ma_uint32 ma_notch2_get_latency(ma_notch2* pFilter) +MA_API ma_uint32 ma_notch2_get_latency(const ma_notch2* pFilter) { if (pFilter == NULL) { return 0; @@ -38231,7 +37976,7 @@ MA_API ma_result ma_peak2_process_pcm_frames(ma_peak2* pFilter, void* pFramesOut return ma_biquad_process_pcm_frames(&pFilter->bq, pFramesOut, pFramesIn, frameCount); } -MA_API ma_uint32 ma_peak2_get_latency(ma_peak2* pFilter) +MA_API ma_uint32 ma_peak2_get_latency(const ma_peak2* pFilter) { if (pFilter == NULL) { return 0; @@ -38357,7 +38102,7 @@ MA_API ma_result ma_loshelf2_process_pcm_frames(ma_loshelf2* pFilter, void* pFra return ma_biquad_process_pcm_frames(&pFilter->bq, pFramesOut, pFramesIn, frameCount); } -MA_API ma_uint32 ma_loshelf2_get_latency(ma_loshelf2* pFilter) +MA_API ma_uint32 ma_loshelf2_get_latency(const ma_loshelf2* pFilter) { if (pFilter == NULL) { return 0; @@ -38483,7 +38228,7 @@ MA_API ma_result ma_hishelf2_process_pcm_frames(ma_hishelf2* pFilter, void* pFra return ma_biquad_process_pcm_frames(&pFilter->bq, pFramesOut, pFramesIn, frameCount); } -MA_API ma_uint32 ma_hishelf2_get_latency(ma_hishelf2* pFilter) +MA_API ma_uint32 ma_hishelf2_get_latency(const ma_hishelf2* pFilter) { if (pFilter == NULL) { return 0; @@ -38646,10 +38391,11 @@ static MA_INLINE ma_int16 ma_linear_resampler_mix_s16(ma_int16 x, ma_int16 y, ma return (ma_int16)(r >> shift); } -static void ma_linear_resampler_interpolate_frame_s16(ma_linear_resampler* pResampler, ma_int16* pFrameOut) +static void ma_linear_resampler_interpolate_frame_s16(ma_linear_resampler* pResampler, ma_int16* MA_RESTRICT pFrameOut) { ma_uint32 c; ma_uint32 a; + const ma_uint32 channels = pResampler->config.channels; const ma_uint32 shift = 12; MA_ASSERT(pResampler != NULL); @@ -38657,24 +38403,27 @@ static void ma_linear_resampler_interpolate_frame_s16(ma_linear_resampler* pResa a = (pResampler->inTimeFrac << shift) / pResampler->config.sampleRateOut; - for (c = 0; c < pResampler->config.channels; c += 1) { + MA_ASSUME(channels >= MA_MIN_CHANNELS && channels <= MA_MAX_CHANNELS); + for (c = 0; c < channels; c += 1) { ma_int16 s = ma_linear_resampler_mix_s16(pResampler->x0.s16[c], pResampler->x1.s16[c], a, shift); pFrameOut[c] = s; } } -static void ma_linear_resampler_interpolate_frame_f32(ma_linear_resampler* pResampler, float* pFrameOut) +static void ma_linear_resampler_interpolate_frame_f32(ma_linear_resampler* pResampler, float* MA_RESTRICT pFrameOut) { ma_uint32 c; float a; + const ma_uint32 channels = pResampler->config.channels; MA_ASSERT(pResampler != NULL); MA_ASSERT(pFrameOut != NULL); a = (float)pResampler->inTimeFrac / pResampler->config.sampleRateOut; - for (c = 0; c < pResampler->config.channels; c += 1) { + MA_ASSUME(channels >= MA_MIN_CHANNELS && channels <= MA_MAX_CHANNELS); + for (c = 0; c < channels; c += 1) { float s = ma_mix_f32_fast(pResampler->x0.f32[c], pResampler->x1.f32[c], a); pFrameOut[c] = s; } @@ -39041,7 +38790,7 @@ MA_API ma_result ma_linear_resampler_set_rate_ratio(ma_linear_resampler* pResamp } -MA_API ma_uint64 ma_linear_resampler_get_required_input_frame_count(ma_linear_resampler* pResampler, ma_uint64 outputFrameCount) +MA_API ma_uint64 ma_linear_resampler_get_required_input_frame_count(const ma_linear_resampler* pResampler, ma_uint64 outputFrameCount) { ma_uint64 inputFrameCount; @@ -39064,7 +38813,7 @@ MA_API ma_uint64 ma_linear_resampler_get_required_input_frame_count(ma_linear_re return inputFrameCount; } -MA_API ma_uint64 ma_linear_resampler_get_expected_output_frame_count(ma_linear_resampler* pResampler, ma_uint64 inputFrameCount) +MA_API ma_uint64 ma_linear_resampler_get_expected_output_frame_count(const ma_linear_resampler* pResampler, ma_uint64 inputFrameCount) { ma_uint64 outputFrameCount; ma_uint64 preliminaryInputFrameCountFromFrac; @@ -39101,7 +38850,7 @@ MA_API ma_uint64 ma_linear_resampler_get_expected_output_frame_count(ma_linear_r return outputFrameCount; } -MA_API ma_uint64 ma_linear_resampler_get_input_latency(ma_linear_resampler* pResampler) +MA_API ma_uint64 ma_linear_resampler_get_input_latency(const ma_linear_resampler* pResampler) { if (pResampler == NULL) { return 0; @@ -39110,7 +38859,7 @@ MA_API ma_uint64 ma_linear_resampler_get_input_latency(ma_linear_resampler* pRes return 1 + ma_lpf_get_latency(&pResampler->lpf); } -MA_API ma_uint64 ma_linear_resampler_get_output_latency(ma_linear_resampler* pResampler) +MA_API ma_uint64 ma_linear_resampler_get_output_latency(const ma_linear_resampler* pResampler) { if (pResampler == NULL) { return 0; @@ -39540,7 +39289,7 @@ MA_API ma_result ma_resampler_set_rate_ratio(ma_resampler* pResampler, float rat } } -MA_API ma_uint64 ma_resampler_get_required_input_frame_count(ma_resampler* pResampler, ma_uint64 outputFrameCount) +MA_API ma_uint64 ma_resampler_get_required_input_frame_count(const ma_resampler* pResampler, ma_uint64 outputFrameCount) { if (pResampler == NULL) { return 0; @@ -39580,7 +39329,7 @@ MA_API ma_uint64 ma_resampler_get_required_input_frame_count(ma_resampler* pResa return 0; } -MA_API ma_uint64 ma_resampler_get_expected_output_frame_count(ma_resampler* pResampler, ma_uint64 inputFrameCount) +MA_API ma_uint64 ma_resampler_get_expected_output_frame_count(const ma_resampler* pResampler, ma_uint64 inputFrameCount) { if (pResampler == NULL) { return 0; /* Invalid args. */ @@ -39620,7 +39369,7 @@ MA_API ma_uint64 ma_resampler_get_expected_output_frame_count(ma_resampler* pRes return 0; } -MA_API ma_uint64 ma_resampler_get_input_latency(ma_resampler* pResampler) +MA_API ma_uint64 ma_resampler_get_input_latency(const ma_resampler* pResampler) { if (pResampler == NULL) { return 0; @@ -39650,7 +39399,7 @@ MA_API ma_uint64 ma_resampler_get_input_latency(ma_resampler* pResampler) return 0; } -MA_API ma_uint64 ma_resampler_get_output_latency(ma_resampler* pResampler) +MA_API ma_uint64 ma_resampler_get_output_latency(const ma_resampler* pResampler) { if (pResampler == NULL) { return 0; @@ -41434,7 +41183,7 @@ MA_API ma_result ma_data_converter_set_rate_ratio(ma_data_converter* pConverter, return ma_resampler_set_rate_ratio(&pConverter->resampler, ratioInOut); } -MA_API ma_uint64 ma_data_converter_get_required_input_frame_count(ma_data_converter* pConverter, ma_uint64 outputFrameCount) +MA_API ma_uint64 ma_data_converter_get_required_input_frame_count(const ma_data_converter* pConverter, ma_uint64 outputFrameCount) { if (pConverter == NULL) { return 0; @@ -41447,7 +41196,7 @@ MA_API ma_uint64 ma_data_converter_get_required_input_frame_count(ma_data_conver } } -MA_API ma_uint64 ma_data_converter_get_expected_output_frame_count(ma_data_converter* pConverter, ma_uint64 inputFrameCount) +MA_API ma_uint64 ma_data_converter_get_expected_output_frame_count(const ma_data_converter* pConverter, ma_uint64 inputFrameCount) { if (pConverter == NULL) { return 0; @@ -41460,7 +41209,7 @@ MA_API ma_uint64 ma_data_converter_get_expected_output_frame_count(ma_data_conve } } -MA_API ma_uint64 ma_data_converter_get_input_latency(ma_data_converter* pConverter) +MA_API ma_uint64 ma_data_converter_get_input_latency(const ma_data_converter* pConverter) { if (pConverter == NULL) { return 0; @@ -41473,7 +41222,7 @@ MA_API ma_uint64 ma_data_converter_get_input_latency(ma_data_converter* pConvert return 0; /* No latency without a resampler. */ } -MA_API ma_uint64 ma_data_converter_get_output_latency(ma_data_converter* pConverter) +MA_API ma_uint64 ma_data_converter_get_output_latency(const ma_data_converter* pConverter) { if (pConverter == NULL) { return 0; @@ -42109,7 +41858,8 @@ MA_API void ma_get_standard_channel_map(ma_standard_channel_map standardChannelM ma_get_standard_channel_map_sndio(channels, pChannelMap); } break; - case ma_standard_channel_map_microsoft: + case ma_standard_channel_map_microsoft: /* Also default. */ + /*case ma_standard_channel_map_default;*/ default: { ma_get_standard_channel_map_microsoft(channels, pChannelMap); @@ -42917,12 +42667,12 @@ MA_API void* ma_pcm_rb_get_subbuffer_ptr(ma_pcm_rb* pRB, ma_uint32 subbufferInde -MA_API ma_result ma_duplex_rb_init(ma_uint32 inputSampleRate, ma_format captureFormat, ma_uint32 captureChannels, ma_uint32 captureSampleRate, ma_uint32 capturePeriodSizeInFrames, const ma_allocation_callbacks* pAllocationCallbacks, ma_duplex_rb* pRB) +MA_API ma_result ma_duplex_rb_init(ma_format captureFormat, ma_uint32 captureChannels, ma_uint32 sampleRate, ma_uint32 captureInternalSampleRate, ma_uint32 captureInternalPeriodSizeInFrames, const ma_allocation_callbacks* pAllocationCallbacks, ma_duplex_rb* pRB) { ma_result result; ma_uint32 sizeInFrames; - sizeInFrames = (ma_uint32)ma_calculate_frame_count_after_resampling(inputSampleRate, captureSampleRate, capturePeriodSizeInFrames * 5); + sizeInFrames = (ma_uint32)ma_calculate_frame_count_after_resampling(sampleRate, captureInternalSampleRate, captureInternalPeriodSizeInFrames * 5); if (sizeInFrames == 0) { return MA_INVALID_ARGS; } @@ -42933,7 +42683,7 @@ MA_API ma_result ma_duplex_rb_init(ma_uint32 inputSampleRate, ma_format captureF } /* Seek forward a bit so we have a bit of a buffer in case of desyncs. */ - ma_pcm_rb_seek_write((ma_pcm_rb*)pRB, capturePeriodSizeInFrames * 2); + ma_pcm_rb_seek_write((ma_pcm_rb*)pRB, captureInternalPeriodSizeInFrames * 2); return MA_SUCCESS; } @@ -43130,6 +42880,12 @@ MA_API ma_uint32 ma_get_bytes_per_sample(ma_format format) MA_API ma_result ma_data_source_read_pcm_frames(ma_data_source* pDataSource, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead, ma_bool32 loop) { ma_data_source_callbacks* pCallbacks = (ma_data_source_callbacks*)pDataSource; + + /* Safety. */ + if (pFramesRead != NULL) { + *pFramesRead = 0; + } + if (pCallbacks == NULL) { return MA_INVALID_ARGS; } @@ -43313,6 +43069,245 @@ MA_API ma_result ma_data_source_get_length_in_pcm_frames(ma_data_source* pDataSo + +static ma_result ma_audio_buffer_ref__data_source_on_read(ma_data_source* pDataSource, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead) +{ + ma_uint64 framesRead = ma_audio_buffer_ref_read_pcm_frames((ma_audio_buffer_ref*)pDataSource, pFramesOut, frameCount, MA_FALSE); + + if (pFramesRead != NULL) { + *pFramesRead = framesRead; + } + + if (framesRead < frameCount) { + return MA_AT_END; + } + + return MA_SUCCESS; +} + +static ma_result ma_audio_buffer_ref__data_source_on_seek(ma_data_source* pDataSource, ma_uint64 frameIndex) +{ + return ma_audio_buffer_ref_seek_to_pcm_frame((ma_audio_buffer_ref*)pDataSource, frameIndex); +} + +static ma_result ma_audio_buffer_ref__data_source_on_map(ma_data_source* pDataSource, void** ppFramesOut, ma_uint64* pFrameCount) +{ + return ma_audio_buffer_ref_map((ma_audio_buffer_ref*)pDataSource, ppFramesOut, pFrameCount); +} + +static ma_result ma_audio_buffer_ref__data_source_on_unmap(ma_data_source* pDataSource, ma_uint64 frameCount) +{ + return ma_audio_buffer_ref_unmap((ma_audio_buffer_ref*)pDataSource, frameCount); +} + +static ma_result ma_audio_buffer_ref__data_source_on_get_data_format(ma_data_source* pDataSource, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate) +{ + ma_audio_buffer_ref* pAudioBufferRef = (ma_audio_buffer_ref*)pDataSource; + + *pFormat = pAudioBufferRef->format; + *pChannels = pAudioBufferRef->channels; + *pSampleRate = 0; /* There is no notion of a sample rate with audio buffers. */ + + return MA_SUCCESS; +} + +static ma_result ma_audio_buffer_ref__data_source_on_get_cursor(ma_data_source* pDataSource, ma_uint64* pCursor) +{ + ma_audio_buffer_ref* pAudioBufferRef = (ma_audio_buffer_ref*)pDataSource; + + *pCursor = pAudioBufferRef->cursor; + + return MA_SUCCESS; +} + +static ma_result ma_audio_buffer_ref__data_source_on_get_length(ma_data_source* pDataSource, ma_uint64* pLength) +{ + ma_audio_buffer_ref* pAudioBufferRef = (ma_audio_buffer_ref*)pDataSource; + + *pLength = pAudioBufferRef->sizeInFrames; + + return MA_SUCCESS; +} + +MA_API ma_result ma_audio_buffer_ref_init(ma_format format, ma_uint32 channels, const void* pData, ma_uint64 sizeInFrames, ma_audio_buffer_ref* pAudioBufferRef) +{ + if (pAudioBufferRef == NULL) { + return MA_INVALID_ARGS; + } + + MA_ZERO_OBJECT(pAudioBufferRef); + + pAudioBufferRef->ds.onRead = ma_audio_buffer_ref__data_source_on_read; + pAudioBufferRef->ds.onSeek = ma_audio_buffer_ref__data_source_on_seek; + pAudioBufferRef->ds.onMap = ma_audio_buffer_ref__data_source_on_map; + pAudioBufferRef->ds.onUnmap = ma_audio_buffer_ref__data_source_on_unmap; + pAudioBufferRef->ds.onGetDataFormat = ma_audio_buffer_ref__data_source_on_get_data_format; + pAudioBufferRef->ds.onGetCursor = ma_audio_buffer_ref__data_source_on_get_cursor; + pAudioBufferRef->ds.onGetLength = ma_audio_buffer_ref__data_source_on_get_length; + pAudioBufferRef->format = format; + pAudioBufferRef->channels = channels; + pAudioBufferRef->cursor = 0; + pAudioBufferRef->sizeInFrames = sizeInFrames; + pAudioBufferRef->pData = pData; + + return MA_SUCCESS; +} + +MA_API ma_result ma_audio_buffer_ref_set_data(ma_audio_buffer_ref* pAudioBufferRef, const void* pData, ma_uint64 sizeInFrames) +{ + if (pAudioBufferRef == NULL) { + return MA_INVALID_ARGS; + } + + pAudioBufferRef->cursor = 0; + pAudioBufferRef->sizeInFrames = sizeInFrames; + pAudioBufferRef->pData = pData; + + return MA_SUCCESS; +} + +MA_API ma_uint64 ma_audio_buffer_ref_read_pcm_frames(ma_audio_buffer_ref* pAudioBufferRef, void* pFramesOut, ma_uint64 frameCount, ma_bool32 loop) +{ + ma_uint64 totalFramesRead = 0; + + if (pAudioBufferRef == NULL) { + return 0; + } + + if (frameCount == 0) { + return 0; + } + + while (totalFramesRead < frameCount) { + ma_uint64 framesAvailable = pAudioBufferRef->sizeInFrames - pAudioBufferRef->cursor; + ma_uint64 framesRemaining = frameCount - totalFramesRead; + ma_uint64 framesToRead; + + framesToRead = framesRemaining; + if (framesToRead > framesAvailable) { + framesToRead = framesAvailable; + } + + if (pFramesOut != NULL) { + ma_copy_pcm_frames(pFramesOut, ma_offset_ptr(pAudioBufferRef->pData, pAudioBufferRef->cursor * ma_get_bytes_per_frame(pAudioBufferRef->format, pAudioBufferRef->channels)), framesToRead, pAudioBufferRef->format, pAudioBufferRef->channels); + } + + totalFramesRead += framesToRead; + + pAudioBufferRef->cursor += framesToRead; + if (pAudioBufferRef->cursor == pAudioBufferRef->sizeInFrames) { + if (loop) { + pAudioBufferRef->cursor = 0; + } else { + break; /* We've reached the end and we're not looping. Done. */ + } + } + + MA_ASSERT(pAudioBufferRef->cursor < pAudioBufferRef->sizeInFrames); + } + + return totalFramesRead; +} + +MA_API ma_result ma_audio_buffer_ref_seek_to_pcm_frame(ma_audio_buffer_ref* pAudioBufferRef, ma_uint64 frameIndex) +{ + if (pAudioBufferRef == NULL) { + return MA_INVALID_ARGS; + } + + if (frameIndex > pAudioBufferRef->sizeInFrames) { + return MA_INVALID_ARGS; + } + + pAudioBufferRef->cursor = (size_t)frameIndex; + + return MA_SUCCESS; +} + +MA_API ma_result ma_audio_buffer_ref_map(ma_audio_buffer_ref* pAudioBufferRef, void** ppFramesOut, ma_uint64* pFrameCount) +{ + ma_uint64 framesAvailable; + ma_uint64 frameCount = 0; + + if (ppFramesOut != NULL) { + *ppFramesOut = NULL; /* Safety. */ + } + + if (pFrameCount != NULL) { + frameCount = *pFrameCount; + *pFrameCount = 0; /* Safety. */ + } + + if (pAudioBufferRef == NULL || ppFramesOut == NULL || pFrameCount == NULL) { + return MA_INVALID_ARGS; + } + + framesAvailable = pAudioBufferRef->sizeInFrames - pAudioBufferRef->cursor; + if (frameCount > framesAvailable) { + frameCount = framesAvailable; + } + + *ppFramesOut = ma_offset_ptr(pAudioBufferRef->pData, pAudioBufferRef->cursor * ma_get_bytes_per_frame(pAudioBufferRef->format, pAudioBufferRef->channels)); + *pFrameCount = frameCount; + + return MA_SUCCESS; +} + +MA_API ma_result ma_audio_buffer_ref_unmap(ma_audio_buffer_ref* pAudioBufferRef, ma_uint64 frameCount) +{ + ma_uint64 framesAvailable; + + if (pAudioBufferRef == NULL) { + return MA_INVALID_ARGS; + } + + framesAvailable = pAudioBufferRef->sizeInFrames - pAudioBufferRef->cursor; + if (frameCount > framesAvailable) { + return MA_INVALID_ARGS; /* The frame count was too big. This should never happen in an unmapping. Need to make sure the caller is aware of this. */ + } + + pAudioBufferRef->cursor += frameCount; + + if (pAudioBufferRef->cursor == pAudioBufferRef->sizeInFrames) { + return MA_AT_END; /* Successful. Need to tell the caller that the end has been reached so that it can loop if desired. */ + } else { + return MA_SUCCESS; + } +} + +MA_API ma_result ma_audio_buffer_ref_at_end(ma_audio_buffer_ref* pAudioBufferRef) +{ + if (pAudioBufferRef == NULL) { + return MA_FALSE; + } + + return pAudioBufferRef->cursor == pAudioBufferRef->sizeInFrames; +} + +MA_API ma_result ma_audio_buffer_ref_get_available_frames(ma_audio_buffer_ref* pAudioBufferRef, ma_uint64* pAvailableFrames) +{ + if (pAvailableFrames == NULL) { + return MA_INVALID_ARGS; + } + + *pAvailableFrames = 0; + + if (pAudioBufferRef == NULL) { + return MA_INVALID_ARGS; + } + + if (pAudioBufferRef->sizeInFrames <= pAudioBufferRef->cursor) { + *pAvailableFrames = 0; + } else { + *pAvailableFrames = pAudioBufferRef->sizeInFrames - pAudioBufferRef->cursor; + } + + return MA_SUCCESS; +} + + + + MA_API ma_audio_buffer_config ma_audio_buffer_config_init(ma_format format, ma_uint32 channels, ma_uint64 sizeInFrames, const void* pData, const ma_allocation_callbacks* pAllocationCallbacks) { ma_audio_buffer_config config; @@ -43327,68 +43322,10 @@ MA_API ma_audio_buffer_config ma_audio_buffer_config_init(ma_format format, ma_u return config; } - -static ma_result ma_audio_buffer__data_source_on_read(ma_data_source* pDataSource, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead) -{ - ma_uint64 framesRead = ma_audio_buffer_read_pcm_frames((ma_audio_buffer*)pDataSource, pFramesOut, frameCount, MA_FALSE); - - if (pFramesRead != NULL) { - *pFramesRead = framesRead; - } - - if (framesRead < frameCount) { - return MA_AT_END; - } - - return MA_SUCCESS; -} - -static ma_result ma_audio_buffer__data_source_on_seek(ma_data_source* pDataSource, ma_uint64 frameIndex) -{ - return ma_audio_buffer_seek_to_pcm_frame((ma_audio_buffer*)pDataSource, frameIndex); -} - -static ma_result ma_audio_buffer__data_source_on_map(ma_data_source* pDataSource, void** ppFramesOut, ma_uint64* pFrameCount) -{ - return ma_audio_buffer_map((ma_audio_buffer*)pDataSource, ppFramesOut, pFrameCount); -} - -static ma_result ma_audio_buffer__data_source_on_unmap(ma_data_source* pDataSource, ma_uint64 frameCount) -{ - return ma_audio_buffer_unmap((ma_audio_buffer*)pDataSource, frameCount); -} - -static ma_result ma_audio_buffer__data_source_on_get_data_format(ma_data_source* pDataSource, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate) -{ - ma_audio_buffer* pAudioBuffer = (ma_audio_buffer*)pDataSource; - - *pFormat = pAudioBuffer->format; - *pChannels = pAudioBuffer->channels; - *pSampleRate = 0; /* There is no notion of a sample rate with audio buffers. */ - - return MA_SUCCESS; -} - -static ma_result ma_audio_buffer__data_source_on_get_cursor(ma_data_source* pDataSource, ma_uint64* pCursor) -{ - ma_audio_buffer* pAudioBuffer = (ma_audio_buffer*)pDataSource; - - *pCursor = pAudioBuffer->cursor; - - return MA_SUCCESS; -} - -static ma_result ma_audio_buffer__data_source_on_get_length(ma_data_source* pDataSource, ma_uint64* pLength) -{ - ma_audio_buffer* pAudioBuffer = (ma_audio_buffer*)pDataSource; - - *pLength = pAudioBuffer->sizeInFrames; - - return MA_SUCCESS; -} - static ma_result ma_audio_buffer_init_ex(const ma_audio_buffer_config* pConfig, ma_bool32 doCopy, ma_audio_buffer* pAudioBuffer) { + ma_result result; + if (pAudioBuffer == NULL) { return MA_INVALID_ARGS; } @@ -43403,25 +43340,18 @@ static ma_result ma_audio_buffer_init_ex(const ma_audio_buffer_config* pConfig, return MA_INVALID_ARGS; /* Not allowing buffer sizes of 0 frames. */ } - pAudioBuffer->ds.onRead = ma_audio_buffer__data_source_on_read; - pAudioBuffer->ds.onSeek = ma_audio_buffer__data_source_on_seek; - pAudioBuffer->ds.onMap = ma_audio_buffer__data_source_on_map; - pAudioBuffer->ds.onUnmap = ma_audio_buffer__data_source_on_unmap; - pAudioBuffer->ds.onGetDataFormat = ma_audio_buffer__data_source_on_get_data_format; - pAudioBuffer->ds.onGetCursor = ma_audio_buffer__data_source_on_get_cursor; - pAudioBuffer->ds.onGetLength = ma_audio_buffer__data_source_on_get_length; - pAudioBuffer->format = pConfig->format; - pAudioBuffer->channels = pConfig->channels; - pAudioBuffer->cursor = 0; - pAudioBuffer->sizeInFrames = pConfig->sizeInFrames; - pAudioBuffer->pData = NULL; /* Set properly later. */ + result = ma_audio_buffer_ref_init(pConfig->format, pConfig->channels, NULL, 0, &pAudioBuffer->ref); + if (result != MA_SUCCESS) { + return result; + } + ma_allocation_callbacks_init_copy(&pAudioBuffer->allocationCallbacks, &pConfig->allocationCallbacks); if (doCopy) { ma_uint64 allocationSizeInBytes; void* pData; - allocationSizeInBytes = pAudioBuffer->sizeInFrames * ma_get_bytes_per_frame(pAudioBuffer->format, pAudioBuffer->channels); + allocationSizeInBytes = pConfig->sizeInFrames * ma_get_bytes_per_frame(pConfig->format, pConfig->channels); if (allocationSizeInBytes > MA_SIZE_MAX) { return MA_OUT_OF_MEMORY; /* Too big. */ } @@ -43432,15 +43362,15 @@ static ma_result ma_audio_buffer_init_ex(const ma_audio_buffer_config* pConfig, } if (pConfig->pData != NULL) { - ma_copy_pcm_frames(pData, pConfig->pData, pAudioBuffer->sizeInFrames, pAudioBuffer->format, pAudioBuffer->channels); + ma_copy_pcm_frames(pData, pConfig->pData, pConfig->sizeInFrames, pConfig->format, pConfig->channels); } else { - ma_silence_pcm_frames(pData, pAudioBuffer->sizeInFrames, pAudioBuffer->format, pAudioBuffer->channels); + ma_silence_pcm_frames(pData, pConfig->sizeInFrames, pConfig->format, pConfig->channels); } - pAudioBuffer->pData = pData; + ma_audio_buffer_ref_set_data(&pAudioBuffer->ref, pData, pConfig->sizeInFrames); pAudioBuffer->ownsData = MA_TRUE; } else { - pAudioBuffer->pData = pConfig->pData; + ma_audio_buffer_ref_set_data(&pAudioBuffer->ref, pConfig->pData, pConfig->sizeInFrames); pAudioBuffer->ownsData = MA_FALSE; } @@ -43453,13 +43383,12 @@ static void ma_audio_buffer_uninit_ex(ma_audio_buffer* pAudioBuffer, ma_bool32 d return; } - if (pAudioBuffer->ownsData && pAudioBuffer->pData != &pAudioBuffer->_pExtraData[0]) { - ma__free_from_callbacks((void*)pAudioBuffer->pData, &pAudioBuffer->allocationCallbacks); /* Naugty const cast, but OK in this case since we've guarded it with the ownsData check. */ + if (pAudioBuffer->ownsData && pAudioBuffer->ref.pData != &pAudioBuffer->_pExtraData[0]) { + ma__free_from_callbacks((void*)pAudioBuffer->ref.pData, &pAudioBuffer->allocationCallbacks); /* Naugty const cast, but OK in this case since we've guarded it with the ownsData check. */ } if (doFree) { - ma_allocation_callbacks allocationCallbacks = pAudioBuffer->allocationCallbacks; - ma__free_from_callbacks(pAudioBuffer, &allocationCallbacks); + ma__free_from_callbacks(pAudioBuffer, &pAudioBuffer->allocationCallbacks); } } @@ -43534,45 +43463,11 @@ MA_API void ma_audio_buffer_uninit_and_free(ma_audio_buffer* pAudioBuffer) MA_API ma_uint64 ma_audio_buffer_read_pcm_frames(ma_audio_buffer* pAudioBuffer, void* pFramesOut, ma_uint64 frameCount, ma_bool32 loop) { - ma_uint64 totalFramesRead = 0; - if (pAudioBuffer == NULL) { return 0; } - if (frameCount == 0) { - return 0; - } - - while (totalFramesRead < frameCount) { - ma_uint64 framesAvailable = pAudioBuffer->sizeInFrames - pAudioBuffer->cursor; - ma_uint64 framesRemaining = frameCount - totalFramesRead; - ma_uint64 framesToRead; - - framesToRead = framesRemaining; - if (framesToRead > framesAvailable) { - framesToRead = framesAvailable; - } - - if (pFramesOut != NULL) { - ma_copy_pcm_frames(pFramesOut, ma_offset_ptr(pAudioBuffer->pData, pAudioBuffer->cursor * ma_get_bytes_per_frame(pAudioBuffer->format, pAudioBuffer->channels)), framesToRead, pAudioBuffer->format, pAudioBuffer->channels); - } - - totalFramesRead += framesToRead; - - pAudioBuffer->cursor += framesToRead; - if (pAudioBuffer->cursor == pAudioBuffer->sizeInFrames) { - if (loop) { - pAudioBuffer->cursor = 0; - } else { - break; /* We've reached the end and we're not looping. Done. */ - } - } - - MA_ASSERT(pAudioBuffer->cursor < pAudioBuffer->sizeInFrames); - } - - return totalFramesRead; + return ma_audio_buffer_ref_read_pcm_frames(&pAudioBuffer->ref, pFramesOut, frameCount, loop); } MA_API ma_result ma_audio_buffer_seek_to_pcm_frame(ma_audio_buffer* pAudioBuffer, ma_uint64 frameIndex) @@ -43581,64 +43476,33 @@ MA_API ma_result ma_audio_buffer_seek_to_pcm_frame(ma_audio_buffer* pAudioBuffer return MA_INVALID_ARGS; } - if (frameIndex > pAudioBuffer->sizeInFrames) { - return MA_INVALID_ARGS; - } - - pAudioBuffer->cursor = (size_t)frameIndex; - - return MA_SUCCESS; + return ma_audio_buffer_ref_seek_to_pcm_frame(&pAudioBuffer->ref, frameIndex); } MA_API ma_result ma_audio_buffer_map(ma_audio_buffer* pAudioBuffer, void** ppFramesOut, ma_uint64* pFrameCount) { - ma_uint64 framesAvailable; - ma_uint64 frameCount = 0; - if (ppFramesOut != NULL) { *ppFramesOut = NULL; /* Safety. */ } - if (pFrameCount != NULL) { - frameCount = *pFrameCount; - *pFrameCount = 0; /* Safety. */ - } + if (pAudioBuffer == NULL) { + if (pFrameCount != NULL) { + *pFrameCount = 0; + } - if (pAudioBuffer == NULL || ppFramesOut == NULL || pFrameCount == NULL) { return MA_INVALID_ARGS; } - framesAvailable = pAudioBuffer->sizeInFrames - pAudioBuffer->cursor; - if (frameCount > framesAvailable) { - frameCount = framesAvailable; - } - - *ppFramesOut = ma_offset_ptr(pAudioBuffer->pData, pAudioBuffer->cursor * ma_get_bytes_per_frame(pAudioBuffer->format, pAudioBuffer->channels)); - *pFrameCount = frameCount; - - return MA_SUCCESS; + return ma_audio_buffer_ref_map(&pAudioBuffer->ref, ppFramesOut, pFrameCount); } MA_API ma_result ma_audio_buffer_unmap(ma_audio_buffer* pAudioBuffer, ma_uint64 frameCount) { - ma_uint64 framesAvailable; - if (pAudioBuffer == NULL) { return MA_INVALID_ARGS; } - framesAvailable = pAudioBuffer->sizeInFrames - pAudioBuffer->cursor; - if (frameCount > framesAvailable) { - return MA_INVALID_ARGS; /* The frame count was too big. This should never happen in an unmapping. Need to make sure the caller is aware of this. */ - } - - pAudioBuffer->cursor += frameCount; - - if (pAudioBuffer->cursor == pAudioBuffer->sizeInFrames) { - return MA_AT_END; /* Successful. Need to tell the caller that the end has been reached so that it can loop if desired. */ - } else { - return MA_SUCCESS; - } + return ma_audio_buffer_ref_unmap(&pAudioBuffer->ref, frameCount); } MA_API ma_result ma_audio_buffer_at_end(ma_audio_buffer* pAudioBuffer) @@ -43647,7 +43511,7 @@ MA_API ma_result ma_audio_buffer_at_end(ma_audio_buffer* pAudioBuffer) return MA_FALSE; } - return pAudioBuffer->cursor == pAudioBuffer->sizeInFrames; + return ma_audio_buffer_ref_at_end(&pAudioBuffer->ref); } MA_API ma_result ma_audio_buffer_get_available_frames(ma_audio_buffer* pAudioBuffer, ma_uint64* pAvailableFrames) @@ -43662,13 +43526,7 @@ MA_API ma_result ma_audio_buffer_get_available_frames(ma_audio_buffer* pAudioBuf return MA_INVALID_ARGS; } - if (pAudioBuffer->sizeInFrames <= pAudioBuffer->cursor) { - *pAvailableFrames = 0; - } else { - *pAvailableFrames = pAudioBuffer->sizeInFrames - pAudioBuffer->cursor; - } - - return MA_SUCCESS; + return ma_audio_buffer_ref_get_available_frames(&pAudioBuffer->ref, pAvailableFrames); } @@ -43831,7 +43689,7 @@ MA_API ma_result ma_vfs_info(ma_vfs* pVFS, ma_vfs_file file, ma_file_info* pInfo } -static ma_result ma_vfs_open_and_read_file_ex(ma_vfs* pVFS, const char* pFilePath, void** ppData, size_t* pSize, const ma_allocation_callbacks* pAllocationCallbacks, ma_uint32 allocationType) +static ma_result ma_vfs_open_and_read_file_ex(ma_vfs* pVFS, const char* pFilePath, const wchar_t* pFilePathW, void** ppData, size_t* pSize, const ma_allocation_callbacks* pAllocationCallbacks, ma_uint32 allocationType) { ma_result result; ma_vfs_file file; @@ -43852,7 +43710,11 @@ static ma_result ma_vfs_open_and_read_file_ex(ma_vfs* pVFS, const char* pFilePat return MA_INVALID_ARGS; } - result = ma_vfs_open(pVFS, pFilePath, MA_OPEN_MODE_READ, &file); + if (pFilePath != NULL) { + result = ma_vfs_open(pVFS, pFilePath, MA_OPEN_MODE_READ, &file); + } else { + result = ma_vfs_open_w(pVFS, pFilePathW, MA_OPEN_MODE_READ, &file); + } if (result != MA_SUCCESS) { return result; } @@ -43892,9 +43754,14 @@ static ma_result ma_vfs_open_and_read_file_ex(ma_vfs* pVFS, const char* pFilePat return MA_SUCCESS; } -ma_result ma_vfs_open_and_read_file(ma_vfs* pVFS, const char* pFilePath, void** ppData, size_t* pSize, const ma_allocation_callbacks* pAllocationCallbacks) +MA_API ma_result ma_vfs_open_and_read_file(ma_vfs* pVFS, const char* pFilePath, void** ppData, size_t* pSize, const ma_allocation_callbacks* pAllocationCallbacks) { - return ma_vfs_open_and_read_file_ex(pVFS, pFilePath, ppData, pSize, pAllocationCallbacks, 0 /*MA_ALLOCATION_TYPE_GENERAL*/); + return ma_vfs_open_and_read_file_ex(pVFS, pFilePath, NULL, ppData, pSize, pAllocationCallbacks, 0 /*MA_ALLOCATION_TYPE_GENERAL*/); +} + +MA_API ma_result ma_vfs_open_and_read_file_w(ma_vfs* pVFS, const wchar_t* pFilePath, void** ppData, size_t* pSize, const ma_allocation_callbacks* pAllocationCallbacks) +{ + return ma_vfs_open_and_read_file_ex(pVFS, NULL, pFilePath, ppData, pSize, pAllocationCallbacks, 0 /*MA_ALLOCATION_TYPE_GENERAL*/); } @@ -44592,7 +44459,7 @@ extern "C" { #define DRWAV_XSTRINGIFY(x) DRWAV_STRINGIFY(x) #define DRWAV_VERSION_MAJOR 0 #define DRWAV_VERSION_MINOR 12 -#define DRWAV_VERSION_REVISION 16 +#define DRWAV_VERSION_REVISION 19 #define DRWAV_VERSION_STRING DRWAV_XSTRINGIFY(DRWAV_VERSION_MAJOR) "." DRWAV_XSTRINGIFY(DRWAV_VERSION_MINOR) "." DRWAV_XSTRINGIFY(DRWAV_VERSION_REVISION) #include typedef signed char drwav_int8; @@ -44965,7 +44832,7 @@ extern "C" { #define DRFLAC_XSTRINGIFY(x) DRFLAC_STRINGIFY(x) #define DRFLAC_VERSION_MAJOR 0 #define DRFLAC_VERSION_MINOR 12 -#define DRFLAC_VERSION_REVISION 25 +#define DRFLAC_VERSION_REVISION 29 #define DRFLAC_VERSION_STRING DRFLAC_XSTRINGIFY(DRFLAC_VERSION_MAJOR) "." DRFLAC_XSTRINGIFY(DRFLAC_VERSION_MINOR) "." DRFLAC_XSTRINGIFY(DRFLAC_VERSION_REVISION) #include typedef signed char drflac_int8; @@ -45326,7 +45193,7 @@ extern "C" { #define DRMP3_XSTRINGIFY(x) DRMP3_STRINGIFY(x) #define DRMP3_VERSION_MAJOR 0 #define DRMP3_VERSION_MINOR 6 -#define DRMP3_VERSION_REVISION 25 +#define DRMP3_VERSION_REVISION 27 #define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION) #include typedef signed char drmp3_int8; @@ -48864,20 +48731,22 @@ static MA_INLINE ma_uint64 ma_noise_read_pcm_frames__white(ma_noise* pNoise, voi { ma_uint64 iFrame; ma_uint32 iChannel; + const ma_uint32 channels = pNoise->config.channels; + MA_ASSUME(channels >= MA_MIN_CHANNELS && channels <= MA_MAX_CHANNELS); if (pNoise->config.format == ma_format_f32) { float* pFramesOutF32 = (float*)pFramesOut; if (pNoise->config.duplicateChannels) { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { float s = ma_noise_f32_white(pNoise); - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { - pFramesOutF32[iFrame*pNoise->config.channels + iChannel] = s; + for (iChannel = 0; iChannel < channels; iChannel += 1) { + pFramesOutF32[iFrame*channels + iChannel] = s; } } } else { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { - pFramesOutF32[iFrame*pNoise->config.channels + iChannel] = ma_noise_f32_white(pNoise); + for (iChannel = 0; iChannel < channels; iChannel += 1) { + pFramesOutF32[iFrame*channels + iChannel] = ma_noise_f32_white(pNoise); } } } @@ -48886,31 +48755,31 @@ static MA_INLINE ma_uint64 ma_noise_read_pcm_frames__white(ma_noise* pNoise, voi if (pNoise->config.duplicateChannels) { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { ma_int16 s = ma_noise_s16_white(pNoise); - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { - pFramesOutS16[iFrame*pNoise->config.channels + iChannel] = s; + for (iChannel = 0; iChannel < channels; iChannel += 1) { + pFramesOutS16[iFrame*channels + iChannel] = s; } } } else { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { - pFramesOutS16[iFrame*pNoise->config.channels + iChannel] = ma_noise_s16_white(pNoise); + for (iChannel = 0; iChannel < channels; iChannel += 1) { + pFramesOutS16[iFrame*channels + iChannel] = ma_noise_s16_white(pNoise); } } } } else { - ma_uint32 bps = ma_get_bytes_per_sample(pNoise->config.format); - ma_uint32 bpf = bps * pNoise->config.channels; + const ma_uint32 bps = ma_get_bytes_per_sample(pNoise->config.format); + const ma_uint32 bpf = bps * channels; if (pNoise->config.duplicateChannels) { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { float s = ma_noise_f32_white(pNoise); - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { + for (iChannel = 0; iChannel < channels; iChannel += 1) { ma_pcm_convert(ma_offset_ptr(pFramesOut, iFrame*bpf + iChannel*bps), pNoise->config.format, &s, ma_format_f32, 1, ma_dither_mode_none); } } } else { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { + for (iChannel = 0; iChannel < channels; iChannel += 1) { float s = ma_noise_f32_white(pNoise); ma_pcm_convert(ma_offset_ptr(pFramesOut, iFrame*bpf + iChannel*bps), pNoise->config.format, &s, ma_format_f32, 1, ma_dither_mode_none); } @@ -48981,20 +48850,22 @@ static MA_INLINE ma_uint64 ma_noise_read_pcm_frames__pink(ma_noise* pNoise, void { ma_uint64 iFrame; ma_uint32 iChannel; + const ma_uint32 channels = pNoise->config.channels; + MA_ASSUME(channels >= MA_MIN_CHANNELS && channels <= MA_MAX_CHANNELS); if (pNoise->config.format == ma_format_f32) { float* pFramesOutF32 = (float*)pFramesOut; if (pNoise->config.duplicateChannels) { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { float s = ma_noise_f32_pink(pNoise, 0); - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { - pFramesOutF32[iFrame*pNoise->config.channels + iChannel] = s; + for (iChannel = 0; iChannel < channels; iChannel += 1) { + pFramesOutF32[iFrame*channels + iChannel] = s; } } } else { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { - pFramesOutF32[iFrame*pNoise->config.channels + iChannel] = ma_noise_f32_pink(pNoise, iChannel); + for (iChannel = 0; iChannel < channels; iChannel += 1) { + pFramesOutF32[iFrame*channels + iChannel] = ma_noise_f32_pink(pNoise, iChannel); } } } @@ -49003,31 +48874,31 @@ static MA_INLINE ma_uint64 ma_noise_read_pcm_frames__pink(ma_noise* pNoise, void if (pNoise->config.duplicateChannels) { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { ma_int16 s = ma_noise_s16_pink(pNoise, 0); - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { - pFramesOutS16[iFrame*pNoise->config.channels + iChannel] = s; + for (iChannel = 0; iChannel < channels; iChannel += 1) { + pFramesOutS16[iFrame*channels + iChannel] = s; } } } else { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { - pFramesOutS16[iFrame*pNoise->config.channels + iChannel] = ma_noise_s16_pink(pNoise, iChannel); + for (iChannel = 0; iChannel < channels; iChannel += 1) { + pFramesOutS16[iFrame*channels + iChannel] = ma_noise_s16_pink(pNoise, iChannel); } } } } else { - ma_uint32 bps = ma_get_bytes_per_sample(pNoise->config.format); - ma_uint32 bpf = bps * pNoise->config.channels; + const ma_uint32 bps = ma_get_bytes_per_sample(pNoise->config.format); + const ma_uint32 bpf = bps * channels; if (pNoise->config.duplicateChannels) { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { float s = ma_noise_f32_pink(pNoise, 0); - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { + for (iChannel = 0; iChannel < channels; iChannel += 1) { ma_pcm_convert(ma_offset_ptr(pFramesOut, iFrame*bpf + iChannel*bps), pNoise->config.format, &s, ma_format_f32, 1, ma_dither_mode_none); } } } else { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { + for (iChannel = 0; iChannel < channels; iChannel += 1) { float s = ma_noise_f32_pink(pNoise, iChannel); ma_pcm_convert(ma_offset_ptr(pFramesOut, iFrame*bpf + iChannel*bps), pNoise->config.format, &s, ma_format_f32, 1, ma_dither_mode_none); } @@ -49061,20 +48932,22 @@ static MA_INLINE ma_uint64 ma_noise_read_pcm_frames__brownian(ma_noise* pNoise, { ma_uint64 iFrame; ma_uint32 iChannel; + const ma_uint32 channels = pNoise->config.channels; + MA_ASSUME(channels >= MA_MIN_CHANNELS && channels <= MA_MAX_CHANNELS); if (pNoise->config.format == ma_format_f32) { float* pFramesOutF32 = (float*)pFramesOut; if (pNoise->config.duplicateChannels) { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { float s = ma_noise_f32_brownian(pNoise, 0); - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { - pFramesOutF32[iFrame*pNoise->config.channels + iChannel] = s; + for (iChannel = 0; iChannel < channels; iChannel += 1) { + pFramesOutF32[iFrame*channels + iChannel] = s; } } } else { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { - pFramesOutF32[iFrame*pNoise->config.channels + iChannel] = ma_noise_f32_brownian(pNoise, iChannel); + for (iChannel = 0; iChannel < channels; iChannel += 1) { + pFramesOutF32[iFrame*channels + iChannel] = ma_noise_f32_brownian(pNoise, iChannel); } } } @@ -49083,31 +48956,31 @@ static MA_INLINE ma_uint64 ma_noise_read_pcm_frames__brownian(ma_noise* pNoise, if (pNoise->config.duplicateChannels) { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { ma_int16 s = ma_noise_s16_brownian(pNoise, 0); - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { - pFramesOutS16[iFrame*pNoise->config.channels + iChannel] = s; + for (iChannel = 0; iChannel < channels; iChannel += 1) { + pFramesOutS16[iFrame*channels + iChannel] = s; } } } else { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { - pFramesOutS16[iFrame*pNoise->config.channels + iChannel] = ma_noise_s16_brownian(pNoise, iChannel); + for (iChannel = 0; iChannel < channels; iChannel += 1) { + pFramesOutS16[iFrame*channels + iChannel] = ma_noise_s16_brownian(pNoise, iChannel); } } } } else { - ma_uint32 bps = ma_get_bytes_per_sample(pNoise->config.format); - ma_uint32 bpf = bps * pNoise->config.channels; + const ma_uint32 bps = ma_get_bytes_per_sample(pNoise->config.format); + const ma_uint32 bpf = bps * channels; if (pNoise->config.duplicateChannels) { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { float s = ma_noise_f32_brownian(pNoise, 0); - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { + for (iChannel = 0; iChannel < channels; iChannel += 1) { ma_pcm_convert(ma_offset_ptr(pFramesOut, iFrame*bpf + iChannel*bps), pNoise->config.format, &s, ma_format_f32, 1, ma_dither_mode_none); } } } else { for (iFrame = 0; iFrame < frameCount; iFrame += 1) { - for (iChannel = 0; iChannel < pNoise->config.channels; iChannel += 1) { + for (iChannel = 0; iChannel < channels; iChannel += 1) { float s = ma_noise_f32_brownian(pNoise, iChannel); ma_pcm_convert(ma_offset_ptr(pFramesOut, iFrame*bpf + iChannel*bps), pNoise->config.format, &s, ma_format_f32, 1, ma_dither_mode_none); } @@ -49284,24 +49157,6 @@ static const drwav_uint8 drwavGUID_W64_FMT [16] = {0x66,0x6D,0x74,0x20, 0xF3,0xA static const drwav_uint8 drwavGUID_W64_FACT[16] = {0x66,0x61,0x63,0x74, 0xF3,0xAC, 0xD3,0x11, 0x8C,0xD1, 0x00,0xC0,0x4F,0x8E,0xDB,0x8A}; static const drwav_uint8 drwavGUID_W64_DATA[16] = {0x64,0x61,0x74,0x61, 0xF3,0xAC, 0xD3,0x11, 0x8C,0xD1, 0x00,0xC0,0x4F,0x8E,0xDB,0x8A}; static const drwav_uint8 drwavGUID_W64_SMPL[16] = {0x73,0x6D,0x70,0x6C, 0xF3,0xAC, 0xD3,0x11, 0x8C,0xD1, 0x00,0xC0,0x4F,0x8E,0xDB,0x8A}; -static DRWAV_INLINE drwav_bool32 drwav__guid_equal(const drwav_uint8 a[16], const drwav_uint8 b[16]) -{ - int i; - for (i = 0; i < 16; i += 1) { - if (a[i] != b[i]) { - return DRWAV_FALSE; - } - } - return DRWAV_TRUE; -} -static DRWAV_INLINE drwav_bool32 drwav__fourcc_equal(const drwav_uint8* a, const char* b) -{ - return - a[0] == b[0] && - a[1] == b[1] && - a[2] == b[2] && - a[3] == b[3]; -} static DRWAV_INLINE int drwav__is_little_endian(void) { #if defined(DRWAV_X86) || defined(DRWAV_X64) @@ -49313,32 +49168,6 @@ static DRWAV_INLINE int drwav__is_little_endian(void) return (*(char*)&n) == 1; #endif } -static DRWAV_INLINE drwav_uint16 drwav__bytes_to_u16(const drwav_uint8* data) -{ - return (data[0] << 0) | (data[1] << 8); -} -static DRWAV_INLINE drwav_int16 drwav__bytes_to_s16(const drwav_uint8* data) -{ - return (short)drwav__bytes_to_u16(data); -} -static DRWAV_INLINE drwav_uint32 drwav__bytes_to_u32(const drwav_uint8* data) -{ - return (data[0] << 0) | (data[1] << 8) | (data[2] << 16) | (data[3] << 24); -} -static DRWAV_INLINE drwav_int32 drwav__bytes_to_s32(const drwav_uint8* data) -{ - return (drwav_int32)drwav__bytes_to_u32(data); -} -static DRWAV_INLINE drwav_uint64 drwav__bytes_to_u64(const drwav_uint8* data) -{ - return - ((drwav_uint64)data[0] << 0) | ((drwav_uint64)data[1] << 8) | ((drwav_uint64)data[2] << 16) | ((drwav_uint64)data[3] << 24) | - ((drwav_uint64)data[4] << 32) | ((drwav_uint64)data[5] << 40) | ((drwav_uint64)data[6] << 48) | ((drwav_uint64)data[7] << 56); -} -static DRWAV_INLINE drwav_int64 drwav__bytes_to_s64(const drwav_uint8* data) -{ - return (drwav_int64)drwav__bytes_to_u64(data); -} static DRWAV_INLINE void drwav__bytes_to_guid(const drwav_uint8* data, drwav_uint8* guid) { int i; @@ -49553,22 +49382,22 @@ static DRWAV_INLINE void drwav__bswap_samples(void* pSamples, drwav_uint64 sampl } break; } } -static void* drwav__malloc_default(size_t sz, void* pUserData) +DRWAV_PRIVATE void* drwav__malloc_default(size_t sz, void* pUserData) { (void)pUserData; return DRWAV_MALLOC(sz); } -static void* drwav__realloc_default(void* p, size_t sz, void* pUserData) +DRWAV_PRIVATE void* drwav__realloc_default(void* p, size_t sz, void* pUserData) { (void)pUserData; return DRWAV_REALLOC(p, sz); } -static void drwav__free_default(void* p, void* pUserData) +DRWAV_PRIVATE void drwav__free_default(void* p, void* pUserData) { (void)pUserData; DRWAV_FREE(p); } -static void* drwav__malloc_from_callbacks(size_t sz, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE void* drwav__malloc_from_callbacks(size_t sz, const drwav_allocation_callbacks* pAllocationCallbacks) { if (pAllocationCallbacks == NULL) { return NULL; @@ -49581,7 +49410,7 @@ static void* drwav__malloc_from_callbacks(size_t sz, const drwav_allocation_call } return NULL; } -static void* drwav__realloc_from_callbacks(void* p, size_t szNew, size_t szOld, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE void* drwav__realloc_from_callbacks(void* p, size_t szNew, size_t szOld, const drwav_allocation_callbacks* pAllocationCallbacks) { if (pAllocationCallbacks == NULL) { return NULL; @@ -49603,7 +49432,7 @@ static void* drwav__realloc_from_callbacks(void* p, size_t szNew, size_t szOld, } return NULL; } -static void drwav__free_from_callbacks(void* p, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE void drwav__free_from_callbacks(void* p, const drwav_allocation_callbacks* pAllocationCallbacks) { if (p == NULL || pAllocationCallbacks == NULL) { return; @@ -49612,7 +49441,7 @@ static void drwav__free_from_callbacks(void* p, const drwav_allocation_callbacks pAllocationCallbacks->onFree(p, pAllocationCallbacks->pUserData); } } -static drwav_allocation_callbacks drwav_copy_allocation_callbacks_or_defaults(const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_allocation_callbacks drwav_copy_allocation_callbacks_or_defaults(const drwav_allocation_callbacks* pAllocationCallbacks) { if (pAllocationCallbacks != NULL) { return *pAllocationCallbacks; @@ -49631,18 +49460,18 @@ static DRWAV_INLINE drwav_bool32 drwav__is_compressed_format_tag(drwav_uint16 fo formatTag == DR_WAVE_FORMAT_ADPCM || formatTag == DR_WAVE_FORMAT_DVI_ADPCM; } -static unsigned int drwav__chunk_padding_size_riff(drwav_uint64 chunkSize) +DRWAV_PRIVATE unsigned int drwav__chunk_padding_size_riff(drwav_uint64 chunkSize) { return (unsigned int)(chunkSize % 2); } -static unsigned int drwav__chunk_padding_size_w64(drwav_uint64 chunkSize) +DRWAV_PRIVATE unsigned int drwav__chunk_padding_size_w64(drwav_uint64 chunkSize) { return (unsigned int)(chunkSize % 8); } -static drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 samplesToRead, drwav_int16* pBufferOut); -static drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 samplesToRead, drwav_int16* pBufferOut); -static drwav_bool32 drwav_init_write__internal(drwav* pWav, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount); -static drwav_result drwav__read_chunk_header(drwav_read_proc onRead, void* pUserData, drwav_container container, drwav_uint64* pRunningBytesReadOut, drwav_chunk_header* pHeaderOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 samplesToRead, drwav_int16* pBufferOut); +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 samplesToRead, drwav_int16* pBufferOut); +DRWAV_PRIVATE drwav_bool32 drwav_init_write__internal(drwav* pWav, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount); +DRWAV_PRIVATE drwav_result drwav__read_chunk_header(drwav_read_proc onRead, void* pUserData, drwav_container container, drwav_uint64* pRunningBytesReadOut, drwav_chunk_header* pHeaderOut) { if (container == drwav_container_riff || container == drwav_container_rf64) { drwav_uint8 sizeInBytes[4]; @@ -49652,7 +49481,7 @@ static drwav_result drwav__read_chunk_header(drwav_read_proc onRead, void* pUser if (onRead(pUserData, sizeInBytes, 4) != 4) { return DRWAV_INVALID_FILE; } - pHeaderOut->sizeInBytes = drwav__bytes_to_u32(sizeInBytes); + pHeaderOut->sizeInBytes = drwav_bytes_to_u32(sizeInBytes); pHeaderOut->paddingSize = drwav__chunk_padding_size_riff(pHeaderOut->sizeInBytes); *pRunningBytesReadOut += 8; } else { @@ -49663,13 +49492,13 @@ static drwav_result drwav__read_chunk_header(drwav_read_proc onRead, void* pUser if (onRead(pUserData, sizeInBytes, 8) != 8) { return DRWAV_INVALID_FILE; } - pHeaderOut->sizeInBytes = drwav__bytes_to_u64(sizeInBytes) - 24; + pHeaderOut->sizeInBytes = drwav_bytes_to_u64(sizeInBytes) - 24; pHeaderOut->paddingSize = drwav__chunk_padding_size_w64(pHeaderOut->sizeInBytes); *pRunningBytesReadOut += 24; } return DRWAV_SUCCESS; } -static drwav_bool32 drwav__seek_forward(drwav_seek_proc onSeek, drwav_uint64 offset, void* pUserData) +DRWAV_PRIVATE drwav_bool32 drwav__seek_forward(drwav_seek_proc onSeek, drwav_uint64 offset, void* pUserData) { drwav_uint64 bytesRemainingToSeek = offset; while (bytesRemainingToSeek > 0) { @@ -49687,7 +49516,7 @@ static drwav_bool32 drwav__seek_forward(drwav_seek_proc onSeek, drwav_uint64 off } return DRWAV_TRUE; } -static drwav_bool32 drwav__seek_from_start(drwav_seek_proc onSeek, drwav_uint64 offset, void* pUserData) +DRWAV_PRIVATE drwav_bool32 drwav__seek_from_start(drwav_seek_proc onSeek, drwav_uint64 offset, void* pUserData) { if (offset <= 0x7FFFFFFF) { return onSeek(pUserData, (int)offset, drwav_seek_origin_start); @@ -49706,14 +49535,14 @@ static drwav_bool32 drwav__seek_from_start(drwav_seek_proc onSeek, drwav_uint64 offset -= 0x7FFFFFFF; } } -static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSeek, void* pUserData, drwav_container container, drwav_uint64* pRunningBytesReadOut, drwav_fmt* fmtOut) +DRWAV_PRIVATE drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSeek, void* pUserData, drwav_container container, drwav_uint64* pRunningBytesReadOut, drwav_fmt* fmtOut) { drwav_chunk_header header; drwav_uint8 fmt[16]; if (drwav__read_chunk_header(onRead, pUserData, container, pRunningBytesReadOut, &header) != DRWAV_SUCCESS) { return DRWAV_FALSE; } - while (((container == drwav_container_riff || container == drwav_container_rf64) && !drwav__fourcc_equal(header.id.fourcc, "fmt ")) || (container == drwav_container_w64 && !drwav__guid_equal(header.id.guid, drwavGUID_W64_FMT))) { + while (((container == drwav_container_riff || container == drwav_container_rf64) && !drwav_fourcc_equal(header.id.fourcc, "fmt ")) || (container == drwav_container_w64 && !drwav_guid_equal(header.id.guid, drwavGUID_W64_FMT))) { if (!drwav__seek_forward(onSeek, header.sizeInBytes + header.paddingSize, pUserData)) { return DRWAV_FALSE; } @@ -49723,11 +49552,11 @@ static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSe } } if (container == drwav_container_riff || container == drwav_container_rf64) { - if (!drwav__fourcc_equal(header.id.fourcc, "fmt ")) { + if (!drwav_fourcc_equal(header.id.fourcc, "fmt ")) { return DRWAV_FALSE; } } else { - if (!drwav__guid_equal(header.id.guid, drwavGUID_W64_FMT)) { + if (!drwav_guid_equal(header.id.guid, drwavGUID_W64_FMT)) { return DRWAV_FALSE; } } @@ -49735,12 +49564,12 @@ static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSe return DRWAV_FALSE; } *pRunningBytesReadOut += sizeof(fmt); - fmtOut->formatTag = drwav__bytes_to_u16(fmt + 0); - fmtOut->channels = drwav__bytes_to_u16(fmt + 2); - fmtOut->sampleRate = drwav__bytes_to_u32(fmt + 4); - fmtOut->avgBytesPerSec = drwav__bytes_to_u32(fmt + 8); - fmtOut->blockAlign = drwav__bytes_to_u16(fmt + 12); - fmtOut->bitsPerSample = drwav__bytes_to_u16(fmt + 14); + fmtOut->formatTag = drwav_bytes_to_u16(fmt + 0); + fmtOut->channels = drwav_bytes_to_u16(fmt + 2); + fmtOut->sampleRate = drwav_bytes_to_u32(fmt + 4); + fmtOut->avgBytesPerSec = drwav_bytes_to_u32(fmt + 8); + fmtOut->blockAlign = drwav_bytes_to_u16(fmt + 12); + fmtOut->bitsPerSample = drwav_bytes_to_u16(fmt + 14); fmtOut->extendedSize = 0; fmtOut->validBitsPerSample = 0; fmtOut->channelMask = 0; @@ -49753,7 +49582,7 @@ static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSe } *pRunningBytesReadOut += sizeof(fmt_cbSize); bytesReadSoFar = 18; - fmtOut->extendedSize = drwav__bytes_to_u16(fmt_cbSize); + fmtOut->extendedSize = drwav_bytes_to_u16(fmt_cbSize); if (fmtOut->extendedSize > 0) { if (fmtOut->formatTag == DR_WAVE_FORMAT_EXTENSIBLE) { if (fmtOut->extendedSize != 22) { @@ -49765,8 +49594,8 @@ static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSe if (onRead(pUserData, fmtext, fmtOut->extendedSize) != fmtOut->extendedSize) { return DRWAV_FALSE; } - fmtOut->validBitsPerSample = drwav__bytes_to_u16(fmtext + 0); - fmtOut->channelMask = drwav__bytes_to_u32(fmtext + 2); + fmtOut->validBitsPerSample = drwav_bytes_to_u16(fmtext + 0); + fmtOut->channelMask = drwav_bytes_to_u32(fmtext + 2); drwav__bytes_to_guid(fmtext + 6, fmtOut->subFormat); } else { if (!onSeek(pUserData, fmtOut->extendedSize, drwav_seek_origin_current)) { @@ -49789,7 +49618,7 @@ static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSe } return DRWAV_TRUE; } -static size_t drwav__on_read(drwav_read_proc onRead, void* pUserData, void* pBufferOut, size_t bytesToRead, drwav_uint64* pCursor) +DRWAV_PRIVATE size_t drwav__on_read(drwav_read_proc onRead, void* pUserData, void* pBufferOut, size_t bytesToRead, drwav_uint64* pCursor) { size_t bytesRead; DRWAV_ASSERT(onRead != NULL); @@ -49799,7 +49628,7 @@ static size_t drwav__on_read(drwav_read_proc onRead, void* pUserData, void* pBuf return bytesRead; } #if 0 -static drwav_bool32 drwav__on_seek(drwav_seek_proc onSeek, void* pUserData, int offset, drwav_seek_origin origin, drwav_uint64* pCursor) +DRWAV_PRIVATE drwav_bool32 drwav__on_seek(drwav_seek_proc onSeek, void* pUserData, int offset, drwav_seek_origin origin, drwav_uint64* pCursor) { DRWAV_ASSERT(onSeek != NULL); DRWAV_ASSERT(pCursor != NULL); @@ -49814,7 +49643,7 @@ static drwav_bool32 drwav__on_seek(drwav_seek_proc onSeek, void* pUserData, int return DRWAV_TRUE; } #endif -static drwav_uint32 drwav_get_bytes_per_pcm_frame(drwav* pWav) +DRWAV_PRIVATE drwav_uint32 drwav_get_bytes_per_pcm_frame(drwav* pWav) { if ((pWav->bitsPerSample & 0x7) == 0) { return (pWav->bitsPerSample * pWav->fmt.channels) >> 3; @@ -49830,10 +49659,10 @@ DRWAV_API drwav_uint16 drwav_fmt_get_format(const drwav_fmt* pFMT) if (pFMT->formatTag != DR_WAVE_FORMAT_EXTENSIBLE) { return pFMT->formatTag; } else { - return drwav__bytes_to_u16(pFMT->subFormat); + return drwav_bytes_to_u16(pFMT->subFormat); } } -static drwav_bool32 drwav_preinit(drwav* pWav, drwav_read_proc onRead, drwav_seek_proc onSeek, void* pReadSeekUserData, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_bool32 drwav_preinit(drwav* pWav, drwav_read_proc onRead, drwav_seek_proc onSeek, void* pReadSeekUserData, const drwav_allocation_callbacks* pAllocationCallbacks) { if (pWav == NULL || onRead == NULL || onSeek == NULL) { return DRWAV_FALSE; @@ -49848,7 +49677,7 @@ static drwav_bool32 drwav_preinit(drwav* pWav, drwav_read_proc onRead, drwav_see } return DRWAV_TRUE; } -static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, void* pChunkUserData, drwav_uint32 flags) +DRWAV_PRIVATE drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, void* pChunkUserData, drwav_uint32 flags) { drwav_uint64 cursor; drwav_bool32 sequential; @@ -49864,9 +49693,9 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, if (drwav__on_read(pWav->onRead, pWav->pUserData, riff, sizeof(riff), &cursor) != sizeof(riff)) { return DRWAV_FALSE; } - if (drwav__fourcc_equal(riff, "RIFF")) { + if (drwav_fourcc_equal(riff, "RIFF")) { pWav->container = drwav_container_riff; - } else if (drwav__fourcc_equal(riff, "riff")) { + } else if (drwav_fourcc_equal(riff, "riff")) { int i; drwav_uint8 riff2[12]; pWav->container = drwav_container_w64; @@ -49878,7 +49707,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, return DRWAV_FALSE; } } - } else if (drwav__fourcc_equal(riff, "RF64")) { + } else if (drwav_fourcc_equal(riff, "RF64")) { pWav->container = drwav_container_rf64; } else { return DRWAV_FALSE; @@ -49890,18 +49719,18 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, return DRWAV_FALSE; } if (pWav->container == drwav_container_riff) { - if (drwav__bytes_to_u32(chunkSizeBytes) < 36) { + if (drwav_bytes_to_u32(chunkSizeBytes) < 36) { return DRWAV_FALSE; } } else { - if (drwav__bytes_to_u32(chunkSizeBytes) != 0xFFFFFFFF) { + if (drwav_bytes_to_u32(chunkSizeBytes) != 0xFFFFFFFF) { return DRWAV_FALSE; } } if (drwav__on_read(pWav->onRead, pWav->pUserData, wave, sizeof(wave), &cursor) != sizeof(wave)) { return DRWAV_FALSE; } - if (!drwav__fourcc_equal(wave, "WAVE")) { + if (!drwav_fourcc_equal(wave, "WAVE")) { return DRWAV_FALSE; } } else { @@ -49910,13 +49739,13 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, if (drwav__on_read(pWav->onRead, pWav->pUserData, chunkSizeBytes, sizeof(chunkSizeBytes), &cursor) != sizeof(chunkSizeBytes)) { return DRWAV_FALSE; } - if (drwav__bytes_to_u64(chunkSizeBytes) < 80) { + if (drwav_bytes_to_u64(chunkSizeBytes) < 80) { return DRWAV_FALSE; } if (drwav__on_read(pWav->onRead, pWav->pUserData, wave, sizeof(wave), &cursor) != sizeof(wave)) { return DRWAV_FALSE; } - if (!drwav__guid_equal(wave, drwavGUID_W64_WAVE)) { + if (!drwav_guid_equal(wave, drwavGUID_W64_WAVE)) { return DRWAV_FALSE; } } @@ -49928,7 +49757,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, if (result != DRWAV_SUCCESS) { return DRWAV_FALSE; } - if (!drwav__fourcc_equal(header.id.fourcc, "ds64")) { + if (!drwav_fourcc_equal(header.id.fourcc, "ds64")) { return DRWAV_FALSE; } bytesRemainingInChunk = header.sizeInBytes + header.paddingSize; @@ -49941,12 +49770,12 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, return DRWAV_FALSE; } bytesRemainingInChunk -= 8; - dataChunkSize = drwav__bytes_to_u64(sizeBytes); + dataChunkSize = drwav_bytes_to_u64(sizeBytes); if (drwav__on_read(pWav->onRead, pWav->pUserData, sizeBytes, sizeof(sizeBytes), &cursor) != sizeof(sizeBytes)) { return DRWAV_FALSE; } bytesRemainingInChunk -= 8; - sampleCountFromFactChunk = drwav__bytes_to_u64(sizeBytes); + sampleCountFromFactChunk = drwav_bytes_to_u64(sizeBytes); if (!drwav__seek_forward(pWav->onSeek, bytesRemainingInChunk, pWav->pUserData)) { return DRWAV_FALSE; } @@ -49963,7 +49792,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, } translatedFormatTag = fmt.formatTag; if (translatedFormatTag == DR_WAVE_FORMAT_EXTENSIBLE) { - translatedFormatTag = drwav__bytes_to_u16(fmt.subFormat + 0); + translatedFormatTag = drwav_bytes_to_u16(fmt.subFormat + 0); } foundDataChunk = DRWAV_FALSE; for (;;) @@ -49990,14 +49819,14 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, } chunkSize = header.sizeInBytes; if (pWav->container == drwav_container_riff || pWav->container == drwav_container_rf64) { - if (drwav__fourcc_equal(header.id.fourcc, "data")) { + if (drwav_fourcc_equal(header.id.fourcc, "data")) { foundDataChunk = DRWAV_TRUE; if (pWav->container != drwav_container_rf64) { dataChunkSize = chunkSize; } } } else { - if (drwav__guid_equal(header.id.guid, drwavGUID_W64_DATA)) { + if (drwav_guid_equal(header.id.guid, drwavGUID_W64_DATA)) { foundDataChunk = DRWAV_TRUE; dataChunkSize = chunkSize; } @@ -50006,7 +49835,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, break; } if (pWav->container == drwav_container_riff) { - if (drwav__fourcc_equal(header.id.fourcc, "fact")) { + if (drwav_fourcc_equal(header.id.fourcc, "fact")) { drwav_uint32 sampleCount; if (drwav__on_read(pWav->onRead, pWav->pUserData, &sampleCount, 4, &cursor) != 4) { return DRWAV_FALSE; @@ -50022,7 +49851,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, } } } else if (pWav->container == drwav_container_w64) { - if (drwav__guid_equal(header.id.guid, drwavGUID_W64_FACT)) { + if (drwav_guid_equal(header.id.guid, drwavGUID_W64_FACT)) { if (drwav__on_read(pWav->onRead, pWav->pUserData, &sampleCountFromFactChunk, 8, &cursor) != 8) { return DRWAV_FALSE; } @@ -50034,33 +49863,33 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, } else if (pWav->container == drwav_container_rf64) { } if (pWav->container == drwav_container_riff || pWav->container == drwav_container_rf64) { - if (drwav__fourcc_equal(header.id.fourcc, "smpl")) { + if (drwav_fourcc_equal(header.id.fourcc, "smpl")) { drwav_uint8 smplHeaderData[36]; if (chunkSize >= sizeof(smplHeaderData)) { drwav_uint64 bytesJustRead = drwav__on_read(pWav->onRead, pWav->pUserData, smplHeaderData, sizeof(smplHeaderData), &cursor); chunkSize -= bytesJustRead; if (bytesJustRead == sizeof(smplHeaderData)) { drwav_uint32 iLoop; - pWav->smpl.manufacturer = drwav__bytes_to_u32(smplHeaderData+0); - pWav->smpl.product = drwav__bytes_to_u32(smplHeaderData+4); - pWav->smpl.samplePeriod = drwav__bytes_to_u32(smplHeaderData+8); - pWav->smpl.midiUnityNotes = drwav__bytes_to_u32(smplHeaderData+12); - pWav->smpl.midiPitchFraction = drwav__bytes_to_u32(smplHeaderData+16); - pWav->smpl.smpteFormat = drwav__bytes_to_u32(smplHeaderData+20); - pWav->smpl.smpteOffset = drwav__bytes_to_u32(smplHeaderData+24); - pWav->smpl.numSampleLoops = drwav__bytes_to_u32(smplHeaderData+28); - pWav->smpl.samplerData = drwav__bytes_to_u32(smplHeaderData+32); + pWav->smpl.manufacturer = drwav_bytes_to_u32(smplHeaderData+0); + pWav->smpl.product = drwav_bytes_to_u32(smplHeaderData+4); + pWav->smpl.samplePeriod = drwav_bytes_to_u32(smplHeaderData+8); + pWav->smpl.midiUnityNotes = drwav_bytes_to_u32(smplHeaderData+12); + pWav->smpl.midiPitchFraction = drwav_bytes_to_u32(smplHeaderData+16); + pWav->smpl.smpteFormat = drwav_bytes_to_u32(smplHeaderData+20); + pWav->smpl.smpteOffset = drwav_bytes_to_u32(smplHeaderData+24); + pWav->smpl.numSampleLoops = drwav_bytes_to_u32(smplHeaderData+28); + pWav->smpl.samplerData = drwav_bytes_to_u32(smplHeaderData+32); for (iLoop = 0; iLoop < pWav->smpl.numSampleLoops && iLoop < drwav_countof(pWav->smpl.loops); ++iLoop) { drwav_uint8 smplLoopData[24]; bytesJustRead = drwav__on_read(pWav->onRead, pWav->pUserData, smplLoopData, sizeof(smplLoopData), &cursor); chunkSize -= bytesJustRead; if (bytesJustRead == sizeof(smplLoopData)) { - pWav->smpl.loops[iLoop].cuePointId = drwav__bytes_to_u32(smplLoopData+0); - pWav->smpl.loops[iLoop].type = drwav__bytes_to_u32(smplLoopData+4); - pWav->smpl.loops[iLoop].start = drwav__bytes_to_u32(smplLoopData+8); - pWav->smpl.loops[iLoop].end = drwav__bytes_to_u32(smplLoopData+12); - pWav->smpl.loops[iLoop].fraction = drwav__bytes_to_u32(smplLoopData+16); - pWav->smpl.loops[iLoop].playCount = drwav__bytes_to_u32(smplLoopData+20); + pWav->smpl.loops[iLoop].cuePointId = drwav_bytes_to_u32(smplLoopData+0); + pWav->smpl.loops[iLoop].type = drwav_bytes_to_u32(smplLoopData+4); + pWav->smpl.loops[iLoop].start = drwav_bytes_to_u32(smplLoopData+8); + pWav->smpl.loops[iLoop].end = drwav_bytes_to_u32(smplLoopData+12); + pWav->smpl.loops[iLoop].fraction = drwav_bytes_to_u32(smplLoopData+16); + pWav->smpl.loops[iLoop].playCount = drwav_bytes_to_u32(smplLoopData+20); } else { break; } @@ -50070,7 +49899,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk, } } } else { - if (drwav__guid_equal(header.id.guid, drwavGUID_W64_SMPL)) { + if (drwav_guid_equal(header.id.guid, drwavGUID_W64_SMPL)) { } } chunkSize += header.paddingSize; @@ -50150,7 +49979,7 @@ DRWAV_API drwav_bool32 drwav_init_ex(drwav* pWav, drwav_read_proc onRead, drwav_ } return drwav_init__internal(pWav, onChunk, pChunkUserData, flags); } -static drwav_uint32 drwav__riff_chunk_size_riff(drwav_uint64 dataChunkSize) +DRWAV_PRIVATE drwav_uint32 drwav__riff_chunk_size_riff(drwav_uint64 dataChunkSize) { drwav_uint64 chunkSize = 4 + 24 + dataChunkSize + drwav__chunk_padding_size_riff(dataChunkSize); if (chunkSize > 0xFFFFFFFFUL) { @@ -50158,7 +49987,7 @@ static drwav_uint32 drwav__riff_chunk_size_riff(drwav_uint64 dataChunkSize) } return (drwav_uint32)chunkSize; } -static drwav_uint32 drwav__data_chunk_size_riff(drwav_uint64 dataChunkSize) +DRWAV_PRIVATE drwav_uint32 drwav__data_chunk_size_riff(drwav_uint64 dataChunkSize) { if (dataChunkSize <= 0xFFFFFFFFUL) { return (drwav_uint32)dataChunkSize; @@ -50166,16 +49995,16 @@ static drwav_uint32 drwav__data_chunk_size_riff(drwav_uint64 dataChunkSize) return 0xFFFFFFFFUL; } } -static drwav_uint64 drwav__riff_chunk_size_w64(drwav_uint64 dataChunkSize) +DRWAV_PRIVATE drwav_uint64 drwav__riff_chunk_size_w64(drwav_uint64 dataChunkSize) { drwav_uint64 dataSubchunkPaddingSize = drwav__chunk_padding_size_w64(dataChunkSize); return 80 + 24 + dataChunkSize + dataSubchunkPaddingSize; } -static drwav_uint64 drwav__data_chunk_size_w64(drwav_uint64 dataChunkSize) +DRWAV_PRIVATE drwav_uint64 drwav__data_chunk_size_w64(drwav_uint64 dataChunkSize) { return 24 + dataChunkSize; } -static drwav_uint64 drwav__riff_chunk_size_rf64(drwav_uint64 dataChunkSize) +DRWAV_PRIVATE drwav_uint64 drwav__riff_chunk_size_rf64(drwav_uint64 dataChunkSize) { drwav_uint64 chunkSize = 4 + 36 + 24 + dataChunkSize + drwav__chunk_padding_size_riff(dataChunkSize); if (chunkSize > 0xFFFFFFFFUL) { @@ -50183,17 +50012,17 @@ static drwav_uint64 drwav__riff_chunk_size_rf64(drwav_uint64 dataChunkSize) } return chunkSize; } -static drwav_uint64 drwav__data_chunk_size_rf64(drwav_uint64 dataChunkSize) +DRWAV_PRIVATE drwav_uint64 drwav__data_chunk_size_rf64(drwav_uint64 dataChunkSize) { return dataChunkSize; } -static size_t drwav__write(drwav* pWav, const void* pData, size_t dataSize) +DRWAV_PRIVATE size_t drwav__write(drwav* pWav, const void* pData, size_t dataSize) { DRWAV_ASSERT(pWav != NULL); DRWAV_ASSERT(pWav->onWrite != NULL); return pWav->onWrite(pWav->pUserData, pData, dataSize); } -static size_t drwav__write_u16ne_to_le(drwav* pWav, drwav_uint16 value) +DRWAV_PRIVATE size_t drwav__write_u16ne_to_le(drwav* pWav, drwav_uint16 value) { DRWAV_ASSERT(pWav != NULL); DRWAV_ASSERT(pWav->onWrite != NULL); @@ -50202,7 +50031,7 @@ static size_t drwav__write_u16ne_to_le(drwav* pWav, drwav_uint16 value) } return drwav__write(pWav, &value, 2); } -static size_t drwav__write_u32ne_to_le(drwav* pWav, drwav_uint32 value) +DRWAV_PRIVATE size_t drwav__write_u32ne_to_le(drwav* pWav, drwav_uint32 value) { DRWAV_ASSERT(pWav != NULL); DRWAV_ASSERT(pWav->onWrite != NULL); @@ -50211,7 +50040,7 @@ static size_t drwav__write_u32ne_to_le(drwav* pWav, drwav_uint32 value) } return drwav__write(pWav, &value, 4); } -static size_t drwav__write_u64ne_to_le(drwav* pWav, drwav_uint64 value) +DRWAV_PRIVATE size_t drwav__write_u64ne_to_le(drwav* pWav, drwav_uint64 value) { DRWAV_ASSERT(pWav != NULL); DRWAV_ASSERT(pWav->onWrite != NULL); @@ -50220,7 +50049,7 @@ static size_t drwav__write_u64ne_to_le(drwav* pWav, drwav_uint64 value) } return drwav__write(pWav, &value, 8); } -static drwav_bool32 drwav_preinit_write(drwav* pWav, const drwav_data_format* pFormat, drwav_bool32 isSequential, drwav_write_proc onWrite, drwav_seek_proc onSeek, void* pUserData, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_bool32 drwav_preinit_write(drwav* pWav, const drwav_data_format* pFormat, drwav_bool32 isSequential, drwav_write_proc onWrite, drwav_seek_proc onSeek, void* pUserData, const drwav_allocation_callbacks* pAllocationCallbacks) { if (pWav == NULL || onWrite == NULL) { return DRWAV_FALSE; @@ -50252,7 +50081,7 @@ static drwav_bool32 drwav_preinit_write(drwav* pWav, const drwav_data_format* pF pWav->isSequentialWrite = isSequential; return DRWAV_TRUE; } -static drwav_bool32 drwav_init_write__internal(drwav* pWav, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount) +DRWAV_PRIVATE drwav_bool32 drwav_init_write__internal(drwav* pWav, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount) { size_t runningPos = 0; drwav_uint64 initialDataChunkSize = 0; @@ -50306,7 +50135,6 @@ static drwav_bool32 drwav_init_write__internal(drwav* pWav, const drwav_data_for runningPos += drwav__write_u32ne_to_le(pWav, pWav->fmt.avgBytesPerSec); runningPos += drwav__write_u16ne_to_le(pWav, pWav->fmt.blockAlign); runningPos += drwav__write_u16ne_to_le(pWav, pWav->fmt.bitsPerSample); - pWav->dataChunkDataPos = runningPos; if (pFormat->container == drwav_container_riff) { drwav_uint32 chunkSizeDATA = (drwav_uint32)initialDataChunkSize; runningPos += drwav__write(pWav, "data", 4); @@ -50319,12 +50147,12 @@ static drwav_bool32 drwav_init_write__internal(drwav* pWav, const drwav_data_for runningPos += drwav__write(pWav, "data", 4); runningPos += drwav__write_u32ne_to_le(pWav, 0xFFFFFFFF); } - (void)runningPos; pWav->container = pFormat->container; pWav->channels = (drwav_uint16)pFormat->channels; pWav->sampleRate = pFormat->sampleRate; pWav->bitsPerSample = (drwav_uint16)pFormat->bitsPerSample; pWav->translatedFormatTag = (drwav_uint16)pFormat->format; + pWav->dataChunkDataPos = runningPos; return DRWAV_TRUE; } DRWAV_API drwav_bool32 drwav_init_write(drwav* pWav, const drwav_data_format* pFormat, drwav_write_proc onWrite, drwav_seek_proc onSeek, void* pUserData, const drwav_allocation_callbacks* pAllocationCallbacks) @@ -50367,7 +50195,7 @@ DRWAV_API drwav_uint64 drwav_target_write_size_bytes(const drwav_data_format* pF } #ifndef DR_WAV_NO_STDIO #include -static drwav_result drwav_result_from_errno(int e) +DRWAV_PRIVATE drwav_result drwav_result_from_errno(int e) { switch (e) { @@ -50768,9 +50596,9 @@ static drwav_result drwav_result_from_errno(int e) default: return DRWAV_ERROR; } } -static drwav_result drwav_fopen(FILE** ppFile, const char* pFilePath, const char* pOpenMode) +DRWAV_PRIVATE drwav_result drwav_fopen(FILE** ppFile, const char* pFilePath, const char* pOpenMode) { -#if _MSC_VER && _MSC_VER >= 1400 +#if defined(_MSC_VER) && _MSC_VER >= 1400 errno_t err; #endif if (ppFile != NULL) { @@ -50779,7 +50607,7 @@ static drwav_result drwav_fopen(FILE** ppFile, const char* pFilePath, const char if (pFilePath == NULL || pOpenMode == NULL || ppFile == NULL) { return DRWAV_INVALID_ARGS; } -#if _MSC_VER && _MSC_VER >= 1400 +#if defined(_MSC_VER) && _MSC_VER >= 1400 err = fopen_s(ppFile, pFilePath, pOpenMode); if (err != 0) { return drwav_result_from_errno(err); @@ -50809,7 +50637,7 @@ static drwav_result drwav_fopen(FILE** ppFile, const char* pFilePath, const char #define DRWAV_HAS_WFOPEN #endif #endif -static drwav_result drwav_wfopen(FILE** ppFile, const wchar_t* pFilePath, const wchar_t* pOpenMode, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_result drwav_wfopen(FILE** ppFile, const wchar_t* pFilePath, const wchar_t* pOpenMode, const drwav_allocation_callbacks* pAllocationCallbacks) { if (ppFile != NULL) { *ppFile = NULL; @@ -50871,15 +50699,15 @@ static drwav_result drwav_wfopen(FILE** ppFile, const wchar_t* pFilePath, const #endif return DRWAV_SUCCESS; } -static size_t drwav__on_read_stdio(void* pUserData, void* pBufferOut, size_t bytesToRead) +DRWAV_PRIVATE size_t drwav__on_read_stdio(void* pUserData, void* pBufferOut, size_t bytesToRead) { return fread(pBufferOut, 1, bytesToRead, (FILE*)pUserData); } -static size_t drwav__on_write_stdio(void* pUserData, const void* pData, size_t bytesToWrite) +DRWAV_PRIVATE size_t drwav__on_write_stdio(void* pUserData, const void* pData, size_t bytesToWrite) { return fwrite(pData, 1, bytesToWrite, (FILE*)pUserData); } -static drwav_bool32 drwav__on_seek_stdio(void* pUserData, int offset, drwav_seek_origin origin) +DRWAV_PRIVATE drwav_bool32 drwav__on_seek_stdio(void* pUserData, int offset, drwav_seek_origin origin) { return fseek((FILE*)pUserData, offset, (origin == drwav_seek_origin_current) ? SEEK_CUR : SEEK_SET) == 0; } @@ -50887,7 +50715,7 @@ DRWAV_API drwav_bool32 drwav_init_file(drwav* pWav, const char* filename, const { return drwav_init_file_ex(pWav, filename, NULL, NULL, 0, pAllocationCallbacks); } -static drwav_bool32 drwav_init_file__internal_FILE(drwav* pWav, FILE* pFile, drwav_chunk_proc onChunk, void* pChunkUserData, drwav_uint32 flags, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_bool32 drwav_init_file__internal_FILE(drwav* pWav, FILE* pFile, drwav_chunk_proc onChunk, void* pChunkUserData, drwav_uint32 flags, const drwav_allocation_callbacks* pAllocationCallbacks) { drwav_bool32 result; result = drwav_preinit(pWav, drwav__on_read_stdio, drwav__on_seek_stdio, (void*)pFile, pAllocationCallbacks); @@ -50922,7 +50750,7 @@ DRWAV_API drwav_bool32 drwav_init_file_ex_w(drwav* pWav, const wchar_t* filename } return drwav_init_file__internal_FILE(pWav, pFile, onChunk, pChunkUserData, flags, pAllocationCallbacks); } -static drwav_bool32 drwav_init_file_write__internal_FILE(drwav* pWav, FILE* pFile, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_bool32 drwav_init_file_write__internal_FILE(drwav* pWav, FILE* pFile, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) { drwav_bool32 result; result = drwav_preinit_write(pWav, pFormat, isSequential, drwav__on_write_stdio, drwav__on_seek_stdio, (void*)pFile, pAllocationCallbacks); @@ -50937,7 +50765,7 @@ static drwav_bool32 drwav_init_file_write__internal_FILE(drwav* pWav, FILE* pFil } return DRWAV_TRUE; } -static drwav_bool32 drwav_init_file_write__internal(drwav* pWav, const char* filename, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_bool32 drwav_init_file_write__internal(drwav* pWav, const char* filename, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) { FILE* pFile; if (drwav_fopen(&pFile, filename, "wb") != DRWAV_SUCCESS) { @@ -50945,7 +50773,7 @@ static drwav_bool32 drwav_init_file_write__internal(drwav* pWav, const char* fil } return drwav_init_file_write__internal_FILE(pWav, pFile, pFormat, totalSampleCount, isSequential, pAllocationCallbacks); } -static drwav_bool32 drwav_init_file_write_w__internal(drwav* pWav, const wchar_t* filename, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_bool32 drwav_init_file_write_w__internal(drwav* pWav, const wchar_t* filename, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) { FILE* pFile; if (drwav_wfopen(&pFile, filename, L"wb", pAllocationCallbacks) != DRWAV_SUCCESS) { @@ -50984,7 +50812,7 @@ DRWAV_API drwav_bool32 drwav_init_file_write_sequential_pcm_frames_w(drwav* pWav return drwav_init_file_write_sequential_w(pWav, filename, pFormat, totalPCMFrameCount*pFormat->channels, pAllocationCallbacks); } #endif -static size_t drwav__on_read_memory(void* pUserData, void* pBufferOut, size_t bytesToRead) +DRWAV_PRIVATE size_t drwav__on_read_memory(void* pUserData, void* pBufferOut, size_t bytesToRead) { drwav* pWav = (drwav*)pUserData; size_t bytesRemaining; @@ -51000,7 +50828,7 @@ static size_t drwav__on_read_memory(void* pUserData, void* pBufferOut, size_t by } return bytesToRead; } -static drwav_bool32 drwav__on_seek_memory(void* pUserData, int offset, drwav_seek_origin origin) +DRWAV_PRIVATE drwav_bool32 drwav__on_seek_memory(void* pUserData, int offset, drwav_seek_origin origin) { drwav* pWav = (drwav*)pUserData; DRWAV_ASSERT(pWav != NULL); @@ -51024,7 +50852,7 @@ static drwav_bool32 drwav__on_seek_memory(void* pUserData, int offset, drwav_see } return DRWAV_TRUE; } -static size_t drwav__on_write_memory(void* pUserData, const void* pDataIn, size_t bytesToWrite) +DRWAV_PRIVATE size_t drwav__on_write_memory(void* pUserData, const void* pDataIn, size_t bytesToWrite) { drwav* pWav = (drwav*)pUserData; size_t bytesRemaining; @@ -51052,7 +50880,7 @@ static size_t drwav__on_write_memory(void* pUserData, const void* pDataIn, size_ *pWav->memoryStreamWrite.pDataSize = pWav->memoryStreamWrite.dataSize; return bytesToWrite; } -static drwav_bool32 drwav__on_seek_memory_write(void* pUserData, int offset, drwav_seek_origin origin) +DRWAV_PRIVATE drwav_bool32 drwav__on_seek_memory_write(void* pUserData, int offset, drwav_seek_origin origin) { drwav* pWav = (drwav*)pUserData; DRWAV_ASSERT(pWav != NULL); @@ -51093,7 +50921,7 @@ DRWAV_API drwav_bool32 drwav_init_memory_ex(drwav* pWav, const void* data, size_ pWav->memoryStream.currentReadPos = 0; return drwav_init__internal(pWav, onChunk, pChunkUserData, flags); } -static drwav_bool32 drwav_init_memory_write__internal(drwav* pWav, void** ppData, size_t* pDataSize, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) +DRWAV_PRIVATE drwav_bool32 drwav_init_memory_write__internal(drwav* pWav, void** ppData, size_t* pDataSize, const drwav_data_format* pFormat, drwav_uint64 totalSampleCount, drwav_bool32 isSequential, const drwav_allocation_callbacks* pAllocationCallbacks) { if (ppData == NULL || pDataSize == NULL) { return DRWAV_FALSE; @@ -51148,7 +50976,7 @@ DRWAV_API drwav_result drwav_uninit(drwav* pWav) drwav_uint32 riffChunkSize = drwav__riff_chunk_size_riff(pWav->dataChunkDataSize); drwav__write_u32ne_to_le(pWav, riffChunkSize); } - if (pWav->onSeek(pWav->pUserData, (int)pWav->dataChunkDataPos + 4, drwav_seek_origin_start)) { + if (pWav->onSeek(pWav->pUserData, (int)pWav->dataChunkDataPos - 4, drwav_seek_origin_start)) { drwav_uint32 dataChunkSize = drwav__data_chunk_size_riff(pWav->dataChunkDataSize); drwav__write_u32ne_to_le(pWav, dataChunkSize); } @@ -51157,7 +50985,7 @@ DRWAV_API drwav_result drwav_uninit(drwav* pWav) drwav_uint64 riffChunkSize = drwav__riff_chunk_size_w64(pWav->dataChunkDataSize); drwav__write_u64ne_to_le(pWav, riffChunkSize); } - if (pWav->onSeek(pWav->pUserData, (int)pWav->dataChunkDataPos + 16, drwav_seek_origin_start)) { + if (pWav->onSeek(pWav->pUserData, (int)pWav->dataChunkDataPos - 8, drwav_seek_origin_start)) { drwav_uint64 dataChunkSize = drwav__data_chunk_size_w64(pWav->dataChunkDataSize); drwav__write_u64ne_to_le(pWav, dataChunkSize); } @@ -51265,7 +51093,7 @@ DRWAV_API drwav_uint64 drwav_read_pcm_frames(drwav* pWav, drwav_uint64 framesToR return drwav_read_pcm_frames_be(pWav, framesToRead, pBufferOut); } } -DRWAV_API drwav_bool32 drwav_seek_to_first_pcm_frame(drwav* pWav) +DRWAV_PRIVATE drwav_bool32 drwav_seek_to_first_pcm_frame(drwav* pWav) { if (pWav->onWrite != NULL) { return DRWAV_FALSE; @@ -51442,12 +51270,13 @@ DRWAV_API drwav_uint64 drwav_write_pcm_frames(drwav* pWav, drwav_uint64 framesTo return drwav_write_pcm_frames_be(pWav, framesToWrite, pData); } } -static drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) { drwav_uint64 totalFramesRead = 0; DRWAV_ASSERT(pWav != NULL); DRWAV_ASSERT(framesToRead > 0); - while (framesToRead > 0 && pWav->compressed.iCurrentPCMFrame < pWav->totalPCMFrameCount) { + while (pWav->compressed.iCurrentPCMFrame < pWav->totalPCMFrameCount) { + DRWAV_ASSERT(framesToRead > 0); if (pWav->msadpcm.cachedFrameCount == 0 && pWav->msadpcm.bytesRemainingInBlock == 0) { if (pWav->channels == 1) { drwav_uint8 header[7]; @@ -51456,9 +51285,9 @@ static drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 } pWav->msadpcm.bytesRemainingInBlock = pWav->fmt.blockAlign - sizeof(header); pWav->msadpcm.predictor[0] = header[0]; - pWav->msadpcm.delta[0] = drwav__bytes_to_s16(header + 1); - pWav->msadpcm.prevFrames[0][1] = (drwav_int32)drwav__bytes_to_s16(header + 3); - pWav->msadpcm.prevFrames[0][0] = (drwav_int32)drwav__bytes_to_s16(header + 5); + pWav->msadpcm.delta[0] = drwav_bytes_to_s16(header + 1); + pWav->msadpcm.prevFrames[0][1] = (drwav_int32)drwav_bytes_to_s16(header + 3); + pWav->msadpcm.prevFrames[0][0] = (drwav_int32)drwav_bytes_to_s16(header + 5); pWav->msadpcm.cachedFrames[2] = pWav->msadpcm.prevFrames[0][0]; pWav->msadpcm.cachedFrames[3] = pWav->msadpcm.prevFrames[0][1]; pWav->msadpcm.cachedFrameCount = 2; @@ -51470,12 +51299,12 @@ static drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 pWav->msadpcm.bytesRemainingInBlock = pWav->fmt.blockAlign - sizeof(header); pWav->msadpcm.predictor[0] = header[0]; pWav->msadpcm.predictor[1] = header[1]; - pWav->msadpcm.delta[0] = drwav__bytes_to_s16(header + 2); - pWav->msadpcm.delta[1] = drwav__bytes_to_s16(header + 4); - pWav->msadpcm.prevFrames[0][1] = (drwav_int32)drwav__bytes_to_s16(header + 6); - pWav->msadpcm.prevFrames[1][1] = (drwav_int32)drwav__bytes_to_s16(header + 8); - pWav->msadpcm.prevFrames[0][0] = (drwav_int32)drwav__bytes_to_s16(header + 10); - pWav->msadpcm.prevFrames[1][0] = (drwav_int32)drwav__bytes_to_s16(header + 12); + pWav->msadpcm.delta[0] = drwav_bytes_to_s16(header + 2); + pWav->msadpcm.delta[1] = drwav_bytes_to_s16(header + 4); + pWav->msadpcm.prevFrames[0][1] = (drwav_int32)drwav_bytes_to_s16(header + 6); + pWav->msadpcm.prevFrames[1][1] = (drwav_int32)drwav_bytes_to_s16(header + 8); + pWav->msadpcm.prevFrames[0][0] = (drwav_int32)drwav_bytes_to_s16(header + 10); + pWav->msadpcm.prevFrames[1][0] = (drwav_int32)drwav_bytes_to_s16(header + 12); pWav->msadpcm.cachedFrames[0] = pWav->msadpcm.prevFrames[0][0]; pWav->msadpcm.cachedFrames[1] = pWav->msadpcm.prevFrames[1][0]; pWav->msadpcm.cachedFrames[2] = pWav->msadpcm.prevFrames[0][1]; @@ -51497,7 +51326,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 pWav->msadpcm.cachedFrameCount -= 1; } if (framesToRead == 0) { - return totalFramesRead; + break; } if (pWav->msadpcm.cachedFrameCount == 0) { if (pWav->msadpcm.bytesRemainingInBlock == 0) { @@ -51572,7 +51401,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__msadpcm(drwav* pWav, drwav_uint64 } return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) { drwav_uint64 totalFramesRead = 0; drwav_uint32 iChannel; @@ -51593,7 +51422,8 @@ static drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 fra }; DRWAV_ASSERT(pWav != NULL); DRWAV_ASSERT(framesToRead > 0); - while (framesToRead > 0 && pWav->compressed.iCurrentPCMFrame < pWav->totalPCMFrameCount) { + while (pWav->compressed.iCurrentPCMFrame < pWav->totalPCMFrameCount) { + DRWAV_ASSERT(framesToRead > 0); if (pWav->ima.cachedFrameCount == 0 && pWav->ima.bytesRemainingInBlock == 0) { if (pWav->channels == 1) { drwav_uint8 header[4]; @@ -51606,7 +51436,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 fra pWav->ima.bytesRemainingInBlock = 0; return totalFramesRead; } - pWav->ima.predictor[0] = drwav__bytes_to_s16(header + 0); + pWav->ima.predictor[0] = drwav_bytes_to_s16(header + 0); pWav->ima.stepIndex[0] = header[2]; pWav->ima.cachedFrames[drwav_countof(pWav->ima.cachedFrames) - 1] = pWav->ima.predictor[0]; pWav->ima.cachedFrameCount = 1; @@ -51621,9 +51451,9 @@ static drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 fra pWav->ima.bytesRemainingInBlock = 0; return totalFramesRead; } - pWav->ima.predictor[0] = drwav__bytes_to_s16(header + 0); + pWav->ima.predictor[0] = drwav_bytes_to_s16(header + 0); pWav->ima.stepIndex[0] = header[2]; - pWav->ima.predictor[1] = drwav__bytes_to_s16(header + 4); + pWav->ima.predictor[1] = drwav_bytes_to_s16(header + 4); pWav->ima.stepIndex[1] = header[6]; pWav->ima.cachedFrames[drwav_countof(pWav->ima.cachedFrames) - 2] = pWav->ima.predictor[0]; pWav->ima.cachedFrames[drwav_countof(pWav->ima.cachedFrames) - 1] = pWav->ima.predictor[1]; @@ -51644,7 +51474,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__ima(drwav* pWav, drwav_uint64 fra pWav->ima.cachedFrameCount -= 1; } if (framesToRead == 0) { - return totalFramesRead; + break; } if (pWav->ima.cachedFrameCount == 0) { if (pWav->ima.bytesRemainingInBlock == 0) { @@ -51736,7 +51566,7 @@ static DRWAV_INLINE drwav_int16 drwav__mulaw_to_s16(drwav_uint8 sampleIn) { return (short)g_drwavMulawTable[sampleIn]; } -static void drwav__pcm_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) +DRWAV_PRIVATE void drwav__pcm_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) { unsigned int i; if (bytesPerSample == 1) { @@ -51774,7 +51604,7 @@ static void drwav__pcm_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_t *pOut++ = (drwav_int16)((drwav_int64)sample >> 48); } } -static void drwav__ieee_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) +DRWAV_PRIVATE void drwav__ieee_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) { if (bytesPerSample == 4) { drwav_f32_to_s16(pOut, (const float*)pIn, totalSampleCount); @@ -51787,11 +51617,11 @@ static void drwav__ieee_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_t return; } } -static drwav_uint64 drwav_read_pcm_frames_s16__pcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__pcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) { - drwav_uint32 bytesPerFrame; drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; + drwav_uint32 bytesPerFrame; if ((pWav->translatedFormatTag == DR_WAVE_FORMAT_PCM && pWav->bitsPerSample == 16) || pBufferOut == NULL) { return drwav_read_pcm_frames(pWav, framesToRead, pBufferOut); } @@ -51812,7 +51642,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__pcm(drwav* pWav, drwav_uint64 fra } return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s16__ieee(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__ieee(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -51837,7 +51667,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__ieee(drwav* pWav, drwav_uint64 fr } return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s16__alaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__alaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -51862,7 +51692,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__alaw(drwav* pWav, drwav_uint64 fr } return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s16__mulaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s16__mulaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -52007,7 +51837,7 @@ DRWAV_API void drwav_mulaw_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, siz pOut[i] = drwav__mulaw_to_s16(pIn[i]); } } -static void drwav__pcm_to_f32(float* pOut, const drwav_uint8* pIn, size_t sampleCount, unsigned int bytesPerSample) +DRWAV_PRIVATE void drwav__pcm_to_f32(float* pOut, const drwav_uint8* pIn, size_t sampleCount, unsigned int bytesPerSample) { unsigned int i; if (bytesPerSample == 1) { @@ -52043,7 +51873,7 @@ static void drwav__pcm_to_f32(float* pOut, const drwav_uint8* pIn, size_t sample *pOut++ = (float)((drwav_int64)sample / 9223372036854775807.0); } } -static void drwav__ieee_to_f32(float* pOut, const drwav_uint8* pIn, size_t sampleCount, unsigned int bytesPerSample) +DRWAV_PRIVATE void drwav__ieee_to_f32(float* pOut, const drwav_uint8* pIn, size_t sampleCount, unsigned int bytesPerSample) { if (bytesPerSample == 4) { unsigned int i; @@ -52059,7 +51889,7 @@ static void drwav__ieee_to_f32(float* pOut, const drwav_uint8* pIn, size_t sampl return; } } -static drwav_uint64 drwav_read_pcm_frames_f32__pcm(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_f32__pcm(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -52080,7 +51910,7 @@ static drwav_uint64 drwav_read_pcm_frames_f32__pcm(drwav* pWav, drwav_uint64 fra } return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_f32__msadpcm(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_f32__msadpcm(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) { drwav_uint64 totalFramesRead = 0; drwav_int16 samples16[2048]; @@ -52096,7 +51926,7 @@ static drwav_uint64 drwav_read_pcm_frames_f32__msadpcm(drwav* pWav, drwav_uint64 } return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_f32__ima(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_f32__ima(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) { drwav_uint64 totalFramesRead = 0; drwav_int16 samples16[2048]; @@ -52112,7 +51942,7 @@ static drwav_uint64 drwav_read_pcm_frames_f32__ima(drwav* pWav, drwav_uint64 fra } return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_f32__ieee(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_f32__ieee(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -52137,7 +51967,7 @@ static drwav_uint64 drwav_read_pcm_frames_f32__ieee(drwav* pWav, drwav_uint64 fr } return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_f32__alaw(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_f32__alaw(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -52158,7 +51988,7 @@ static drwav_uint64 drwav_read_pcm_frames_f32__alaw(drwav* pWav, drwav_uint64 fr } return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_f32__mulaw(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_f32__mulaw(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -52310,7 +52140,7 @@ DRWAV_API void drwav_mulaw_to_f32(float* pOut, const drwav_uint8* pIn, size_t sa *pOut++ = drwav__mulaw_to_s16(pIn[i]) / 32768.0f; } } -static void drwav__pcm_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) +DRWAV_PRIVATE void drwav__pcm_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) { unsigned int i; if (bytesPerSample == 1) { @@ -52348,7 +52178,7 @@ static void drwav__pcm_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, size_t *pOut++ = (drwav_int32)((drwav_int64)sample >> 32); } } -static void drwav__ieee_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) +DRWAV_PRIVATE void drwav__ieee_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample) { if (bytesPerSample == 4) { drwav_f32_to_s32(pOut, (const float*)pIn, totalSampleCount); @@ -52361,7 +52191,7 @@ static void drwav__ieee_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, size_t return; } } -static drwav_uint64 drwav_read_pcm_frames_s32__pcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s32__pcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -52386,7 +52216,7 @@ static drwav_uint64 drwav_read_pcm_frames_s32__pcm(drwav* pWav, drwav_uint64 fra } return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s32__msadpcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s32__msadpcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) { drwav_uint64 totalFramesRead = 0; drwav_int16 samples16[2048]; @@ -52402,7 +52232,7 @@ static drwav_uint64 drwav_read_pcm_frames_s32__msadpcm(drwav* pWav, drwav_uint64 } return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s32__ima(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s32__ima(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) { drwav_uint64 totalFramesRead = 0; drwav_int16 samples16[2048]; @@ -52418,7 +52248,7 @@ static drwav_uint64 drwav_read_pcm_frames_s32__ima(drwav* pWav, drwav_uint64 fra } return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s32__ieee(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s32__ieee(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -52439,7 +52269,7 @@ static drwav_uint64 drwav_read_pcm_frames_s32__ieee(drwav* pWav, drwav_uint64 fr } return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s32__alaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s32__alaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -52460,7 +52290,7 @@ static drwav_uint64 drwav_read_pcm_frames_s32__alaw(drwav* pWav, drwav_uint64 fr } return totalFramesRead; } -static drwav_uint64 drwav_read_pcm_frames_s32__mulaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) +DRWAV_PRIVATE drwav_uint64 drwav_read_pcm_frames_s32__mulaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut) { drwav_uint64 totalFramesRead; drwav_uint8 sampleData[4096]; @@ -52602,7 +52432,7 @@ DRWAV_API void drwav_mulaw_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, siz *pOut++ = ((drwav_int32)drwav__mulaw_to_s16(pIn[i])) << 16; } } -static drwav_int16* drwav__read_pcm_frames_and_close_s16(drwav* pWav, unsigned int* channels, unsigned int* sampleRate, drwav_uint64* totalFrameCount) +DRWAV_PRIVATE drwav_int16* drwav__read_pcm_frames_and_close_s16(drwav* pWav, unsigned int* channels, unsigned int* sampleRate, drwav_uint64* totalFrameCount) { drwav_uint64 sampleDataSize; drwav_int16* pSampleData; @@ -52636,7 +52466,7 @@ static drwav_int16* drwav__read_pcm_frames_and_close_s16(drwav* pWav, unsigned i } return pSampleData; } -static float* drwav__read_pcm_frames_and_close_f32(drwav* pWav, unsigned int* channels, unsigned int* sampleRate, drwav_uint64* totalFrameCount) +DRWAV_PRIVATE float* drwav__read_pcm_frames_and_close_f32(drwav* pWav, unsigned int* channels, unsigned int* sampleRate, drwav_uint64* totalFrameCount) { drwav_uint64 sampleDataSize; float* pSampleData; @@ -52670,7 +52500,7 @@ static float* drwav__read_pcm_frames_and_close_f32(drwav* pWav, unsigned int* ch } return pSampleData; } -static drwav_int32* drwav__read_pcm_frames_and_close_s32(drwav* pWav, unsigned int* channels, unsigned int* sampleRate, drwav_uint64* totalFrameCount) +DRWAV_PRIVATE drwav_int32* drwav__read_pcm_frames_and_close_s32(drwav* pWav, unsigned int* channels, unsigned int* sampleRate, drwav_uint64* totalFrameCount) { drwav_uint64 sampleDataSize; drwav_int32* pSampleData; @@ -52921,35 +52751,47 @@ DRWAV_API void drwav_free(void* p, const drwav_allocation_callbacks* pAllocation } DRWAV_API drwav_uint16 drwav_bytes_to_u16(const drwav_uint8* data) { - return drwav__bytes_to_u16(data); + return (data[0] << 0) | (data[1] << 8); } DRWAV_API drwav_int16 drwav_bytes_to_s16(const drwav_uint8* data) { - return drwav__bytes_to_s16(data); + return (short)drwav_bytes_to_u16(data); } DRWAV_API drwav_uint32 drwav_bytes_to_u32(const drwav_uint8* data) { - return drwav__bytes_to_u32(data); + return (data[0] << 0) | (data[1] << 8) | (data[2] << 16) | (data[3] << 24); } DRWAV_API drwav_int32 drwav_bytes_to_s32(const drwav_uint8* data) { - return drwav__bytes_to_s32(data); + return (drwav_int32)drwav_bytes_to_u32(data); } DRWAV_API drwav_uint64 drwav_bytes_to_u64(const drwav_uint8* data) { - return drwav__bytes_to_u64(data); + return + ((drwav_uint64)data[0] << 0) | ((drwav_uint64)data[1] << 8) | ((drwav_uint64)data[2] << 16) | ((drwav_uint64)data[3] << 24) | + ((drwav_uint64)data[4] << 32) | ((drwav_uint64)data[5] << 40) | ((drwav_uint64)data[6] << 48) | ((drwav_uint64)data[7] << 56); } DRWAV_API drwav_int64 drwav_bytes_to_s64(const drwav_uint8* data) { - return drwav__bytes_to_s64(data); + return (drwav_int64)drwav_bytes_to_u64(data); } DRWAV_API drwav_bool32 drwav_guid_equal(const drwav_uint8 a[16], const drwav_uint8 b[16]) { - return drwav__guid_equal(a, b); + int i; + for (i = 0; i < 16; i += 1) { + if (a[i] != b[i]) { + return DRWAV_FALSE; + } + } + return DRWAV_TRUE; } DRWAV_API drwav_bool32 drwav_fourcc_equal(const drwav_uint8* a, const char* b) { - return drwav__fourcc_equal(a, b); + return + a[0] == b[0] && + a[1] == b[1] && + a[2] == b[2] && + a[3] == b[3]; } #endif /* dr_wav_c end */ @@ -52971,6 +52813,9 @@ DRWAV_API drwav_bool32 drwav_fourcc_equal(const drwav_uint8* a, const char* b) #ifndef _BSD_SOURCE #define _BSD_SOURCE #endif + #ifndef _DEFAULT_SOURCE + #define _DEFAULT_SOURCE + #endif #ifndef __USE_BSD #define __USE_BSD #endif @@ -53161,6 +53006,27 @@ static DRFLAC_INLINE drflac_bool32 drflac_has_sse41(void) #if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) #define DRFLAC_HAS_BYTESWAP16_INTRINSIC #endif +#elif defined(__WATCOMC__) && defined(__386__) + #define DRFLAC_HAS_BYTESWAP16_INTRINSIC + #define DRFLAC_HAS_BYTESWAP32_INTRINSIC + #define DRFLAC_HAS_BYTESWAP64_INTRINSIC + extern __inline drflac_uint16 _watcom_bswap16(drflac_uint16); + extern __inline drflac_uint32 _watcom_bswap32(drflac_uint32); + extern __inline drflac_uint64 _watcom_bswap64(drflac_uint64); +#pragma aux _watcom_bswap16 = \ + "xchg al, ah" \ + parm [ax] \ + modify [ax]; +#pragma aux _watcom_bswap32 = \ + "bswap eax" \ + parm [eax] \ + modify [eax]; +#pragma aux _watcom_bswap64 = \ + "bswap eax" \ + "bswap edx" \ + "xchg eax,edx" \ + parm [eax edx] \ + modify [eax edx]; #endif #ifndef DRFLAC_ASSERT #include @@ -53342,6 +53208,8 @@ static DRFLAC_INLINE drflac_uint16 drflac__swap_endian_uint16(drflac_uint16 n) return _byteswap_ushort(n); #elif defined(__GNUC__) || defined(__clang__) return __builtin_bswap16(n); + #elif defined(__WATCOMC__) && defined(__386__) + return _watcom_bswap16(n); #else #error "This compiler does not support the byte swap intrinsic." #endif @@ -53369,6 +53237,8 @@ static DRFLAC_INLINE drflac_uint32 drflac__swap_endian_uint32(drflac_uint32 n) #else return __builtin_bswap32(n); #endif + #elif defined(__WATCOMC__) && defined(__386__) + return _watcom_bswap32(n); #else #error "This compiler does not support the byte swap intrinsic." #endif @@ -53386,6 +53256,8 @@ static DRFLAC_INLINE drflac_uint64 drflac__swap_endian_uint64(drflac_uint64 n) return _byteswap_uint64(n); #elif defined(__GNUC__) || defined(__clang__) return __builtin_bswap64(n); + #elif defined(__WATCOMC__) && defined(__386__) + return _watcom_bswap64(n); #else #error "This compiler does not support the byte swap intrinsic." #endif @@ -54003,6 +53875,9 @@ static drflac_bool32 drflac__find_and_seek_to_next_sync_code(drflac_bs* bs) #if defined(_MSC_VER) && _MSC_VER >= 1400 && (defined(DRFLAC_X64) || defined(DRFLAC_X86)) && !defined(__clang__) #define DRFLAC_IMPLEMENT_CLZ_MSVC #endif +#if defined(__WATCOMC__) && defined(__386__) +#define DRFLAC_IMPLEMENT_CLZ_WATCOM +#endif static DRFLAC_INLINE drflac_uint32 drflac__clz_software(drflac_cache_t x) { drflac_uint32 n; @@ -54115,6 +53990,15 @@ static DRFLAC_INLINE drflac_uint32 drflac__clz_msvc(drflac_cache_t x) return sizeof(x)*8 - n - 1; } #endif +#ifdef DRFLAC_IMPLEMENT_CLZ_WATCOM +static __inline drflac_uint32 drflac__clz_watcom (drflac_uint32); +#pragma aux drflac__clz_watcom = \ + "bsr eax, eax" \ + "xor eax, 31" \ + parm [eax] nomemory \ + value [eax] \ + modify exact [eax] nomemory; +#endif static DRFLAC_INLINE drflac_uint32 drflac__clz(drflac_cache_t x) { #ifdef DRFLAC_IMPLEMENT_CLZ_LZCNT @@ -54125,6 +54009,8 @@ static DRFLAC_INLINE drflac_uint32 drflac__clz(drflac_cache_t x) { #ifdef DRFLAC_IMPLEMENT_CLZ_MSVC return drflac__clz_msvc(x); +#elif defined(DRFLAC_IMPLEMENT_CLZ_WATCOM) + return (x == 0) ? sizeof(x)*8 : drflac__clz_watcom(x); #else return drflac__clz_software(x); #endif @@ -54441,7 +54327,6 @@ static drflac_bool32 drflac__decode_samples_with_residual__rice__reference(drfla { drflac_uint32 i; DRFLAC_ASSERT(bs != NULL); - DRFLAC_ASSERT(count > 0); DRFLAC_ASSERT(pSamplesOut != NULL); for (i = 0; i < count; ++i) { drflac_uint32 zeroCounter = 0; @@ -54710,7 +54595,6 @@ static drflac_bool32 drflac__decode_samples_with_residual__rice__scalar_zeroorde drflac_uint32 riceParamMask; drflac_uint32 i; DRFLAC_ASSERT(bs != NULL); - DRFLAC_ASSERT(count > 0); DRFLAC_ASSERT(pSamplesOut != NULL); (void)bitsPerSample; (void)order; @@ -54745,7 +54629,6 @@ static drflac_bool32 drflac__decode_samples_with_residual__rice__scalar(drflac_b const drflac_int32* pSamplesOutEnd; drflac_uint32 i; DRFLAC_ASSERT(bs != NULL); - DRFLAC_ASSERT(count > 0); DRFLAC_ASSERT(pSamplesOut != NULL); if (order == 0) { return drflac__decode_samples_with_residual__rice__scalar_zeroorder(bs, bitsPerSample, count, riceParam, order, shift, coefficients, pSamplesOut); @@ -55164,7 +55047,6 @@ static drflac_bool32 drflac__decode_samples_with_residual__rice__sse41_64(drflac static drflac_bool32 drflac__decode_samples_with_residual__rice__sse41(drflac_bs* bs, drflac_uint32 bitsPerSample, drflac_uint32 count, drflac_uint8 riceParam, drflac_uint32 order, drflac_int32 shift, const drflac_int32* coefficients, drflac_int32* pSamplesOut) { DRFLAC_ASSERT(bs != NULL); - DRFLAC_ASSERT(count > 0); DRFLAC_ASSERT(pSamplesOut != NULL); if (order > 0 && order <= 12) { if (bitsPerSample+shift > 32) { @@ -55515,7 +55397,6 @@ static drflac_bool32 drflac__decode_samples_with_residual__rice__neon_64(drflac_ static drflac_bool32 drflac__decode_samples_with_residual__rice__neon(drflac_bs* bs, drflac_uint32 bitsPerSample, drflac_uint32 count, drflac_uint8 riceParam, drflac_uint32 order, drflac_int32 shift, const drflac_int32* coefficients, drflac_int32* pSamplesOut) { DRFLAC_ASSERT(bs != NULL); - DRFLAC_ASSERT(count > 0); DRFLAC_ASSERT(pSamplesOut != NULL); if (order > 0 && order <= 12) { if (bitsPerSample+shift > 32) { @@ -55551,7 +55432,6 @@ static drflac_bool32 drflac__read_and_seek_residual__rice(drflac_bs* bs, drflac_ { drflac_uint32 i; DRFLAC_ASSERT(bs != NULL); - DRFLAC_ASSERT(count > 0); for (i = 0; i < count; ++i) { if (!drflac__seek_rice_parts(bs, riceParam)) { return DRFLAC_FALSE; @@ -55563,7 +55443,6 @@ static drflac_bool32 drflac__decode_samples_with_residual__unencoded(drflac_bs* { drflac_uint32 i; DRFLAC_ASSERT(bs != NULL); - DRFLAC_ASSERT(count > 0); DRFLAC_ASSERT(unencodedBitsPerSample <= 31); DRFLAC_ASSERT(pSamplesOut != NULL); for (i = 0; i < count; ++i) { @@ -55604,7 +55483,7 @@ static drflac_bool32 drflac__decode_samples_with_residual(drflac_bs* bs, drflac_ if (partitionOrder > 8) { return DRFLAC_FALSE; } - if ((blockSize / (1 << partitionOrder)) <= order) { + if ((blockSize / (1 << partitionOrder)) < order) { return DRFLAC_FALSE; } samplesInPartition = (blockSize / (1 << partitionOrder)) - order; @@ -55887,7 +55766,8 @@ static drflac_bool32 drflac__read_next_flac_frame_header(drflac_bs* bs, drflac_u DRFLAC_ASSERT(blockSize > 0); if (blockSize == 1) { header->blockSizeInPCMFrames = 192; - } else if (blockSize >= 2 && blockSize <= 5) { + } else if (blockSize <= 5) { + DRFLAC_ASSERT(blockSize >= 2); header->blockSizeInPCMFrames = 576 * (1 << (blockSize - 2)); } else if (blockSize == 6) { if (!drflac__read_uint16(bs, 8, &header->blockSizeInPCMFrames)) { @@ -58306,7 +58186,7 @@ static drflac_result drflac_result_from_errno(int e) } static drflac_result drflac_fopen(FILE** ppFile, const char* pFilePath, const char* pOpenMode) { -#if _MSC_VER && _MSC_VER >= 1400 +#if defined(_MSC_VER) && _MSC_VER >= 1400 errno_t err; #endif if (ppFile != NULL) { @@ -58315,7 +58195,7 @@ static drflac_result drflac_fopen(FILE** ppFile, const char* pFilePath, const ch if (pFilePath == NULL || pOpenMode == NULL || ppFile == NULL) { return DRFLAC_INVALID_ARGS; } -#if _MSC_VER && _MSC_VER >= 1400 +#if defined(_MSC_VER) && _MSC_VER >= 1400 err = fopen_s(ppFile, pFilePath, pOpenMode); if (err != 0) { return drflac_result_from_errno(err); @@ -60748,6 +60628,7 @@ DRFLAC_API drflac_bool32 drflac_seek_to_pcm_frame(drflac* pFlac, drflac_uint64 p return drflac__seek_to_first_frame(pFlac); } else { drflac_bool32 wasSuccessful = DRFLAC_FALSE; + drflac_uint64 originalPCMFrame = pFlac->currentPCMFrame; if (pcmFrameIndex > pFlac->totalPCMFrameCount) { pcmFrameIndex = pFlac->totalPCMFrameCount; } @@ -60788,7 +60669,13 @@ DRFLAC_API drflac_bool32 drflac_seek_to_pcm_frame(drflac* pFlac, drflac_uint64 p wasSuccessful = drflac__seek_to_pcm_frame__brute_force(pFlac, pcmFrameIndex); } } - pFlac->currentPCMFrame = pcmFrameIndex; + if (wasSuccessful) { + pFlac->currentPCMFrame = pcmFrameIndex; + } else { + if (drflac_seek_to_pcm_frame(pFlac, originalPCMFrame) == DRFLAC_FALSE) { + drflac_seek_to_pcm_frame(pFlac, 0); + } + } return wasSuccessful; } } @@ -63616,7 +63503,7 @@ static drmp3_result drmp3_result_from_errno(int e) } static drmp3_result drmp3_fopen(FILE** ppFile, const char* pFilePath, const char* pOpenMode) { -#if _MSC_VER && _MSC_VER >= 1400 +#if defined(_MSC_VER) && _MSC_VER >= 1400 errno_t err; #endif if (ppFile != NULL) { @@ -63625,7 +63512,7 @@ static drmp3_result drmp3_fopen(FILE** ppFile, const char* pFilePath, const char if (pFilePath == NULL || pOpenMode == NULL || ppFile == NULL) { return DRMP3_INVALID_ARGS; } -#if _MSC_VER && _MSC_VER >= 1400 +#if defined(_MSC_VER) && _MSC_VER >= 1400 err = fopen_s(ppFile, pFilePath, pOpenMode); if (err != 0) { return drmp3_result_from_errno(err); @@ -64684,6 +64571,47 @@ The following miscellaneous changes have also been made. /* REVISION HISTORY ================ +v0.10.33 - 2021-04-04 + - Core Audio: Fix a memory leak. + - Core Audio: Fix a bug where the performance profile is not being used by playback devices. + - JACK: Fix loading of 64-bit JACK on Windows. + - Fix a calculation error and add a safety check to the following APIs to prevent a division by zero: + - ma_calculate_buffer_size_in_milliseconds_from_frames() + - ma_calculate_buffer_size_in_frames_from_milliseconds() + - Fix compilation errors relating to c89atomic. + - Update FLAC decoder. + +v0.10.32 - 2021-02-23 + - WASAPI: Fix a deadlock in exclusive mode. + - WASAPI: No longer return an error from ma_context_get_device_info() when an exclusive mode format + cannot be retrieved. + - WASAPI: Attempt to fix some bugs with device uninitialization. + - PulseAudio: Yet another refactor, this time to remove the dependency on `pa_threaded_mainloop`. + - Web Audio: Fix a bug on Chrome and any other browser using the same engine. + - Web Audio: Automatically start the device on some user input if the device has been started. This + is to work around Google's policy of not starting audio if no user input has yet been performed. + - Fix a bug where thread handles are not being freed. + - Fix some static analysis warnings in FLAC, WAV and MP3 decoders. + - Fix a warning due to referencing _MSC_VER when it is undefined. + - Update to latest version of c89atomic. + - Internal refactoring to migrate over to the new backend callback system for the following backends: + - PulseAudio + - ALSA + - Core Audio + - AAudio + - OpenSL|ES + - OSS + - audio(4) + - sndio + +v0.10.31 - 2021-01-17 + - Make some functions const correct. + - Update ma_data_source_read_pcm_frames() to initialize pFramesRead to 0 for safety. + - Add the MA_ATOMIC annotation for use with variables that should be used atomically and remove unnecessary volatile qualifiers. + - Add support for enabling only specific backends at compile time. This is the reverse of the pre-existing system. With the new + system, all backends are first disabled with `MA_ENABLE_ONLY_SPECIFIC_BACKENDS`, which is then followed with `MA_ENABLE_*`. The + old system where you disable backends with `MA_NO_*` still exists and is still the default. + v0.10.30 - 2021-01-10 - Fix a crash in ma_audio_buffer_read_pcm_frames(). - Update spinlock APIs to take a volatile parameter as input. diff --git a/src/external/sinfl.h b/src/external/sinfl.h index 20ec4eeed..37c1aaeae 100644 --- a/src/external/sinfl.h +++ b/src/external/sinfl.h @@ -322,10 +322,10 @@ sinfl_decompress(unsigned char *out, const unsigned char *in, int size) { case 0x02: state = dyn; break;} } break; case stored: { - int len, nlen; /* uncompressed block */ + int len; /* uncompressed block */ sinfl_get(&in,e,&s,s.bitcnt & 7); len = sinfl_get(&in,e,&s,16); - nlen = sinfl_get(&in,e,&s,16); + //int nlen = sinfl_get(&in,e,&s,16); in -= 2; s.bitcnt = 0; if (len > (e-in) || !len) diff --git a/src/external/stb_vorbis.h b/src/external/stb_vorbis.h index 90f3b0614..c9ee5cccc 100644 --- a/src/external/stb_vorbis.h +++ b/src/external/stb_vorbis.h @@ -570,7 +570,7 @@ enum STBVorbisError #if defined(_MSC_VER) || defined(__MINGW32__) #include #endif - #if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__) + #if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__) || defined(__APPLE__) #include #endif #else // STB_VORBIS_NO_CRT diff --git a/src/external/tinyobj_loader_c.h b/src/external/tinyobj_loader_c.h index 242b47d85..6bd63fceb 100644 --- a/src/external/tinyobj_loader_c.h +++ b/src/external/tinyobj_loader_c.h @@ -1377,7 +1377,7 @@ int tinyobj_parse_obj(tinyobj_attrib_t *attrib, tinyobj_shape_t **shapes, /* Create a null terminated string */ char* material_name_null_term = (char*) TINYOBJ_MALLOC(commands[i].material_name_len + 1); memcpy((void*) material_name_null_term, (const void*) commands[i].material_name, commands[i].material_name_len); - material_name_null_term[commands[i].material_name_len - 1] = 0; + material_name_null_term[commands[i].material_name_len] = 0; if (hash_table_exists(material_name_null_term, &material_table)) material_id = (int)hash_table_get(material_name_null_term, &material_table); diff --git a/src/easings.h b/src/extras/easings.h similarity index 100% rename from src/easings.h rename to src/extras/easings.h diff --git a/src/physac.h b/src/extras/physac.h similarity index 57% rename from src/physac.h rename to src/extras/physac.h index c3898d2fc..676a96953 100644 --- a/src/physac.h +++ b/src/extras/physac.h @@ -1,6 +1,6 @@ /********************************************************************************************** * -* Physac v1.0 - 2D Physics library for videogames +* Physac v1.1 - 2D Physics library for videogames * * DESCRIPTION: * @@ -20,38 +20,44 @@ * The generated implementation will stay private inside implementation file and all * internal symbols and functions will only be visible inside that file. * -* #define PHYSAC_NO_THREADS -* The generated implementation won't include pthread library and user must create a secondary thread to call PhysicsThread(). -* It is so important that the thread where PhysicsThread() is called must not have v-sync or any other CPU limitation. -* -* #define PHYSAC_STANDALONE -* Avoid raylib.h header inclusion in this file. Data types defined on raylib are defined -* internally in the library and input management and drawing functions must be provided by -* the user (check library implementation for further details). -* * #define PHYSAC_DEBUG -* Traces log messages when creating and destroying physics bodies and detects errors in physics -* calculations and reference exceptions; it is useful for debug purposes +* Show debug traces log messages about physic bodies creation/destruction, physic system errors, +* some calculations results and NULL reference exceptions +* +* #define PHYSAC_DEFINE_VECTOR2_TYPE +* Forces library to define struct Vector2 data type (float x; float y) +* +* #define PHYSAC_AVOID_TIMMING_SYSTEM +* Disables internal timming system, used by UpdatePhysics() to launch timmed physic steps, +* it allows just running UpdatePhysics() automatically on a separate thread at a desired time step. +* In case physics steps update needs to be controlled by user with a custom timming mechanism, +* just define this flag and the internal timming mechanism will be avoided, in that case, +* timming libraries are neither required by the module. * * #define PHYSAC_MALLOC() +* #define PHYSAC_CALLOC() * #define PHYSAC_FREE() * You can define your own malloc/free implementation replacing stdlib.h malloc()/free() functions. * Otherwise it will include stdlib.h and use the C standard library malloc()/free() function. * +* COMPILATION: * -* NOTE 1: Physac requires multi-threading, when InitPhysics() a second thread is created to manage physics calculations. -* NOTE 2: Physac requires static C library linkage to avoid dependency on MinGW DLL (-static -lpthread) +* Use the following code to compile with GCC: +* gcc -o $(NAME_PART).exe $(FILE_NAME) -s -static -lraylib -lopengl32 -lgdi32 -lwinmm -std=c99 * -* Use the following code to compile: -* gcc -o $(NAME_PART).exe $(FILE_NAME) -s -static -lraylib -lpthread -lopengl32 -lgdi32 -lwinmm -std=c99 -* -* VERY THANKS TO: -* Ramon Santamaria (github: @raysan5) +* VERSIONS HISTORY: +* 1.1 (20-Jan-2021) @raysan5: Library general revision +* Removed threading system (up to the user) +* Support MSVC C++ compilation using CLITERAL() +* Review DEBUG mechanism for TRACELOG() and all TRACELOG() messages +* Review internal variables/functions naming for consistency +* Allow option to avoid internal timming system, to allow app manage the steps +* 1.0 (12-Jun-2017) First release of the library * * * LICENSE: zlib/libpng * -* Copyright (c) 2016-2018 Victor Fisac (github: @victorfisac) +* Copyright (c) 2016-2021 Victor Fisac (@victorfisac) and 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. @@ -87,6 +93,9 @@ #ifndef PHYSAC_MALLOC #define PHYSAC_MALLOC(size) malloc(size) #endif +#ifndef PHYSAC_CALLOC + #define PHYSAC_CALLOC(size, n) calloc(size, n) +#endif #ifndef PHYSAC_FREE #define PHYSAC_FREE(ptr) free(ptr) #endif @@ -94,46 +103,38 @@ //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define PHYSAC_MAX_BODIES 64 -#define PHYSAC_MAX_MANIFOLDS 4096 -#define PHYSAC_MAX_VERTICES 24 -#define PHYSAC_CIRCLE_VERTICES 24 +#define PHYSAC_MAX_BODIES 64 // Maximum number of physic bodies supported +#define PHYSAC_MAX_MANIFOLDS 4096 // Maximum number of physic bodies interactions (64x64) +#define PHYSAC_MAX_VERTICES 24 // Maximum number of vertex for polygons shapes +#define PHYSAC_DEFAULT_CIRCLE_VERTICES 24 // Default number of vertices for circle shapes #define PHYSAC_COLLISION_ITERATIONS 100 #define PHYSAC_PENETRATION_ALLOWANCE 0.05f #define PHYSAC_PENETRATION_CORRECTION 0.4f -#define PHYSAC_PI 3.14159265358979323846 +#define PHYSAC_PI 3.14159265358979323846f #define PHYSAC_DEG2RAD (PHYSAC_PI/180.0f) -//---------------------------------------------------------------------------------- -// Types and Structures Definition -// NOTE: Below types are required for PHYSAC_STANDALONE usage -//---------------------------------------------------------------------------------- -#if defined(PHYSAC_STANDALONE) - // Boolean type - #if defined(__STDC__) && __STDC_VERSION__ >= 199901L - #include - #elif !defined(__cplusplus) && !defined(bool) - typedef enum { false, true } bool; - #endif - - // Vector2 type - typedef struct Vector2 { - float x; - float y; - } Vector2; -#endif - //---------------------------------------------------------------------------------- // Data Types Structure Definition //---------------------------------------------------------------------------------- +#if defined(__STDC__) && __STDC_VERSION__ >= 199901L + #include +#endif -typedef enum PhysicsShapeType { PHYSICS_CIRCLE, PHYSICS_POLYGON } PhysicsShapeType; +typedef enum PhysicsShapeType { PHYSICS_CIRCLE = 0, PHYSICS_POLYGON } PhysicsShapeType; // Previously defined to be used in PhysicsShape struct as circular dependencies typedef struct PhysicsBodyData *PhysicsBody; +#if defined(PHYSAC_DEFINE_VECTOR2_TYPE) +// Vector2 type +typedef struct Vector2 { + float x; + float y; +} Vector2; +#endif + // Matrix2x2 type (used for polygon shape rotation matrix) typedef struct Matrix2x2 { float m00; @@ -142,22 +143,22 @@ typedef struct Matrix2x2 { float m11; } Matrix2x2; -typedef struct PolygonData { - unsigned int vertexCount; // Current used vertex and normals count - Vector2 positions[PHYSAC_MAX_VERTICES]; // Polygon vertex positions vectors - Vector2 normals[PHYSAC_MAX_VERTICES]; // Polygon vertex normals vectors -} PolygonData; +typedef struct PhysicsVertexData { + unsigned int vertexCount; // Vertex count (positions and normals) + Vector2 positions[PHYSAC_MAX_VERTICES]; // Vertex positions vectors + Vector2 normals[PHYSAC_MAX_VERTICES]; // Vertex normals vectors +} PhysicsVertexData; typedef struct PhysicsShape { - PhysicsShapeType type; // Physics shape type (circle or polygon) - PhysicsBody body; // Shape physics body reference - float radius; // Circle shape radius (used for circle shapes) + PhysicsShapeType type; // Shape type (circle or polygon) + PhysicsBody body; // Shape physics body data pointer + PhysicsVertexData vertexData; // Shape vertices data (used for polygon shapes) + float radius; // Shape radius (used for circle shapes) Matrix2x2 transform; // Vertices transform matrix 2x2 - PolygonData vertexData; // Polygon shape vertices position and normals data (just used for polygon shapes) } PhysicsShape; typedef struct PhysicsBodyData { - unsigned int id; // Reference unique identifier + unsigned int id; // Unique identifier bool enabled; // Enabled dynamics state (collisions are calculated anyway) Vector2 position; // Physics body shape pivot Vector2 velocity; // Current linear velocity applied to position @@ -175,11 +176,11 @@ typedef struct PhysicsBodyData { bool useGravity; // Apply gravity force to dynamics bool isGrounded; // Physics grounded on other body state bool freezeOrient; // Physics rotation constraint - PhysicsShape shape; // Physics body shape information (type, radius, vertices, normals) + PhysicsShape shape; // Physics body shape information (type, radius, vertices, transform) } PhysicsBodyData; typedef struct PhysicsManifoldData { - unsigned int id; // Reference unique identifier + unsigned int id; // Unique identifier PhysicsBody bodyA; // Manifold first physics body reference PhysicsBody bodyB; // Manifold second physics body reference float penetration; // Depth of penetration from collision @@ -198,26 +199,32 @@ extern "C" { // Prevents name mangling of fun //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- -PHYSACDEF void InitPhysics(void); // Initializes physics values, pointers and creates physics loop thread -PHYSACDEF void RunPhysicsStep(void); // Run physics step, to be used if PHYSICS_NO_THREADS is set in your main loop +// Physics system management +PHYSACDEF void InitPhysics(void); // Initializes physics system +PHYSACDEF void UpdatePhysics(void); // Update physics system +PHYSACDEF void ResetPhysics(void); // Reset physics system (global variables) +PHYSACDEF void ClosePhysics(void); // Close physics system and unload used memory PHYSACDEF void SetPhysicsTimeStep(double delta); // Sets physics fixed time step in milliseconds. 1.666666 by default -PHYSACDEF bool IsPhysicsEnabled(void); // Returns true if physics thread is currently enabled PHYSACDEF void SetPhysicsGravity(float x, float y); // Sets physics global gravity force + +// Physic body creation/destroy PHYSACDEF PhysicsBody CreatePhysicsBodyCircle(Vector2 pos, float radius, float density); // Creates a new circle physics body with generic parameters PHYSACDEF PhysicsBody CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density); // Creates a new rectangle physics body with generic parameters PHYSACDEF PhysicsBody CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density); // Creates a new polygon physics body with generic parameters +PHYSACDEF void DestroyPhysicsBody(PhysicsBody body); // Destroy a physics body + +// Physic body forces PHYSACDEF void PhysicsAddForce(PhysicsBody body, Vector2 force); // Adds a force to a physics body PHYSACDEF void PhysicsAddTorque(PhysicsBody body, float amount); // Adds an angular force to a physics body PHYSACDEF void PhysicsShatter(PhysicsBody body, Vector2 position, float force); // Shatters a polygon shape physics body to little physics bodies with explosion force -PHYSACDEF int GetPhysicsBodiesCount(void); // Returns the current amount of created physics bodies +PHYSACDEF void SetPhysicsBodyRotation(PhysicsBody body, float radians); // Sets physics body shape transform based on radians parameter + +// Query physics info PHYSACDEF PhysicsBody GetPhysicsBody(int index); // Returns a physics body of the bodies pool at a specific index +PHYSACDEF int GetPhysicsBodiesCount(void); // Returns the current amount of created physics bodies PHYSACDEF int GetPhysicsShapeType(int index); // Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON) PHYSACDEF int GetPhysicsShapeVerticesCount(int index); // Returns the amount of vertices of a physics body shape PHYSACDEF Vector2 GetPhysicsShapeVertex(PhysicsBody body, int vertex); // Returns transformed position of a body shape (body position + vertex transformed position) -PHYSACDEF void SetPhysicsBodyRotation(PhysicsBody body, float radians); // Sets physics body shape transform based on radians parameter -PHYSACDEF void DestroyPhysicsBody(PhysicsBody body); // Unitializes and destroy a physics body -PHYSACDEF void ResetPhysics(void); // Destroys created physics bodies and manifolds and resets global values -PHYSACDEF void ClosePhysics(void); // Unitializes physics pointers and closes physics loop thread #if defined(__cplusplus) } @@ -233,151 +240,140 @@ PHYSACDEF void ClosePhysics(void); #if defined(PHYSAC_IMPLEMENTATION) -#if !defined(PHYSAC_NO_THREADS) - #include // Required for: pthread_t, pthread_create() -#endif - -#if defined(PHYSAC_DEBUG) - -#endif - // Support TRACELOG macros #if defined(PHYSAC_DEBUG) #include // Required for: printf() #define TRACELOG(...) printf(__VA_ARGS__) #else - #define TRACELOG(...) (void)0 + #define TRACELOG(...) (void)0; #endif -#include // Required for: malloc(), free(), srand(), rand() +#include // Required for: malloc(), calloc(), free() #include // Required for: cosf(), sinf(), fabs(), sqrtf() -#if !defined(PHYSAC_STANDALONE) - #include "raymath.h" // Required for: Vector2Add(), Vector2Subtract() +#if !defined(PHYSAC_AVOID_TIMMING_SYSTEM) + // Time management functionality + #include // Required for: time(), clock_gettime() + #if defined(_WIN32) + // Functions required to query time on Windows + int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount); + int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency); + #endif + #if defined(__linux__) || defined(__FreeBSD__) + #if _POSIX_C_SOURCE < 199309L + #undef _POSIX_C_SOURCE + #define _POSIX_C_SOURCE 199309L // Required for CLOCK_MONOTONIC if compiled with c99 without gnu ext. + #endif + #include // Required for: timespec + #endif + #if defined(__APPLE__) // macOS also defines __MACH__ + #include // Required for: mach_absolute_time() + #endif #endif -// Time management functionality -#include // Required for: time(), clock_gettime() -#if defined(_WIN32) - // Functions required to query time on Windows - int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount); - int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency); -#elif defined(__linux__) - #if _POSIX_C_SOURCE < 199309L - #undef _POSIX_C_SOURCE - #define _POSIX_C_SOURCE 199309L // Required for CLOCK_MONOTONIC if compiled with c99 without gnu ext. - #endif - #include // Required for: timespec -#elif defined(__APPLE__) // macOS also defines __MACH__ - #include // Required for: mach_absolute_time() +// NOTE: MSVC C++ compiler does not support compound literals (C99 feature) +// Plain structures in C++ (without constructors) can be initialized from { } initializers. +#if defined(__cplusplus) + #define CLITERAL(type) type +#else + #define CLITERAL(type) (type) #endif //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define min(a,b) (((a)<(b))?(a):(b)) -#define max(a,b) (((a)>(b))?(a):(b)) -#define PHYSAC_FLT_MAX 3.402823466e+38f -#define PHYSAC_EPSILON 0.000001f -#define PHYSAC_K 1.0f/3.0f -#define PHYSAC_VECTOR_ZERO (Vector2){ 0.0f, 0.0f } +#define PHYSAC_MIN(a,b) (((a)<(b))?(a):(b)) +#define PHYSAC_MAX(a,b) (((a)>(b))?(a):(b)) +#define PHYSAC_FLT_MAX 3.402823466e+38f +#define PHYSAC_EPSILON 0.000001f +#define PHYSAC_K 1.0f/3.0f +#define PHYSAC_VECTOR_ZERO CLITERAL(Vector2){ 0.0f, 0.0f } //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -#if !defined(PHYSAC_NO_THREADS) -static pthread_t physicsThreadId; // Physics thread id -#endif -static unsigned int usedMemory = 0; // Total allocated dynamic memory -static bool physicsThreadEnabled = false; // Physics thread enabled state -static double baseTime = 0.0; // Offset time for MONOTONIC clock -static double startTime = 0.0; // Start time in milliseconds -static double deltaTime = 1.0/60.0/10.0 * 1000; // Delta time used for physics steps, in milliseconds -static double currentTime = 0.0; // Current time in milliseconds -static unsigned long long int frequency = 0; // Hi-res clock frequency +static double deltaTime = 1.0/60.0/10.0 * 1000; // Delta time in milliseconds used for physics steps -static double accumulator = 0.0; // Physics time step delta time accumulator -static unsigned int stepsCount = 0; // Total physics steps processed -static Vector2 gravityForce = { 0.0f, 9.81f }; // Physics world gravity force +#if !defined(PHYSAC_AVOID_TIMMING_SYSTEM) +// Time measure variables +static double baseClockTicks = 0.0; // Offset clock ticks for MONOTONIC clock +static unsigned long long int frequency = 0; // Hi-res clock frequency +static double startTime = 0.0; // Start time in milliseconds +static double currentTime = 0.0; // Current time in milliseconds +#endif + +// Physics system configuration static PhysicsBody bodies[PHYSAC_MAX_BODIES]; // Physics bodies pointers array static unsigned int physicsBodiesCount = 0; // Physics world current bodies counter static PhysicsManifold contacts[PHYSAC_MAX_MANIFOLDS]; // Physics bodies pointers array static unsigned int physicsManifoldsCount = 0; // Physics world current manifolds counter +static Vector2 gravityForce = { 0.0f, 9.81f }; // Physics world gravity force + +// Utilities variables +static unsigned int usedMemory = 0; // Total allocated dynamic memory + //---------------------------------------------------------------------------------- // Module Internal Functions Declaration //---------------------------------------------------------------------------------- +#if !defined(PHYSAC_AVOID_TIMMING_SYSTEM) +// Timming measure functions +static void InitTimer(void); // Initializes hi-resolution MONOTONIC timer +static unsigned long long int GetClockTicks(void); // Get hi-res MONOTONIC time measure in mseconds +static double GetCurrentTime(void); // Get current time measure in milliseconds +#endif + +static void UpdatePhysicsStep(void); // Update physics step (dynamics, collisions and position corrections) + static int FindAvailableBodyIndex(); // Finds a valid index for a new physics body initialization -static PolygonData CreateRandomPolygon(float radius, int sides); // Creates a random polygon shape with max vertex distance from polygon pivot -static PolygonData CreateRectanglePolygon(Vector2 pos, Vector2 size); // Creates a rectangle polygon shape based on a min and max positions -static void *PhysicsLoop(void *arg); // Physics loop thread function -static void PhysicsStep(void); // Physics steps calculations (dynamics, collisions and position corrections) static int FindAvailableManifoldIndex(); // Finds a valid index for a new manifold initialization +static PhysicsVertexData CreateDefaultPolygon(float radius, int sides); // Creates a random polygon shape with max vertex distance from polygon pivot +static PhysicsVertexData CreateRectanglePolygon(Vector2 pos, Vector2 size); // Creates a rectangle polygon shape based on a min and max positions + +static void InitializePhysicsManifolds(PhysicsManifold manifold); // Initializes physics manifolds to solve collisions static PhysicsManifold CreatePhysicsManifold(PhysicsBody a, PhysicsBody b); // Creates a new physics manifold to solve collision static void DestroyPhysicsManifold(PhysicsManifold manifold); // Unitializes and destroys a physics manifold + static void SolvePhysicsManifold(PhysicsManifold manifold); // Solves a created physics manifold between two physics bodies static void SolveCircleToCircle(PhysicsManifold manifold); // Solves collision between two circle shape physics bodies static void SolveCircleToPolygon(PhysicsManifold manifold); // Solves collision between a circle to a polygon shape physics bodies static void SolvePolygonToCircle(PhysicsManifold manifold); // Solves collision between a polygon to a circle shape physics bodies static void SolvePolygonToPolygon(PhysicsManifold manifold); // Solves collision between two polygons shape physics bodies static void IntegratePhysicsForces(PhysicsBody body); // Integrates physics forces into velocity -static void InitializePhysicsManifolds(PhysicsManifold manifold); // Initializes physics manifolds to solve collisions -static void IntegratePhysicsImpulses(PhysicsManifold manifold); // Integrates physics collisions impulses to solve collisions static void IntegratePhysicsVelocity(PhysicsBody body); // Integrates physics velocity into position and forces +static void IntegratePhysicsImpulses(PhysicsManifold manifold); // Integrates physics collisions impulses to solve collisions static void CorrectPhysicsPositions(PhysicsManifold manifold); // Corrects physics bodies positions based on manifolds collision information -static float FindAxisLeastPenetration(int *faceIndex, PhysicsShape shapeA, PhysicsShape shapeB); // Finds polygon shapes axis least penetration static void FindIncidentFace(Vector2 *v0, Vector2 *v1, PhysicsShape ref, PhysicsShape inc, int index); // Finds two polygon shapes incident face -static int Clip(Vector2 normal, float clip, Vector2 *faceA, Vector2 *faceB); // Calculates clipping based on a normal and two faces -static bool BiasGreaterThan(float valueA, float valueB); // Check if values are between bias range -static Vector2 TriangleBarycenter(Vector2 v1, Vector2 v2, Vector2 v3); // Returns the barycenter of a triangle given by 3 points +static float FindAxisLeastPenetration(int *faceIndex, PhysicsShape shapeA, PhysicsShape shapeB); // Finds polygon shapes axis least penetration -static void InitTimer(void); // Initializes hi-resolution MONOTONIC timer -static unsigned long long int GetTimeCount(void); // Get hi-res MONOTONIC time measure in mseconds -static double GetCurrentTime(void); // Get current time measure in milliseconds - -// Math functions -static Vector2 MathCross(float value, Vector2 vector); // Returns the cross product of a vector and a value -static float MathCrossVector2(Vector2 v1, Vector2 v2); // Returns the cross product of two vectors -static float MathLenSqr(Vector2 vector); // Returns the len square root of a vector -static float MathDot(Vector2 v1, Vector2 v2); // Returns the dot product of two vectors -static inline float DistSqr(Vector2 v1, Vector2 v2); // Returns the square root of distance between two vectors -static void MathNormalize(Vector2 *vector); // Returns the normalized values of a vector -#if defined(PHYSAC_STANDALONE) -static Vector2 Vector2Add(Vector2 v1, Vector2 v2); // Returns the sum of two given vectors -static Vector2 Vector2Subtract(Vector2 v1, Vector2 v2); // Returns the subtract of two given vectors -#endif - -static Matrix2x2 Mat2Radians(float radians); // Creates a matrix 2x2 from a given radians value -static void Mat2Set(Matrix2x2 *matrix, float radians); // Set values from radians to a created matrix 2x2 -static inline Matrix2x2 Mat2Transpose(Matrix2x2 matrix); // Returns the transpose of a given matrix 2x2 -static inline Vector2 Mat2MultiplyVector2(Matrix2x2 matrix, Vector2 vector); // Multiplies a vector by a matrix 2x2 +// Math required functions +static Vector2 MathVector2Product(Vector2 vector, float value); // Returns the product of a vector and a value +static float MathVector2CrossProduct(Vector2 v1, Vector2 v2); // Returns the cross product of two vectors +static float MathVector2SqrLen(Vector2 vector); // Returns the len square root of a vector +static float MathVector2DotProduct(Vector2 v1, Vector2 v2); // Returns the dot product of two vectors +static inline float MathVector2SqrDistance(Vector2 v1, Vector2 v2); // Returns the square root of distance between two vectors +static void MathVector2Normalize(Vector2 *vector); // Returns the normalized values of a vector +static Vector2 MathVector2Add(Vector2 v1, Vector2 v2); // Returns the sum of two given vectors +static Vector2 MathVector2Subtract(Vector2 v1, Vector2 v2); // Returns the subtract of two given vectors +static Matrix2x2 MathMatFromRadians(float radians); // Returns a matrix 2x2 from a given radians value +static inline Matrix2x2 MathMatTranspose(Matrix2x2 matrix); // Returns the transpose of a given matrix 2x2 +static inline Vector2 MathMatVector2Product(Matrix2x2 matrix, Vector2 vector); // Returns product between matrix 2x2 and vector +static int MathVector2Clip(Vector2 normal, Vector2 *faceA, Vector2 *faceB, float clip); // Returns clipping value based on a normal and two faces +static Vector2 MathTriangleBarycenter(Vector2 v1, Vector2 v2, Vector2 v3); // Returns the barycenter of a triangle given by 3 points //---------------------------------------------------------------------------------- // Module Functions Definition //---------------------------------------------------------------------------------- + // Initializes physics values, pointers and creates physics loop thread PHYSACDEF void InitPhysics(void) { - #if !defined(PHYSAC_NO_THREADS) - // NOTE: if defined, user will need to create a thread for PhysicsThread function manually - // Create physics thread using POSIXS thread libraries - pthread_create(&physicsThreadId, NULL, &PhysicsLoop, NULL); - #endif - +#if !defined(PHYSAC_AVOID_TIMMING_SYSTEM) // Initialize high resolution timer InitTimer(); +#endif - #if defined(PHYSAC_DEBUG) - TRACELOG("[PHYSAC] physics module initialized successfully\n"); - #endif - - accumulator = 0.0; -} - -// Returns true if physics thread is currently enabled -PHYSACDEF bool IsPhysicsEnabled(void) -{ - return physicsThreadEnabled; + TRACELOG("[PHYSAC] Physics module initialized successfully\n"); } // Sets physics global gravity force @@ -390,47 +386,42 @@ PHYSACDEF void SetPhysicsGravity(float x, float y) // Creates a new circle physics body with generic parameters PHYSACDEF PhysicsBody CreatePhysicsBodyCircle(Vector2 pos, float radius, float density) { - PhysicsBody newBody = CreatePhysicsBodyPolygon(pos, radius, PHYSAC_CIRCLE_VERTICES, density); - return newBody; + PhysicsBody body = CreatePhysicsBodyPolygon(pos, radius, PHYSAC_DEFAULT_CIRCLE_VERTICES, density); + return body; } // Creates a new rectangle physics body with generic parameters PHYSACDEF PhysicsBody CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density) { - PhysicsBody newBody = (PhysicsBody)PHYSAC_MALLOC(sizeof(PhysicsBodyData)); + // NOTE: Make sure body data is initialized to 0 + PhysicsBody body = (PhysicsBody)PHYSAC_CALLOC(sizeof(PhysicsBodyData), 1); usedMemory += sizeof(PhysicsBodyData); - int newId = FindAvailableBodyIndex(); - if (newId != -1) + int id = FindAvailableBodyIndex(); + if (id != -1) { // Initialize new body with generic values - newBody->id = newId; - newBody->enabled = true; - newBody->position = pos; - newBody->velocity = (Vector2){ 0.0f, 0.0f }; - newBody->force = (Vector2){ 0.0f, 0.0f }; - newBody->angularVelocity = 0.0f; - newBody->torque = 0.0f; - newBody->orient = 0.0f; - newBody->shape.type = PHYSICS_POLYGON; - newBody->shape.body = newBody; - newBody->shape.radius = 0.0f; - newBody->shape.transform = Mat2Radians(0.0f); - newBody->shape.vertexData = CreateRectanglePolygon(pos, (Vector2){ width, height }); + body->id = id; + body->enabled = true; + body->position = pos; + body->shape.type = PHYSICS_POLYGON; + body->shape.body = body; + body->shape.transform = MathMatFromRadians(0.0f); + body->shape.vertexData = CreateRectanglePolygon(pos, CLITERAL(Vector2){ width, height }); // Calculate centroid and moment of inertia Vector2 center = { 0.0f, 0.0f }; float area = 0.0f; float inertia = 0.0f; - for (int i = 0; i < newBody->shape.vertexData.vertexCount; i++) + for (unsigned int i = 0; i < body->shape.vertexData.vertexCount; i++) { // Triangle vertices, third vertex implied as (0, 0) - Vector2 p1 = newBody->shape.vertexData.positions[i]; - int nextIndex = (((i + 1) < newBody->shape.vertexData.vertexCount) ? (i + 1) : 0); - Vector2 p2 = newBody->shape.vertexData.positions[nextIndex]; + Vector2 p1 = body->shape.vertexData.positions[i]; + unsigned int nextIndex = (((i + 1) < body->shape.vertexData.vertexCount) ? (i + 1) : 0); + Vector2 p2 = body->shape.vertexData.positions[nextIndex]; - float D = MathCrossVector2(p1, p2); + float D = MathVector2CrossProduct(p1, p2); float triangleArea = D/2; area += triangleArea; @@ -449,74 +440,70 @@ PHYSACDEF PhysicsBody CreatePhysicsBodyRectangle(Vector2 pos, float width, float // Translate vertices to centroid (make the centroid (0, 0) for the polygon in model space) // Note: this is not really necessary - for (int i = 0; i < newBody->shape.vertexData.vertexCount; i++) + for (unsigned int i = 0; i < body->shape.vertexData.vertexCount; i++) { - newBody->shape.vertexData.positions[i].x -= center.x; - newBody->shape.vertexData.positions[i].y -= center.y; + body->shape.vertexData.positions[i].x -= center.x; + body->shape.vertexData.positions[i].y -= center.y; } - newBody->mass = density*area; - newBody->inverseMass = ((newBody->mass != 0.0f) ? 1.0f/newBody->mass : 0.0f); - newBody->inertia = density*inertia; - newBody->inverseInertia = ((newBody->inertia != 0.0f) ? 1.0f/newBody->inertia : 0.0f); - newBody->staticFriction = 0.4f; - newBody->dynamicFriction = 0.2f; - newBody->restitution = 0.0f; - newBody->useGravity = true; - newBody->isGrounded = false; - newBody->freezeOrient = false; + body->mass = density*area; + body->inverseMass = ((body->mass != 0.0f) ? 1.0f/body->mass : 0.0f); + body->inertia = density*inertia; + body->inverseInertia = ((body->inertia != 0.0f) ? 1.0f/body->inertia : 0.0f); + body->staticFriction = 0.4f; + body->dynamicFriction = 0.2f; + body->restitution = 0.0f; + body->useGravity = true; + body->isGrounded = false; + body->freezeOrient = false; // Add new body to bodies pointers array and update bodies count - bodies[physicsBodiesCount] = newBody; + bodies[physicsBodiesCount] = body; physicsBodiesCount++; - #if defined(PHYSAC_DEBUG) - TRACELOG("[PHYSAC] created polygon physics body id %i\n", newBody->id); - #endif + TRACELOG("[PHYSAC] Physic body created successfully (id: %i)\n", body->id); } - #if defined(PHYSAC_DEBUG) - else TRACELOG("[PHYSAC] new physics body creation failed because there is any available id to use\n"); - #endif + else TRACELOG("[PHYSAC] Physic body could not be created, PHYSAC_MAX_BODIES reached\n"); - return newBody; + return body; } // Creates a new polygon physics body with generic parameters PHYSACDEF PhysicsBody CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density) { - PhysicsBody newBody = (PhysicsBody)PHYSAC_MALLOC(sizeof(PhysicsBodyData)); + PhysicsBody body = (PhysicsBody)PHYSAC_MALLOC(sizeof(PhysicsBodyData)); usedMemory += sizeof(PhysicsBodyData); - int newId = FindAvailableBodyIndex(); - if (newId != -1) + int id = FindAvailableBodyIndex(); + if (id != -1) { // Initialize new body with generic values - newBody->id = newId; - newBody->enabled = true; - newBody->position = pos; - newBody->velocity = PHYSAC_VECTOR_ZERO; - newBody->force = PHYSAC_VECTOR_ZERO; - newBody->angularVelocity = 0.0f; - newBody->torque = 0.0f; - newBody->orient = 0.0f; - newBody->shape.type = PHYSICS_POLYGON; - newBody->shape.body = newBody; - newBody->shape.transform = Mat2Radians(0.0f); - newBody->shape.vertexData = CreateRandomPolygon(radius, sides); + body->id = id; + body->enabled = true; + body->position = pos; + body->velocity = PHYSAC_VECTOR_ZERO; + body->force = PHYSAC_VECTOR_ZERO; + body->angularVelocity = 0.0f; + body->torque = 0.0f; + body->orient = 0.0f; + body->shape.type = PHYSICS_POLYGON; + body->shape.body = body; + body->shape.transform = MathMatFromRadians(0.0f); + body->shape.vertexData = CreateDefaultPolygon(radius, sides); // Calculate centroid and moment of inertia Vector2 center = { 0.0f, 0.0f }; float area = 0.0f; float inertia = 0.0f; - for (int i = 0; i < newBody->shape.vertexData.vertexCount; i++) + for (unsigned int i = 0; i < body->shape.vertexData.vertexCount; i++) { // Triangle vertices, third vertex implied as (0, 0) - Vector2 position1 = newBody->shape.vertexData.positions[i]; - int nextIndex = (((i + 1) < newBody->shape.vertexData.vertexCount) ? (i + 1) : 0); - Vector2 position2 = newBody->shape.vertexData.positions[nextIndex]; + Vector2 position1 = body->shape.vertexData.positions[i]; + unsigned int nextIndex = (((i + 1) < body->shape.vertexData.vertexCount) ? (i + 1) : 0); + Vector2 position2 = body->shape.vertexData.positions[nextIndex]; - float cross = MathCrossVector2(position1, position2); + float cross = MathVector2CrossProduct(position1, position2); float triangleArea = cross/2; area += triangleArea; @@ -535,42 +522,38 @@ PHYSACDEF PhysicsBody CreatePhysicsBodyPolygon(Vector2 pos, float radius, int si // Translate vertices to centroid (make the centroid (0, 0) for the polygon in model space) // Note: this is not really necessary - for (int i = 0; i < newBody->shape.vertexData.vertexCount; i++) + for (unsigned int i = 0; i < body->shape.vertexData.vertexCount; i++) { - newBody->shape.vertexData.positions[i].x -= center.x; - newBody->shape.vertexData.positions[i].y -= center.y; + body->shape.vertexData.positions[i].x -= center.x; + body->shape.vertexData.positions[i].y -= center.y; } - newBody->mass = density*area; - newBody->inverseMass = ((newBody->mass != 0.0f) ? 1.0f/newBody->mass : 0.0f); - newBody->inertia = density*inertia; - newBody->inverseInertia = ((newBody->inertia != 0.0f) ? 1.0f/newBody->inertia : 0.0f); - newBody->staticFriction = 0.4f; - newBody->dynamicFriction = 0.2f; - newBody->restitution = 0.0f; - newBody->useGravity = true; - newBody->isGrounded = false; - newBody->freezeOrient = false; + body->mass = density*area; + body->inverseMass = ((body->mass != 0.0f) ? 1.0f/body->mass : 0.0f); + body->inertia = density*inertia; + body->inverseInertia = ((body->inertia != 0.0f) ? 1.0f/body->inertia : 0.0f); + body->staticFriction = 0.4f; + body->dynamicFriction = 0.2f; + body->restitution = 0.0f; + body->useGravity = true; + body->isGrounded = false; + body->freezeOrient = false; // Add new body to bodies pointers array and update bodies count - bodies[physicsBodiesCount] = newBody; + bodies[physicsBodiesCount] = body; physicsBodiesCount++; - #if defined(PHYSAC_DEBUG) - TRACELOG("[PHYSAC] created polygon physics body id %i\n", newBody->id); - #endif + TRACELOG("[PHYSAC] Physic body created successfully (id: %i)\n", body->id); } - #if defined(PHYSAC_DEBUG) - else TRACELOG("[PHYSAC] new physics body creation failed because there is any available id to use\n"); - #endif + else TRACELOG("[PHYSAC] Physics body could not be created, PHYSAC_MAX_BODIES reached\n"); - return newBody; + return body; } // Adds a force to a physics body PHYSACDEF void PhysicsAddForce(PhysicsBody body, Vector2 force) { - if (body != NULL) body->force = Vector2Add(body->force, force); + if (body != NULL) body->force = MathVector2Add(body->force, force); } // Adds an angular force to a physics body @@ -586,15 +569,15 @@ PHYSACDEF void PhysicsShatter(PhysicsBody body, Vector2 position, float force) { if (body->shape.type == PHYSICS_POLYGON) { - PolygonData vertexData = body->shape.vertexData; + PhysicsVertexData vertexData = body->shape.vertexData; bool collision = false; - for (int i = 0; i < vertexData.vertexCount; i++) + for (unsigned int i = 0; i < vertexData.vertexCount; i++) { Vector2 positionA = body->position; - Vector2 positionB = Mat2MultiplyVector2(body->shape.transform, Vector2Add(body->position, vertexData.positions[i])); - int nextIndex = (((i + 1) < vertexData.vertexCount) ? (i + 1) : 0); - Vector2 positionC = Mat2MultiplyVector2(body->shape.transform, Vector2Add(body->position, vertexData.positions[nextIndex])); + Vector2 positionB = MathMatVector2Product(body->shape.transform, MathVector2Add(body->position, vertexData.positions[i])); + unsigned int nextIndex = (((i + 1) < vertexData.vertexCount) ? (i + 1) : 0); + Vector2 positionC = MathMatVector2Product(body->shape.transform, MathVector2Add(body->position, vertexData.positions[nextIndex])); // Check collision between each triangle float alpha = ((positionB.y - positionC.y)*(position.x - positionC.x) + (positionC.x - positionB.x)*(position.y - positionC.y))/ @@ -626,54 +609,54 @@ PHYSACDEF void PhysicsShatter(PhysicsBody body, Vector2 position, float force) for (int i = 0; i < count; i++) { int nextIndex = (((i + 1) < count) ? (i + 1) : 0); - Vector2 center = TriangleBarycenter(vertices[i], vertices[nextIndex], PHYSAC_VECTOR_ZERO); - center = Vector2Add(bodyPos, center); - Vector2 offset = Vector2Subtract(center, bodyPos); + Vector2 center = MathTriangleBarycenter(vertices[i], vertices[nextIndex], PHYSAC_VECTOR_ZERO); + center = MathVector2Add(bodyPos, center); + Vector2 offset = MathVector2Subtract(center, bodyPos); - PhysicsBody newBody = CreatePhysicsBodyPolygon(center, 10, 3, 10); // Create polygon physics body with relevant values + PhysicsBody body = CreatePhysicsBodyPolygon(center, 10, 3, 10); // Create polygon physics body with relevant values - PolygonData newData = { 0 }; - newData.vertexCount = 3; + PhysicsVertexData vertexData = { 0 }; + vertexData.vertexCount = 3; - newData.positions[0] = Vector2Subtract(vertices[i], offset); - newData.positions[1] = Vector2Subtract(vertices[nextIndex], offset); - newData.positions[2] = Vector2Subtract(position, center); + vertexData.positions[0] = MathVector2Subtract(vertices[i], offset); + vertexData.positions[1] = MathVector2Subtract(vertices[nextIndex], offset); + vertexData.positions[2] = MathVector2Subtract(position, center); // Separate vertices to avoid unnecessary physics collisions - newData.positions[0].x *= 0.95f; - newData.positions[0].y *= 0.95f; - newData.positions[1].x *= 0.95f; - newData.positions[1].y *= 0.95f; - newData.positions[2].x *= 0.95f; - newData.positions[2].y *= 0.95f; + vertexData.positions[0].x *= 0.95f; + vertexData.positions[0].y *= 0.95f; + vertexData.positions[1].x *= 0.95f; + vertexData.positions[1].y *= 0.95f; + vertexData.positions[2].x *= 0.95f; + vertexData.positions[2].y *= 0.95f; // Calculate polygon faces normals - for (int j = 0; j < newData.vertexCount; j++) + for (unsigned int j = 0; j < vertexData.vertexCount; j++) { - int nextVertex = (((j + 1) < newData.vertexCount) ? (j + 1) : 0); - Vector2 face = Vector2Subtract(newData.positions[nextVertex], newData.positions[j]); + unsigned int nextVertex = (((j + 1) < vertexData.vertexCount) ? (j + 1) : 0); + Vector2 face = MathVector2Subtract(vertexData.positions[nextVertex], vertexData.positions[j]); - newData.normals[j] = (Vector2){ face.y, -face.x }; - MathNormalize(&newData.normals[j]); + vertexData.normals[j] = CLITERAL(Vector2){ face.y, -face.x }; + MathVector2Normalize(&vertexData.normals[j]); } // Apply computed vertex data to new physics body shape - newBody->shape.vertexData = newData; - newBody->shape.transform = trans; + body->shape.vertexData = vertexData; + body->shape.transform = trans; // Calculate centroid and moment of inertia center = PHYSAC_VECTOR_ZERO; float area = 0.0f; float inertia = 0.0f; - for (int j = 0; j < newBody->shape.vertexData.vertexCount; j++) + for (unsigned int j = 0; j < body->shape.vertexData.vertexCount; j++) { // Triangle vertices, third vertex implied as (0, 0) - Vector2 p1 = newBody->shape.vertexData.positions[j]; - int nextVertex = (((j + 1) < newBody->shape.vertexData.vertexCount) ? (j + 1) : 0); - Vector2 p2 = newBody->shape.vertexData.positions[nextVertex]; + Vector2 p1 = body->shape.vertexData.positions[j]; + unsigned int nextVertex = (((j + 1) < body->shape.vertexData.vertexCount) ? (j + 1) : 0); + Vector2 p2 = body->shape.vertexData.positions[nextVertex]; - float D = MathCrossVector2(p1, p2); + float D = MathVector2CrossProduct(p1, p2); float triangleArea = D/2; area += triangleArea; @@ -690,32 +673,30 @@ PHYSACDEF void PhysicsShatter(PhysicsBody body, Vector2 position, float force) center.x *= 1.0f/area; center.y *= 1.0f/area; - newBody->mass = area; - newBody->inverseMass = ((newBody->mass != 0.0f) ? 1.0f/newBody->mass : 0.0f); - newBody->inertia = inertia; - newBody->inverseInertia = ((newBody->inertia != 0.0f) ? 1.0f/newBody->inertia : 0.0f); + body->mass = area; + body->inverseMass = ((body->mass != 0.0f) ? 1.0f/body->mass : 0.0f); + body->inertia = inertia; + body->inverseInertia = ((body->inertia != 0.0f) ? 1.0f/body->inertia : 0.0f); // Calculate explosion force direction - Vector2 pointA = newBody->position; - Vector2 pointB = Vector2Subtract(newData.positions[1], newData.positions[0]); + Vector2 pointA = body->position; + Vector2 pointB = MathVector2Subtract(vertexData.positions[1], vertexData.positions[0]); pointB.x /= 2.0f; pointB.y /= 2.0f; - Vector2 forceDirection = Vector2Subtract(Vector2Add(pointA, Vector2Add(newData.positions[0], pointB)), newBody->position); - MathNormalize(&forceDirection); + Vector2 forceDirection = MathVector2Subtract(MathVector2Add(pointA, MathVector2Add(vertexData.positions[0], pointB)), body->position); + MathVector2Normalize(&forceDirection); forceDirection.x *= force; forceDirection.y *= force; // Apply force to new physics body - PhysicsAddForce(newBody, forceDirection); + PhysicsAddForce(body, forceDirection); } PHYSAC_FREE(vertices); } } } - #if defined(PHYSAC_DEBUG) - else TRACELOG("[PHYSAC] error when trying to shatter a null reference physics body"); - #endif + else TRACELOG("[PHYSAC] WARNING: PhysicsShatter: NULL physic body\n"); } // Returns the current amount of created physics bodies @@ -729,20 +710,13 @@ PHYSACDEF PhysicsBody GetPhysicsBody(int index) { PhysicsBody body = NULL; - if (index < physicsBodiesCount) + if (index < (int)physicsBodiesCount) { body = bodies[index]; - if (body == NULL) - { - #if defined(PHYSAC_DEBUG) - TRACELOG("[PHYSAC] error when trying to get a null reference physics body"); - #endif - } + if (body == NULL) TRACELOG("[PHYSAC] WARNING: GetPhysicsBody: NULL physic body\n"); } - #if defined(PHYSAC_DEBUG) - else TRACELOG("[PHYSAC] physics body index is out of bounds"); - #endif + else TRACELOG("[PHYSAC] WARNING: Physic body index is out of bounds\n"); return body; } @@ -752,18 +726,14 @@ PHYSACDEF int GetPhysicsShapeType(int index) { int result = -1; - if (index < physicsBodiesCount) + if (index < (int)physicsBodiesCount) { PhysicsBody body = bodies[index]; if (body != NULL) result = body->shape.type; - #if defined(PHYSAC_DEBUG) - else TRACELOG("[PHYSAC] error when trying to get a null reference physics body"); - #endif + else TRACELOG("[PHYSAC] WARNING: GetPhysicsShapeType: NULL physic body\n"); } - #if defined(PHYSAC_DEBUG) - else TRACELOG("[PHYSAC] physics body index is out of bounds"); - #endif + else TRACELOG("[PHYSAC] WARNING: Physic body index is out of bounds\n"); return result; } @@ -773,7 +743,7 @@ PHYSACDEF int GetPhysicsShapeVerticesCount(int index) { int result = 0; - if (index < physicsBodiesCount) + if (index < (int)physicsBodiesCount) { PhysicsBody body = bodies[index]; @@ -781,18 +751,14 @@ PHYSACDEF int GetPhysicsShapeVerticesCount(int index) { switch (body->shape.type) { - case PHYSICS_CIRCLE: result = PHYSAC_CIRCLE_VERTICES; break; + case PHYSICS_CIRCLE: result = PHYSAC_DEFAULT_CIRCLE_VERTICES; break; case PHYSICS_POLYGON: result = body->shape.vertexData.vertexCount; break; default: break; } } - #if defined(PHYSAC_DEBUG) - else TRACELOG("[PHYSAC] error when trying to get a null reference physics body"); - #endif + else TRACELOG("[PHYSAC] WARNING: GetPhysicsShapeVerticesCount: NULL physic body\n"); } - #if defined(PHYSAC_DEBUG) - else TRACELOG("[PHYSAC] physics body index is out of bounds"); - #endif + else TRACELOG("[PHYSAC] WARNING: Physic body index is out of bounds\n"); return result; } @@ -808,20 +774,18 @@ PHYSACDEF Vector2 GetPhysicsShapeVertex(PhysicsBody body, int vertex) { case PHYSICS_CIRCLE: { - position.x = body->position.x + cosf(360.0f/PHYSAC_CIRCLE_VERTICES*vertex*PHYSAC_DEG2RAD)*body->shape.radius; - position.y = body->position.y + sinf(360.0f/PHYSAC_CIRCLE_VERTICES*vertex*PHYSAC_DEG2RAD)*body->shape.radius; + position.x = body->position.x + cosf(360.0f/PHYSAC_DEFAULT_CIRCLE_VERTICES*vertex*PHYSAC_DEG2RAD)*body->shape.radius; + position.y = body->position.y + sinf(360.0f/PHYSAC_DEFAULT_CIRCLE_VERTICES*vertex*PHYSAC_DEG2RAD)*body->shape.radius; } break; case PHYSICS_POLYGON: { - PolygonData vertexData = body->shape.vertexData; - position = Vector2Add(body->position, Mat2MultiplyVector2(body->shape.transform, vertexData.positions[vertex])); + PhysicsVertexData vertexData = body->shape.vertexData; + position = MathVector2Add(body->position, MathMatVector2Product(body->shape.transform, vertexData.positions[vertex])); } break; default: break; } } - #if defined(PHYSAC_DEBUG) - else TRACELOG("[PHYSAC] error when trying to get a null reference physics body"); - #endif + else TRACELOG("[PHYSAC] WARNING: GetPhysicsShapeVertex: NULL physic body\n"); return position; } @@ -833,7 +797,7 @@ PHYSACDEF void SetPhysicsBodyRotation(PhysicsBody body, float radians) { body->orient = radians; - if (body->shape.type == PHYSICS_POLYGON) body->shape.transform = Mat2Radians(radians); + if (body->shape.type == PHYSICS_POLYGON) body->shape.transform = MathMatFromRadians(radians); } } @@ -845,7 +809,7 @@ PHYSACDEF void DestroyPhysicsBody(PhysicsBody body) int id = body->id; int index = -1; - for (int i = 0; i < physicsBodiesCount; i++) + for (unsigned int i = 0; i < physicsBodiesCount; i++) { if (bodies[i]->id == id) { @@ -856,9 +820,7 @@ PHYSACDEF void DestroyPhysicsBody(PhysicsBody body) if (index == -1) { - #if defined(PHYSAC_DEBUG) - TRACELOG("[PHYSAC] Not possible to find body id %i in pointers array\n", id); - #endif + TRACELOG("[PHYSAC] WARNING: Requested body (id: %i) can not be found\n", id); return; // Prevent access to index -1 } @@ -868,7 +830,7 @@ PHYSACDEF void DestroyPhysicsBody(PhysicsBody body) bodies[index] = NULL; // Reorder physics bodies pointers array and its catched index - for (int i = index; i < physicsBodiesCount; i++) + for (unsigned int i = index; i < physicsBodiesCount; i++) { if ((i + 1) < physicsBodiesCount) bodies[i] = bodies[i + 1]; } @@ -876,74 +838,80 @@ PHYSACDEF void DestroyPhysicsBody(PhysicsBody body) // Update physics bodies count physicsBodiesCount--; - #if defined(PHYSAC_DEBUG) - TRACELOG("[PHYSAC] destroyed physics body id %i\n", id); - #endif + TRACELOG("[PHYSAC] Physic body destroyed successfully (id: %i)\n", id); } - #if defined(PHYSAC_DEBUG) - else TRACELOG("[PHYSAC] error trying to destroy a null referenced body\n"); - #endif + else TRACELOG("[PHYSAC] WARNING: DestroyPhysicsBody: NULL physic body\n"); } // Destroys created physics bodies and manifolds and resets global values PHYSACDEF void ResetPhysics(void) { - // Unitialize physics bodies dynamic memory allocations - for (int i = physicsBodiesCount - 1; i >= 0; i--) + if (physicsBodiesCount > 0) { - PhysicsBody body = bodies[i]; - - if (body != NULL) + // Unitialize physics bodies dynamic memory allocations + for (int i = physicsBodiesCount - 1; i >= 0; i--) { - PHYSAC_FREE(body); - bodies[i] = NULL; - usedMemory -= sizeof(PhysicsBodyData); + PhysicsBody body = bodies[i]; + + if (body != NULL) + { + PHYSAC_FREE(body); + bodies[i] = NULL; + usedMemory -= sizeof(PhysicsBodyData); + } } + + physicsBodiesCount = 0; } - physicsBodiesCount = 0; - - // Unitialize physics manifolds dynamic memory allocations - for (int i = physicsManifoldsCount - 1; i >= 0; i--) + if (physicsManifoldsCount > 0) { - PhysicsManifold manifold = contacts[i]; - - if (manifold != NULL) + // Unitialize physics manifolds dynamic memory allocations + for (int i = physicsManifoldsCount - 1; i >= 0; i--) { - PHYSAC_FREE(manifold); - contacts[i] = NULL; - usedMemory -= sizeof(PhysicsManifoldData); + PhysicsManifold manifold = contacts[i]; + + if (manifold != NULL) + { + PHYSAC_FREE(manifold); + contacts[i] = NULL; + usedMemory -= sizeof(PhysicsManifoldData); + } } + + physicsManifoldsCount = 0; } - physicsManifoldsCount = 0; - - #if defined(PHYSAC_DEBUG) - TRACELOG("[PHYSAC] physics module reset successfully\n"); - #endif + TRACELOG("[PHYSAC] Physics module reseted successfully\n"); } // Unitializes physics pointers and exits physics loop thread PHYSACDEF void ClosePhysics(void) { - // Exit physics loop thread - physicsThreadEnabled = false; - - #if !defined(PHYSAC_NO_THREADS) - pthread_join(physicsThreadId, NULL); - #endif - // Unitialize physics manifolds dynamic memory allocations - for (int i = physicsManifoldsCount - 1; i >= 0; i--) DestroyPhysicsManifold(contacts[i]); - + if (physicsManifoldsCount > 0) + { + for (unsigned int i = physicsManifoldsCount - 1; i >= 0; i--) + DestroyPhysicsManifold(contacts[i]); + } + // Unitialize physics bodies dynamic memory allocations - for (int i = physicsBodiesCount - 1; i >= 0; i--) DestroyPhysicsBody(bodies[i]); + if (physicsBodiesCount > 0) + { + for (unsigned int i = physicsBodiesCount - 1; i >= 0; i--) + DestroyPhysicsBody(bodies[i]); + } - #if defined(PHYSAC_DEBUG) - if (physicsBodiesCount > 0 || usedMemory != 0) TRACELOG("[PHYSAC] physics module closed with %i still allocated bodies [MEMORY: %i bytes]\n", physicsBodiesCount, usedMemory); - else if (physicsManifoldsCount > 0 || usedMemory != 0) TRACELOG("[PHYSAC] physics module closed with %i still allocated manifolds [MEMORY: %i bytes]\n", physicsManifoldsCount, usedMemory); - else TRACELOG("[PHYSAC] physics module closed successfully\n"); - #endif + // Trace log info + if ((physicsBodiesCount > 0) || (usedMemory != 0)) + { + TRACELOG("[PHYSAC] WARNING: Physics module closed with unallocated bodies (BODIES: %i, MEMORY: %i bytes)\n", physicsBodiesCount, usedMemory); + } + else if ((physicsManifoldsCount > 0) || (usedMemory != 0)) + { + TRACELOG("[PHYSAC] WARNING: Pysics module closed with unallocated manifolds (MANIFOLDS: %i, MEMORY: %i bytes)\n", physicsManifoldsCount, usedMemory); + } + else TRACELOG("[PHYSAC] Physics module closed successfully\n"); } //---------------------------------------------------------------------------------- @@ -958,7 +926,7 @@ static int FindAvailableBodyIndex() int currentId = i; // Check if current id already exist in other physics body - for (int k = 0; k < physicsBodiesCount; k++) + for (unsigned int k = 0; k < physicsBodiesCount; k++) { if (bodies[k]->id == currentId) { @@ -968,9 +936,9 @@ static int FindAvailableBodyIndex() } // If it is not used, use it as new physics body id - if (currentId == i) + if (currentId == (int)i) { - index = i; + index = (int)i; break; } } @@ -978,106 +946,82 @@ static int FindAvailableBodyIndex() return index; } -// Creates a random polygon shape with max vertex distance from polygon pivot -static PolygonData CreateRandomPolygon(float radius, int sides) +// Creates a default polygon shape with max vertex distance from polygon pivot +static PhysicsVertexData CreateDefaultPolygon(float radius, int sides) { - PolygonData data = { 0 }; + PhysicsVertexData data = { 0 }; data.vertexCount = sides; // Calculate polygon vertices positions - for (int i = 0; i < data.vertexCount; i++) + for (unsigned int i = 0; i < data.vertexCount; i++) { - data.positions[i].x = cosf(360.0f/sides*i*PHYSAC_DEG2RAD)*radius; - data.positions[i].y = sinf(360.0f/sides*i*PHYSAC_DEG2RAD)*radius; + data.positions[i].x = (float)cosf(360.0f/sides*i*PHYSAC_DEG2RAD)*radius; + data.positions[i].y = (float)sinf(360.0f/sides*i*PHYSAC_DEG2RAD)*radius; } // Calculate polygon faces normals - for (int i = 0; i < data.vertexCount; i++) + for (int i = 0; i < (int)data.vertexCount; i++) { int nextIndex = (((i + 1) < sides) ? (i + 1) : 0); - Vector2 face = Vector2Subtract(data.positions[nextIndex], data.positions[i]); + Vector2 face = MathVector2Subtract(data.positions[nextIndex], data.positions[i]); - data.normals[i] = (Vector2){ face.y, -face.x }; - MathNormalize(&data.normals[i]); + data.normals[i] = CLITERAL(Vector2){ face.y, -face.x }; + MathVector2Normalize(&data.normals[i]); } return data; } // Creates a rectangle polygon shape based on a min and max positions -static PolygonData CreateRectanglePolygon(Vector2 pos, Vector2 size) +static PhysicsVertexData CreateRectanglePolygon(Vector2 pos, Vector2 size) { - PolygonData data = { 0 }; + PhysicsVertexData data = { 0 }; data.vertexCount = 4; // Calculate polygon vertices positions - data.positions[0] = (Vector2){ pos.x + size.x/2, pos.y - size.y/2 }; - data.positions[1] = (Vector2){ pos.x + size.x/2, pos.y + size.y/2 }; - data.positions[2] = (Vector2){ pos.x - size.x/2, pos.y + size.y/2 }; - data.positions[3] = (Vector2){ pos.x - size.x/2, pos.y - size.y/2 }; + data.positions[0] = CLITERAL(Vector2){ pos.x + size.x/2, pos.y - size.y/2 }; + data.positions[1] = CLITERAL(Vector2){ pos.x + size.x/2, pos.y + size.y/2 }; + data.positions[2] = CLITERAL(Vector2){ pos.x - size.x/2, pos.y + size.y/2 }; + data.positions[3] = CLITERAL(Vector2){ pos.x - size.x/2, pos.y - size.y/2 }; // Calculate polygon faces normals - for (int i = 0; i < data.vertexCount; i++) + for (unsigned int i = 0; i < data.vertexCount; i++) { int nextIndex = (((i + 1) < data.vertexCount) ? (i + 1) : 0); - Vector2 face = Vector2Subtract(data.positions[nextIndex], data.positions[i]); + Vector2 face = MathVector2Subtract(data.positions[nextIndex], data.positions[i]); - data.normals[i] = (Vector2){ face.y, -face.x }; - MathNormalize(&data.normals[i]); + data.normals[i] = CLITERAL(Vector2){ face.y, -face.x }; + MathVector2Normalize(&data.normals[i]); } return data; } -// Physics loop thread function -static void *PhysicsLoop(void *arg) +// Update physics step (dynamics, collisions and position corrections) +void UpdatePhysicsStep(void) { -#if !defined(PHYSAC_NO_THREADS) - #if defined(PHYSAC_DEBUG) - TRACELOG("[PHYSAC] physics thread created successfully\n"); - #endif - - // Initialize physics loop thread values - physicsThreadEnabled = true; - - // Physics update loop - while (physicsThreadEnabled) - { - RunPhysicsStep(); - } -#endif - - return NULL; -} - -// Physics steps calculations (dynamics, collisions and position corrections) -static void PhysicsStep(void) -{ - // Update current steps count - stepsCount++; - // Clear previous generated collisions information - for (int i = physicsManifoldsCount - 1; i >= 0; i--) + for (int i = (int)physicsManifoldsCount - 1; i >= 0; i--) { PhysicsManifold manifold = contacts[i]; if (manifold != NULL) DestroyPhysicsManifold(manifold); } // Reset physics bodies grounded state - for (int i = 0; i < physicsBodiesCount; i++) + for (unsigned int i = 0; i < physicsBodiesCount; i++) { PhysicsBody body = bodies[i]; body->isGrounded = false; } - + // Generate new collision information - for (int i = 0; i < physicsBodiesCount; i++) + for (unsigned int i = 0; i < physicsBodiesCount; i++) { PhysicsBody bodyA = bodies[i]; if (bodyA != NULL) { - for (int j = i + 1; j < physicsBodiesCount; j++) + for (unsigned int j = i + 1; j < physicsBodiesCount; j++) { PhysicsBody bodyB = bodies[j]; @@ -1091,15 +1035,15 @@ static void PhysicsStep(void) if (manifold->contactsCount > 0) { // Create a new manifold with same information as previously solved manifold and add it to the manifolds pool last slot - PhysicsManifold newManifold = CreatePhysicsManifold(bodyA, bodyB); - newManifold->penetration = manifold->penetration; - newManifold->normal = manifold->normal; - newManifold->contacts[0] = manifold->contacts[0]; - newManifold->contacts[1] = manifold->contacts[1]; - newManifold->contactsCount = manifold->contactsCount; - newManifold->restitution = manifold->restitution; - newManifold->dynamicFriction = manifold->dynamicFriction; - newManifold->staticFriction = manifold->staticFriction; + PhysicsManifold manifold = CreatePhysicsManifold(bodyA, bodyB); + manifold->penetration = manifold->penetration; + manifold->normal = manifold->normal; + manifold->contacts[0] = manifold->contacts[0]; + manifold->contacts[1] = manifold->contacts[1]; + manifold->contactsCount = manifold->contactsCount; + manifold->restitution = manifold->restitution; + manifold->dynamicFriction = manifold->dynamicFriction; + manifold->staticFriction = manifold->staticFriction; } } } @@ -1107,23 +1051,23 @@ static void PhysicsStep(void) } // Integrate forces to physics bodies - for (int i = 0; i < physicsBodiesCount; i++) + for (unsigned int i = 0; i < physicsBodiesCount; i++) { PhysicsBody body = bodies[i]; if (body != NULL) IntegratePhysicsForces(body); } // Initialize physics manifolds to solve collisions - for (int i = 0; i < physicsManifoldsCount; i++) + for (unsigned int i = 0; i < physicsManifoldsCount; i++) { PhysicsManifold manifold = contacts[i]; if (manifold != NULL) InitializePhysicsManifolds(manifold); } // Integrate physics collisions impulses to solve collisions - for (int i = 0; i < PHYSAC_COLLISION_ITERATIONS; i++) + for (unsigned int i = 0; i < PHYSAC_COLLISION_ITERATIONS; i++) { - for (int j = 0; j < physicsManifoldsCount; j++) + for (unsigned int j = 0; j < physicsManifoldsCount; j++) { PhysicsManifold manifold = contacts[i]; if (manifold != NULL) IntegratePhysicsImpulses(manifold); @@ -1131,21 +1075,21 @@ static void PhysicsStep(void) } // Integrate velocity to physics bodies - for (int i = 0; i < physicsBodiesCount; i++) + for (unsigned int i = 0; i < physicsBodiesCount; i++) { PhysicsBody body = bodies[i]; if (body != NULL) IntegratePhysicsVelocity(body); } // Correct physics bodies positions based on manifolds collision information - for (int i = 0; i < physicsManifoldsCount; i++) + for (unsigned int i = 0; i < physicsManifoldsCount; i++) { PhysicsManifold manifold = contacts[i]; if (manifold != NULL) CorrectPhysicsPositions(manifold); } // Clear physics bodies forces - for (int i = 0; i < physicsBodiesCount; i++) + for (unsigned int i = 0; i < physicsBodiesCount; i++) { PhysicsBody body = bodies[i]; if (body != NULL) @@ -1156,31 +1100,34 @@ static void PhysicsStep(void) } } -// Wrapper to ensure PhysicsStep is run with at a fixed time step -PHYSACDEF void RunPhysicsStep(void) +// Update physics system +// Physics steps are launched at a fixed time step if enabled +PHYSACDEF void UpdatePhysics(void) { - // Calculate current time +#if !defined(PHYSAC_AVOID_TIMMING_SYSTEM) + static double deltaTimeAccumulator = 0.0; + + // Calculate current time (ms) currentTime = GetCurrentTime(); - // Calculate current delta time + // Calculate current delta time (ms) const double delta = currentTime - startTime; // Store the time elapsed since the last frame began - accumulator += delta; + deltaTimeAccumulator += delta; // Fixed time stepping loop - while (accumulator >= deltaTime) + while (deltaTimeAccumulator >= deltaTime) { -#ifdef PHYSAC_DEBUG - //TRACELOG("currentTime %f, startTime %f, accumulator-pre %f, accumulator-post %f, delta %f, deltaTime %f\n", - // currentTime, startTime, accumulator, accumulator-deltaTime, delta, deltaTime); -#endif - PhysicsStep(); - accumulator -= deltaTime; + UpdatePhysicsStep(); + deltaTimeAccumulator -= deltaTime; } // Record the starting of this frame startTime = currentTime; +#else + UpdatePhysicsStep(); +#endif } PHYSACDEF void SetPhysicsTimeStep(double delta) @@ -1197,7 +1144,7 @@ static int FindAvailableManifoldIndex() int currentId = i; // Check if current id already exist in other physics body - for (int k = 0; k < physicsManifoldsCount; k++) + for (unsigned int k = 0; k < physicsManifoldsCount; k++) { if (contacts[k]->id == currentId) { @@ -1220,34 +1167,32 @@ static int FindAvailableManifoldIndex() // Creates a new physics manifold to solve collision static PhysicsManifold CreatePhysicsManifold(PhysicsBody a, PhysicsBody b) { - PhysicsManifold newManifold = (PhysicsManifold)PHYSAC_MALLOC(sizeof(PhysicsManifoldData)); + PhysicsManifold manifold = (PhysicsManifold)PHYSAC_MALLOC(sizeof(PhysicsManifoldData)); usedMemory += sizeof(PhysicsManifoldData); - int newId = FindAvailableManifoldIndex(); - if (newId != -1) + int id = FindAvailableManifoldIndex(); + if (id != -1) { // Initialize new manifold with generic values - newManifold->id = newId; - newManifold->bodyA = a; - newManifold->bodyB = b; - newManifold->penetration = 0; - newManifold->normal = PHYSAC_VECTOR_ZERO; - newManifold->contacts[0] = PHYSAC_VECTOR_ZERO; - newManifold->contacts[1] = PHYSAC_VECTOR_ZERO; - newManifold->contactsCount = 0; - newManifold->restitution = 0.0f; - newManifold->dynamicFriction = 0.0f; - newManifold->staticFriction = 0.0f; + manifold->id = id; + manifold->bodyA = a; + manifold->bodyB = b; + manifold->penetration = 0; + manifold->normal = PHYSAC_VECTOR_ZERO; + manifold->contacts[0] = PHYSAC_VECTOR_ZERO; + manifold->contacts[1] = PHYSAC_VECTOR_ZERO; + manifold->contactsCount = 0; + manifold->restitution = 0.0f; + manifold->dynamicFriction = 0.0f; + manifold->staticFriction = 0.0f; // Add new body to bodies pointers array and update bodies count - contacts[physicsManifoldsCount] = newManifold; + contacts[physicsManifoldsCount] = manifold; physicsManifoldsCount++; } - #if defined(PHYSAC_DEBUG) - else TRACELOG("[PHYSAC] new physics manifold creation failed because there is any available id to use\n"); - #endif + else TRACELOG("[PHYSAC] Physic manifold could not be created, PHYSAC_MAX_MANIFOLDS reached\n"); - return newManifold; + return manifold; } // Unitializes and destroys a physics manifold @@ -1258,7 +1203,7 @@ static void DestroyPhysicsManifold(PhysicsManifold manifold) int id = manifold->id; int index = -1; - for (int i = 0; i < physicsManifoldsCount; i++) + for (unsigned int i = 0; i < physicsManifoldsCount; i++) { if (contacts[i]->id == id) { @@ -1267,13 +1212,7 @@ static void DestroyPhysicsManifold(PhysicsManifold manifold) } } - if (index == -1) - { - #if defined(PHYSAC_DEBUG) - TRACELOG("[PHYSAC] Not possible to manifold id %i in pointers array\n", id); - #endif - return; // Prevent access to index -1 - } + if (index == -1) return; // Prevent access to index -1 // Free manifold allocated memory PHYSAC_FREE(manifold); @@ -1281,7 +1220,7 @@ static void DestroyPhysicsManifold(PhysicsManifold manifold) contacts[index] = NULL; // Reorder physics manifolds pointers array and its catched index - for (int i = index; i < physicsManifoldsCount; i++) + for (unsigned int i = index; i < physicsManifoldsCount; i++) { if ((i + 1) < physicsManifoldsCount) contacts[i] = contacts[i + 1]; } @@ -1289,9 +1228,7 @@ static void DestroyPhysicsManifold(PhysicsManifold manifold) // Update physics manifolds count physicsManifoldsCount--; } - #if defined(PHYSAC_DEBUG) - else TRACELOG("[PHYSAC] error trying to destroy a null referenced manifold\n"); - #endif + else TRACELOG("[PHYSAC] WARNING: DestroyPhysicsManifold: NULL physic manifold\n"); } // Solves a created physics manifold between two physics bodies @@ -1333,9 +1270,9 @@ static void SolveCircleToCircle(PhysicsManifold manifold) if ((bodyA == NULL) || (bodyB == NULL)) return; // Calculate translational vector, which is normal - Vector2 normal = Vector2Subtract(bodyB->position, bodyA->position); + Vector2 normal = MathVector2Subtract(bodyB->position, bodyA->position); - float distSqr = MathLenSqr(normal); + float distSqr = MathVector2SqrLen(normal); float radius = bodyA->shape.radius + bodyB->shape.radius; // Check if circles are not in contact @@ -1351,14 +1288,14 @@ static void SolveCircleToCircle(PhysicsManifold manifold) if (distance == 0.0f) { manifold->penetration = bodyA->shape.radius; - manifold->normal = (Vector2){ 1.0f, 0.0f }; + manifold->normal = CLITERAL(Vector2){ 1.0f, 0.0f }; manifold->contacts[0] = bodyA->position; } else { manifold->penetration = radius - distance; - manifold->normal = (Vector2){ normal.x/distance, normal.y/distance }; // Faster than using MathNormalize() due to sqrt is already performed - manifold->contacts[0] = (Vector2){ manifold->normal.x*bodyA->shape.radius + bodyA->position.x, manifold->normal.y*bodyA->shape.radius + bodyA->position.y }; + manifold->normal = CLITERAL(Vector2){ normal.x/distance, normal.y/distance }; // Faster than using MathVector2Normalize() due to sqrt is already performed + manifold->contacts[0] = CLITERAL(Vector2){ manifold->normal.x*bodyA->shape.radius + bodyA->position.x, manifold->normal.y*bodyA->shape.radius + bodyA->position.y }; } // Update physics body grounded state if normal direction is down @@ -1377,17 +1314,17 @@ static void SolveCircleToPolygon(PhysicsManifold manifold) // Transform circle center to polygon transform space Vector2 center = bodyA->position; - center = Mat2MultiplyVector2(Mat2Transpose(bodyB->shape.transform), Vector2Subtract(center, bodyB->position)); + center = MathMatVector2Product(MathMatTranspose(bodyB->shape.transform), MathVector2Subtract(center, bodyB->position)); // Find edge with minimum penetration // It is the same concept as using support points in SolvePolygonToPolygon float separation = -PHYSAC_FLT_MAX; int faceNormal = 0; - PolygonData vertexData = bodyB->shape.vertexData; + PhysicsVertexData vertexData = bodyB->shape.vertexData; - for (int i = 0; i < vertexData.vertexCount; i++) + for (unsigned int i = 0; i < vertexData.vertexCount; i++) { - float currentSeparation = MathDot(vertexData.normals[i], Vector2Subtract(center, vertexData.positions[i])); + float currentSeparation = MathVector2DotProduct(vertexData.normals[i], MathVector2Subtract(center, vertexData.positions[i])); if (currentSeparation > bodyA->shape.radius) return; @@ -1400,60 +1337,60 @@ static void SolveCircleToPolygon(PhysicsManifold manifold) // Grab face's vertices Vector2 v1 = vertexData.positions[faceNormal]; - int nextIndex = (((faceNormal + 1) < vertexData.vertexCount) ? (faceNormal + 1) : 0); + int nextIndex = (((faceNormal + 1) < (int)vertexData.vertexCount) ? (faceNormal + 1) : 0); Vector2 v2 = vertexData.positions[nextIndex]; // Check to see if center is within polygon if (separation < PHYSAC_EPSILON) { manifold->contactsCount = 1; - Vector2 normal = Mat2MultiplyVector2(bodyB->shape.transform, vertexData.normals[faceNormal]); - manifold->normal = (Vector2){ -normal.x, -normal.y }; - manifold->contacts[0] = (Vector2){ manifold->normal.x*bodyA->shape.radius + bodyA->position.x, manifold->normal.y*bodyA->shape.radius + bodyA->position.y }; + Vector2 normal = MathMatVector2Product(bodyB->shape.transform, vertexData.normals[faceNormal]); + manifold->normal = CLITERAL(Vector2){ -normal.x, -normal.y }; + manifold->contacts[0] = CLITERAL(Vector2){ manifold->normal.x*bodyA->shape.radius + bodyA->position.x, manifold->normal.y*bodyA->shape.radius + bodyA->position.y }; manifold->penetration = bodyA->shape.radius; return; } // Determine which voronoi region of the edge center of circle lies within - float dot1 = MathDot(Vector2Subtract(center, v1), Vector2Subtract(v2, v1)); - float dot2 = MathDot(Vector2Subtract(center, v2), Vector2Subtract(v1, v2)); + float dot1 = MathVector2DotProduct(MathVector2Subtract(center, v1), MathVector2Subtract(v2, v1)); + float dot2 = MathVector2DotProduct(MathVector2Subtract(center, v2), MathVector2Subtract(v1, v2)); manifold->penetration = bodyA->shape.radius - separation; if (dot1 <= 0.0f) // Closest to v1 { - if (DistSqr(center, v1) > bodyA->shape.radius*bodyA->shape.radius) return; + if (MathVector2SqrDistance(center, v1) > bodyA->shape.radius*bodyA->shape.radius) return; manifold->contactsCount = 1; - Vector2 normal = Vector2Subtract(v1, center); - normal = Mat2MultiplyVector2(bodyB->shape.transform, normal); - MathNormalize(&normal); + Vector2 normal = MathVector2Subtract(v1, center); + normal = MathMatVector2Product(bodyB->shape.transform, normal); + MathVector2Normalize(&normal); manifold->normal = normal; - v1 = Mat2MultiplyVector2(bodyB->shape.transform, v1); - v1 = Vector2Add(v1, bodyB->position); + v1 = MathMatVector2Product(bodyB->shape.transform, v1); + v1 = MathVector2Add(v1, bodyB->position); manifold->contacts[0] = v1; } else if (dot2 <= 0.0f) // Closest to v2 { - if (DistSqr(center, v2) > bodyA->shape.radius*bodyA->shape.radius) return; + if (MathVector2SqrDistance(center, v2) > bodyA->shape.radius*bodyA->shape.radius) return; manifold->contactsCount = 1; - Vector2 normal = Vector2Subtract(v2, center); - v2 = Mat2MultiplyVector2(bodyB->shape.transform, v2); - v2 = Vector2Add(v2, bodyB->position); + Vector2 normal = MathVector2Subtract(v2, center); + v2 = MathMatVector2Product(bodyB->shape.transform, v2); + v2 = MathVector2Add(v2, bodyB->position); manifold->contacts[0] = v2; - normal = Mat2MultiplyVector2(bodyB->shape.transform, normal); - MathNormalize(&normal); + normal = MathMatVector2Product(bodyB->shape.transform, normal); + MathVector2Normalize(&normal); manifold->normal = normal; } else // Closest to face { Vector2 normal = vertexData.normals[faceNormal]; - if (MathDot(Vector2Subtract(center, v1), normal) > bodyA->shape.radius) return; + if (MathVector2DotProduct(MathVector2Subtract(center, v1), normal) > bodyA->shape.radius) return; - normal = Mat2MultiplyVector2(bodyB->shape.transform, normal); - manifold->normal = (Vector2){ -normal.x, -normal.y }; - manifold->contacts[0] = (Vector2){ manifold->normal.x*bodyA->shape.radius + bodyA->position.x, manifold->normal.y*bodyA->shape.radius + bodyA->position.y }; + normal = MathMatVector2Product(bodyB->shape.transform, normal); + manifold->normal = CLITERAL(Vector2){ -normal.x, -normal.y }; + manifold->contacts[0] = CLITERAL(Vector2){ manifold->normal.x*bodyA->shape.radius + bodyA->position.x, manifold->normal.y*bodyA->shape.radius + bodyA->position.y }; manifold->contactsCount = 1; } } @@ -1500,7 +1437,8 @@ static void SolvePolygonToPolygon(PhysicsManifold manifold) PhysicsShape incPoly; // Incident // Determine which shape contains reference face - if (BiasGreaterThan(penetrationA, penetrationB)) + // Checking bias range for penetration + if (penetrationA >= (penetrationB*0.95f + penetrationA*0.01f)) { refPoly = bodyA; incPoly = bodyB; @@ -1519,37 +1457,37 @@ static void SolvePolygonToPolygon(PhysicsManifold manifold) FindIncidentFace(&incidentFace[0], &incidentFace[1], refPoly, incPoly, referenceIndex); // Setup reference face vertices - PolygonData refData = refPoly.vertexData; + PhysicsVertexData refData = refPoly.vertexData; Vector2 v1 = refData.positions[referenceIndex]; - referenceIndex = (((referenceIndex + 1) < refData.vertexCount) ? (referenceIndex + 1) : 0); + referenceIndex = (((referenceIndex + 1) < (int)refData.vertexCount) ? (referenceIndex + 1) : 0); Vector2 v2 = refData.positions[referenceIndex]; // Transform vertices to world space - v1 = Mat2MultiplyVector2(refPoly.transform, v1); - v1 = Vector2Add(v1, refPoly.body->position); - v2 = Mat2MultiplyVector2(refPoly.transform, v2); - v2 = Vector2Add(v2, refPoly.body->position); + v1 = MathMatVector2Product(refPoly.transform, v1); + v1 = MathVector2Add(v1, refPoly.body->position); + v2 = MathMatVector2Product(refPoly.transform, v2); + v2 = MathVector2Add(v2, refPoly.body->position); // Calculate reference face side normal in world space - Vector2 sidePlaneNormal = Vector2Subtract(v2, v1); - MathNormalize(&sidePlaneNormal); + Vector2 sidePlaneNormal = MathVector2Subtract(v2, v1); + MathVector2Normalize(&sidePlaneNormal); // Orthogonalize Vector2 refFaceNormal = { sidePlaneNormal.y, -sidePlaneNormal.x }; - float refC = MathDot(refFaceNormal, v1); - float negSide = MathDot(sidePlaneNormal, v1)*-1; - float posSide = MathDot(sidePlaneNormal, v2); + float refC = MathVector2DotProduct(refFaceNormal, v1); + float negSide = MathVector2DotProduct(sidePlaneNormal, v1)*-1; + float posSide = MathVector2DotProduct(sidePlaneNormal, v2); - // Clip incident face to reference face side planes (due to floating point error, possible to not have required points - if (Clip((Vector2){ -sidePlaneNormal.x, -sidePlaneNormal.y }, negSide, &incidentFace[0], &incidentFace[1]) < 2) return; - if (Clip(sidePlaneNormal, posSide, &incidentFace[0], &incidentFace[1]) < 2) return; + // MathVector2Clip incident face to reference face side planes (due to floating point error, possible to not have required points + if (MathVector2Clip(CLITERAL(Vector2){ -sidePlaneNormal.x, -sidePlaneNormal.y }, &incidentFace[0], &incidentFace[1], negSide) < 2) return; + if (MathVector2Clip(sidePlaneNormal, &incidentFace[0], &incidentFace[1], posSide) < 2) return; // Flip normal if required - manifold->normal = (flip ? (Vector2){ -refFaceNormal.x, -refFaceNormal.y } : refFaceNormal); + manifold->normal = (flip ? CLITERAL(Vector2){ -refFaceNormal.x, -refFaceNormal.y } : refFaceNormal); // Keep points behind reference face - int currentPoint = 0; // Clipped points behind reference face - float separation = MathDot(refFaceNormal, incidentFace[0]) - refC; + int currentPoint = 0; // MathVector2Clipped points behind reference face + float separation = MathVector2DotProduct(refFaceNormal, incidentFace[0]) - refC; if (separation <= 0.0f) { manifold->contacts[currentPoint] = incidentFace[0]; @@ -1558,7 +1496,7 @@ static void SolvePolygonToPolygon(PhysicsManifold manifold) } else manifold->penetration = 0.0f; - separation = MathDot(refFaceNormal, incidentFace[1]) - refC; + separation = MathVector2DotProduct(refFaceNormal, incidentFace[1]) - refC; if (separation <= 0.0f) { @@ -1578,16 +1516,16 @@ static void IntegratePhysicsForces(PhysicsBody body) { if ((body == NULL) || (body->inverseMass == 0.0f) || !body->enabled) return; - body->velocity.x += (body->force.x*body->inverseMass)*(deltaTime/2.0); - body->velocity.y += (body->force.y*body->inverseMass)*(deltaTime/2.0); + body->velocity.x += (float)((body->force.x*body->inverseMass)*(deltaTime/2.0)); + body->velocity.y += (float)((body->force.y*body->inverseMass)*(deltaTime/2.0)); if (body->useGravity) { - body->velocity.x += gravityForce.x*(deltaTime/1000/2.0); - body->velocity.y += gravityForce.y*(deltaTime/1000/2.0); + body->velocity.x += (float)(gravityForce.x*(deltaTime/1000/2.0)); + body->velocity.y += (float)(gravityForce.y*(deltaTime/1000/2.0)); } - if (!body->freezeOrient) body->angularVelocity += body->torque*body->inverseInertia*(deltaTime/2.0); + if (!body->freezeOrient) body->angularVelocity += (float)(body->torque*body->inverseInertia*(deltaTime/2.0)); } // Initializes physics manifolds to solve collisions @@ -1603,14 +1541,14 @@ static void InitializePhysicsManifolds(PhysicsManifold manifold) manifold->staticFriction = sqrtf(bodyA->staticFriction*bodyB->staticFriction); manifold->dynamicFriction = sqrtf(bodyA->dynamicFriction*bodyB->dynamicFriction); - for (int i = 0; i < manifold->contactsCount; i++) + for (unsigned int i = 0; i < manifold->contactsCount; i++) { // Caculate radius from center of mass to contact - Vector2 radiusA = Vector2Subtract(manifold->contacts[i], bodyA->position); - Vector2 radiusB = Vector2Subtract(manifold->contacts[i], bodyB->position); + Vector2 radiusA = MathVector2Subtract(manifold->contacts[i], bodyA->position); + Vector2 radiusB = MathVector2Subtract(manifold->contacts[i], bodyB->position); - Vector2 crossA = MathCross(bodyA->angularVelocity, radiusA); - Vector2 crossB = MathCross(bodyB->angularVelocity, radiusB); + Vector2 crossA = MathVector2Product(radiusA, bodyA->angularVelocity); + Vector2 crossB = MathVector2Product(radiusB, bodyB->angularVelocity); Vector2 radiusV = { 0.0f, 0.0f }; radiusV.x = bodyB->velocity.x + crossB.x - bodyA->velocity.x - crossA.x; @@ -1618,7 +1556,7 @@ static void InitializePhysicsManifolds(PhysicsManifold manifold) // Determine if we should perform a resting collision or not; // The idea is if the only thing moving this object is gravity, then the collision should be performed without any restitution - if (MathLenSqr(radiusV) < (MathLenSqr((Vector2){ gravityForce.x*deltaTime/1000, gravityForce.y*deltaTime/1000 }) + PHYSAC_EPSILON)) manifold->restitution = 0; + if (MathVector2SqrLen(radiusV) < (MathVector2SqrLen(CLITERAL(Vector2){ (float)(gravityForce.x*deltaTime/1000), (float)(gravityForce.y*deltaTime/1000) }) + PHYSAC_EPSILON)) manifold->restitution = 0; } } @@ -1638,25 +1576,25 @@ static void IntegratePhysicsImpulses(PhysicsManifold manifold) return; } - for (int i = 0; i < manifold->contactsCount; i++) + for (unsigned int i = 0; i < manifold->contactsCount; i++) { // Calculate radius from center of mass to contact - Vector2 radiusA = Vector2Subtract(manifold->contacts[i], bodyA->position); - Vector2 radiusB = Vector2Subtract(manifold->contacts[i], bodyB->position); + Vector2 radiusA = MathVector2Subtract(manifold->contacts[i], bodyA->position); + Vector2 radiusB = MathVector2Subtract(manifold->contacts[i], bodyB->position); // Calculate relative velocity Vector2 radiusV = { 0.0f, 0.0f }; - radiusV.x = bodyB->velocity.x + MathCross(bodyB->angularVelocity, radiusB).x - bodyA->velocity.x - MathCross(bodyA->angularVelocity, radiusA).x; - radiusV.y = bodyB->velocity.y + MathCross(bodyB->angularVelocity, radiusB).y - bodyA->velocity.y - MathCross(bodyA->angularVelocity, radiusA).y; + radiusV.x = bodyB->velocity.x + MathVector2Product(radiusB, bodyB->angularVelocity).x - bodyA->velocity.x - MathVector2Product(radiusA, bodyA->angularVelocity).x; + radiusV.y = bodyB->velocity.y + MathVector2Product(radiusB, bodyB->angularVelocity).y - bodyA->velocity.y - MathVector2Product(radiusA, bodyA->angularVelocity).y; // Relative velocity along the normal - float contactVelocity = MathDot(radiusV, manifold->normal); + float contactVelocity = MathVector2DotProduct(radiusV, manifold->normal); // Do not resolve if velocities are separating if (contactVelocity > 0.0f) return; - float raCrossN = MathCrossVector2(radiusA, manifold->normal); - float rbCrossN = MathCrossVector2(radiusB, manifold->normal); + float raCrossN = MathVector2CrossProduct(radiusA, manifold->normal); + float rbCrossN = MathVector2CrossProduct(radiusB, manifold->normal); float inverseMassSum = bodyA->inverseMass + bodyB->inverseMass + (raCrossN*raCrossN)*bodyA->inverseInertia + (rbCrossN*rbCrossN)*bodyB->inverseInertia; @@ -1672,37 +1610,37 @@ static void IntegratePhysicsImpulses(PhysicsManifold manifold) { bodyA->velocity.x += bodyA->inverseMass*(-impulseV.x); bodyA->velocity.y += bodyA->inverseMass*(-impulseV.y); - if (!bodyA->freezeOrient) bodyA->angularVelocity += bodyA->inverseInertia*MathCrossVector2(radiusA, (Vector2){ -impulseV.x, -impulseV.y }); + if (!bodyA->freezeOrient) bodyA->angularVelocity += bodyA->inverseInertia*MathVector2CrossProduct(radiusA, CLITERAL(Vector2){ -impulseV.x, -impulseV.y }); } if (bodyB->enabled) { bodyB->velocity.x += bodyB->inverseMass*(impulseV.x); bodyB->velocity.y += bodyB->inverseMass*(impulseV.y); - if (!bodyB->freezeOrient) bodyB->angularVelocity += bodyB->inverseInertia*MathCrossVector2(radiusB, impulseV); + if (!bodyB->freezeOrient) bodyB->angularVelocity += bodyB->inverseInertia*MathVector2CrossProduct(radiusB, impulseV); } // Apply friction impulse to each physics body - radiusV.x = bodyB->velocity.x + MathCross(bodyB->angularVelocity, radiusB).x - bodyA->velocity.x - MathCross(bodyA->angularVelocity, radiusA).x; - radiusV.y = bodyB->velocity.y + MathCross(bodyB->angularVelocity, radiusB).y - bodyA->velocity.y - MathCross(bodyA->angularVelocity, radiusA).y; + radiusV.x = bodyB->velocity.x + MathVector2Product(radiusB, bodyB->angularVelocity).x - bodyA->velocity.x - MathVector2Product(radiusA, bodyA->angularVelocity).x; + radiusV.y = bodyB->velocity.y + MathVector2Product(radiusB, bodyB->angularVelocity).y - bodyA->velocity.y - MathVector2Product(radiusA, bodyA->angularVelocity).y; - Vector2 tangent = { radiusV.x - (manifold->normal.x*MathDot(radiusV, manifold->normal)), radiusV.y - (manifold->normal.y*MathDot(radiusV, manifold->normal)) }; - MathNormalize(&tangent); + Vector2 tangent = { radiusV.x - (manifold->normal.x*MathVector2DotProduct(radiusV, manifold->normal)), radiusV.y - (manifold->normal.y*MathVector2DotProduct(radiusV, manifold->normal)) }; + MathVector2Normalize(&tangent); // Calculate impulse tangent magnitude - float impulseTangent = -MathDot(radiusV, tangent); + float impulseTangent = -MathVector2DotProduct(radiusV, tangent); impulseTangent /= inverseMassSum; impulseTangent /= (float)manifold->contactsCount; - float absImpulseTangent = fabs(impulseTangent); + float absImpulseTangent = (float)fabs(impulseTangent); // Don't apply tiny friction impulses if (absImpulseTangent <= PHYSAC_EPSILON) return; // Apply coulumb's law Vector2 tangentImpulse = { 0.0f, 0.0f }; - if (absImpulseTangent < impulse*manifold->staticFriction) tangentImpulse = (Vector2){ tangent.x*impulseTangent, tangent.y*impulseTangent }; - else tangentImpulse = (Vector2){ tangent.x*-impulse*manifold->dynamicFriction, tangent.y*-impulse*manifold->dynamicFriction }; + if (absImpulseTangent < impulse*manifold->staticFriction) tangentImpulse = CLITERAL(Vector2){ tangent.x*impulseTangent, tangent.y*impulseTangent }; + else tangentImpulse = CLITERAL(Vector2){ tangent.x*-impulse*manifold->dynamicFriction, tangent.y*-impulse*manifold->dynamicFriction }; // Apply friction impulse if (bodyA->enabled) @@ -1710,7 +1648,7 @@ static void IntegratePhysicsImpulses(PhysicsManifold manifold) bodyA->velocity.x += bodyA->inverseMass*(-tangentImpulse.x); bodyA->velocity.y += bodyA->inverseMass*(-tangentImpulse.y); - if (!bodyA->freezeOrient) bodyA->angularVelocity += bodyA->inverseInertia*MathCrossVector2(radiusA, (Vector2){ -tangentImpulse.x, -tangentImpulse.y }); + if (!bodyA->freezeOrient) bodyA->angularVelocity += bodyA->inverseInertia*MathVector2CrossProduct(radiusA, CLITERAL(Vector2){ -tangentImpulse.x, -tangentImpulse.y }); } if (bodyB->enabled) @@ -1718,7 +1656,7 @@ static void IntegratePhysicsImpulses(PhysicsManifold manifold) bodyB->velocity.x += bodyB->inverseMass*(tangentImpulse.x); bodyB->velocity.y += bodyB->inverseMass*(tangentImpulse.y); - if (!bodyB->freezeOrient) bodyB->angularVelocity += bodyB->inverseInertia*MathCrossVector2(radiusB, tangentImpulse); + if (!bodyB->freezeOrient) bodyB->angularVelocity += bodyB->inverseInertia*MathVector2CrossProduct(radiusB, tangentImpulse); } } } @@ -1728,11 +1666,11 @@ static void IntegratePhysicsVelocity(PhysicsBody body) { if ((body == NULL) ||!body->enabled) return; - body->position.x += body->velocity.x*deltaTime; - body->position.y += body->velocity.y*deltaTime; + body->position.x += (float)(body->velocity.x*deltaTime); + body->position.y += (float)(body->velocity.y*deltaTime); - if (!body->freezeOrient) body->orient += body->angularVelocity*deltaTime; - Mat2Set(&body->shape.transform, body->orient); + if (!body->freezeOrient) body->orient += (float)(body->angularVelocity*deltaTime); + body->shape.transform = MathMatFromRadians(body->orient); IntegratePhysicsForces(body); } @@ -1746,8 +1684,8 @@ static void CorrectPhysicsPositions(PhysicsManifold manifold) if ((bodyA == NULL) || (bodyB == NULL)) return; Vector2 correction = { 0.0f, 0.0f }; - correction.x = (max(manifold->penetration - PHYSAC_PENETRATION_ALLOWANCE, 0.0f)/(bodyA->inverseMass + bodyB->inverseMass))*manifold->normal.x*PHYSAC_PENETRATION_CORRECTION; - correction.y = (max(manifold->penetration - PHYSAC_PENETRATION_ALLOWANCE, 0.0f)/(bodyA->inverseMass + bodyB->inverseMass))*manifold->normal.y*PHYSAC_PENETRATION_CORRECTION; + correction.x = (PHYSAC_MAX(manifold->penetration - PHYSAC_PENETRATION_ALLOWANCE, 0.0f)/(bodyA->inverseMass + bodyB->inverseMass))*manifold->normal.x*PHYSAC_PENETRATION_CORRECTION; + correction.y = (PHYSAC_MAX(manifold->penetration - PHYSAC_PENETRATION_ALLOWANCE, 0.0f)/(bodyA->inverseMass + bodyB->inverseMass))*manifold->normal.y*PHYSAC_PENETRATION_CORRECTION; if (bodyA->enabled) { @@ -1767,12 +1705,12 @@ static Vector2 GetSupport(PhysicsShape shape, Vector2 dir) { float bestProjection = -PHYSAC_FLT_MAX; Vector2 bestVertex = { 0.0f, 0.0f }; - PolygonData data = shape.vertexData; + PhysicsVertexData data = shape.vertexData; - for (int i = 0; i < data.vertexCount; i++) + for (unsigned int i = 0; i < data.vertexCount; i++) { Vector2 vertex = data.positions[i]; - float projection = MathDot(vertex, dir); + float projection = MathVector2DotProduct(vertex, dir); if (projection > bestProjection) { @@ -1790,31 +1728,31 @@ static float FindAxisLeastPenetration(int *faceIndex, PhysicsShape shapeA, Physi float bestDistance = -PHYSAC_FLT_MAX; int bestIndex = 0; - PolygonData dataA = shapeA.vertexData; - //PolygonData dataB = shapeB.vertexData; + PhysicsVertexData dataA = shapeA.vertexData; + //PhysicsVertexData dataB = shapeB.vertexData; - for (int i = 0; i < dataA.vertexCount; i++) + for (unsigned int i = 0; i < dataA.vertexCount; i++) { // Retrieve a face normal from A shape Vector2 normal = dataA.normals[i]; - Vector2 transNormal = Mat2MultiplyVector2(shapeA.transform, normal); + Vector2 transNormal = MathMatVector2Product(shapeA.transform, normal); // Transform face normal into B shape's model space - Matrix2x2 buT = Mat2Transpose(shapeB.transform); - normal = Mat2MultiplyVector2(buT, transNormal); + Matrix2x2 buT = MathMatTranspose(shapeB.transform); + normal = MathMatVector2Product(buT, transNormal); // Retrieve support point from B shape along -n - Vector2 support = GetSupport(shapeB, (Vector2){ -normal.x, -normal.y }); + Vector2 support = GetSupport(shapeB, CLITERAL(Vector2){ -normal.x, -normal.y }); // Retrieve vertex on face from A shape, transform into B shape's model space Vector2 vertex = dataA.positions[i]; - vertex = Mat2MultiplyVector2(shapeA.transform, vertex); - vertex = Vector2Add(vertex, shapeA.body->position); - vertex = Vector2Subtract(vertex, shapeB.body->position); - vertex = Mat2MultiplyVector2(buT, vertex); + vertex = MathMatVector2Product(shapeA.transform, vertex); + vertex = MathVector2Add(vertex, shapeA.body->position); + vertex = MathVector2Subtract(vertex, shapeB.body->position); + vertex = MathMatVector2Product(buT, vertex); // Compute penetration distance in B shape's model space - float distance = MathDot(normal, Vector2Subtract(support, vertex)); + float distance = MathVector2DotProduct(normal, MathVector2Subtract(support, vertex)); // Store greatest distance if (distance > bestDistance) @@ -1831,22 +1769,22 @@ static float FindAxisLeastPenetration(int *faceIndex, PhysicsShape shapeA, Physi // Finds two polygon shapes incident face static void FindIncidentFace(Vector2 *v0, Vector2 *v1, PhysicsShape ref, PhysicsShape inc, int index) { - PolygonData refData = ref.vertexData; - PolygonData incData = inc.vertexData; + PhysicsVertexData refData = ref.vertexData; + PhysicsVertexData incData = inc.vertexData; Vector2 referenceNormal = refData.normals[index]; // Calculate normal in incident's frame of reference - referenceNormal = Mat2MultiplyVector2(ref.transform, referenceNormal); // To world space - referenceNormal = Mat2MultiplyVector2(Mat2Transpose(inc.transform), referenceNormal); // To incident's model space + referenceNormal = MathMatVector2Product(ref.transform, referenceNormal); // To world space + referenceNormal = MathMatVector2Product(MathMatTranspose(inc.transform), referenceNormal); // To incident's model space // Find most anti-normal face on polygon int incidentFace = 0; float minDot = PHYSAC_FLT_MAX; - for (int i = 0; i < incData.vertexCount; i++) + for (unsigned int i = 0; i < incData.vertexCount; i++) { - float dot = MathDot(referenceNormal, incData.normals[i]); + float dot = MathVector2DotProduct(referenceNormal, incData.normals[i]); if (dot < minDot) { @@ -1856,22 +1794,22 @@ static void FindIncidentFace(Vector2 *v0, Vector2 *v1, PhysicsShape ref, Physics } // Assign face vertices for incident face - *v0 = Mat2MultiplyVector2(inc.transform, incData.positions[incidentFace]); - *v0 = Vector2Add(*v0, inc.body->position); - incidentFace = (((incidentFace + 1) < incData.vertexCount) ? (incidentFace + 1) : 0); - *v1 = Mat2MultiplyVector2(inc.transform, incData.positions[incidentFace]); - *v1 = Vector2Add(*v1, inc.body->position); + *v0 = MathMatVector2Product(inc.transform, incData.positions[incidentFace]); + *v0 = MathVector2Add(*v0, inc.body->position); + incidentFace = (((incidentFace + 1) < (int)incData.vertexCount) ? (incidentFace + 1) : 0); + *v1 = MathMatVector2Product(inc.transform, incData.positions[incidentFace]); + *v1 = MathVector2Add(*v1, inc.body->position); } -// Calculates clipping based on a normal and two faces -static int Clip(Vector2 normal, float clip, Vector2 *faceA, Vector2 *faceB) +// Returns clipping value based on a normal and two faces +static int MathVector2Clip(Vector2 normal, Vector2 *faceA, Vector2 *faceB, float clip) { int sp = 0; Vector2 out[2] = { *faceA, *faceB }; // Retrieve distances from each endpoint to the line - float distanceA = MathDot(normal, *faceA) - clip; - float distanceB = MathDot(normal, *faceB) - clip; + float distanceA = MathVector2DotProduct(normal, *faceA) - clip; + float distanceB = MathVector2DotProduct(normal, *faceB) - clip; // If negative (behind plane) if (distanceA <= 0.0f) out[sp++] = *faceA; @@ -1883,10 +1821,10 @@ static int Clip(Vector2 normal, float clip, Vector2 *faceA, Vector2 *faceB) // Push intersection point float alpha = distanceA/(distanceA - distanceB); out[sp] = *faceA; - Vector2 delta = Vector2Subtract(*faceB, *faceA); + Vector2 delta = MathVector2Subtract(*faceB, *faceA); delta.x *= alpha; delta.y *= alpha; - out[sp] = Vector2Add(out[sp], delta); + out[sp] = MathVector2Add(out[sp], delta); sp++; } @@ -1897,14 +1835,8 @@ static int Clip(Vector2 normal, float clip, Vector2 *faceA, Vector2 *faceB) return sp; } -// Check if values are between bias range -static bool BiasGreaterThan(float valueA, float valueB) -{ - return (valueA >= (valueB*0.95f + valueA*0.01f)); -} - // Returns the barycenter of a triangle given by 3 points -static Vector2 TriangleBarycenter(Vector2 v1, Vector2 v2, Vector2 v3) +static Vector2 MathTriangleBarycenter(Vector2 v1, Vector2 v2, Vector2 v3) { Vector2 result = { 0.0f, 0.0f }; @@ -1914,11 +1846,10 @@ static Vector2 TriangleBarycenter(Vector2 v1, Vector2 v2, Vector2 v3) return result; } +#if !defined(PHYSAC_AVOID_TIMMING_SYSTEM) // Initializes hi-resolution MONOTONIC timer static void InitTimer(void) { - srand(time(NULL)); // Initialize random seed - #if defined(_WIN32) QueryPerformanceFrequency((unsigned long long int *) &frequency); #endif @@ -1934,12 +1865,12 @@ static void InitTimer(void) frequency = (timebase.denom*1e9)/timebase.numer; #endif - baseTime = GetTimeCount(); // Get MONOTONIC clock time offset - startTime = GetCurrentTime(); // Get current time + baseClockTicks = (double)GetClockTicks(); // Get MONOTONIC clock time offset + startTime = GetCurrentTime(); // Get current time in milliseconds } -// Get hi-res MONOTONIC time measure in seconds -static unsigned long long int GetTimeCount(void) +// Get hi-res MONOTONIC time measure in clock ticks +static unsigned long long int GetClockTicks(void) { unsigned long long int value = 0; @@ -1963,42 +1894,45 @@ static unsigned long long int GetTimeCount(void) // Get current time in milliseconds static double GetCurrentTime(void) { - return (double)(GetTimeCount() - baseTime)/frequency*1000; + return (double)(GetClockTicks() - baseClockTicks)/frequency*1000; } +#endif // !PHYSAC_AVOID_TIMMING_SYSTEM + // Returns the cross product of a vector and a value -static inline Vector2 MathCross(float value, Vector2 vector) +static inline Vector2 MathVector2Product(Vector2 vector, float value) { - return (Vector2){ -value*vector.y, value*vector.x }; + Vector2 result = { -value*vector.y, value*vector.x }; + return result; } // Returns the cross product of two vectors -static inline float MathCrossVector2(Vector2 v1, Vector2 v2) +static inline float MathVector2CrossProduct(Vector2 v1, Vector2 v2) { return (v1.x*v2.y - v1.y*v2.x); } // Returns the len square root of a vector -static inline float MathLenSqr(Vector2 vector) +static inline float MathVector2SqrLen(Vector2 vector) { return (vector.x*vector.x + vector.y*vector.y); } // Returns the dot product of two vectors -static inline float MathDot(Vector2 v1, Vector2 v2) +static inline float MathVector2DotProduct(Vector2 v1, Vector2 v2) { return (v1.x*v2.x + v1.y*v2.y); } // Returns the square root of distance between two vectors -static inline float DistSqr(Vector2 v1, Vector2 v2) +static inline float MathVector2SqrDistance(Vector2 v1, Vector2 v2) { - Vector2 dir = Vector2Subtract(v1, v2); - return MathDot(dir, dir); + Vector2 dir = MathVector2Subtract(v1, v2); + return MathVector2DotProduct(dir, dir); } // Returns the normalized values of a vector -static void MathNormalize(Vector2 *vector) +static void MathVector2Normalize(Vector2 *vector) { float length, ilength; @@ -2013,51 +1947,42 @@ static void MathNormalize(Vector2 *vector) vector->y *= ilength; } -#if defined(PHYSAC_STANDALONE) // Returns the sum of two given vectors -static inline Vector2 Vector2Add(Vector2 v1, Vector2 v2) +static inline Vector2 MathVector2Add(Vector2 v1, Vector2 v2) { - return (Vector2){ v1.x + v2.x, v1.y + v2.y }; + Vector2 result = { v1.x + v2.x, v1.y + v2.y }; + return result; } // Returns the subtract of two given vectors -static inline Vector2 Vector2Subtract(Vector2 v1, Vector2 v2) +static inline Vector2 MathVector2Subtract(Vector2 v1, Vector2 v2) { - return (Vector2){ v1.x - v2.x, v1.y - v2.y }; + Vector2 result = { v1.x - v2.x, v1.y - v2.y }; + return result; } -#endif // Creates a matrix 2x2 from a given radians value -static Matrix2x2 Mat2Radians(float radians) -{ - float c = cosf(radians); - float s = sinf(radians); - - return (Matrix2x2){ c, -s, s, c }; -} - -// Set values from radians to a created matrix 2x2 -static void Mat2Set(Matrix2x2 *matrix, float radians) +static Matrix2x2 MathMatFromRadians(float radians) { float cos = cosf(radians); float sin = sinf(radians); - matrix->m00 = cos; - matrix->m01 = -sin; - matrix->m10 = sin; - matrix->m11 = cos; + Matrix2x2 result = { cos, -sin, sin, cos }; + return result; } // Returns the transpose of a given matrix 2x2 -static inline Matrix2x2 Mat2Transpose(Matrix2x2 matrix) +static inline Matrix2x2 MathMatTranspose(Matrix2x2 matrix) { - return (Matrix2x2){ matrix.m00, matrix.m10, matrix.m01, matrix.m11 }; + Matrix2x2 result = { matrix.m00, matrix.m10, matrix.m01, matrix.m11 }; + return result; } // Multiplies a vector by a matrix 2x2 -static inline Vector2 Mat2MultiplyVector2(Matrix2x2 matrix, Vector2 vector) +static inline Vector2 MathMatVector2Product(Matrix2x2 matrix, Vector2 vector) { - return (Vector2){ matrix.m00*vector.x + matrix.m01*vector.y, matrix.m10*vector.x + matrix.m11*vector.y }; + Vector2 result = { matrix.m00*vector.x + matrix.m01*vector.y, matrix.m10*vector.x + matrix.m11*vector.y }; + return result; } #endif // PHYSAC_IMPLEMENTATION diff --git a/src/rmem.h b/src/extras/rmem.h similarity index 100% rename from src/rmem.h rename to src/extras/rmem.h diff --git a/src/rnet.h b/src/extras/rnet.h similarity index 96% rename from src/rnet.h rename to src/extras/rnet.h index 1145df01b..439b105a2 100644 --- a/src/rnet.h +++ b/src/extras/rnet.h @@ -1,2252 +1,2256 @@ -/********************************************************************************************** -* -* rnet - A simple and easy-to-use network module for raylib -* -* FEATURES: -* - Provides a simple and (hopefully) easy to use wrapper around the Berkeley socket API -* -* INSPIRED BY: -* SFML Sockets - https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1Socket.php -* SDL_net - https://www.libsdl.org/projects/SDL_net/ -* BSD Sockets - https://www.gnu.org/software/libc/manual/html_node/Sockets.html -* BEEJ - https://beej.us/guide/bgnet/html/single/bgnet.html -* Winsock2 - https://docs.microsoft.com/en-us/windows/desktop/api/winsock2 -* -* CONTRIBUTORS: -* Jak Barnes (github: @syphonx) (Feb. 2019) - Initial version -* -* -* LICENSE: zlib/libpng -* -* Copyright (c) 2019-2020 Jak Barnes (@syphonx) and Ramon Santamaria (@raysan5) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -* -**********************************************************************************************/ - -#ifndef RNET_H -#define RNET_H - -#include // Required for limits -#include // Required for platform type sizes - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- - -// Undefine any conflicting windows.h symbols -// If defined, the following flags inhibit definition of the indicated items. -#define NOGDICAPMASKS // CC_*, LC_*, PC_*, CP_*, TC_*, RC_ -#define NOVIRTUALKEYCODES // VK_* -#define NOWINMESSAGES // WM_*, EM_*, LB_*, CB_* -#define NOWINSTYLES // WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_* -#define NOSYSMETRICS // SM_* -#define NOMENUS // MF_* -#define NOICONS // IDI_* -#define NOKEYSTATES // MK_* -#define NOSYSCOMMANDS // SC_* -#define NORASTEROPS // Binary and Tertiary raster ops -#define NOSHOWWINDOW // SW_* -#define OEMRESOURCE // OEM Resource values -#define NOATOM // Atom Manager routines -#define NOCLIPBOARD // Clipboard routines -#define NOCOLOR // Screen colors -#define NOCTLMGR // Control and Dialog routines -#define NODRAWTEXT // DrawText() and DT_* -#define NOGDI // All GDI defines and routines -#define NOKERNEL // All KERNEL defines and routines -#define NOUSER // All USER defines and routines -#define NONLS // All NLS defines and routines -#define NOMB // MB_* and MessageBox() -#define NOMEMMGR // GMEM_*, LMEM_*, GHND, LHND, associated routines -#define NOMETAFILE // typedef METAFILEPICT -#define NOMINMAX // Macros min(a,b) and max(a,b) -#define NOMSG // typedef MSG and associated routines -#define NOOPENFILE // OpenFile(), OemToAnsi, AnsiToOem, and OF_* -#define NOSCROLL // SB_* and scrolling routines -#define NOSERVICE // All Service Controller routines, SERVICE_ equates, etc. -#define NOSOUND // Sound driver routines -#define NOTEXTMETRIC // typedef TEXTMETRIC and associated routines -#define NOWH // SetWindowsHook and WH_* -#define NOWINOFFSETS // GWL_*, GCL_*, associated routines -#define NOCOMM // COMM driver routines -#define NOKANJI // Kanji support stuff. -#define NOHELP // Help engine interface. -#define NOPROFILER // Profiler interface. -#define NODEFERWINDOWPOS // DeferWindowPos routines -#define NOMCX // Modem Configuration Extensions -#define MMNOSOUND - -// Allow custom memory allocators -#ifndef RNET_MALLOC - #define RNET_MALLOC(sz) malloc(sz) -#endif -#ifndef RNET_CALLOC - #define RNET_CALLOC(n,sz) calloc(n,sz) -#endif -#ifndef RNET_FREE - #define RNET_FREE(p) free(p) -#endif - -//---------------------------------------------------------------------------------- -// Platform type definitions -// From: https://github.com/DFHack/clsocket/blob/master/src/Host.h -//---------------------------------------------------------------------------------- - -#ifdef WIN32 -typedef int socklen_t; -#endif - -#ifndef RESULT_SUCCESS -# define RESULT_SUCCESS 0 -#endif // RESULT_SUCCESS - -#ifndef RESULT_FAILURE -# define RESULT_FAILURE 1 -#endif // RESULT_FAILURE - -#ifndef htonll -# ifdef _BIG_ENDIAN -# define htonll(x) (x) -# define ntohll(x) (x) -# else -# define htonll(x) ((((uint64) htonl(x)) << 32) + htonl(x >> 32)) -# define ntohll(x) ((((uint64) ntohl(x)) << 32) + ntohl(x >> 32)) -# endif // _BIG_ENDIAN -#endif // htonll - -//---------------------------------------------------------------------------------- -// Platform specific network includes -// From: https://github.com/SDL-mirror/SDL_net/blob/master/SDLnetsys.h -//---------------------------------------------------------------------------------- - -// Include system network headers -#if defined(_WIN32) // Windows - #define __USE_W32_SOCKETS - #define WIN32_LEAN_AND_MEAN - #include - #include - #include - #define IPTOS_LOWDELAY 0x10 -#else // Unix - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#endif - -#ifndef INVALID_SOCKET - #define INVALID_SOCKET ~(0) -#endif - -#ifndef __USE_W32_SOCKETS - #define closesocket close - #define SOCKET int - #define INVALID_SOCKET -1 - #define SOCKET_ERROR -1 -#endif - -#ifdef __USE_W32_SOCKETS - #ifndef EINTR - #define EINTR WSAEINTR - #endif -#endif - -//---------------------------------------------------------------------------------- -// Module defines -//---------------------------------------------------------------------------------- - -// Network connection related defines -#define SOCKET_MAX_SET_SIZE 32 // Maximum sockets in a set -#define SOCKET_MAX_QUEUE_SIZE 16 // Maximum socket queue size -#define SOCKET_MAX_SOCK_OPTS 4 // Maximum socket options -#define SOCKET_MAX_UDPCHANNELS 32 // Maximum UDP channels -#define SOCKET_MAX_UDPADDRESSES 4 // Maximum bound UDP addresses - -// Network address related defines -#define ADDRESS_IPV4_ADDRSTRLEN 22 // IPv4 string length -#define ADDRESS_IPV6_ADDRSTRLEN 65 // IPv6 string length -#define ADDRESS_TYPE_ANY 0 // AF_UNSPEC -#define ADDRESS_TYPE_IPV4 2 // AF_INET -#define ADDRESS_TYPE_IPV6 23 // AF_INET6 -#define ADDRESS_MAXHOST 1025 // Max size of a fully-qualified domain name -#define ADDRESS_MAXSERV 32 // Max size of a service name - -// Network address related defines -#define ADDRESS_ANY (unsigned long)0x00000000 -#define ADDRESS_LOOPBACK 0x7f000001 -#define ADDRESS_BROADCAST (unsigned long)0xffffffff -#define ADDRESS_NONE 0xffffffff - -// Network resolution related defines -#define NAME_INFO_DEFAULT 0x00 // No flags set -#define NAME_INFO_NOFQDN 0x01 // Only return nodename portion for local hosts -#define NAME_INFO_NUMERICHOST 0x02 // Return numeric form of the host's address -#define NAME_INFO_NAMEREQD 0x04 // Error if the host's name not in DNS -#define NAME_INFO_NUMERICSERV 0x08 // Return numeric form of the service (port #) -#define NAME_INFO_DGRAM 0x10 // Service is a datagram service - -// Address resolution related defines -#if defined(_WIN32) - #define ADDRESS_INFO_PASSIVE (0x00000001) // Socket address will be used in bind() call - #define ADDRESS_INFO_CANONNAME (0x00000002) // Return canonical name in first ai_canonname - #define ADDRESS_INFO_NUMERICHOST (0x00000004) // Nodename must be a numeric address string - #define ADDRESS_INFO_NUMERICSERV (0x00000008) // Servicename must be a numeric port number - #define ADDRESS_INFO_DNS_ONLY (0x00000010) // Restrict queries to unicast DNS only (no LLMNR, netbios, etc.) - #define ADDRESS_INFO_ALL (0x00000100) // Query both IP6 and IP4 with AI_V4MAPPED - #define ADDRESS_INFO_ADDRCONFIG (0x00000400) // Resolution only if global address configured - #define ADDRESS_INFO_V4MAPPED (0x00000800) // On v6 failure, query v4 and convert to V4MAPPED format - #define ADDRESS_INFO_NON_AUTHORITATIVE (0x00004000) // LUP_NON_AUTHORITATIVE - #define ADDRESS_INFO_SECURE (0x00008000) // LUP_SECURE - #define ADDRESS_INFO_RETURN_PREFERRED_NAMES (0x00010000) // LUP_RETURN_PREFERRED_NAMES - #define ADDRESS_INFO_FQDN (0x00020000) // Return the FQDN in ai_canonname - #define ADDRESS_INFO_FILESERVER (0x00040000) // Resolving fileserver name resolution - #define ADDRESS_INFO_DISABLE_IDN_ENCODING (0x00080000) // Disable Internationalized Domain Names handling - #define ADDRESS_INFO_EXTENDED (0x80000000) // Indicates this is extended ADDRINFOEX(2/..) struct - #define ADDRESS_INFO_RESOLUTION_HANDLE (0x40000000) // Request resolution handle -#endif - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -//---------------------------------------------------------------------------------- - -// Boolean type -#if defined(__STDC__) && __STDC_VERSION__ >= 199901L - #include -#elif !defined(__cplusplus) && !defined(bool) - typedef enum { false, true } bool; -#endif - -typedef enum { - SOCKET_TCP = 0, // SOCK_STREAM - SOCKET_UDP = 1 // SOCK_DGRAM -} SocketType; - -// Network typedefs -typedef uint32_t SocketChannel; -typedef struct _AddressInformation *AddressInformation; -typedef struct _SocketAddress *SocketAddress; -typedef struct _SocketAddressIPv4 *SocketAddressIPv4; -typedef struct _SocketAddressIPv6 *SocketAddressIPv6; -typedef struct _SocketAddressStorage *SocketAddressStorage; - -// IPAddress definition (in network byte order) -typedef struct IPAddress { - unsigned long host; // 32-bit IPv4 host address - unsigned short port; // 16-bit protocol port -} IPAddress; - -typedef struct UDPChannel { - int numbound; // The total number of addresses this channel is bound to - IPAddress address[SOCKET_MAX_UDPADDRESSES]; // The list of remote addresses this channel is bound to -} UDPChannel; - -// An option ID, value, sizeof(value) tuple for setsockopt(2). -typedef struct SocketOpt { - int id; // Socked option id - int valueLen; // Socked option value len - void *value; // Socked option value data -} SocketOpt; - -typedef struct Socket { - int ready; // Is the socket ready? i.e. has information - int status; // The last status code to have occured using this socket - bool isServer; // Is this socket a server socket (i.e. TCP/UDP Listen Server) - SocketChannel channel; // The socket handle id - SocketType type; // Is this socket a TCP or UDP socket? - - bool isIPv6; // Is this socket address an ipv6 address? - SocketAddressIPv4 addripv4; // The host/target IPv4 for this socket (in network byte order) - SocketAddressIPv6 addripv6; // The host/target IPv6 for this socket (in network byte order) - - struct UDPChannel binding[SOCKET_MAX_UDPCHANNELS]; // The amount of channels (if UDP) this socket is bound to -} Socket; - -// Configuration for a socket -typedef struct SocketConfig { - SocketType type; // The type of socket, TCP/UDP - char *host; // The host address in xxx.xxx.xxx.xxx form - char *port; // The target port/service in the form "http" or "25565" - bool server; // Listen for incoming clients? - bool nonblocking; // non-blocking operation? - int backlog_size; // set a custom backlog size - SocketOpt sockopts[SOCKET_MAX_SOCK_OPTS]; -} SocketConfig; - -typedef struct SocketDataPacket { - IPAddress address; // The source/dest address of an incoming/outgoing packet - int channel; // The src/dst channel of the packet - int maxlen; // The size of the data buffer - int status; // Packet status after sending - unsigned int len; // The length of the packet data - unsigned char *data; // The packet data -} SocketDataPacket; - -// Result from calling open with a given config -typedef struct SocketResult { - int status; // Socket result state - Socket *socket; // Socket ref -} SocketResult; - -typedef struct SocketSet { - int numsockets; // Socket set count - int maxsockets; // Socket set max - struct Socket **sockets; // Sockets array -} SocketSet; - -// Packet type -typedef struct Packet { - uint32_t size; // The total size of bytes in data - uint32_t offs; // The offset to data access - uint32_t maxs; // The max size of data - uint8_t *data; // Data stored in network byte order -} Packet; - - -#ifdef __cplusplus -extern "C" { // Prevents name mangling of functions -#endif - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- -//... - -//---------------------------------------------------------------------------------- -// Module Functions Declaration -//---------------------------------------------------------------------------------- - -// Initialisation and cleanup -bool InitNetworkDevice(void); -void CloseNetworkDevice(void); - -// Address API -void ResolveIP(const char *ip, const char *service, int flags, char *outhost, char *outserv); -int ResolveHost(const char *address, const char *service, int addressType, int flags, AddressInformation *outAddr); -int GetAddressFamily(AddressInformation address); -int GetAddressSocketType(AddressInformation address); -int GetAddressProtocol(AddressInformation address); -char *GetAddressCanonName(AddressInformation address); -char *GetAddressHostAndPort(AddressInformation address, char *outhost, int *outport); - -// Address Memory API -AddressInformation LoadAddress(void); -void UnloadAddress(AddressInformation *addressInfo); -AddressInformation *LoadAddressList(int size); - -// Socket API -bool SocketCreate(SocketConfig *config, SocketResult *result); -bool SocketBind(SocketConfig *config, SocketResult *result); -bool SocketListen(SocketConfig *config, SocketResult *result); -bool SocketConnect(SocketConfig *config, SocketResult *result); -Socket *SocketAccept(Socket *server, SocketConfig *config); - -// General Socket API -int SocketSend(Socket *sock, const void *datap, int len); -int SocketReceive(Socket *sock, void *data, int maxlen); -SocketAddressStorage SocketGetPeerAddress(Socket *sock); -char *GetSocketAddressHost(SocketAddressStorage storage); -short GetSocketAddressPort(SocketAddressStorage storage); -void SocketClose(Socket *sock); - -// UDP Socket API -int SocketSetChannel(Socket *socket, int channel, const IPAddress *address); -void SocketUnsetChannel(Socket *socket, int channel); - -// UDP DataPacket API -SocketDataPacket *AllocPacket(int size); -int ResizePacket(SocketDataPacket *packet, int newsize); -void FreePacket(SocketDataPacket *packet); -SocketDataPacket **AllocPacketList(int count, int size); -void FreePacketList(SocketDataPacket **packets); - -// Socket Memory API -Socket *LoadSocket(void); -void UnloadSocket(Socket **sock); -SocketResult *LoadSocketResult(void); -void UnloadSocketResult(SocketResult **result); -SocketSet *LoadSocketSet(int max); -void UnloadSocketSet(SocketSet *sockset); - -// Socket I/O API -bool IsSocketReady(Socket *sock); -bool IsSocketConnected(Socket *sock); -int AddSocket(SocketSet *set, Socket *sock); -int RemoveSocket(SocketSet *set, Socket *sock); -int CheckSockets(SocketSet *set, unsigned int timeout); - -// Packet API -void PacketSend(Packet *packet); -void PacketReceive(Packet *packet); -void PacketWrite8(Packet *packet, uint16_t value); -void PacketWrite16(Packet *packet, uint16_t value); -void PacketWrite32(Packet *packet, uint32_t value); -void PacketWrite64(Packet *packet, uint64_t value); -uint16_t PacketRead8(Packet *packet); -uint16_t PacketRead16(Packet *packet); -uint32_t PacketRead32(Packet *packet); -uint64_t PacketRead64(Packet *packet); - -#ifdef __cplusplus -} -#endif - -#endif // RNET_H - -/*********************************************************************************** -* -* RNET IMPLEMENTATION -* -************************************************************************************/ - -#if defined(RNET_IMPLEMENTATION) - -#include // Required for: assert() -#include // Required for: FILE, fopen(), fclose(), fread() -#include // Required for: malloc(), free() -#include // Required for: strcmp(), strncmp() - -#define NET_DEBUG_ENABLED 1 - -#if defined(SUPPORT_TRACELOG) - #define TRACELOG(level, ...) TraceLog(level, __VA_ARGS__) - - #if defined(SUPPORT_TRACELOG_DEBUG) - #define TRACELOGD(...) TraceLog(LOG_DEBUG, __VA_ARGS__) - #else - #define TRACELOGD(...) (void)0 - #endif -#else - #define TRACELOG(level, ...) (void)0 - #define TRACELOGD(...) (void)0 -#endif - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -//---------------------------------------------------------------------------------- - -typedef struct _SocketAddress -{ - struct sockaddr address; -} _SocketAddress; - -typedef struct _SocketAddressIPv4 -{ - struct sockaddr_in address; -} _SocketAddressIPv4; - -typedef struct _SocketAddressIPv6 -{ - struct sockaddr_in6 address; -} _SocketAddressIPv6; - -typedef struct _SocketAddressStorage -{ - struct sockaddr_storage address; -} _SocketAddressStorage; - -typedef struct _AddressInformation -{ - struct addrinfo addr; -} _AddressInformation; - -//---------------------------------------------------------------------------------- -// Local module Functions Declarations -//---------------------------------------------------------------------------------- -static void PrintSocket(struct sockaddr_storage *addr, const int family, const int socktype, const int protocol); -static const char *SocketAddressToString(struct sockaddr_storage *sockaddr); -static bool IsIPv4Address(const char *ip); -static bool IsIPv6Address(const char *ip); -static void *GetSocketPortPtr(struct sockaddr_storage *sa); -static void *GetSocketAddressPtr(struct sockaddr_storage *sa); -static bool IsSocketValid(Socket *sock); -static void SocketSetLastError(int err); -static int SocketGetLastError(); -static char *SocketGetLastErrorString(); -static char *SocketErrorCodeToString(int err); -static bool SocketSetDefaults(SocketConfig *config); -static bool InitSocket(Socket *sock, struct addrinfo *addr); -static bool CreateSocket(SocketConfig *config, SocketResult *outresult); -static bool SocketSetBlocking(Socket *sock); -static bool SocketSetNonBlocking(Socket *sock); -static bool SocketSetOptions(SocketConfig *config, Socket *sock); -static void SocketSetHints(SocketConfig *config, struct addrinfo *hints); - -//---------------------------------------------------------------------------------- -// Local module Functions Definition -//---------------------------------------------------------------------------------- -// Print socket information -static void PrintSocket(struct sockaddr_storage *addr, const int family, const int socktype, const int protocol) -{ - switch (family) - { - case AF_UNSPEC: TRACELOG(LOG_DEBUG, "\tFamily: Unspecified"); break; - case AF_INET: - { - TRACELOG(LOG_DEBUG, "\tFamily: AF_INET (IPv4)"); - TRACELOG(LOG_INFO, "\t- IPv4 address %s", SocketAddressToString(addr)); - } break; - case AF_INET6: - { - TRACELOG(LOG_DEBUG, "\tFamily: AF_INET6 (IPv6)"); - TRACELOG(LOG_INFO, "\t- IPv6 address %s", SocketAddressToString(addr)); - } break; - case AF_NETBIOS: - { - TRACELOG(LOG_DEBUG, "\tFamily: AF_NETBIOS (NetBIOS)"); - } break; - default: TRACELOG(LOG_DEBUG, "\tFamily: Other %ld", family); break; - } - - TRACELOG(LOG_DEBUG, "\tSocket type:"); - switch (socktype) - { - case 0: TRACELOG(LOG_DEBUG, "\t- Unspecified"); break; - case SOCK_STREAM: TRACELOG(LOG_DEBUG, "\t- SOCK_STREAM (stream)"); break; - case SOCK_DGRAM: TRACELOG(LOG_DEBUG, "\t- SOCK_DGRAM (datagram)"); break; - case SOCK_RAW: TRACELOG(LOG_DEBUG, "\t- SOCK_RAW (raw)"); break; - case SOCK_RDM: TRACELOG(LOG_DEBUG, "\t- SOCK_RDM (reliable message datagram)"); break; - case SOCK_SEQPACKET: TRACELOG(LOG_DEBUG, "\t- SOCK_SEQPACKET (pseudo-stream packet)"); break; - default: TRACELOG(LOG_DEBUG, "\t- Other %ld", socktype); break; - } - - TRACELOG(LOG_DEBUG, "\tProtocol:"); - switch (protocol) - { - case 0: TRACELOG(LOG_DEBUG, "\t- Unspecified"); break; - case IPPROTO_TCP: TRACELOG(LOG_DEBUG, "\t- IPPROTO_TCP (TCP)"); break; - case IPPROTO_UDP: TRACELOG(LOG_DEBUG, "\t- IPPROTO_UDP (UDP)"); break; - default: TRACELOG(LOG_DEBUG, "\t- Other %ld", protocol); break; - } -} - -// Convert network ordered socket address to human readable string (127.0.0.1) -static const char *SocketAddressToString(struct sockaddr_storage *sockaddr) -{ - //static const char* ipv6[INET6_ADDRSTRLEN]; - assert(sockaddr != NULL); - assert(sockaddr->ss_family == AF_INET || sockaddr->ss_family == AF_INET6); - - switch (sockaddr->ss_family) - { - case AF_INET: - { - //struct sockaddr_in *s = ((struct sockaddr_in *)sockaddr); - //return inet_ntop(AF_INET, &s->sin_addr, ipv6, INET_ADDRSTRLEN); // TODO. - } - break; - case AF_INET6: - { - //struct sockaddr_in6 *s = ((struct sockaddr_in6 *)sockaddr); - //return inet_ntop(AF_INET6, &s->sin6_addr, ipv6, INET6_ADDRSTRLEN); // TODO. - } - break; - } - - return NULL; -} - -// Check if the null terminated string ip is a valid IPv4 address -static bool IsIPv4Address(const char *ip) -{ - /* - struct sockaddr_in sa; - int result = inet_pton(AF_INET, ip, &(sa.sin_addr)); // TODO. - return (result != 0); - */ - return false; -} - -// Check if the null terminated string ip is a valid IPv6 address -static bool IsIPv6Address(const char *ip) -{ - /* - struct sockaddr_in6 sa; - int result = inet_pton(AF_INET6, ip, &(sa.sin6_addr)); // TODO. - return result != 0; - */ - return false; -} - -// Return a pointer to the port from the correct address family (IPv4, or IPv6) -static void *GetSocketPortPtr(struct sockaddr_storage *sa) -{ - if (sa->ss_family == AF_INET) - { - return &(((struct sockaddr_in *)sa)->sin_port); - } - - return &(((struct sockaddr_in6 *)sa)->sin6_port); -} - -// Return a pointer to the address from the correct address family (IPv4, or IPv6) -static void *GetSocketAddressPtr(struct sockaddr_storage *sa) -{ - if (sa->ss_family == AF_INET) - { - return &(((struct sockaddr_in *)sa)->sin_addr); - } - - return &(((struct sockaddr_in6 *)sa)->sin6_addr); -} - -// Is the socket in a valid state? -static bool IsSocketValid(Socket *sock) -{ - if (sock != NULL) - { - return (sock->channel != INVALID_SOCKET); - } - - return false; -} - -// Sets the error code that can be retrieved through the WSAGetLastError function. -static void SocketSetLastError(int err) -{ -#if defined(_WIN32) - WSASetLastError(err); -#else - errno = err; -#endif -} - -// Returns the error status for the last Sockets operation that failed -static int SocketGetLastError(void) -{ -#if defined(_WIN32) - return WSAGetLastError(); -#else - return errno; -#endif -} - -// Returns a human-readable string representing the last error message -static char *SocketGetLastErrorString(void) -{ - return SocketErrorCodeToString(SocketGetLastError()); -} - -// Returns a human-readable string representing the error message (err) -static char *SocketErrorCodeToString(int err) -{ -#if defined(_WIN32) - static char gaiStrErrorBuffer[GAI_STRERROR_BUFFER_SIZE]; - TRACELOG(LOG_INFO, gaiStrErrorBuffer, "%s", gai_strerror(err)); - return gaiStrErrorBuffer; -#else - return gai_strerror(err); -#endif -} - -// Set the defaults in the supplied SocketConfig if they're not already set -static bool SocketSetDefaults(SocketConfig *config) -{ - if (config->backlog_size == 0) config->backlog_size = SOCKET_MAX_QUEUE_SIZE; - - return true; -} - -// Create the socket channel -static bool InitSocket(Socket *sckt, struct addrinfo *address) -{ - switch (sckt->type) - { - case SOCKET_TCP: - { - if (address->ai_family == AF_INET) sckt->channel = socket(AF_INET, SOCK_STREAM, 0); - else sckt->channel = socket(AF_INET6, SOCK_STREAM, 0); - } break; - case SOCKET_UDP: - { - if (address->ai_family == AF_INET) sckt->channel = socket(AF_INET, SOCK_DGRAM, 0); - else sckt->channel = socket(AF_INET6, SOCK_DGRAM, 0); - } break; - default: TRACELOG(LOG_WARNING, "Invalid socket type specified."); break; - } - - return IsSocketValid(sckt); -} - -// CreateSocket() - Interally called by CreateSocket() -// -// This here is the bread and butter of the socket API, This function will -// attempt to open a socket, bind and listen to it based on the config passed in -// -// SocketConfig* config - Configuration for which socket to open -// SocketResult* result - The results of this function (if any, including errors) -// -// e.g. -// SocketConfig server_config = { SocketConfig client_config = { -// .host = "127.0.0.1", .host = "127.0.0.1", -// .port = 8080, .port = 8080, -// .server = true, }; -// .nonblocking = true, -// }; -// SocketResult server_res; SocketResult client_res; -static bool CreateSocket(SocketConfig *config, SocketResult *outresult) -{ - bool success = true; - int addrstatus; - struct addrinfo hints; // Address flags (IPV4, IPV6, UDP?) - struct addrinfo *res; // A pointer to the resulting address list - - outresult->socket->channel = INVALID_SOCKET; - outresult->status = RESULT_FAILURE; - - // Set the socket type - outresult->socket->type = config->type; - - // Set the hints based on information in the config - // - // AI_CANONNAME Causes the ai_canonname of the result to the filled out with the host's canonical (real) name. - // AI_PASSIVE: Causes the result's IP address to be filled out with INADDR_ANY (IPv4)or in6addr_any (IPv6); - // Note: This causes a subsequent call to bind() to auto-fill the IP address - // of the struct sockaddr with the address of the current host. - // - SocketSetHints(config, &hints); - - // Populate address information - addrstatus = getaddrinfo(config->host, // e.g. "www.example.com" or IP (Can be null if AI_PASSIVE flag is set - config->port, // e.g. "http" or port number - &hints, // e.g. SOCK_STREAM/SOCK_DGRAM - &res // The struct to populate - ); - - // Did we succeed? - if (addrstatus != 0) - { - outresult->socket->status = SocketGetLastError(); - TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(outresult->socket->status)); - SocketSetLastError(0); - TRACELOG(LOG_WARNING, "Failed to get resolve host %s:%s: %s", config->host, config->port, SocketGetLastErrorString()); - - return (success = false); - } - else - { - char hoststr[NI_MAXHOST]; - char portstr[NI_MAXSERV]; - //socklen_t client_len = sizeof(struct sockaddr_storage); - //int rc = getnameinfo((struct sockaddr *)res->ai_addr, client_len, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NUMERICHOST | NI_NUMERICSERV); - TRACELOG(LOG_INFO, "Successfully resolved host %s:%s", hoststr, portstr); - } - - // Walk the address information linked-list - struct addrinfo *it; - for (it = res; it != NULL; it = it->ai_next) - { - // Initialise the socket - if (!InitSocket(outresult->socket, it)) - { - outresult->socket->status = SocketGetLastError(); - TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(outresult->socket->status)); - SocketSetLastError(0); - continue; - } - - // Set socket options - if (!SocketSetOptions(config, outresult->socket)) - { - outresult->socket->status = SocketGetLastError(); - TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(outresult->socket->status)); - SocketSetLastError(0); - freeaddrinfo(res); - - return (success = false); - } - } - - if (!IsSocketValid(outresult->socket)) - { - outresult->socket->status = SocketGetLastError(); - TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(outresult->status)); - SocketSetLastError(0); - freeaddrinfo(res); - - return (success = false); - } - - if (success) - { - outresult->status = RESULT_SUCCESS; - outresult->socket->ready = 0; - outresult->socket->status = 0; - - if (!(config->type == SOCKET_UDP)) outresult->socket->isServer = config->server; - - switch (res->ai_addr->sa_family) - { - case AF_INET: - { - outresult->socket->addripv4 = (struct _SocketAddressIPv4 *)RNET_MALLOC(sizeof(*outresult->socket->addripv4)); - - if (outresult->socket->addripv4 != NULL) - { - memset(outresult->socket->addripv4, 0, sizeof(*outresult->socket->addripv4)); - - if (outresult->socket->addripv4 != NULL) - { - memcpy(&outresult->socket->addripv4->address, (struct sockaddr_in *)res->ai_addr, sizeof(struct sockaddr_in)); - - outresult->socket->isIPv6 = false; - char hoststr[NI_MAXHOST]; - char portstr[NI_MAXSERV]; - - socklen_t client_len = sizeof(struct sockaddr_storage); - getnameinfo((struct sockaddr *)&outresult->socket->addripv4->address, client_len, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NUMERICHOST | NI_NUMERICSERV); - - TRACELOG(LOG_INFO, "Socket address set to %s:%s", hoststr, portstr); - } - } - } break; - case AF_INET6: - { - outresult->socket->addripv6 = (struct _SocketAddressIPv6 *)RNET_MALLOC( - sizeof(*outresult->socket->addripv6)); - if (outresult->socket->addripv6 != NULL) - { - memset(outresult->socket->addripv6, 0, - sizeof(*outresult->socket->addripv6)); - if (outresult->socket->addripv6 != NULL) - { - memcpy(&outresult->socket->addripv6->address, - (struct sockaddr_in6 *)res->ai_addr, sizeof(struct sockaddr_in6)); - outresult->socket->isIPv6 = true; - char hoststr[NI_MAXHOST]; - char portstr[NI_MAXSERV]; - socklen_t client_len = sizeof(struct sockaddr_storage); - getnameinfo( - (struct sockaddr *)&outresult->socket->addripv6->address, client_len, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NUMERICHOST | NI_NUMERICSERV); - TRACELOG(LOG_INFO, "Socket address set to %s:%s", hoststr, portstr); - } - } - } break; - default: break; - } - } - - freeaddrinfo(res); - return success; -} - -// Set the state of the Socket sock to blocking -static bool SocketSetBlocking(Socket *sock) -{ - bool ret = true; -#if defined(_WIN32) - unsigned long mode = 0; - ret = ioctlsocket(sock->channel, FIONBIO, &mode); -#else - const int flags = fcntl(sock->channel, F_GETFL, 0); - if (!(flags & O_NONBLOCK)) - { - TRACELOG(LOG_DEBUG, "Socket was already in blocking mode"); - return ret; - } - - ret = (0 == fcntl(sock->channel, F_SETFL, (flags ^ O_NONBLOCK))); -#endif - return ret; -} - -// Set the state of the Socket sock to non-blocking -static bool SocketSetNonBlocking(Socket *sock) -{ - bool ret = true; -#if defined(_WIN32) - unsigned long mode = 1; - ret = ioctlsocket(sock->channel, FIONBIO, &mode); -#else - const int flags = fcntl(sock->channel, F_GETFL, 0); - - if ((flags & O_NONBLOCK)) - { - TRACELOG(LOG_DEBUG, "Socket was already in non-blocking mode"); - return ret; - } - - ret = (0 == fcntl(sock->channel, F_SETFL, (flags | O_NONBLOCK))); -#endif - return ret; -} - -// Set options specified in SocketConfig to Socket sock -static bool SocketSetOptions(SocketConfig *config, Socket *sock) -{ - for (int i = 0; i < SOCKET_MAX_SOCK_OPTS; i++) - { - SocketOpt *opt = &config->sockopts[i]; - - if (opt->id == 0) break; - - if (setsockopt(sock->channel, SOL_SOCKET, opt->id, opt->value, opt->valueLen) < 0) return false; - } - - return true; -} - -// Set "hints" in an addrinfo struct, to be passed to getaddrinfo. -static void SocketSetHints(SocketConfig *config, struct addrinfo *hints) -{ - if (config == NULL || hints == NULL) return; - - memset(hints, 0, sizeof(*hints)); - - // Check if the ip supplied in the config is a valid ipv4 ip ipv6 address - if (IsIPv4Address(config->host)) - { - hints->ai_family = AF_INET; - hints->ai_flags |= AI_NUMERICHOST; - } - else - { - if (IsIPv6Address(config->host)) - { - hints->ai_family = AF_INET6; - hints->ai_flags |= AI_NUMERICHOST; - } - else hints->ai_family = AF_UNSPEC; - } - - if (config->type == SOCKET_UDP) hints->ai_socktype = SOCK_DGRAM; - else hints->ai_socktype = SOCK_STREAM; - - - // Set passive unless UDP client - if (!(config->type == SOCKET_UDP) || config->server) hints->ai_flags = AI_PASSIVE; -} - -//---------------------------------------------------------------------------------- -// Module implementation -//---------------------------------------------------------------------------------- - -// Initialise the network (requires for windows platforms only) -bool InitNetworkDevice(void) -{ -#if defined(_WIN32) - WORD wVersionRequested; - WSADATA wsaData; - - wVersionRequested = MAKEWORD(2, 2); - int err = WSAStartup(wVersionRequested, &wsaData); - - if (err != 0) - { - TRACELOG(LOG_WARNING, "WinSock failed to initialise."); - return false; - } - else TRACELOG(LOG_INFO, "WinSock initialised."); - - if (LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2) - { - TRACELOG(LOG_WARNING, "WinSock failed to initialise."); - WSACleanup(); - return false; - } - - return true; -#else - return true; -#endif -} - -// Cleanup, and close the network -void CloseNetworkDevice(void) -{ -#if defined(_WIN32) - WSACleanup(); -#endif -} - -// Protocol-independent name resolution from an address to an ANSI host name -// and from a port number to the ANSI service name. -// -// The flags parameter can be used to customize processing of the getnameinfo function -// -// The following flags are available: -// -// NAME_INFO_DEFAULT 0x00 // No flags set -// NAME_INFO_NOFQDN 0x01 // Only return nodename portion for local hosts -// NAME_INFO_NUMERICHOST 0x02 // Return numeric form of the host's address -// NAME_INFO_NAMEREQD 0x04 // Error if the host's name not in DNS -// NAME_INFO_NUMERICSERV 0x08 // Return numeric form of the service (port #) -// NAME_INFO_DGRAM 0x10 // Service is a datagram service -void ResolveIP(const char *ip, const char *port, int flags, char *host, char *serv) -{ - // Variables - int status; // Status value to return (0) is success - struct addrinfo hints; // Address flags (IPV4, IPV6, UDP?) - struct addrinfo *res; // A pointer to the resulting address list - - // Set the hints - memset(&hints, 0, sizeof hints); - hints.ai_family = AF_UNSPEC; // Either IPv4 or IPv6 (AF_INET, AF_INET6) - hints.ai_protocol = 0; // Automatically select correct protocol (IPPROTO_TCP), (IPPROTO_UDP) - - // Populate address information - status = getaddrinfo(ip, // e.g. "www.example.com" or IP - port, // e.g. "http" or port number - &hints, // e.g. SOCK_STREAM/SOCK_DGRAM - &res // The struct to populate - ); - - // Did we succeed? - if (status != 0) TRACELOG(LOG_WARNING, "Failed to get resolve host %s:%s: %s", ip, port, gai_strerror(errno)); - else TRACELOG(LOG_DEBUG, "Resolving... %s::%s", ip, port); - - // Attempt to resolve network byte order ip to hostname - switch (res->ai_family) - { - case AF_INET: - { - status = getnameinfo(&*((struct sockaddr *)res->ai_addr), - sizeof(*((struct sockaddr_in *)res->ai_addr)), - host, NI_MAXHOST, serv, NI_MAXSERV, flags); - } break; - case AF_INET6: - { - /* - status = getnameinfo(&*((struct sockaddr_in6 *)res->ai_addr), // TODO. - sizeof(*((struct sockaddr_in6 *)res->ai_addr)), - host, NI_MAXHOST, serv, NI_MAXSERV, flags); - */ - } break; - default: break; - } - - if (status != 0) TRACELOG(LOG_WARNING, "Failed to resolve ip %s: %s", ip, SocketGetLastErrorString()); - else TRACELOG(LOG_DEBUG, "Successfully resolved %s::%s to %s", ip, port, host); - - // Free the pointer to the data returned by addrinfo - freeaddrinfo(res); -} - -// Protocol-independent translation from an ANSI host name to an address -// -// e.g. -// const char* address = "127.0.0.1" (local address) -// const char* port = "80" -// -// Parameters: -// const char* address - A pointer to a NULL-terminated ANSI string that contains a host (node) name or a numeric host address string. -// const char* service - A pointer to a NULL-terminated ANSI string that contains either a service name or port number represented as a string. -// -// Returns: -// The total amount of addresses found, -1 on error -// -int ResolveHost(const char *address, const char *service, int addressType, int flags, AddressInformation *outAddr) -{ - // Variables - int status; // Status value to return (0) is success - struct addrinfo hints; // Address flags (IPV4, IPV6, UDP?) - struct addrinfo *res; // will point to the results - struct addrinfo *iterator; - assert(((address != NULL || address != 0) || (service != NULL || service != 0))); - assert(((addressType == AF_INET) || (addressType == AF_INET6) || (addressType == AF_UNSPEC))); - - // Set the hints - memset(&hints, 0, sizeof hints); - hints.ai_family = addressType; // Either IPv4 or IPv6 (ADDRESS_TYPE_IPV4, ADDRESS_TYPE_IPV6) - hints.ai_protocol = 0; // Automatically select correct protocol (IPPROTO_TCP), (IPPROTO_UDP) - hints.ai_flags = flags; - assert((hints.ai_addrlen == 0) || (hints.ai_addrlen == 0)); - assert((hints.ai_canonname == 0) || (hints.ai_canonname == 0)); - assert((hints.ai_addr == 0) || (hints.ai_addr == 0)); - assert((hints.ai_next == 0) || (hints.ai_next == 0)); - - // When the address is NULL, populate the IP for me - if (address == NULL) - { - if ((hints.ai_flags & AI_PASSIVE) == 0) hints.ai_flags |= AI_PASSIVE; - } - - TRACELOG(LOG_INFO, "Resolving host..."); - - // Populate address information - status = getaddrinfo(address, // e.g. "www.example.com" or IP - service, // e.g. "http" or port number - &hints, // e.g. SOCK_STREAM/SOCK_DGRAM - &res // The struct to populate - ); - - // Did we succeed? - if (status != 0) - { - int error = SocketGetLastError(); - SocketSetLastError(0); - TRACELOG(LOG_WARNING, "Failed to get resolve host: %s", SocketErrorCodeToString(error)); - return -1; - } - else TRACELOG(LOG_INFO, "Successfully resolved host %s:%s", address, service); - - // Calculate the size of the address information list - int size = 0; - for (iterator = res; iterator != NULL; iterator = iterator->ai_next) size++; - - // Validate the size is > 0, otherwise return - if (size <= 0) - { - TRACELOG(LOG_WARNING, "Error, no addresses found."); - return -1; - } - - // If not address list was allocated, allocate it dynamically with the known address size - if (outAddr == NULL) outAddr = (AddressInformation *)RNET_MALLOC(size * sizeof(AddressInformation)); - - // Dynamically allocate an array of address information structs - if (outAddr != NULL) - { - int i; - for (i = 0; i < size; ++i) - { - outAddr[i] = LoadAddress(); - if (outAddr[i] == NULL) - { - break; - } - } - - outAddr[i] = NULL; - if (i != size) outAddr = NULL; - } - else - { - TRACELOG(LOG_WARNING, "Error, failed to dynamically allocate memory for the address list"); - return -1; - } - - // Copy all the address information from res into outAddrList - int i = 0; - for (iterator = res; iterator != NULL; iterator = iterator->ai_next) - { - if (i < size) - { - outAddr[i]->addr.ai_flags = iterator->ai_flags; - outAddr[i]->addr.ai_family = iterator->ai_family; - outAddr[i]->addr.ai_socktype = iterator->ai_socktype; - outAddr[i]->addr.ai_protocol = iterator->ai_protocol; - outAddr[i]->addr.ai_addrlen = iterator->ai_addrlen; - *outAddr[i]->addr.ai_addr = *iterator->ai_addr; -#if NET_DEBUG_ENABLED - TRACELOG(LOG_DEBUG, "GetAddressInformation"); - TRACELOG(LOG_DEBUG, "\tFlags: 0x%x", iterator->ai_flags); - //PrintSocket(outAddr[i]->addr.ai_addr, outAddr[i]->addr.ai_family, outAddr[i]->addr.ai_socktype, outAddr[i]->addr.ai_protocol); - TRACELOG(LOG_DEBUG, "Length of this sockaddr: %d", outAddr[i]->addr.ai_addrlen); - TRACELOG(LOG_DEBUG, "Canonical name: %s", iterator->ai_canonname); -#endif - i++; - } - } - - // Free the pointer to the data returned by addrinfo - freeaddrinfo(res); - - // Return the total count of addresses found - return size; -} - -// This here is the bread and butter of the socket API, This function will -// attempt to open a socket, bind and listen to it based on the config passed in -// -// SocketConfig* config - Configuration for which socket to open -// SocketResult* result - The results of this function (if any, including errors) -// -// e.g. -// SocketConfig server_config = { SocketConfig client_config = { -// .host = "127.0.0.1", .host = "127.0.0.1", -// .port = 8080, .port = 8080, -// .server = true, }; -// .nonblocking = true, -// }; -// SocketResult server_res; SocketResult client_res; -bool SocketCreate(SocketConfig *config, SocketResult *result) -{ - // Socket creation result - bool success = true; - - // Make sure we've not received a null config or result pointer - if (config == NULL || result == NULL) return (success = false); - - // Set the defaults based on the config - if (!SocketSetDefaults(config)) - { - TRACELOG(LOG_WARNING, "Configuration Error."); - success = false; - } - else - { - // Create the socket - if (CreateSocket(config, result)) - { - if (config->nonblocking) SocketSetNonBlocking(result->socket); - else SocketSetBlocking(result->socket); - } - else success = false; - } - - return success; -} - -// Bind a socket to a local address -// Note: The bind function is required on an unconnected socket before subsequent calls to the listen function. -bool SocketBind(SocketConfig *config, SocketResult *result) -{ - bool success = false; - result->status = RESULT_FAILURE; - struct sockaddr_storage *sock_addr = NULL; - - // Don't bind to a socket that isn't configured as a server - if (!IsSocketValid(result->socket) || !config->server) - { - TRACELOG(LOG_WARNING, Cannot bind to socket marked as \"Client\" in SocketConfig."); - success = false; - } - else - { - if (result->socket->isIPv6) sock_addr = (struct sockaddr_storage *)&result->socket->addripv6->address; - else sock_addr = (struct sockaddr_storage *)&result->socket->addripv4->address; - - if (sock_addr != NULL) - { - if (bind(result->socket->channel, (struct sockaddr *)sock_addr, sizeof(*sock_addr)) != SOCKET_ERROR) - { - TRACELOG(LOG_INFO, "Successfully bound socket."); - success = true; - } - else - { - result->socket->status = SocketGetLastError(); - TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(result->socket->status)); - SocketSetLastError(0); - success = false; - } - } - } - - // Was the bind a success? - if (success) - { - result->status = RESULT_SUCCESS; - result->socket->ready = 0; - result->socket->status = 0; - socklen_t sock_len = sizeof(*sock_addr); - - if (getsockname(result->socket->channel, (struct sockaddr *)sock_addr, &sock_len) < 0) - { - TRACELOG(LOG_WARNING, "Couldn't get socket address"); - } - else - { - struct sockaddr_in *s = (struct sockaddr_in *)sock_addr; - // result->socket->address.host = s->sin_addr.s_addr; - // result->socket->address.port = s->sin_port; - - result->socket->addripv4 = (struct _SocketAddressIPv4 *)RNET_MALLOC(sizeof(*result->socket->addripv4)); - - if (result->socket->addripv4 != NULL) memset(result->socket->addripv4, 0, sizeof(*result->socket->addripv4)); - - memcpy(&result->socket->addripv4->address, (struct sockaddr_in *)&s->sin_addr, sizeof(struct sockaddr_in)); - } - } - return success; -} - -// Listens (and queues) incoming connections requests for a bound port. -bool SocketListen(SocketConfig *config, SocketResult *result) -{ - bool success = false; - result->status = RESULT_FAILURE; - - // Don't bind to a socket that isn't configured as a server - if (!IsSocketValid(result->socket) || !config->server) - { - TRACELOG(LOG_WARNING, "Cannot listen on socket marked as \"Client\" in SocketConfig."); - success = false; - } - else - { - // Don't listen on UDP sockets - if (!(config->type == SOCKET_UDP)) - { - if (listen(result->socket->channel, config->backlog_size) != SOCKET_ERROR) - { - TRACELOG(LOG_INFO, "Started listening on socket..."); - success = true; - } - else - { - success = false; - result->socket->status = SocketGetLastError(); - TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(result->socket->status)); - SocketSetLastError(0); - } - } - else - { - TRACELOG(LOG_WARNING, "Cannot listen on socket marked as \"UDP\" (datagram) in SocketConfig."); - success = false; - } - } - - // Was the listen a success? - if (success) - { - result->status = RESULT_SUCCESS; - result->socket->ready = 0; - result->socket->status = 0; - } - - return success; -} - -// Connect the socket to the destination specified by "host" and "port" in SocketConfig -bool SocketConnect(SocketConfig *config, SocketResult *result) -{ - bool success = true; - result->status = RESULT_FAILURE; - - // Only bind to sockets marked as server - if (config->server) - { - TRACELOG(LOG_WARNING, "Cannot connect to socket marked as \"Server\" in SocketConfig."); - success = false; - } - else - { - if (IsIPv4Address(config->host)) - { - struct sockaddr_in ip4addr; - ip4addr.sin_family = AF_INET; - unsigned long hport; - hport = strtoul(config->port, NULL, 0); - ip4addr.sin_port = htons(hport); - - // TODO: Changed the code to avoid the usage of inet_pton and inet_ntop replacing them with getnameinfo (that should have a better support on windows). - - //inet_pton(AF_INET, config->host, &ip4addr.sin_addr); - int connect_result = connect(result->socket->channel, (struct sockaddr *)&ip4addr, sizeof(ip4addr)); - - if (connect_result == SOCKET_ERROR) - { - result->socket->status = SocketGetLastError(); - SocketSetLastError(0); - - switch (result->socket->status) - { - case WSAEWOULDBLOCK: success = true; break; - default: - { - TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(result->socket->status)); - success = false; - } break; - } - } - else - { - TRACELOG(LOG_INFO, "Successfully connected to socket."); - success = true; - } - } - else - { - if (IsIPv6Address(config->host)) - { - struct sockaddr_in6 ip6addr; - ip6addr.sin6_family = AF_INET6; - unsigned long hport; - hport = strtoul(config->port, NULL, 0); - ip6addr.sin6_port = htons(hport); - //inet_pton(AF_INET6, config->host, &ip6addr.sin6_addr); // TODO. - int connect_result = connect(result->socket->channel, (struct sockaddr *)&ip6addr, sizeof(ip6addr)); - - if (connect_result == SOCKET_ERROR) - { - result->socket->status = SocketGetLastError(); - SocketSetLastError(0); - - switch (result->socket->status) - { - case WSAEWOULDBLOCK: success = true; break; - default: - { - TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(result->socket->status)); - success = false; - } break; - } - } - else - { - TRACELOG(LOG_INFO, "Successfully connected to socket."); - success = true; - } - } - } - } - - if (success) - { - result->status = RESULT_SUCCESS; - result->socket->ready = 0; - result->socket->status = 0; - } - - return success; -} - -// Closes an existing socket -// -// SocketChannel socket - The id of the socket to close -void SocketClose(Socket *sock) -{ - if (sock != NULL) - { - if (sock->channel != INVALID_SOCKET) closesocket(sock->channel); - } -} - -// Returns the sockaddress for a specific socket in a generic storage struct -SocketAddressStorage SocketGetPeerAddress(Socket *sock) -{ - // TODO. - /* - if (sock->isServer) return NULL; - if (sock->isIPv6) return sock->addripv6; - else return sock->addripv4; - */ - - return NULL; -} - -// Return the address-type appropriate host portion of a socket address -char *GetSocketAddressHost(SocketAddressStorage storage) -{ - assert(storage->address.ss_family == AF_INET || storage->address.ss_family == AF_INET6); - return SocketAddressToString((struct sockaddr_storage *)storage); -} - -// Return the address-type appropriate port(service) portion of a socket address -short GetSocketAddressPort(SocketAddressStorage storage) -{ - //return ntohs(GetSocketPortPtr(storage)); // TODO. - - return 0; -} - -// The accept function permits an incoming connection attempt on a socket. -// -// SocketChannel listener - The socket to listen for incoming connections on (i.e. server) -// SocketResult* out - The result of this function (if any, including errors) -// -// e.g. -// -// SocketResult connection; -// bool connected = false; -// if (!connected) -// { -// if (SocketAccept(server_res.socket.channel, &connection)) -// { -// connected = true; -// } -// } -Socket *SocketAccept(Socket *server, SocketConfig *config) -{ - if (!server->isServer || server->type == SOCKET_UDP) return NULL; - - struct sockaddr_storage sock_addr; - socklen_t sock_alen; - Socket *sock = LoadSocket(); - server->ready = 0; - sock_alen = sizeof(sock_addr); - sock->channel = accept(server->channel, (struct sockaddr *)&sock_addr, &sock_alen); - - if (sock->channel == INVALID_SOCKET) - { - sock->status = SocketGetLastError(); - TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(sock->status)); - SocketSetLastError(0); - SocketClose(sock); - - return NULL; - } - - (config->nonblocking) ? SocketSetNonBlocking(sock) : SocketSetBlocking(sock); - sock->isServer = false; - sock->ready = 0; - sock->type = server->type; - - switch (sock_addr.ss_family) - { - case AF_INET: - { - struct sockaddr_in *s = ((struct sockaddr_in *)&sock_addr); - sock->addripv4 = (struct _SocketAddressIPv4 *)RNET_MALLOC(sizeof(*sock->addripv4)); - - if (sock->addripv4 != NULL) - { - memset(sock->addripv4, 0, sizeof(*sock->addripv4)); - memcpy(&sock->addripv4->address, (struct sockaddr_in *)&s->sin_addr, sizeof(struct sockaddr_in)); - TRACELOG(LOG_INFO, "Server: Got connection from %s::%hu", SocketAddressToString((struct sockaddr_storage *)s), ntohs(sock->addripv4->address.sin_port)); - } - } break; - case AF_INET6: - { - struct sockaddr_in6 *s = ((struct sockaddr_in6 *)&sock_addr); - sock->addripv6 = (struct _SocketAddressIPv6 *)RNET_MALLOC(sizeof(*sock->addripv6)); - - if (sock->addripv6 != NULL) - { - memset(sock->addripv6, 0, sizeof(*sock->addripv6)); - memcpy(&sock->addripv6->address, (struct sockaddr_in6 *)&s->sin6_addr, sizeof(struct sockaddr_in6)); - TRACELOG(LOG_INFO, "Server: Got connection from %s::%hu", SocketAddressToString((struct sockaddr_storage *)s), ntohs(sock->addripv6->address.sin6_port)); - } - } break; - } - - return sock; -} - -// Verify that the channel is in the valid range -static int ValidChannel(int channel) -{ - if ((channel < 0) || (channel >= SOCKET_MAX_UDPCHANNELS)) - { - TRACELOG(LOG_WARNING, "Invalid channel"); - return 0; - } - - return 1; -} - -// Set the socket channel -int SocketSetChannel(Socket *socket, int channel, const IPAddress *address) -{ - struct UDPChannel *binding; - - if (socket == NULL) - { - TRACELOG(LOG_WARNING, "Passed a NULL socket"); - return (-1); - } - - if (channel == -1) - { - for (channel = 0; channel < SOCKET_MAX_UDPCHANNELS; ++channel) - { - binding = &socket->binding[channel]; - if (binding->numbound < SOCKET_MAX_UDPADDRESSES) break; - } - } - else - { - if (!ValidChannel(channel)) return (-1); - - binding = &socket->binding[channel]; - } - - if (binding->numbound == SOCKET_MAX_UDPADDRESSES) - { - TRACELOG(LOG_WARNING, "No room for new addresses"); - return (-1); - } - - binding->address[binding->numbound++] = *address; - - return (channel); -} - -// Remove the socket channel -void SocketUnsetChannel(Socket *socket, int channel) -{ - if ((channel >= 0) && (channel < SOCKET_MAX_UDPCHANNELS)) socket->binding[channel].numbound = 0; -} - -/* Allocate/free a single UDP packet 'size' bytes long. - The new packet is returned, or NULL if the function ran out of memory. - */ -SocketDataPacket *AllocPacket(int size) -{ - SocketDataPacket *packet = (SocketDataPacket *)RNET_MALLOC(sizeof(*packet)); - int error = 1; - - if (packet != NULL) - { - packet->maxlen = size; - packet->data = (uint8_t *)RNET_MALLOC(size); - if (packet->data != NULL) - { - error = 0; - } - } - - if (error) - { - FreePacket(packet); - packet = NULL; - } - - return (packet); -} - -int ResizePacket(SocketDataPacket *packet, int newsize) -{ - uint8_t *newdata = (uint8_t *)RNET_MALLOC(newsize); - - if (newdata != NULL) - { - RNET_FREE(packet->data); - packet->data = newdata; - packet->maxlen = newsize; - } - - return (packet->maxlen); -} - -void FreePacket(SocketDataPacket *packet) -{ - if (packet) - { - RNET_FREE(packet->data); - RNET_FREE(packet); - } -} - -// Allocate/Free a UDP packet vector (array of packets) of 'howmany' packets, each 'size' bytes long. -// A pointer to the packet array is returned, or NULL if the function ran out of memory. -SocketDataPacket **AllocPacketList(int howmany, int size) -{ - SocketDataPacket **packetV = (SocketDataPacket **)RNET_MALLOC((howmany + 1) * sizeof(*packetV)); - - if (packetV != NULL) - { - int i; - for (i = 0; i < howmany; ++i) - { - packetV[i] = AllocPacket(size); - if (packetV[i] == NULL) - { - break; - } - } - packetV[i] = NULL; - - if (i != howmany) - { - FreePacketList(packetV); - packetV = NULL; - } - } - - return (packetV); -} - -void FreePacketList(SocketDataPacket **packetV) -{ - if (packetV) - { - for (int i = 0; packetV[i]; ++i) FreePacket(packetV[i]); - RNET_FREE(packetV); - } -} - -// Send 'len' bytes of 'data' over the non-server socket 'sock' -int SocketSend(Socket *sock, const void *datap, int length) -{ - int sent = 0; - int left = length; - int status = -1; - int numsent = 0; - const unsigned char *data = (const unsigned char *)datap; - - // Server sockets are for accepting connections only - if (sock->isServer) - { - TRACELOG(LOG_WARNING, "Cannot send information on a server socket"); - return -1; - } - - // Which socket are we trying to send data on - switch (sock->type) - { - case SOCKET_TCP: - { - SocketSetLastError(0); - do - { - length = send(sock->channel, (const char *)data, left, 0); - if (length > 0) - { - sent += length; - left -= length; - data += length; - } - } while ((left > 0) && // While we still have bytes left to send - ((length > 0) || // The amount of bytes we actually sent is > 0 - (SocketGetLastError() == WSAEINTR)) // The socket was interupted - ); - - if (length == SOCKET_ERROR) - { - sock->status = SocketGetLastError(); - TRACELOG(LOG_DEBUG, "Socket Error: %s", SocketErrorCodeToString(sock->status)); - SocketSetLastError(0); - } - else TRACELOG(LOG_DEBUG, "Successfully sent \"%s\" (%d bytes)", datap, sent); - - return sent; - } break; - case SOCKET_UDP: - { - SocketSetLastError(0); - - if (sock->isIPv6) status = sendto(sock->channel, (const char *)data, left, 0, (struct sockaddr *)&sock->addripv6->address, sizeof(sock->addripv6->address)); - else status = sendto(sock->channel, (const char *)data, left, 0, (struct sockaddr *)&sock->addripv4->address, sizeof(sock->addripv4->address)); - - if (sent >= 0) - { - sock->status = 0; - ++numsent; - TRACELOG(LOG_DEBUG, "Successfully sent \"%s\" (%d bytes)", datap, status); - } - else - { - sock->status = SocketGetLastError(); - TRACELOG(LOG_DEBUG, "Socket Error: %s", SocketGetLastErrorString(sock->status)); - SocketSetLastError(0); - return 0; - } - - return numsent; - } break; - default: break; - } - - return -1; -} - -// Receive up to 'maxlen' bytes of data over the non-server socket 'sock', -// and store them in the buffer pointed to by 'data'. -// This function returns the actual amount of data received. If the return -// value is less than or equal to zero, then either the remote connection was -// closed, or an unknown socket error occurred. -int SocketReceive(Socket *sock, void *data, int maxlen) -{ - int len = 0; - int numrecv = 0; - int status = 0; - socklen_t sock_len; - struct sockaddr_storage sock_addr; - //char ip[INET6_ADDRSTRLEN]; - - // Server sockets are for accepting connections only - if (sock->isServer && (sock->type == SOCKET_TCP)) - { - sock->status = SocketGetLastError(); - TRACELOG(LOG_DEBUG, "Socket Error: %s", "Server sockets cannot be used to receive data"); - SocketSetLastError(0); - return 0; - } - - // Which socket are we trying to send data on - switch (sock->type) - { - case SOCKET_TCP: - { - SocketSetLastError(0); - do - { - len = recv(sock->channel, (char *)data, maxlen, 0); - } while (SocketGetLastError() == WSAEINTR); - - if (len > 0) - { - // Who sent the packet? - if (sock->type == SOCKET_UDP) - { - //TRACELOG(LOG_DEBUG, "Received data from: %s", inet_ntop(sock_addr.ss_family, GetSocketAddressPtr((struct sockaddr *)&sock_addr), ip, sizeof(ip))); - } - - ((unsigned char *)data)[len] = '\0'; // Add null terminating character to the end of the stream - TRACELOG(LOG_DEBUG, "Received \"%s\" (%d bytes)", data, len); - } - - sock->ready = 0; - return len; - } break; - case SOCKET_UDP: - { - SocketSetLastError(0); - sock_len = sizeof(sock_addr); - status = recvfrom(sock->channel, // The receving channel - data, // A pointer to the data buffer to fill - maxlen, // The max length of the data to fill - 0, // Flags - (struct sockaddr *)&sock_addr, // The address of the recevied data - &sock_len // The length of the received data address - ); - - if (status >= 0) ++numrecv; - else - { - sock->status = SocketGetLastError(); - - switch (sock->status) - { - case WSAEWOULDBLOCK: break; - default: TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(sock->status)); break; - } - - SocketSetLastError(0); - return 0; - } - - sock->ready = 0; - return numrecv; - } break; - default: break; - } - - return -1; -} - -// Does the socket have it's 'ready' flag set? -bool IsSocketReady(Socket *sock) -{ - return (sock != NULL) && (sock->ready); -} - -// Check if the socket is considered connected -bool IsSocketConnected(Socket *sock) -{ -#if defined(_WIN32) - FD_SET writefds; - FD_ZERO(&writefds); - FD_SET(sock->channel, &writefds); - struct timeval timeout; - timeout.tv_sec = 1; - timeout.tv_usec = 1000000000UL; - int total = select(0, NULL, &writefds, NULL, &timeout); - - if (total == -1) - { // Error - sock->status = SocketGetLastError(); - TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(sock->status)); - SocketSetLastError(0); - } - else if (total == 0) return false; // Timeout - else if (FD_ISSET(sock->channel, &writefds)) return true; - - return false; -#else - return true; -#endif -} - -// Allocate and return a SocketResult struct -SocketResult *LoadSocketResult(void) -{ - struct SocketResult *res = (struct SocketResult *)RNET_MALLOC(sizeof(*res)); - - if (res != NULL) - { - memset(res, 0, sizeof(*res)); - if ((res->socket = LoadSocket()) == NULL) - { - RNET_FREE(res); - res = NULL; - } - } - - return res; -} - -// Free an allocated SocketResult -void UnloadSocketResult(SocketResult **result) -{ - if (*result != NULL) - { - if ((*result)->socket != NULL) UnloadSocket(&((*result)->socket)); - - RNET_FREE(*result); - *result = NULL; - } -} - -// Allocate a Socket -Socket *LoadSocket(void) -{ - struct Socket *sock; - sock = (Socket *)RNET_MALLOC(sizeof(*sock)); - - if (sock != NULL) memset(sock, 0, sizeof(*sock)); - else - { - TRACELOG(LOG_WARNING, "Ran out of memory attempting to allocate a socket"); - SocketClose(sock); - RNET_FREE(sock); - sock = NULL; - } - - return sock; -} - -// Free an allocated Socket -void UnloadSocket(Socket **sock) -{ - if (*sock != NULL) - { - RNET_FREE(*sock); - *sock = NULL; - } -} - -// Allocate a SocketSet -SocketSet *LoadSocketSet(int max) -{ - struct SocketSet *set = (struct SocketSet *)RNET_MALLOC(sizeof(*set)); - - if (set != NULL) - { - set->numsockets = 0; - set->maxsockets = max; - set->sockets = (struct Socket **)RNET_MALLOC(max * sizeof(*set->sockets)); - if (set->sockets != NULL) - { - for (int i = 0; i < max; ++i) set->sockets[i] = NULL; - } - else - { - RNET_FREE(set); - set = NULL; - } - } - - return (set); -} - -// Free an allocated SocketSet -void UnloadSocketSet(SocketSet *set) -{ - if (set) - { - RNET_FREE(set->sockets); - RNET_FREE(set); - } -} - -// Add a Socket "sock" to the SocketSet "set" -int AddSocket(SocketSet *set, Socket *sock) -{ - if (sock != NULL) - { - if (set->numsockets == set->maxsockets) - { - TRACELOG(LOG_DEBUG, "Socket Error: %s", "SocketSet is full"); - SocketSetLastError(0); - return (-1); - } - set->sockets[set->numsockets++] = (struct Socket *)sock; - } - else - { - TRACELOG(LOG_DEBUG, "Socket Error: %s", "Socket was null"); - SocketSetLastError(0); - return (-1); - } - - return (set->numsockets); -} - -// Remove a Socket "sock" to the SocketSet "set" -int RemoveSocket(SocketSet *set, Socket *sock) -{ - if (sock != NULL) - { - int i = 0; - for (i = 0; i < set->numsockets; ++i) - { - if (set->sockets[i] == (struct Socket *)sock) break; - } - - if (i == set->numsockets) - { - TRACELOG(LOG_DEBUG, "Socket Error: %s", "Socket not found"); - SocketSetLastError(0); - return (-1); - } - - --set->numsockets; - for (; i < set->numsockets; ++i) set->sockets[i] = set->sockets[i + 1]; - } - - return (set->numsockets); -} - -// Check the sockets in the socket set for pending information -int CheckSockets(SocketSet *set, unsigned int timeout) -{ - int i; - SOCKET maxfd; - int retval; - struct timeval tv; - fd_set mask; - - /* Find the largest file descriptor */ - maxfd = 0; - for (i = set->numsockets - 1; i >= 0; --i) - { - if (set->sockets[i]->channel > maxfd) - { - maxfd = set->sockets[i]->channel; - } - } - - // Check the file descriptors for available data - do - { - SocketSetLastError(0); - - // Set up the mask of file descriptors - FD_ZERO(&mask); - for (i = set->numsockets - 1; i >= 0; --i) - { - FD_SET(set->sockets[i]->channel, &mask); - } // Set up the timeout - - tv.tv_sec = timeout / 1000; - tv.tv_usec = (timeout % 1000) * 1000; - - /* Look! */ - retval = select(maxfd + 1, &mask, NULL, NULL, &tv); - } while (SocketGetLastError() == WSAEINTR); - - // Mark all file descriptors ready that have data available - if (retval > 0) - { - for (i = set->numsockets - 1; i >= 0; --i) - { - if (FD_ISSET(set->sockets[i]->channel, &mask)) set->sockets[i]->ready = 1; - } - } - - return retval; -} - -// Allocate an AddressInformation -AddressInformation LoadAddress(void) -{ - AddressInformation addressInfo = NULL; - addressInfo = (AddressInformation)RNET_CALLOC(1, sizeof(*addressInfo)); - - if (addressInfo != NULL) - { - addressInfo->addr.ai_addr = (struct sockaddr *)RNET_CALLOC(1, sizeof(struct sockaddr)); - if (addressInfo->addr.ai_addr == NULL) TRACELOG(LOG_WARNING, "Failed to allocate memory for \"struct sockaddr\""); - } - else TRACELOG(LOG_WARNING, "Failed to allocate memory for \"struct AddressInformation\""); - - return addressInfo; -} - -// Free an AddressInformation struct -void UnloadAddress(AddressInformation *addressInfo) -{ - if (*addressInfo != NULL) - { - if ((*addressInfo)->addr.ai_addr != NULL) - { - RNET_FREE((*addressInfo)->addr.ai_addr); - (*addressInfo)->addr.ai_addr = NULL; - } - - RNET_FREE(*addressInfo); - *addressInfo = NULL; - } -} - -// Allocate a list of AddressInformation -AddressInformation *LoadAddressList(int size) -{ - AddressInformation *addr; - addr = (AddressInformation *)RNET_MALLOC(size * sizeof(AddressInformation)); - return addr; -} - -// Opaque datatype accessor addrinfo->ai_family -int GetAddressFamily(AddressInformation address) -{ - return address->addr.ai_family; -} - -// Opaque datatype accessor addrinfo->ai_socktype -int GetAddressSocketType(AddressInformation address) -{ - return address->addr.ai_socktype; -} - -// Opaque datatype accessor addrinfo->ai_protocol -int GetAddressProtocol(AddressInformation address) -{ - return address->addr.ai_protocol; -} - -// Opaque datatype accessor addrinfo->ai_canonname -char *GetAddressCanonName(AddressInformation address) -{ - return address->addr.ai_canonname; -} - -// Opaque datatype accessor addrinfo->ai_addr -char *GetAddressHostAndPort(AddressInformation address, char *outhost, int *outport) -{ - //char *ip[INET6_ADDRSTRLEN]; - char *result = NULL; - struct sockaddr_storage *storage = (struct sockaddr_storage *)address->addr.ai_addr; - - switch (storage->ss_family) - { - case AF_INET: - { - struct sockaddr_in *s = ((struct sockaddr_in *)address->addr.ai_addr); - //result = inet_ntop(AF_INET, &s->sin_addr, ip, INET_ADDRSTRLEN); // TODO. - *outport = ntohs(s->sin_port); - } break; - case AF_INET6: - { - struct sockaddr_in6 *s = ((struct sockaddr_in6 *)address->addr.ai_addr); - //result = inet_ntop(AF_INET6, &s->sin6_addr, ip, INET6_ADDRSTRLEN); // TODO. - *outport = ntohs(s->sin6_port); - } break; - default: break; - } - - if (result == NULL) - { - TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(SocketGetLastError())); - SocketSetLastError(0); - } - else - { - strcpy(outhost, result); - } - return result; -} - -// -void PacketSend(Packet *packet) -{ - TRACELOG(LOG_INFO, "Sending packet (%s) with size %d\n", packet->data, packet->size); -} - -// -void PacketReceive(Packet *packet) -{ - TRACELOG(LOG_INFO, "Receiving packet (%s) with size %d\n", packet->data, packet->size); -} - -// -void PacketWrite16(Packet *packet, uint16_t value) -{ - TRACELOG(LOG_INFO, "Original: 0x%04" PRIX16 " - %" PRIu16 "\n", value, value); - uint8_t *data = packet->data + packet->offs; - *data++ = (uint8_t)(value >> 8); - *data++ = (uint8_t)(value); - packet->size += sizeof(uint16_t); - packet->offs += sizeof(uint16_t); - TRACELOG(LOG_INFO, "Network: 0x%04" PRIX16 " - %" PRIu16 "\n", (uint16_t) *data, (uint16_t) *data); -} - -// -void PacketWrite32(Packet *packet, uint32_t value) -{ - TRACELOG(LOG_INFO, "Original: 0x%08" PRIX32 " - %" PRIu32 "\n", value, value); - uint8_t *data = packet->data + packet->offs; - *data++ = (uint8_t)(value >> 24); - *data++ = (uint8_t)(value >> 16); - *data++ = (uint8_t)(value >> 8); - *data++ = (uint8_t)(value); - packet->size += sizeof(uint32_t); - packet->offs += sizeof(uint32_t); - - TRACELOG(LOG_INFO, "Network: 0x%08" PRIX32 " - %" PRIu32 "\n", - (uint32_t)(((intptr_t) packet->data) - packet->offs), - (uint32_t)(((intptr_t) packet->data) - packet->offs)); -} - -// -void PacketWrite64(Packet *packet, uint64_t value) -{ - TRACELOG(LOG_INFO, "Original: 0x%016" PRIX64 " - %" PRIu64 "\n", value, value); - - uint8_t *data = packet->data + packet->offs; - *data++ = (uint8_t)(value >> 56); - *data++ = (uint8_t)(value >> 48); - *data++ = (uint8_t)(value >> 40); - *data++ = (uint8_t)(value >> 32); - *data++ = (uint8_t)(value >> 24); - *data++ = (uint8_t)(value >> 16); - *data++ = (uint8_t)(value >> 8); - *data++ = (uint8_t)(value); - packet->size += sizeof(uint64_t); - packet->offs += sizeof(uint64_t); - - TRACELOG(LOG_INFO, "Network: 0x%016" PRIX64 " - %" PRIu64 "\n", (uint64_t)(packet->data - packet->offs), (uint64_t)(packet->data - packet->offs)); -} - -// -uint16_t PacketRead16(Packet *packet) -{ - uint8_t *data = packet->data + packet->offs; - packet->size += sizeof(uint16_t); - packet->offs += sizeof(uint16_t); - uint16_t value = ((uint16_t) data[0] << 8) | data[1]; - TRACELOG(LOG_INFO, "Original: 0x%04" PRIX16 " - %" PRIu16 "\n", value, value); - - return value; -} - -// -uint32_t PacketRead32(Packet *packet) -{ - uint8_t *data = packet->data + packet->offs; - packet->size += sizeof(uint32_t); - packet->offs += sizeof(uint32_t); - uint32_t value = ((uint32_t) data[0] << 24) | ((uint32_t) data[1] << 16) | ((uint32_t) data[2] << 8) | data[3]; - TRACELOG(LOG_INFO, "Original: 0x%08" PRIX32 " - %" PRIu32 "\n", value, value); - - return value; -} - -// -uint64_t PacketRead64(Packet *packet) -{ - uint8_t *data = packet->data + packet->offs; - packet->size += sizeof(uint64_t); - packet->offs += sizeof(uint64_t); - uint64_t value = ((uint64_t) data[0] << 56) | ((uint64_t) data[1] << 48) | ((uint64_t) data[2] << 40) | ((uint64_t) data[3] << 32) | ((uint64_t) data[4] << 24) | ((uint64_t) data[5] << 16) | ((uint64_t) data[6] << 8) | data[7]; - TRACELOG(LOG_INFO, "Original: 0x%016" PRIX64 " - %" PRIu64 "\n", value, value); - - return value; -} - +/********************************************************************************************** +* +* rnet - A simple and easy-to-use network module for raylib +* +* FEATURES: +* - Provides a simple and (hopefully) easy to use wrapper around the Berkeley socket API +* +* INSPIRED BY: +* SFML Sockets - https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1Socket.php +* SDL_net - https://www.libsdl.org/projects/SDL_net/ +* BSD Sockets - https://www.gnu.org/software/libc/manual/html_node/Sockets.html +* BEEJ - https://beej.us/guide/bgnet/html/single/bgnet.html +* Winsock2 - https://docs.microsoft.com/en-us/windows/desktop/api/winsock2 +* +* CONTRIBUTORS: +* Jak Barnes (github: @syphonx) (Feb. 2019) - Initial version +* +* +* LICENSE: zlib/libpng +* +* Copyright (c) 2019-2020 Jak Barnes (@syphonx) and Ramon Santamaria (@raysan5) +* +* This software is provided "as-is", without any express or implied warranty. In no event +* will the authors be held liable for any damages arising from the use of this software. +* +* Permission is granted to anyone to use this software for any purpose, including commercial +* applications, and to alter it and redistribute it freely, subject to the following restrictions: +* +* 1. The origin of this software must not be misrepresented; you must not claim that you +* wrote the original software. If you use this software in a product, an acknowledgment +* in the product documentation would be appreciated but is not required. +* +* 2. Altered source versions must be plainly marked as such, and must not be misrepresented +* as being the original software. +* +* 3. This notice may not be removed or altered from any source distribution. +* +**********************************************************************************************/ + +#ifndef RNET_H +#define RNET_H + +#include // Required for limits +#include // Required for platform type sizes + +//---------------------------------------------------------------------------------- +// Defines and Macros +//---------------------------------------------------------------------------------- + +// Undefine any conflicting windows.h symbols +// If defined, the following flags inhibit definition of the indicated items. +#define NOGDICAPMASKS // CC_*, LC_*, PC_*, CP_*, TC_*, RC_ +#define NOVIRTUALKEYCODES // VK_* +#define NOWINMESSAGES // WM_*, EM_*, LB_*, CB_* +#define NOWINSTYLES // WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_* +#define NOSYSMETRICS // SM_* +#define NOMENUS // MF_* +#define NOICONS // IDI_* +#define NOKEYSTATES // MK_* +#define NOSYSCOMMANDS // SC_* +#define NORASTEROPS // Binary and Tertiary raster ops +#define NOSHOWWINDOW // SW_* +#define OEMRESOURCE // OEM Resource values +#define NOATOM // Atom Manager routines +#define NOCLIPBOARD // Clipboard routines +#define NOCOLOR // Screen colors +#define NOCTLMGR // Control and Dialog routines +#define NODRAWTEXT // DrawText() and DT_* +#define NOGDI // All GDI defines and routines +#define NOKERNEL // All KERNEL defines and routines +#define NOUSER // All USER defines and routines +#define NONLS // All NLS defines and routines +#define NOMB // MB_* and MessageBox() +#define NOMEMMGR // GMEM_*, LMEM_*, GHND, LHND, associated routines +#define NOMETAFILE // typedef METAFILEPICT +#define NOMINMAX // Macros min(a,b) and max(a,b) +#define NOMSG // typedef MSG and associated routines +#define NOOPENFILE // OpenFile(), OemToAnsi, AnsiToOem, and OF_* +#define NOSCROLL // SB_* and scrolling routines +#define NOSERVICE // All Service Controller routines, SERVICE_ equates, etc. +#define NOSOUND // Sound driver routines +#define NOTEXTMETRIC // typedef TEXTMETRIC and associated routines +#define NOWH // SetWindowsHook and WH_* +#define NOWINOFFSETS // GWL_*, GCL_*, associated routines +#define NOCOMM // COMM driver routines +#define NOKANJI // Kanji support stuff. +#define NOHELP // Help engine interface. +#define NOPROFILER // Profiler interface. +#define NODEFERWINDOWPOS // DeferWindowPos routines +#define NOMCX // Modem Configuration Extensions +#define MMNOSOUND + +// Allow custom memory allocators +#ifndef RNET_MALLOC + #define RNET_MALLOC(sz) malloc(sz) +#endif +#ifndef RNET_CALLOC + #define RNET_CALLOC(n,sz) calloc(n,sz) +#endif +#ifndef RNET_FREE + #define RNET_FREE(p) free(p) +#endif + +//---------------------------------------------------------------------------------- +// Platform type definitions +// From: https://github.com/DFHack/clsocket/blob/master/src/Host.h +//---------------------------------------------------------------------------------- + +#ifdef WIN32 +typedef int socklen_t; +#endif + +#ifndef RESULT_SUCCESS +# define RESULT_SUCCESS 0 +#endif // RESULT_SUCCESS + +#ifndef RESULT_FAILURE +# define RESULT_FAILURE 1 +#endif // RESULT_FAILURE + +#ifndef htonll +# ifdef _BIG_ENDIAN +# define htonll(x) (x) +# define ntohll(x) (x) +# else +# define htonll(x) ((((uint64) htonl(x)) << 32) + htonl(x >> 32)) +# define ntohll(x) ((((uint64) ntohl(x)) << 32) + ntohl(x >> 32)) +# endif // _BIG_ENDIAN +#endif // htonll + +//---------------------------------------------------------------------------------- +// Platform specific network includes +// From: https://github.com/SDL-mirror/SDL_net/blob/master/SDLnetsys.h +//---------------------------------------------------------------------------------- + +// Include system network headers +#if defined(_WIN32) // Windows + #define __USE_W32_SOCKETS + #define WIN32_LEAN_AND_MEAN + #include + #include + #include + #define IPTOS_LOWDELAY 0x10 +#else // Unix + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#endif + +#ifndef INVALID_SOCKET + #define INVALID_SOCKET ~(0) +#endif + +#ifndef __USE_W32_SOCKETS + #define closesocket close + #define SOCKET int + #define INVALID_SOCKET -1 + #define SOCKET_ERROR -1 +#endif + +#ifdef __USE_W32_SOCKETS + #ifndef EINTR + #define EINTR WSAEINTR + #endif +#endif + +//---------------------------------------------------------------------------------- +// Module defines +//---------------------------------------------------------------------------------- + +// Network connection related defines +#define SOCKET_MAX_SET_SIZE 32 // Maximum sockets in a set +#define SOCKET_MAX_QUEUE_SIZE 16 // Maximum socket queue size +#define SOCKET_MAX_SOCK_OPTS 4 // Maximum socket options +#define SOCKET_MAX_UDPCHANNELS 32 // Maximum UDP channels +#define SOCKET_MAX_UDPADDRESSES 4 // Maximum bound UDP addresses + +// Network address related defines +#define ADDRESS_IPV4_ADDRSTRLEN 22 // IPv4 string length +#define ADDRESS_IPV6_ADDRSTRLEN 65 // IPv6 string length +#define ADDRESS_TYPE_ANY 0 // AF_UNSPEC +#define ADDRESS_TYPE_IPV4 2 // AF_INET +#define ADDRESS_TYPE_IPV6 23 // AF_INET6 +#define ADDRESS_MAXHOST 1025 // Max size of a fully-qualified domain name +#define ADDRESS_MAXSERV 32 // Max size of a service name + +// Network address related defines +#define ADDRESS_ANY (unsigned long)0x00000000 +#define ADDRESS_LOOPBACK 0x7f000001 +#define ADDRESS_BROADCAST (unsigned long)0xffffffff +#define ADDRESS_NONE 0xffffffff + +// Network resolution related defines +#define NAME_INFO_DEFAULT 0x00 // No flags set +#define NAME_INFO_NOFQDN 0x01 // Only return nodename portion for local hosts +#define NAME_INFO_NUMERICHOST 0x02 // Return numeric form of the host's address +#define NAME_INFO_NAMEREQD 0x04 // Error if the host's name not in DNS +#define NAME_INFO_NUMERICSERV 0x08 // Return numeric form of the service (port #) +#define NAME_INFO_DGRAM 0x10 // Service is a datagram service + +// Address resolution related defines +#if defined(_WIN32) + #define ADDRESS_INFO_PASSIVE (0x00000001) // Socket address will be used in bind() call + #define ADDRESS_INFO_CANONNAME (0x00000002) // Return canonical name in first ai_canonname + #define ADDRESS_INFO_NUMERICHOST (0x00000004) // Nodename must be a numeric address string + #define ADDRESS_INFO_NUMERICSERV (0x00000008) // Servicename must be a numeric port number + #define ADDRESS_INFO_DNS_ONLY (0x00000010) // Restrict queries to unicast DNS only (no LLMNR, netbios, etc.) + #define ADDRESS_INFO_ALL (0x00000100) // Query both IP6 and IP4 with AI_V4MAPPED + #define ADDRESS_INFO_ADDRCONFIG (0x00000400) // Resolution only if global address configured + #define ADDRESS_INFO_V4MAPPED (0x00000800) // On v6 failure, query v4 and convert to V4MAPPED format + #define ADDRESS_INFO_NON_AUTHORITATIVE (0x00004000) // LUP_NON_AUTHORITATIVE + #define ADDRESS_INFO_SECURE (0x00008000) // LUP_SECURE + #define ADDRESS_INFO_RETURN_PREFERRED_NAMES (0x00010000) // LUP_RETURN_PREFERRED_NAMES + #define ADDRESS_INFO_FQDN (0x00020000) // Return the FQDN in ai_canonname + #define ADDRESS_INFO_FILESERVER (0x00040000) // Resolving fileserver name resolution + #define ADDRESS_INFO_DISABLE_IDN_ENCODING (0x00080000) // Disable Internationalized Domain Names handling + #define ADDRESS_INFO_EXTENDED (0x80000000) // Indicates this is extended ADDRINFOEX(2/..) struct + #define ADDRESS_INFO_RESOLUTION_HANDLE (0x40000000) // Request resolution handle +#endif + +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- + +// Boolean type +#ifdef _WIN32 + #include +#else +#if defined(__STDC__) && __STDC_VERSION__ >= 199901L + #include +#elif !defined(__cplusplus) && !defined(bool) + typedef enum { false, true } bool; +#endif +#endif + +typedef enum { + SOCKET_TCP = 0, // SOCK_STREAM + SOCKET_UDP = 1 // SOCK_DGRAM +} SocketType; + +// Network typedefs +typedef uint32_t SocketChannel; +typedef struct _AddressInformation *AddressInformation; +typedef struct _SocketAddress *SocketAddress; +typedef struct _SocketAddressIPv4 *SocketAddressIPv4; +typedef struct _SocketAddressIPv6 *SocketAddressIPv6; +typedef struct _SocketAddressStorage *SocketAddressStorage; + +// IPAddress definition (in network byte order) +typedef struct IPAddress { + unsigned long host; // 32-bit IPv4 host address + unsigned short port; // 16-bit protocol port +} IPAddress; + +typedef struct UDPChannel { + int numbound; // The total number of addresses this channel is bound to + IPAddress address[SOCKET_MAX_UDPADDRESSES]; // The list of remote addresses this channel is bound to +} UDPChannel; + +// An option ID, value, sizeof(value) tuple for setsockopt(2). +typedef struct SocketOpt { + int id; // Socked option id + int valueLen; // Socked option value len + void *value; // Socked option value data +} SocketOpt; + +typedef struct Socket { + int ready; // Is the socket ready? i.e. has information + int status; // The last status code to have occured using this socket + bool isServer; // Is this socket a server socket (i.e. TCP/UDP Listen Server) + SocketChannel channel; // The socket handle id + SocketType type; // Is this socket a TCP or UDP socket? + + bool isIPv6; // Is this socket address an ipv6 address? + SocketAddressIPv4 addripv4; // The host/target IPv4 for this socket (in network byte order) + SocketAddressIPv6 addripv6; // The host/target IPv6 for this socket (in network byte order) + + struct UDPChannel binding[SOCKET_MAX_UDPCHANNELS]; // The amount of channels (if UDP) this socket is bound to +} Socket; + +// Configuration for a socket +typedef struct SocketConfig { + SocketType type; // The type of socket, TCP/UDP + char *host; // The host address in xxx.xxx.xxx.xxx form + char *port; // The target port/service in the form "http" or "25565" + bool server; // Listen for incoming clients? + bool nonblocking; // non-blocking operation? + int backlog_size; // set a custom backlog size + SocketOpt sockopts[SOCKET_MAX_SOCK_OPTS]; +} SocketConfig; + +typedef struct SocketDataPacket { + IPAddress address; // The source/dest address of an incoming/outgoing packet + int channel; // The src/dst channel of the packet + int maxlen; // The size of the data buffer + int status; // Packet status after sending + unsigned int len; // The length of the packet data + unsigned char *data; // The packet data +} SocketDataPacket; + +// Result from calling open with a given config +typedef struct SocketResult { + int status; // Socket result state + Socket *socket; // Socket ref +} SocketResult; + +typedef struct SocketSet { + int numsockets; // Socket set count + int maxsockets; // Socket set max + struct Socket **sockets; // Sockets array +} SocketSet; + +// Packet type +typedef struct Packet { + uint32_t size; // The total size of bytes in data + uint32_t offs; // The offset to data access + uint32_t maxs; // The max size of data + uint8_t *data; // Data stored in network byte order +} Packet; + + +#ifdef __cplusplus +extern "C" { // Prevents name mangling of functions +#endif + +//---------------------------------------------------------------------------------- +// Global Variables Definition +//---------------------------------------------------------------------------------- +//... + +//---------------------------------------------------------------------------------- +// Module Functions Declaration +//---------------------------------------------------------------------------------- + +// Initialisation and cleanup +bool InitNetworkDevice(void); +void CloseNetworkDevice(void); + +// Address API +void ResolveIP(const char *ip, const char *service, int flags, char *outhost, char *outserv); +int ResolveHost(const char *address, const char *service, int addressType, int flags, AddressInformation *outAddr); +int GetAddressFamily(AddressInformation address); +int GetAddressSocketType(AddressInformation address); +int GetAddressProtocol(AddressInformation address); +char *GetAddressCanonName(AddressInformation address); +char *GetAddressHostAndPort(AddressInformation address, char *outhost, unsigned short *outport); + +// Address Memory API +AddressInformation LoadAddress(void); +void UnloadAddress(AddressInformation *addressInfo); +AddressInformation *LoadAddressList(int size); + +// Socket API +bool SocketCreate(SocketConfig *config, SocketResult *result); +bool SocketBind(SocketConfig *config, SocketResult *result); +bool SocketListen(SocketConfig *config, SocketResult *result); +bool SocketConnect(SocketConfig *config, SocketResult *result); +Socket *SocketAccept(Socket *server, SocketConfig *config); + +// General Socket API +int SocketSend(Socket *sock, const void *datap, int len); +int SocketReceive(Socket *sock, void *data, int maxlen); +SocketAddressStorage SocketGetPeerAddress(Socket *sock); +const char *GetSocketAddressHost(SocketAddressStorage storage); +short GetSocketAddressPort(SocketAddressStorage storage); +void SocketClose(Socket *sock); + +// UDP Socket API +int SocketSetChannel(Socket *socket, int channel, const IPAddress *address); +void SocketUnsetChannel(Socket *socket, int channel); + +// UDP DataPacket API +SocketDataPacket *AllocPacket(int size); +int ResizePacket(SocketDataPacket *packet, int newsize); +void FreePacket(SocketDataPacket *packet); +SocketDataPacket **AllocPacketList(int count, int size); +void FreePacketList(SocketDataPacket **packets); + +// Socket Memory API +Socket *LoadSocket(void); +void UnloadSocket(Socket **sock); +SocketResult *LoadSocketResult(void); +void UnloadSocketResult(SocketResult **result); +SocketSet *LoadSocketSet(int max); +void UnloadSocketSet(SocketSet *sockset); + +// Socket I/O API +bool IsSocketReady(Socket *sock); +bool IsSocketConnected(Socket *sock); +int AddSocket(SocketSet *set, Socket *sock); +int RemoveSocket(SocketSet *set, Socket *sock); +int CheckSockets(SocketSet *set, unsigned int timeout); + +// Packet API +void PacketSend(Packet *packet); +void PacketReceive(Packet *packet); +void PacketWrite8(Packet *packet, uint16_t value); +void PacketWrite16(Packet *packet, uint16_t value); +void PacketWrite32(Packet *packet, uint32_t value); +void PacketWrite64(Packet *packet, uint64_t value); +uint16_t PacketRead8(Packet *packet); +uint16_t PacketRead16(Packet *packet); +uint32_t PacketRead32(Packet *packet); +uint64_t PacketRead64(Packet *packet); + +#ifdef __cplusplus +} +#endif + +#endif // RNET_H + +/*********************************************************************************** +* +* RNET IMPLEMENTATION +* +************************************************************************************/ + +#if defined(RNET_IMPLEMENTATION) + +#include // Required for: assert() +#include // Required for: FILE, fopen(), fclose(), fread() +#include // Required for: malloc(), free() +#include // Required for: strcmp(), strncmp() + +#define NET_DEBUG_ENABLED 1 + +#if defined(SUPPORT_TRACELOG) + #define TRACELOG(level, ...) TraceLog(level, __VA_ARGS__) + + #if defined(SUPPORT_TRACELOG_DEBUG) + #define TRACELOGD(...) TraceLog(LOG_DEBUG, __VA_ARGS__) + #else + #define TRACELOGD(...) (void)0 + #endif +#else + #define TRACELOG(level, ...) (void)0 + #define TRACELOGD(...) (void)0 +#endif + +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- + +typedef struct _SocketAddress +{ + struct sockaddr address; +} _SocketAddress; + +typedef struct _SocketAddressIPv4 +{ + struct sockaddr_in address; +} _SocketAddressIPv4; + +typedef struct _SocketAddressIPv6 +{ + struct sockaddr_in6 address; +} _SocketAddressIPv6; + +typedef struct _SocketAddressStorage +{ + struct sockaddr_storage address; +} _SocketAddressStorage; + +typedef struct _AddressInformation +{ + struct addrinfo addr; +} _AddressInformation; + +//---------------------------------------------------------------------------------- +// Local module Functions Declarations +//---------------------------------------------------------------------------------- +static void PrintSocket(struct sockaddr_storage *addr, const int family, const int socktype, const int protocol); +static const char *SocketAddressToString(struct sockaddr_storage *sockaddr); +static bool IsIPv4Address(const char *ip); +static bool IsIPv6Address(const char *ip); +static void *GetSocketPortPtr(struct sockaddr_storage *sa); +static void *GetSocketAddressPtr(struct sockaddr_storage *sa); +static bool IsSocketValid(Socket *sock); +static void SocketSetLastError(int err); +static int SocketGetLastError(); +static char *SocketGetLastErrorString(); +static char *SocketErrorCodeToString(int err); +static bool SocketSetDefaults(SocketConfig *config); +static bool InitSocket(Socket *sock, struct addrinfo *addr); +static bool CreateSocket(SocketConfig *config, SocketResult *outresult); +static bool SocketSetBlocking(Socket *sock); +static bool SocketSetNonBlocking(Socket *sock); +static bool SocketSetOptions(SocketConfig *config, Socket *sock); +static void SocketSetHints(SocketConfig *config, struct addrinfo *hints); + +//---------------------------------------------------------------------------------- +// Local module Functions Definition +//---------------------------------------------------------------------------------- +// Print socket information +static void PrintSocket(struct sockaddr_storage *addr, const int family, const int socktype, const int protocol) +{ + switch (family) + { + case AF_UNSPEC: TRACELOG(LOG_DEBUG, "\tFamily: Unspecified"); break; + case AF_INET: + { + TRACELOG(LOG_DEBUG, "\tFamily: AF_INET (IPv4)"); + TRACELOG(LOG_INFO, "\t- IPv4 address %s", SocketAddressToString(addr)); + } break; + case AF_INET6: + { + TRACELOG(LOG_DEBUG, "\tFamily: AF_INET6 (IPv6)"); + TRACELOG(LOG_INFO, "\t- IPv6 address %s", SocketAddressToString(addr)); + } break; + case AF_NETBIOS: + { + TRACELOG(LOG_DEBUG, "\tFamily: AF_NETBIOS (NetBIOS)"); + } break; + default: TRACELOG(LOG_DEBUG, "\tFamily: Other %ld", family); break; + } + + TRACELOG(LOG_DEBUG, "\tSocket type:"); + switch (socktype) + { + case 0: TRACELOG(LOG_DEBUG, "\t- Unspecified"); break; + case SOCK_STREAM: TRACELOG(LOG_DEBUG, "\t- SOCK_STREAM (stream)"); break; + case SOCK_DGRAM: TRACELOG(LOG_DEBUG, "\t- SOCK_DGRAM (datagram)"); break; + case SOCK_RAW: TRACELOG(LOG_DEBUG, "\t- SOCK_RAW (raw)"); break; + case SOCK_RDM: TRACELOG(LOG_DEBUG, "\t- SOCK_RDM (reliable message datagram)"); break; + case SOCK_SEQPACKET: TRACELOG(LOG_DEBUG, "\t- SOCK_SEQPACKET (pseudo-stream packet)"); break; + default: TRACELOG(LOG_DEBUG, "\t- Other %ld", socktype); break; + } + + TRACELOG(LOG_DEBUG, "\tProtocol:"); + switch (protocol) + { + case 0: TRACELOG(LOG_DEBUG, "\t- Unspecified"); break; + case IPPROTO_TCP: TRACELOG(LOG_DEBUG, "\t- IPPROTO_TCP (TCP)"); break; + case IPPROTO_UDP: TRACELOG(LOG_DEBUG, "\t- IPPROTO_UDP (UDP)"); break; + default: TRACELOG(LOG_DEBUG, "\t- Other %ld", protocol); break; + } +} + +// Convert network ordered socket address to human readable string (127.0.0.1) +static const char *SocketAddressToString(struct sockaddr_storage *sockaddr) +{ + //static const char* ipv6[INET6_ADDRSTRLEN]; + assert(sockaddr != NULL); + assert(sockaddr->ss_family == AF_INET || sockaddr->ss_family == AF_INET6); + + switch (sockaddr->ss_family) + { + case AF_INET: + { + //struct sockaddr_in *s = ((struct sockaddr_in *)sockaddr); + //return inet_ntop(AF_INET, &s->sin_addr, ipv6, INET_ADDRSTRLEN); // TODO. + } + break; + case AF_INET6: + { + //struct sockaddr_in6 *s = ((struct sockaddr_in6 *)sockaddr); + //return inet_ntop(AF_INET6, &s->sin6_addr, ipv6, INET6_ADDRSTRLEN); // TODO. + } + break; + } + + return NULL; +} + +// Check if the null terminated string ip is a valid IPv4 address +static bool IsIPv4Address(const char *ip) +{ + /* + struct sockaddr_in sa; + int result = inet_pton(AF_INET, ip, &(sa.sin_addr)); // TODO. + return (result != 0); + */ + return false; +} + +// Check if the null terminated string ip is a valid IPv6 address +static bool IsIPv6Address(const char *ip) +{ + /* + struct sockaddr_in6 sa; + int result = inet_pton(AF_INET6, ip, &(sa.sin6_addr)); // TODO. + return result != 0; + */ + return false; +} + +// Return a pointer to the port from the correct address family (IPv4, or IPv6) +static void *GetSocketPortPtr(struct sockaddr_storage *sa) +{ + if (sa->ss_family == AF_INET) + { + return &(((struct sockaddr_in *)sa)->sin_port); + } + + return &(((struct sockaddr_in6 *)sa)->sin6_port); +} + +// Return a pointer to the address from the correct address family (IPv4, or IPv6) +static void *GetSocketAddressPtr(struct sockaddr_storage *sa) +{ + if (sa->ss_family == AF_INET) + { + return &(((struct sockaddr_in *)sa)->sin_addr); + } + + return &(((struct sockaddr_in6 *)sa)->sin6_addr); +} + +// Is the socket in a valid state? +static bool IsSocketValid(Socket *sock) +{ + if (sock != NULL) + { + return (sock->channel != INVALID_SOCKET); + } + + return false; +} + +// Sets the error code that can be retrieved through the WSAGetLastError function. +static void SocketSetLastError(int err) +{ +#if defined(_WIN32) + WSASetLastError(err); +#else + errno = err; +#endif +} + +// Returns the error status for the last Sockets operation that failed +static int SocketGetLastError(void) +{ +#if defined(_WIN32) + return WSAGetLastError(); +#else + return errno; +#endif +} + +// Returns a human-readable string representing the last error message +static char *SocketGetLastErrorString(void) +{ + return SocketErrorCodeToString(SocketGetLastError()); +} + +// Returns a human-readable string representing the error message (err) +static char *SocketErrorCodeToString(int err) +{ +#if defined(_WIN32) + static char gaiStrErrorBuffer[GAI_STRERROR_BUFFER_SIZE]; + TRACELOG(LOG_INFO, gaiStrErrorBuffer, "%s", gai_strerror(err)); + return gaiStrErrorBuffer; +#else + return gai_strerror(err); +#endif +} + +// Set the defaults in the supplied SocketConfig if they're not already set +static bool SocketSetDefaults(SocketConfig *config) +{ + if (config->backlog_size == 0) config->backlog_size = SOCKET_MAX_QUEUE_SIZE; + + return true; +} + +// Create the socket channel +static bool InitSocket(Socket *sckt, struct addrinfo *address) +{ + switch (sckt->type) + { + case SOCKET_TCP: + { + if (address->ai_family == AF_INET) sckt->channel = socket(AF_INET, SOCK_STREAM, 0); + else sckt->channel = socket(AF_INET6, SOCK_STREAM, 0); + } break; + case SOCKET_UDP: + { + if (address->ai_family == AF_INET) sckt->channel = socket(AF_INET, SOCK_DGRAM, 0); + else sckt->channel = socket(AF_INET6, SOCK_DGRAM, 0); + } break; + default: TRACELOG(LOG_WARNING, "Invalid socket type specified."); break; + } + + return IsSocketValid(sckt); +} + +// CreateSocket() - Interally called by CreateSocket() +// +// This here is the bread and butter of the socket API, This function will +// attempt to open a socket, bind and listen to it based on the config passed in +// +// SocketConfig* config - Configuration for which socket to open +// SocketResult* result - The results of this function (if any, including errors) +// +// e.g. +// SocketConfig server_config = { SocketConfig client_config = { +// .host = "127.0.0.1", .host = "127.0.0.1", +// .port = 8080, .port = 8080, +// .server = true, }; +// .nonblocking = true, +// }; +// SocketResult server_res; SocketResult client_res; +static bool CreateSocket(SocketConfig *config, SocketResult *outresult) +{ + bool success = true; + int addrstatus; + struct addrinfo hints; // Address flags (IPV4, IPV6, UDP?) + struct addrinfo *res; // A pointer to the resulting address list + + outresult->socket->channel = INVALID_SOCKET; + outresult->status = RESULT_FAILURE; + + // Set the socket type + outresult->socket->type = config->type; + + // Set the hints based on information in the config + // + // AI_CANONNAME Causes the ai_canonname of the result to the filled out with the host's canonical (real) name. + // AI_PASSIVE: Causes the result's IP address to be filled out with INADDR_ANY (IPv4)or in6addr_any (IPv6); + // Note: This causes a subsequent call to bind() to auto-fill the IP address + // of the struct sockaddr with the address of the current host. + // + SocketSetHints(config, &hints); + + // Populate address information + addrstatus = getaddrinfo(config->host, // e.g. "www.example.com" or IP (Can be null if AI_PASSIVE flag is set + config->port, // e.g. "http" or port number + &hints, // e.g. SOCK_STREAM/SOCK_DGRAM + &res // The struct to populate + ); + + // Did we succeed? + if (addrstatus != 0) + { + outresult->socket->status = SocketGetLastError(); + TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(outresult->socket->status)); + SocketSetLastError(0); + TRACELOG(LOG_WARNING, "Failed to get resolve host %s:%s: %s", config->host, config->port, SocketGetLastErrorString()); + + return (success = false); + } + else + { + char hoststr[NI_MAXHOST]; + char portstr[NI_MAXSERV]; + //socklen_t client_len = sizeof(struct sockaddr_storage); + //int rc = getnameinfo((struct sockaddr *)res->ai_addr, client_len, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NUMERICHOST | NI_NUMERICSERV); + TRACELOG(LOG_INFO, "Successfully resolved host %s:%s", hoststr, portstr); + } + + // Walk the address information linked-list + struct addrinfo *it; + for (it = res; it != NULL; it = it->ai_next) + { + // Initialise the socket + if (!InitSocket(outresult->socket, it)) + { + outresult->socket->status = SocketGetLastError(); + TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(outresult->socket->status)); + SocketSetLastError(0); + continue; + } + + // Set socket options + if (!SocketSetOptions(config, outresult->socket)) + { + outresult->socket->status = SocketGetLastError(); + TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(outresult->socket->status)); + SocketSetLastError(0); + freeaddrinfo(res); + + return (success = false); + } + } + + if (!IsSocketValid(outresult->socket)) + { + outresult->socket->status = SocketGetLastError(); + TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(outresult->status)); + SocketSetLastError(0); + freeaddrinfo(res); + + return (success = false); + } + + if (success) + { + outresult->status = RESULT_SUCCESS; + outresult->socket->ready = 0; + outresult->socket->status = 0; + + if (!(config->type == SOCKET_UDP)) outresult->socket->isServer = config->server; + + switch (res->ai_addr->sa_family) + { + case AF_INET: + { + outresult->socket->addripv4 = (struct _SocketAddressIPv4 *)RNET_MALLOC(sizeof(*outresult->socket->addripv4)); + + if (outresult->socket->addripv4 != NULL) + { + memset(outresult->socket->addripv4, 0, sizeof(*outresult->socket->addripv4)); + + if (outresult->socket->addripv4 != NULL) + { + memcpy(&outresult->socket->addripv4->address, (struct sockaddr_in *)res->ai_addr, sizeof(struct sockaddr_in)); + + outresult->socket->isIPv6 = false; + char hoststr[NI_MAXHOST]; + char portstr[NI_MAXSERV]; + + socklen_t client_len = sizeof(struct sockaddr_storage); + getnameinfo((struct sockaddr *)&outresult->socket->addripv4->address, client_len, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NUMERICHOST | NI_NUMERICSERV); + + TRACELOG(LOG_INFO, "Socket address set to %s:%s", hoststr, portstr); + } + } + } break; + case AF_INET6: + { + outresult->socket->addripv6 = (struct _SocketAddressIPv6 *)RNET_MALLOC( + sizeof(*outresult->socket->addripv6)); + if (outresult->socket->addripv6 != NULL) + { + memset(outresult->socket->addripv6, 0, + sizeof(*outresult->socket->addripv6)); + if (outresult->socket->addripv6 != NULL) + { + memcpy(&outresult->socket->addripv6->address, + (struct sockaddr_in6 *)res->ai_addr, sizeof(struct sockaddr_in6)); + outresult->socket->isIPv6 = true; + char hoststr[NI_MAXHOST]; + char portstr[NI_MAXSERV]; + socklen_t client_len = sizeof(struct sockaddr_storage); + getnameinfo( + (struct sockaddr *)&outresult->socket->addripv6->address, client_len, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NUMERICHOST | NI_NUMERICSERV); + TRACELOG(LOG_INFO, "Socket address set to %s:%s", hoststr, portstr); + } + } + } break; + default: break; + } + } + + freeaddrinfo(res); + return success; +} + +// Set the state of the Socket sock to blocking +static bool SocketSetBlocking(Socket *sock) +{ + bool ret = true; +#if defined(_WIN32) + unsigned long mode = 0; + ret = ioctlsocket(sock->channel, FIONBIO, &mode); +#else + const int flags = fcntl(sock->channel, F_GETFL, 0); + if (!(flags & O_NONBLOCK)) + { + TRACELOG(LOG_DEBUG, "Socket was already in blocking mode"); + return ret; + } + + ret = (0 == fcntl(sock->channel, F_SETFL, (flags ^ O_NONBLOCK))); +#endif + return ret; +} + +// Set the state of the Socket sock to non-blocking +static bool SocketSetNonBlocking(Socket *sock) +{ + bool ret = true; +#if defined(_WIN32) + unsigned long mode = 1; + ret = ioctlsocket(sock->channel, FIONBIO, &mode); +#else + const int flags = fcntl(sock->channel, F_GETFL, 0); + + if ((flags & O_NONBLOCK)) + { + TRACELOG(LOG_DEBUG, "Socket was already in non-blocking mode"); + return ret; + } + + ret = (0 == fcntl(sock->channel, F_SETFL, (flags | O_NONBLOCK))); +#endif + return ret; +} + +// Set options specified in SocketConfig to Socket sock +static bool SocketSetOptions(SocketConfig *config, Socket *sock) +{ + for (int i = 0; i < SOCKET_MAX_SOCK_OPTS; i++) + { + SocketOpt *opt = &config->sockopts[i]; + + if (opt->id == 0) break; + + if (setsockopt(sock->channel, SOL_SOCKET, opt->id, opt->value, opt->valueLen) < 0) return false; + } + + return true; +} + +// Set "hints" in an addrinfo struct, to be passed to getaddrinfo. +static void SocketSetHints(SocketConfig *config, struct addrinfo *hints) +{ + if (config == NULL || hints == NULL) return; + + memset(hints, 0, sizeof(*hints)); + + // Check if the ip supplied in the config is a valid ipv4 ip ipv6 address + if (IsIPv4Address(config->host)) + { + hints->ai_family = AF_INET; + hints->ai_flags |= AI_NUMERICHOST; + } + else + { + if (IsIPv6Address(config->host)) + { + hints->ai_family = AF_INET6; + hints->ai_flags |= AI_NUMERICHOST; + } + else hints->ai_family = AF_UNSPEC; + } + + if (config->type == SOCKET_UDP) hints->ai_socktype = SOCK_DGRAM; + else hints->ai_socktype = SOCK_STREAM; + + + // Set passive unless UDP client + if (!(config->type == SOCKET_UDP) || config->server) hints->ai_flags = AI_PASSIVE; +} + +//---------------------------------------------------------------------------------- +// Module implementation +//---------------------------------------------------------------------------------- + +// Initialise the network (requires for windows platforms only) +bool InitNetworkDevice(void) +{ +#if defined(_WIN32) + WORD wVersionRequested; + WSADATA wsaData; + + wVersionRequested = MAKEWORD(2, 2); + int err = WSAStartup(wVersionRequested, &wsaData); + + if (err != 0) + { + TRACELOG(LOG_WARNING, "WinSock failed to initialise."); + return false; + } + else TRACELOG(LOG_INFO, "WinSock initialised."); + + if (LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2) + { + TRACELOG(LOG_WARNING, "WinSock failed to initialise."); + WSACleanup(); + return false; + } + + return true; +#else + return true; +#endif +} + +// Cleanup, and close the network +void CloseNetworkDevice(void) +{ +#if defined(_WIN32) + WSACleanup(); +#endif +} + +// Protocol-independent name resolution from an address to an ANSI host name +// and from a port number to the ANSI service name. +// +// The flags parameter can be used to customize processing of the getnameinfo function +// +// The following flags are available: +// +// NAME_INFO_DEFAULT 0x00 // No flags set +// NAME_INFO_NOFQDN 0x01 // Only return nodename portion for local hosts +// NAME_INFO_NUMERICHOST 0x02 // Return numeric form of the host's address +// NAME_INFO_NAMEREQD 0x04 // Error if the host's name not in DNS +// NAME_INFO_NUMERICSERV 0x08 // Return numeric form of the service (port #) +// NAME_INFO_DGRAM 0x10 // Service is a datagram service +void ResolveIP(const char *ip, const char *port, int flags, char *host, char *serv) +{ + // Variables + int status; // Status value to return (0) is success + struct addrinfo hints; // Address flags (IPV4, IPV6, UDP?) + struct addrinfo *res; // A pointer to the resulting address list + + // Set the hints + memset(&hints, 0, sizeof hints); + hints.ai_family = AF_UNSPEC; // Either IPv4 or IPv6 (AF_INET, AF_INET6) + hints.ai_protocol = 0; // Automatically select correct protocol (IPPROTO_TCP), (IPPROTO_UDP) + + // Populate address information + status = getaddrinfo(ip, // e.g. "www.example.com" or IP + port, // e.g. "http" or port number + &hints, // e.g. SOCK_STREAM/SOCK_DGRAM + &res // The struct to populate + ); + + // Did we succeed? + if (status != 0) TRACELOG(LOG_WARNING, "Failed to get resolve host %s:%s: %s", ip, port, gai_strerror(errno)); + else TRACELOG(LOG_DEBUG, "Resolving... %s::%s", ip, port); + + // Attempt to resolve network byte order ip to hostname + switch (res->ai_family) + { + case AF_INET: + { + status = getnameinfo(&*((struct sockaddr *)res->ai_addr), + sizeof(*((struct sockaddr_in *)res->ai_addr)), + host, NI_MAXHOST, serv, NI_MAXSERV, flags); + } break; + case AF_INET6: + { + /* + status = getnameinfo(&*((struct sockaddr_in6 *)res->ai_addr), // TODO. + sizeof(*((struct sockaddr_in6 *)res->ai_addr)), + host, NI_MAXHOST, serv, NI_MAXSERV, flags); + */ + } break; + default: break; + } + + if (status != 0) TRACELOG(LOG_WARNING, "Failed to resolve ip %s: %s", ip, SocketGetLastErrorString()); + else TRACELOG(LOG_DEBUG, "Successfully resolved %s::%s to %s", ip, port, host); + + // Free the pointer to the data returned by addrinfo + freeaddrinfo(res); +} + +// Protocol-independent translation from an ANSI host name to an address +// +// e.g. +// const char* address = "127.0.0.1" (local address) +// const char* port = "80" +// +// Parameters: +// const char* address - A pointer to a NULL-terminated ANSI string that contains a host (node) name or a numeric host address string. +// const char* service - A pointer to a NULL-terminated ANSI string that contains either a service name or port number represented as a string. +// +// Returns: +// The total amount of addresses found, -1 on error +// +int ResolveHost(const char *address, const char *service, int addressType, int flags, AddressInformation *outAddr) +{ + // Variables + int status; // Status value to return (0) is success + struct addrinfo hints; // Address flags (IPV4, IPV6, UDP?) + struct addrinfo *res; // will point to the results + struct addrinfo *iterator; + assert(((address != NULL || address != 0) || (service != NULL || service != 0))); + assert(((addressType == AF_INET) || (addressType == AF_INET6) || (addressType == AF_UNSPEC))); + + // Set the hints + memset(&hints, 0, sizeof hints); + hints.ai_family = addressType; // Either IPv4 or IPv6 (ADDRESS_TYPE_IPV4, ADDRESS_TYPE_IPV6) + hints.ai_protocol = 0; // Automatically select correct protocol (IPPROTO_TCP), (IPPROTO_UDP) + hints.ai_flags = flags; + assert((hints.ai_addrlen == 0) || (hints.ai_addrlen == 0)); + assert((hints.ai_canonname == 0) || (hints.ai_canonname == 0)); + assert((hints.ai_addr == 0) || (hints.ai_addr == 0)); + assert((hints.ai_next == 0) || (hints.ai_next == 0)); + + // When the address is NULL, populate the IP for me + if (address == NULL) + { + if ((hints.ai_flags & AI_PASSIVE) == 0) hints.ai_flags |= AI_PASSIVE; + } + + TRACELOG(LOG_INFO, "Resolving host..."); + + // Populate address information + status = getaddrinfo(address, // e.g. "www.example.com" or IP + service, // e.g. "http" or port number + &hints, // e.g. SOCK_STREAM/SOCK_DGRAM + &res // The struct to populate + ); + + // Did we succeed? + if (status != 0) + { + int error = SocketGetLastError(); + SocketSetLastError(0); + TRACELOG(LOG_WARNING, "Failed to get resolve host: %s", SocketErrorCodeToString(error)); + return -1; + } + else TRACELOG(LOG_INFO, "Successfully resolved host %s:%s", address, service); + + // Calculate the size of the address information list + int size = 0; + for (iterator = res; iterator != NULL; iterator = iterator->ai_next) size++; + + // Validate the size is > 0, otherwise return + if (size <= 0) + { + TRACELOG(LOG_WARNING, "Error, no addresses found."); + return -1; + } + + // If not address list was allocated, allocate it dynamically with the known address size + if (outAddr == NULL) outAddr = (AddressInformation *)RNET_MALLOC(size * sizeof(AddressInformation)); + + // Dynamically allocate an array of address information structs + if (outAddr != NULL) + { + int i; + for (i = 0; i < size; ++i) + { + outAddr[i] = LoadAddress(); + if (outAddr[i] == NULL) + { + break; + } + } + + outAddr[i] = NULL; + if (i != size) outAddr = NULL; + } + else + { + TRACELOG(LOG_WARNING, "Error, failed to dynamically allocate memory for the address list"); + return -1; + } + + // Copy all the address information from res into outAddrList + int i = 0; + for (iterator = res; iterator != NULL; iterator = iterator->ai_next) + { + if (i < size) + { + outAddr[i]->addr.ai_flags = iterator->ai_flags; + outAddr[i]->addr.ai_family = iterator->ai_family; + outAddr[i]->addr.ai_socktype = iterator->ai_socktype; + outAddr[i]->addr.ai_protocol = iterator->ai_protocol; + outAddr[i]->addr.ai_addrlen = iterator->ai_addrlen; + *outAddr[i]->addr.ai_addr = *iterator->ai_addr; +#if NET_DEBUG_ENABLED + TRACELOG(LOG_DEBUG, "GetAddressInformation"); + TRACELOG(LOG_DEBUG, "\tFlags: 0x%x", iterator->ai_flags); + //PrintSocket(outAddr[i]->addr.ai_addr, outAddr[i]->addr.ai_family, outAddr[i]->addr.ai_socktype, outAddr[i]->addr.ai_protocol); + TRACELOG(LOG_DEBUG, "Length of this sockaddr: %d", outAddr[i]->addr.ai_addrlen); + TRACELOG(LOG_DEBUG, "Canonical name: %s", iterator->ai_canonname); +#endif + i++; + } + } + + // Free the pointer to the data returned by addrinfo + freeaddrinfo(res); + + // Return the total count of addresses found + return size; +} + +// This here is the bread and butter of the socket API, This function will +// attempt to open a socket, bind and listen to it based on the config passed in +// +// SocketConfig* config - Configuration for which socket to open +// SocketResult* result - The results of this function (if any, including errors) +// +// e.g. +// SocketConfig server_config = { SocketConfig client_config = { +// .host = "127.0.0.1", .host = "127.0.0.1", +// .port = 8080, .port = 8080, +// .server = true, }; +// .nonblocking = true, +// }; +// SocketResult server_res; SocketResult client_res; +bool SocketCreate(SocketConfig *config, SocketResult *result) +{ + // Socket creation result + bool success = true; + + // Make sure we've not received a null config or result pointer + if (config == NULL || result == NULL) return (success = false); + + // Set the defaults based on the config + if (!SocketSetDefaults(config)) + { + TRACELOG(LOG_WARNING, "Configuration Error."); + success = false; + } + else + { + // Create the socket + if (CreateSocket(config, result)) + { + if (config->nonblocking) SocketSetNonBlocking(result->socket); + else SocketSetBlocking(result->socket); + } + else success = false; + } + + return success; +} + +// Bind a socket to a local address +// Note: The bind function is required on an unconnected socket before subsequent calls to the listen function. +bool SocketBind(SocketConfig *config, SocketResult *result) +{ + bool success = false; + result->status = RESULT_FAILURE; + struct sockaddr_storage *sock_addr = NULL; + + // Don't bind to a socket that isn't configured as a server + if (!IsSocketValid(result->socket) || !config->server) + { + TRACELOG(LOG_WARNING, Cannot bind to socket marked as \"Client\" in SocketConfig."); + success = false; + } + else + { + if (result->socket->isIPv6) sock_addr = (struct sockaddr_storage *)&result->socket->addripv6->address; + else sock_addr = (struct sockaddr_storage *)&result->socket->addripv4->address; + + if (sock_addr != NULL) + { + if (bind(result->socket->channel, (struct sockaddr *)sock_addr, sizeof(*sock_addr)) != SOCKET_ERROR) + { + TRACELOG(LOG_INFO, "Successfully bound socket."); + success = true; + } + else + { + result->socket->status = SocketGetLastError(); + TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(result->socket->status)); + SocketSetLastError(0); + success = false; + } + } + } + + // Was the bind a success? + if (success) + { + result->status = RESULT_SUCCESS; + result->socket->ready = 0; + result->socket->status = 0; + socklen_t sock_len = sizeof(*sock_addr); + + if (getsockname(result->socket->channel, (struct sockaddr *)sock_addr, &sock_len) < 0) + { + TRACELOG(LOG_WARNING, "Couldn't get socket address"); + } + else + { + struct sockaddr_in *s = (struct sockaddr_in *)sock_addr; + // result->socket->address.host = s->sin_addr.s_addr; + // result->socket->address.port = s->sin_port; + + result->socket->addripv4 = (struct _SocketAddressIPv4 *)RNET_MALLOC(sizeof(*result->socket->addripv4)); + + if (result->socket->addripv4 != NULL) memset(result->socket->addripv4, 0, sizeof(*result->socket->addripv4)); + + memcpy(&result->socket->addripv4->address, (struct sockaddr_in *)&s->sin_addr, sizeof(struct sockaddr_in)); + } + } + return success; +} + +// Listens (and queues) incoming connections requests for a bound port. +bool SocketListen(SocketConfig *config, SocketResult *result) +{ + bool success = false; + result->status = RESULT_FAILURE; + + // Don't bind to a socket that isn't configured as a server + if (!IsSocketValid(result->socket) || !config->server) + { + TRACELOG(LOG_WARNING, "Cannot listen on socket marked as \"Client\" in SocketConfig."); + success = false; + } + else + { + // Don't listen on UDP sockets + if (!(config->type == SOCKET_UDP)) + { + if (listen(result->socket->channel, config->backlog_size) != SOCKET_ERROR) + { + TRACELOG(LOG_INFO, "Started listening on socket..."); + success = true; + } + else + { + success = false; + result->socket->status = SocketGetLastError(); + TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(result->socket->status)); + SocketSetLastError(0); + } + } + else + { + TRACELOG(LOG_WARNING, "Cannot listen on socket marked as \"UDP\" (datagram) in SocketConfig."); + success = false; + } + } + + // Was the listen a success? + if (success) + { + result->status = RESULT_SUCCESS; + result->socket->ready = 0; + result->socket->status = 0; + } + + return success; +} + +// Connect the socket to the destination specified by "host" and "port" in SocketConfig +bool SocketConnect(SocketConfig *config, SocketResult *result) +{ + bool success = true; + result->status = RESULT_FAILURE; + + // Only bind to sockets marked as server + if (config->server) + { + TRACELOG(LOG_WARNING, "Cannot connect to socket marked as \"Server\" in SocketConfig."); + success = false; + } + else + { + if (IsIPv4Address(config->host)) + { + struct sockaddr_in ip4addr; + ip4addr.sin_family = AF_INET; + unsigned long hport; + hport = strtoul(config->port, NULL, 0); + ip4addr.sin_port = (unsigned short)(hport); + + // TODO: Changed the code to avoid the usage of inet_pton and inet_ntop replacing them with getnameinfo (that should have a better support on windows). + + //inet_pton(AF_INET, config->host, &ip4addr.sin_addr); + int connect_result = connect(result->socket->channel, (struct sockaddr *)&ip4addr, sizeof(ip4addr)); + + if (connect_result == SOCKET_ERROR) + { + result->socket->status = SocketGetLastError(); + SocketSetLastError(0); + + switch (result->socket->status) + { + case WSAEWOULDBLOCK: success = true; break; + default: + { + TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(result->socket->status)); + success = false; + } break; + } + } + else + { + TRACELOG(LOG_INFO, "Successfully connected to socket."); + success = true; + } + } + else + { + if (IsIPv6Address(config->host)) + { + struct sockaddr_in6 ip6addr; + ip6addr.sin6_family = AF_INET6; + unsigned long hport; + hport = strtoul(config->port, NULL, 0); + ip6addr.sin6_port = htons((unsigned short)hport); + //inet_pton(AF_INET6, config->host, &ip6addr.sin6_addr); // TODO. + int connect_result = connect(result->socket->channel, (struct sockaddr *)&ip6addr, sizeof(ip6addr)); + + if (connect_result == SOCKET_ERROR) + { + result->socket->status = SocketGetLastError(); + SocketSetLastError(0); + + switch (result->socket->status) + { + case WSAEWOULDBLOCK: success = true; break; + default: + { + TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(result->socket->status)); + success = false; + } break; + } + } + else + { + TRACELOG(LOG_INFO, "Successfully connected to socket."); + success = true; + } + } + } + } + + if (success) + { + result->status = RESULT_SUCCESS; + result->socket->ready = 0; + result->socket->status = 0; + } + + return success; +} + +// Closes an existing socket +// +// SocketChannel socket - The id of the socket to close +void SocketClose(Socket *sock) +{ + if (sock != NULL) + { + if (sock->channel != INVALID_SOCKET) closesocket(sock->channel); + } +} + +// Returns the sockaddress for a specific socket in a generic storage struct +SocketAddressStorage SocketGetPeerAddress(Socket *sock) +{ + // TODO. + /* + if (sock->isServer) return NULL; + if (sock->isIPv6) return sock->addripv6; + else return sock->addripv4; + */ + + return NULL; +} + +// Return the address-type appropriate host portion of a socket address +const char *GetSocketAddressHost(SocketAddressStorage storage) +{ + assert(storage->address.ss_family == AF_INET || storage->address.ss_family == AF_INET6); + return SocketAddressToString((struct sockaddr_storage *)storage); +} + +// Return the address-type appropriate port(service) portion of a socket address +short GetSocketAddressPort(SocketAddressStorage storage) +{ + //return ntohs(GetSocketPortPtr(storage)); // TODO. + + return 0; +} + +// The accept function permits an incoming connection attempt on a socket. +// +// SocketChannel listener - The socket to listen for incoming connections on (i.e. server) +// SocketResult* out - The result of this function (if any, including errors) +// +// e.g. +// +// SocketResult connection; +// bool connected = false; +// if (!connected) +// { +// if (SocketAccept(server_res.socket.channel, &connection)) +// { +// connected = true; +// } +// } +Socket *SocketAccept(Socket *server, SocketConfig *config) +{ + if (!server->isServer || server->type == SOCKET_UDP) return NULL; + + struct sockaddr_storage sock_addr; + socklen_t sock_alen; + Socket *sock = LoadSocket(); + server->ready = 0; + sock_alen = sizeof(sock_addr); + sock->channel = accept(server->channel, (struct sockaddr *)&sock_addr, &sock_alen); + + if (sock->channel == INVALID_SOCKET) + { + sock->status = SocketGetLastError(); + TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(sock->status)); + SocketSetLastError(0); + SocketClose(sock); + + return NULL; + } + + (config->nonblocking) ? SocketSetNonBlocking(sock) : SocketSetBlocking(sock); + sock->isServer = false; + sock->ready = 0; + sock->type = server->type; + + switch (sock_addr.ss_family) + { + case AF_INET: + { + struct sockaddr_in *s = ((struct sockaddr_in *)&sock_addr); + sock->addripv4 = (struct _SocketAddressIPv4 *)RNET_MALLOC(sizeof(*sock->addripv4)); + + if (sock->addripv4 != NULL) + { + memset(sock->addripv4, 0, sizeof(*sock->addripv4)); + memcpy(&sock->addripv4->address, (struct sockaddr_in *)&s->sin_addr, sizeof(struct sockaddr_in)); + TRACELOG(LOG_INFO, "Server: Got connection from %s::%hu", SocketAddressToString((struct sockaddr_storage *)s), ntohs(sock->addripv4->address.sin_port)); + } + } break; + case AF_INET6: + { + struct sockaddr_in6 *s = ((struct sockaddr_in6 *)&sock_addr); + sock->addripv6 = (struct _SocketAddressIPv6 *)RNET_MALLOC(sizeof(*sock->addripv6)); + + if (sock->addripv6 != NULL) + { + memset(sock->addripv6, 0, sizeof(*sock->addripv6)); + memcpy(&sock->addripv6->address, (struct sockaddr_in6 *)&s->sin6_addr, sizeof(struct sockaddr_in6)); + TRACELOG(LOG_INFO, "Server: Got connection from %s::%hu", SocketAddressToString((struct sockaddr_storage *)s), ntohs(sock->addripv6->address.sin6_port)); + } + } break; + } + + return sock; +} + +// Verify that the channel is in the valid range +static int ValidChannel(int channel) +{ + if ((channel < 0) || (channel >= SOCKET_MAX_UDPCHANNELS)) + { + TRACELOG(LOG_WARNING, "Invalid channel"); + return 0; + } + + return 1; +} + +// Set the socket channel +int SocketSetChannel(Socket *socket, int channel, const IPAddress *address) +{ + struct UDPChannel *binding; + + if (socket == NULL) + { + TRACELOG(LOG_WARNING, "Passed a NULL socket"); + return (-1); + } + + if (channel == -1) + { + for (channel = 0; channel < SOCKET_MAX_UDPCHANNELS; ++channel) + { + binding = &socket->binding[channel]; + if (binding->numbound < SOCKET_MAX_UDPADDRESSES) break; + } + } + else + { + if (!ValidChannel(channel)) return (-1); + + binding = &socket->binding[channel]; + } + + if (binding->numbound == SOCKET_MAX_UDPADDRESSES) + { + TRACELOG(LOG_WARNING, "No room for new addresses"); + return (-1); + } + + binding->address[binding->numbound++] = *address; + + return (channel); +} + +// Remove the socket channel +void SocketUnsetChannel(Socket *socket, int channel) +{ + if ((channel >= 0) && (channel < SOCKET_MAX_UDPCHANNELS)) socket->binding[channel].numbound = 0; +} + +/* Allocate/free a single UDP packet 'size' bytes long. + The new packet is returned, or NULL if the function ran out of memory. + */ +SocketDataPacket *AllocPacket(int size) +{ + SocketDataPacket *packet = (SocketDataPacket *)RNET_MALLOC(sizeof(*packet)); + int error = 1; + + if (packet != NULL) + { + packet->maxlen = size; + packet->data = (uint8_t *)RNET_MALLOC(size); + if (packet->data != NULL) + { + error = 0; + } + } + + if (error) + { + FreePacket(packet); + packet = NULL; + } + + return (packet); +} + +int ResizePacket(SocketDataPacket *packet, int newsize) +{ + uint8_t *newdata = (uint8_t *)RNET_MALLOC(newsize); + + if (newdata != NULL) + { + RNET_FREE(packet->data); + packet->data = newdata; + packet->maxlen = newsize; + } + + return (packet->maxlen); +} + +void FreePacket(SocketDataPacket *packet) +{ + if (packet) + { + RNET_FREE(packet->data); + RNET_FREE(packet); + } +} + +// Allocate/Free a UDP packet vector (array of packets) of 'howmany' packets, each 'size' bytes long. +// A pointer to the packet array is returned, or NULL if the function ran out of memory. +SocketDataPacket **AllocPacketList(int howmany, int size) +{ + SocketDataPacket **packetV = (SocketDataPacket **)RNET_MALLOC((howmany + 1) * sizeof(*packetV)); + + if (packetV != NULL) + { + int i; + for (i = 0; i < howmany; ++i) + { + packetV[i] = AllocPacket(size); + if (packetV[i] == NULL) + { + break; + } + } + packetV[i] = NULL; + + if (i != howmany) + { + FreePacketList(packetV); + packetV = NULL; + } + } + + return (packetV); +} + +void FreePacketList(SocketDataPacket **packetV) +{ + if (packetV) + { + for (int i = 0; packetV[i]; ++i) FreePacket(packetV[i]); + RNET_FREE(packetV); + } +} + +// Send 'len' bytes of 'data' over the non-server socket 'sock' +int SocketSend(Socket *sock, const void *datap, int length) +{ + int sent = 0; + int left = length; + int status = -1; + int numsent = 0; + const unsigned char *data = (const unsigned char *)datap; + + // Server sockets are for accepting connections only + if (sock->isServer) + { + TRACELOG(LOG_WARNING, "Cannot send information on a server socket"); + return -1; + } + + // Which socket are we trying to send data on + switch (sock->type) + { + case SOCKET_TCP: + { + SocketSetLastError(0); + do + { + length = send(sock->channel, (const char *)data, left, 0); + if (length > 0) + { + sent += length; + left -= length; + data += length; + } + } while ((left > 0) && // While we still have bytes left to send + ((length > 0) || // The amount of bytes we actually sent is > 0 + (SocketGetLastError() == WSAEINTR)) // The socket was interupted + ); + + if (length == SOCKET_ERROR) + { + sock->status = SocketGetLastError(); + TRACELOG(LOG_DEBUG, "Socket Error: %s", SocketErrorCodeToString(sock->status)); + SocketSetLastError(0); + } + else TRACELOG(LOG_DEBUG, "Successfully sent \"%s\" (%d bytes)", datap, sent); + + return sent; + } break; + case SOCKET_UDP: + { + SocketSetLastError(0); + + if (sock->isIPv6) status = sendto(sock->channel, (const char *)data, left, 0, (struct sockaddr *)&sock->addripv6->address, sizeof(sock->addripv6->address)); + else status = sendto(sock->channel, (const char *)data, left, 0, (struct sockaddr *)&sock->addripv4->address, sizeof(sock->addripv4->address)); + + if (sent >= 0) + { + sock->status = 0; + ++numsent; + TRACELOG(LOG_DEBUG, "Successfully sent \"%s\" (%d bytes)", datap, status); + } + else + { + sock->status = SocketGetLastError(); + TRACELOG(LOG_DEBUG, "Socket Error: %s", SocketGetLastErrorString(sock->status)); + SocketSetLastError(0); + return 0; + } + + return numsent; + } break; + default: break; + } + + return -1; +} + +// Receive up to 'maxlen' bytes of data over the non-server socket 'sock', +// and store them in the buffer pointed to by 'data'. +// This function returns the actual amount of data received. If the return +// value is less than or equal to zero, then either the remote connection was +// closed, or an unknown socket error occurred. +int SocketReceive(Socket *sock, void *data, int maxlen) +{ + int len = 0; + int numrecv = 0; + int status = 0; + socklen_t sock_len; + struct sockaddr_storage sock_addr; + //char ip[INET6_ADDRSTRLEN]; + + // Server sockets are for accepting connections only + if (sock->isServer && (sock->type == SOCKET_TCP)) + { + sock->status = SocketGetLastError(); + TRACELOG(LOG_DEBUG, "Socket Error: %s", "Server sockets cannot be used to receive data"); + SocketSetLastError(0); + return 0; + } + + // Which socket are we trying to send data on + switch (sock->type) + { + case SOCKET_TCP: + { + SocketSetLastError(0); + do + { + len = recv(sock->channel, (char *)data, maxlen, 0); + } while (SocketGetLastError() == WSAEINTR); + + if (len > 0) + { + // Who sent the packet? + if (sock->type == SOCKET_UDP) + { + //TRACELOG(LOG_DEBUG, "Received data from: %s", inet_ntop(sock_addr.ss_family, GetSocketAddressPtr((struct sockaddr *)&sock_addr), ip, sizeof(ip))); + } + + ((unsigned char *)data)[len] = '\0'; // Add null terminating character to the end of the stream + TRACELOG(LOG_DEBUG, "Received \"%s\" (%d bytes)", data, len); + } + + sock->ready = 0; + return len; + } break; + case SOCKET_UDP: + { + SocketSetLastError(0); + sock_len = sizeof(sock_addr); + status = recvfrom(sock->channel, // The receving channel + data, // A pointer to the data buffer to fill + maxlen, // The max length of the data to fill + 0, // Flags + (struct sockaddr *)&sock_addr, // The address of the recevied data + &sock_len // The length of the received data address + ); + + if (status >= 0) ++numrecv; + else + { + sock->status = SocketGetLastError(); + + switch (sock->status) + { + case WSAEWOULDBLOCK: break; + default: TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(sock->status)); break; + } + + SocketSetLastError(0); + return 0; + } + + sock->ready = 0; + return numrecv; + } break; + default: break; + } + + return -1; +} + +// Does the socket have it's 'ready' flag set? +bool IsSocketReady(Socket *sock) +{ + return (sock != NULL) && (sock->ready); +} + +// Check if the socket is considered connected +bool IsSocketConnected(Socket *sock) +{ +#if defined(_WIN32) + FD_SET writefds; + FD_ZERO(&writefds); + FD_SET(sock->channel, &writefds); + struct timeval timeout; + timeout.tv_sec = 1; + timeout.tv_usec = 1000000000UL; + int total = select(0, NULL, &writefds, NULL, &timeout); + + if (total == -1) + { // Error + sock->status = SocketGetLastError(); + TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(sock->status)); + SocketSetLastError(0); + } + else if (total == 0) return false; // Timeout + else if (FD_ISSET(sock->channel, &writefds)) return true; + + return false; +#else + return true; +#endif +} + +// Allocate and return a SocketResult struct +SocketResult *LoadSocketResult(void) +{ + struct SocketResult *res = (struct SocketResult *)RNET_MALLOC(sizeof(*res)); + + if (res != NULL) + { + memset(res, 0, sizeof(*res)); + if ((res->socket = LoadSocket()) == NULL) + { + RNET_FREE(res); + res = NULL; + } + } + + return res; +} + +// Free an allocated SocketResult +void UnloadSocketResult(SocketResult **result) +{ + if (*result != NULL) + { + if ((*result)->socket != NULL) UnloadSocket(&((*result)->socket)); + + RNET_FREE(*result); + *result = NULL; + } +} + +// Allocate a Socket +Socket *LoadSocket(void) +{ + struct Socket *sock; + sock = (Socket *)RNET_MALLOC(sizeof(*sock)); + + if (sock != NULL) memset(sock, 0, sizeof(*sock)); + else + { + TRACELOG(LOG_WARNING, "Ran out of memory attempting to allocate a socket"); + SocketClose(sock); + RNET_FREE(sock); + sock = NULL; + } + + return sock; +} + +// Free an allocated Socket +void UnloadSocket(Socket **sock) +{ + if (*sock != NULL) + { + RNET_FREE(*sock); + *sock = NULL; + } +} + +// Allocate a SocketSet +SocketSet *LoadSocketSet(int max) +{ + struct SocketSet *set = (struct SocketSet *)RNET_MALLOC(sizeof(*set)); + + if (set != NULL) + { + set->numsockets = 0; + set->maxsockets = max; + set->sockets = (struct Socket **)RNET_MALLOC(max * sizeof(*set->sockets)); + if (set->sockets != NULL) + { + for (int i = 0; i < max; ++i) set->sockets[i] = NULL; + } + else + { + RNET_FREE(set); + set = NULL; + } + } + + return (set); +} + +// Free an allocated SocketSet +void UnloadSocketSet(SocketSet *set) +{ + if (set) + { + RNET_FREE(set->sockets); + RNET_FREE(set); + } +} + +// Add a Socket "sock" to the SocketSet "set" +int AddSocket(SocketSet *set, Socket *sock) +{ + if (sock != NULL) + { + if (set->numsockets == set->maxsockets) + { + TRACELOG(LOG_DEBUG, "Socket Error: %s", "SocketSet is full"); + SocketSetLastError(0); + return (-1); + } + set->sockets[set->numsockets++] = (struct Socket *)sock; + } + else + { + TRACELOG(LOG_DEBUG, "Socket Error: %s", "Socket was null"); + SocketSetLastError(0); + return (-1); + } + + return (set->numsockets); +} + +// Remove a Socket "sock" to the SocketSet "set" +int RemoveSocket(SocketSet *set, Socket *sock) +{ + if (sock != NULL) + { + int i = 0; + for (i = 0; i < set->numsockets; ++i) + { + if (set->sockets[i] == (struct Socket *)sock) break; + } + + if (i == set->numsockets) + { + TRACELOG(LOG_DEBUG, "Socket Error: %s", "Socket not found"); + SocketSetLastError(0); + return (-1); + } + + --set->numsockets; + for (; i < set->numsockets; ++i) set->sockets[i] = set->sockets[i + 1]; + } + + return (set->numsockets); +} + +// Check the sockets in the socket set for pending information +int CheckSockets(SocketSet *set, unsigned int timeout) +{ + int i; + SOCKET maxfd; + int retval; + struct timeval tv; + fd_set mask; + + /* Find the largest file descriptor */ + maxfd = 0; + for (i = set->numsockets - 1; i >= 0; --i) + { + if (set->sockets[i]->channel > maxfd) + { + maxfd = set->sockets[i]->channel; + } + } + + // Check the file descriptors for available data + do + { + SocketSetLastError(0); + + // Set up the mask of file descriptors + FD_ZERO(&mask); + for (i = set->numsockets - 1; i >= 0; --i) + { + FD_SET(set->sockets[i]->channel, &mask); + } // Set up the timeout + + tv.tv_sec = timeout / 1000; + tv.tv_usec = (timeout % 1000) * 1000; + + /* Look! */ + retval = select(maxfd + 1, &mask, NULL, NULL, &tv); + } while (SocketGetLastError() == WSAEINTR); + + // Mark all file descriptors ready that have data available + if (retval > 0) + { + for (i = set->numsockets - 1; i >= 0; --i) + { + if (FD_ISSET(set->sockets[i]->channel, &mask)) set->sockets[i]->ready = 1; + } + } + + return retval; +} + +// Allocate an AddressInformation +AddressInformation LoadAddress(void) +{ + AddressInformation addressInfo = NULL; + addressInfo = (AddressInformation)RNET_CALLOC(1, sizeof(*addressInfo)); + + if (addressInfo != NULL) + { + addressInfo->addr.ai_addr = (struct sockaddr *)RNET_CALLOC(1, sizeof(struct sockaddr)); + if (addressInfo->addr.ai_addr == NULL) TRACELOG(LOG_WARNING, "Failed to allocate memory for \"struct sockaddr\""); + } + else TRACELOG(LOG_WARNING, "Failed to allocate memory for \"struct AddressInformation\""); + + return addressInfo; +} + +// Free an AddressInformation struct +void UnloadAddress(AddressInformation *addressInfo) +{ + if (*addressInfo != NULL) + { + if ((*addressInfo)->addr.ai_addr != NULL) + { + RNET_FREE((*addressInfo)->addr.ai_addr); + (*addressInfo)->addr.ai_addr = NULL; + } + + RNET_FREE(*addressInfo); + *addressInfo = NULL; + } +} + +// Allocate a list of AddressInformation +AddressInformation *LoadAddressList(int size) +{ + AddressInformation *addr; + addr = (AddressInformation *)RNET_MALLOC(size * sizeof(AddressInformation)); + return addr; +} + +// Opaque datatype accessor addrinfo->ai_family +int GetAddressFamily(AddressInformation address) +{ + return address->addr.ai_family; +} + +// Opaque datatype accessor addrinfo->ai_socktype +int GetAddressSocketType(AddressInformation address) +{ + return address->addr.ai_socktype; +} + +// Opaque datatype accessor addrinfo->ai_protocol +int GetAddressProtocol(AddressInformation address) +{ + return address->addr.ai_protocol; +} + +// Opaque datatype accessor addrinfo->ai_canonname +char *GetAddressCanonName(AddressInformation address) +{ + return address->addr.ai_canonname; +} + +// Opaque datatype accessor addrinfo->ai_addr +char *GetAddressHostAndPort(AddressInformation address, char *outhost, unsigned short *outport) +{ + //char *ip[INET6_ADDRSTRLEN]; + char *result = NULL; + struct sockaddr_storage *storage = (struct sockaddr_storage *)address->addr.ai_addr; + + switch (storage->ss_family) + { + case AF_INET: + { + struct sockaddr_in *s = ((struct sockaddr_in *)address->addr.ai_addr); + //result = inet_ntop(AF_INET, &s->sin_addr, ip, INET_ADDRSTRLEN); // TODO. + *outport = ntohs(s->sin_port); + } break; + case AF_INET6: + { + struct sockaddr_in6 *s = ((struct sockaddr_in6 *)address->addr.ai_addr); + //result = inet_ntop(AF_INET6, &s->sin6_addr, ip, INET6_ADDRSTRLEN); // TODO. + *outport = ntohs(s->sin6_port); + } break; + default: break; + } + + if (result == NULL) + { + TRACELOG(LOG_WARNING, "Socket Error: %s", SocketErrorCodeToString(SocketGetLastError())); + SocketSetLastError(0); + } + else + { + strcpy(outhost, result); + } + return result; +} + +// +void PacketSend(Packet *packet) +{ + TRACELOG(LOG_INFO, "Sending packet (%s) with size %d\n", packet->data, packet->size); +} + +// +void PacketReceive(Packet *packet) +{ + TRACELOG(LOG_INFO, "Receiving packet (%s) with size %d\n", packet->data, packet->size); +} + +// +void PacketWrite16(Packet *packet, uint16_t value) +{ + TRACELOG(LOG_INFO, "Original: 0x%04" PRIX16 " - %" PRIu16 "\n", value, value); + uint8_t *data = packet->data + packet->offs; + *data++ = (uint8_t)(value >> 8); + *data++ = (uint8_t)(value); + packet->size += sizeof(uint16_t); + packet->offs += sizeof(uint16_t); + TRACELOG(LOG_INFO, "Network: 0x%04" PRIX16 " - %" PRIu16 "\n", (uint16_t) *data, (uint16_t) *data); +} + +// +void PacketWrite32(Packet *packet, uint32_t value) +{ + TRACELOG(LOG_INFO, "Original: 0x%08" PRIX32 " - %" PRIu32 "\n", value, value); + uint8_t *data = packet->data + packet->offs; + *data++ = (uint8_t)(value >> 24); + *data++ = (uint8_t)(value >> 16); + *data++ = (uint8_t)(value >> 8); + *data++ = (uint8_t)(value); + packet->size += sizeof(uint32_t); + packet->offs += sizeof(uint32_t); + + TRACELOG(LOG_INFO, "Network: 0x%08" PRIX32 " - %" PRIu32 "\n", + (uint32_t)(((intptr_t) packet->data) - packet->offs), + (uint32_t)(((intptr_t) packet->data) - packet->offs)); +} + +// +void PacketWrite64(Packet *packet, uint64_t value) +{ + TRACELOG(LOG_INFO, "Original: 0x%016" PRIX64 " - %" PRIu64 "\n", value, value); + + uint8_t *data = packet->data + packet->offs; + *data++ = (uint8_t)(value >> 56); + *data++ = (uint8_t)(value >> 48); + *data++ = (uint8_t)(value >> 40); + *data++ = (uint8_t)(value >> 32); + *data++ = (uint8_t)(value >> 24); + *data++ = (uint8_t)(value >> 16); + *data++ = (uint8_t)(value >> 8); + *data++ = (uint8_t)(value); + packet->size += sizeof(uint64_t); + packet->offs += sizeof(uint64_t); + + TRACELOG(LOG_INFO, "Network: 0x%016" PRIX64 " - %" PRIu64 "\n", (uint64_t)(packet->data - packet->offs), (uint64_t)(packet->data - packet->offs)); +} + +// +uint16_t PacketRead16(Packet *packet) +{ + uint8_t *data = packet->data + packet->offs; + packet->size += sizeof(uint16_t); + packet->offs += sizeof(uint16_t); + uint16_t value = ((uint16_t) data[0] << 8) | data[1]; + TRACELOG(LOG_INFO, "Original: 0x%04" PRIX16 " - %" PRIu16 "\n", value, value); + + return value; +} + +// +uint32_t PacketRead32(Packet *packet) +{ + uint8_t *data = packet->data + packet->offs; + packet->size += sizeof(uint32_t); + packet->offs += sizeof(uint32_t); + uint32_t value = ((uint32_t) data[0] << 24) | ((uint32_t) data[1] << 16) | ((uint32_t) data[2] << 8) | data[3]; + TRACELOG(LOG_INFO, "Original: 0x%08" PRIX32 " - %" PRIu32 "\n", value, value); + + return value; +} + +// +uint64_t PacketRead64(Packet *packet) +{ + uint8_t *data = packet->data + packet->offs; + packet->size += sizeof(uint64_t); + packet->offs += sizeof(uint64_t); + uint64_t value = ((uint64_t) data[0] << 56) | ((uint64_t) data[1] << 48) | ((uint64_t) data[2] << 40) | ((uint64_t) data[3] << 32) | ((uint64_t) data[4] << 24) | ((uint64_t) data[5] << 16) | ((uint64_t) data[6] << 8) | data[7]; + TRACELOG(LOG_INFO, "Original: 0x%016" PRIX64 " - %" PRIu64 "\n", value, value); + + return value; +} + #endif // RNET_IMPLEMENTATION \ No newline at end of file diff --git a/src/gestures.h b/src/gestures.h index c19ceaaa0..2ed9f8fd9 100644 --- a/src/gestures.h +++ b/src/gestures.h @@ -90,7 +90,7 @@ typedef enum { TOUCH_UP, TOUCH_DOWN, TOUCH_MOVE } TouchAction; -// Gesture events +// Gesture event // NOTE: MAX_TOUCH_POINTS fixed to 4 typedef struct { int touchAction; @@ -115,7 +115,7 @@ void ProcessGestureEvent(GestureEvent event); // Process gesture event void UpdateGestures(void); // Update gestures detected (must be called every frame) #if defined(GESTURES_STANDALONE) -void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags +void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags bool IsGestureDetected(int gesture); // Check if a gesture have been detected int GetGestureDetected(void); // Get latest detected gesture int GetTouchPointsCount(void); // Get touch points count @@ -234,9 +234,9 @@ static double GetCurrentTime(void); //---------------------------------------------------------------------------------- // Enable only desired getures to be detected -void SetGesturesEnabled(unsigned int gestureFlags) +void SetGesturesEnabled(unsigned int flags) { - GESTURES.enabledFlags = gestureFlags; + GESTURES.enabledFlags = flags; } // Check if a gesture have been detected @@ -490,7 +490,7 @@ float GetGesturePinchAngle(void) // Module specific Functions Definition //---------------------------------------------------------------------------------- #if defined(GESTURES_STANDALONE) -// Returns angle from two-points vector with X-axis +// Get angle from two-points vector with X-axis static float Vector2Angle(Vector2 v1, Vector2 v2) { float angle = atan2f(v2.y - v1.y, v2.x - v1.x)*(180.0f/PI); diff --git a/src/models.c b/src/models.c index 60e08171c..e927fa56a 100644 --- a/src/models.c +++ b/src/models.c @@ -92,9 +92,7 @@ //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#ifndef DEFAULT_MESH_VERTEX_BUFFERS - #define DEFAULT_MESH_VERTEX_BUFFERS 7 // Number of vertex buffers (VBO) per mesh -#endif +// ... //---------------------------------------------------------------------------------- // Types and Structures Definition @@ -114,9 +112,16 @@ static Model LoadOBJ(const char *fileName); // Load OBJ mesh data #endif #if defined(SUPPORT_FILEFORMAT_IQM) static Model LoadIQM(const char *fileName); // Load IQM mesh data +static ModelAnimation *LoadIQMModelAnimations(const char *fileName, int *animCount); // Load IQM animation data #endif #if defined(SUPPORT_FILEFORMAT_GLTF) static Model LoadGLTF(const char *fileName); // Load GLTF mesh data +static ModelAnimation *LoadGLTFModelAnimations(const char *fileName, int *animCount); // Load GLTF animation data +static void LoadGLTFModelIndices(Model *model, cgltf_accessor *indexAccessor, int primitiveIndex); +static void BindGLTFPrimitiveToBones(Model *model, const cgltf_data *data, int primitiveIndex); +static void LoadGLTFBoneAttribute(Model *model, cgltf_accessor *jointsAccessor, const cgltf_data *data, int primitiveIndex); +static void LoadGLTFMaterial(Model *model, const char *fileName, const cgltf_data *data); +static void InitGLTFBones(Model *model, const cgltf_data *data); #endif //---------------------------------------------------------------------------------- @@ -126,6 +131,11 @@ static Model LoadGLTF(const char *fileName); // Load GLTF mesh data // Draw a line in 3D world space void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color) { + // WARNING: Be careful with internal buffer vertex alignment + // when using RL_LINES or RL_TRIANGLES, data is aligned to fit + // lines-triangles-quads in the same indexed buffers!!! + rlCheckRenderBatchLimit(8); + rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); rlVertex3f(startPos.x, startPos.y, startPos.z); @@ -136,7 +146,7 @@ void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color) // Draw a point in 3D space, actually a small line void DrawPoint3D(Vector3 position, Color color) { - if (rlCheckBufferLimit(8)) rlglDraw(); + rlCheckRenderBatchLimit(8); rlPushMatrix(); rlTranslatef(position.x, position.y, position.z); @@ -151,7 +161,7 @@ void DrawPoint3D(Vector3 position, Color color) // Draw a circle in 3D world space void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color) { - if (rlCheckBufferLimit(2*36)) rlglDraw(); + rlCheckRenderBatchLimit(2*36); rlPushMatrix(); rlTranslatef(center.x, center.y, center.z); @@ -172,7 +182,7 @@ void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rota // Draw a color-filled triangle (vertex in counter-clockwise order!) void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color) { - if (rlCheckBufferLimit(3)) rlglDraw(); + rlCheckRenderBatchLimit(3); rlBegin(RL_TRIANGLES); rlColor4ub(color.r, color.g, color.b, color.a); @@ -187,7 +197,7 @@ void DrawTriangleStrip3D(Vector3 *points, int pointsCount, Color color) { if (pointsCount >= 3) { - if (rlCheckBufferLimit(3*(pointsCount - 2))) rlglDraw(); + rlCheckRenderBatchLimit(3*(pointsCount - 2)); rlBegin(RL_TRIANGLES); rlColor4ub(color.r, color.g, color.b, color.a); @@ -219,7 +229,7 @@ void DrawCube(Vector3 position, float width, float height, float length, Color c float y = 0.0f; float z = 0.0f; - if (rlCheckBufferLimit(36)) rlglDraw(); + rlCheckRenderBatchLimit(36); rlPushMatrix(); // NOTE: Transformation is applied in inverse order (scale -> rotate -> translate) @@ -300,7 +310,7 @@ void DrawCubeWires(Vector3 position, float width, float height, float length, Co float y = 0.0f; float z = 0.0f; - if (rlCheckBufferLimit(36)) rlglDraw(); + rlCheckRenderBatchLimit(36); rlPushMatrix(); rlTranslatef(position.x, position.y, position.z); @@ -377,9 +387,9 @@ void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float hei float y = position.y; float z = position.z; - if (rlCheckBufferLimit(36)) rlglDraw(); + rlCheckRenderBatchLimit(36); - rlEnableTexture(texture.id); + rlSetTexture(texture.id); //rlPushMatrix(); // NOTE: Transformation is applied in inverse order (scale -> rotate -> translate) @@ -428,7 +438,7 @@ void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float hei rlEnd(); //rlPopMatrix(); - rlDisableTexture(); + rlSetTexture(0); } // Draw sphere @@ -441,7 +451,7 @@ void DrawSphere(Vector3 centerPos, float radius, Color color) void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color) { int numVertex = (rings + 2)*slices*6; - if (rlCheckBufferLimit(numVertex)) rlglDraw(); + rlCheckRenderBatchLimit(numVertex); rlPushMatrix(); // NOTE: Transformation is applied in inverse order (scale -> translate) @@ -455,25 +465,25 @@ void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color { for (int j = 0; j < slices; j++) { - rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*i))*sinf(DEG2RAD*(j*360/slices)), - sinf(DEG2RAD*(270+(180/(rings + 1))*i)), - cosf(DEG2RAD*(270+(180/(rings + 1))*i))*cosf(DEG2RAD*(j*360/slices))); - rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*((j+1)*360/slices)), - sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*((j+1)*360/slices))); - rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*(j*360/slices)), - sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*(j*360/slices))); + rlVertex3f(cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*i))*sinf(DEG2RAD*(360.0f*j/slices)), + sinf(DEG2RAD*(270 + (180.0f/(rings + 1))*i)), + cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*i))*cosf(DEG2RAD*(360.0f*j/slices))); + rlVertex3f(cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1)))*sinf(DEG2RAD*(360.0f*(j + 1)/slices)), + sinf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1))), + cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1)))*cosf(DEG2RAD*(360.0f*(j + 1)/slices))); + rlVertex3f(cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1)))*sinf(DEG2RAD*(360.0f*j/slices)), + sinf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1))), + cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1)))*cosf(DEG2RAD*(360.0f*j/slices))); - rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*i))*sinf(DEG2RAD*(j*360/slices)), - sinf(DEG2RAD*(270+(180/(rings + 1))*i)), - cosf(DEG2RAD*(270+(180/(rings + 1))*i))*cosf(DEG2RAD*(j*360/slices))); - rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i)))*sinf(DEG2RAD*((j+1)*360/slices)), - sinf(DEG2RAD*(270+(180/(rings + 1))*(i))), - cosf(DEG2RAD*(270+(180/(rings + 1))*(i)))*cosf(DEG2RAD*((j+1)*360/slices))); - rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*((j+1)*360/slices)), - sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*((j+1)*360/slices))); + rlVertex3f(cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*i))*sinf(DEG2RAD*(360.0f*j/slices)), + sinf(DEG2RAD*(270 + (180.0f/(rings + 1))*i)), + cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*i))*cosf(DEG2RAD*(360.0f*j/slices))); + rlVertex3f(cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i)))*sinf(DEG2RAD*(360.0f*(j + 1)/slices)), + sinf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i))), + cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i)))*cosf(DEG2RAD*(360.0f*(j + 1)/slices))); + rlVertex3f(cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1)))*sinf(DEG2RAD*(360.0f*(j + 1)/slices)), + sinf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1))), + cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1)))*cosf(DEG2RAD*(360.0f*(j + 1)/slices))); } } rlEnd(); @@ -484,7 +494,7 @@ void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color) { int numVertex = (rings + 2)*slices*6; - if (rlCheckBufferLimit(numVertex)) rlglDraw(); + rlCheckRenderBatchLimit(numVertex); rlPushMatrix(); // NOTE: Transformation is applied in inverse order (scale -> translate) @@ -498,26 +508,26 @@ void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Col { for (int j = 0; j < slices; j++) { - rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*i))*sinf(DEG2RAD*(j*360/slices)), - sinf(DEG2RAD*(270+(180/(rings + 1))*i)), - cosf(DEG2RAD*(270+(180/(rings + 1))*i))*cosf(DEG2RAD*(j*360/slices))); - rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*((j+1)*360/slices)), - sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*((j+1)*360/slices))); + rlVertex3f(cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*i))*sinf(DEG2RAD*(360.0f*j/slices)), + sinf(DEG2RAD*(270 + (180.0f/(rings + 1))*i)), + cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*i))*cosf(DEG2RAD*(360.0f*j/slices))); + rlVertex3f(cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1)))*sinf(DEG2RAD*(360.0f*(j + 1)/slices)), + sinf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1))), + cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1)))*cosf(DEG2RAD*(360.0f*(j + 1)/slices))); - rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*((j+1)*360/slices)), - sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*((j+1)*360/slices))); - rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*(j*360/slices)), - sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*(j*360/slices))); + rlVertex3f(cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1)))*sinf(DEG2RAD*(360.0f*(j + 1)/slices)), + sinf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1))), + cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1)))*cosf(DEG2RAD*(360.0f*(j + 1)/slices))); + rlVertex3f(cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1)))*sinf(DEG2RAD*(360.0f*j/slices)), + sinf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1))), + cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1)))*cosf(DEG2RAD*(360.0f*j/slices))); - rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*(j*360/slices)), - sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*(j*360/slices))); - rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*i))*sinf(DEG2RAD*(j*360/slices)), - sinf(DEG2RAD*(270+(180/(rings + 1))*i)), - cosf(DEG2RAD*(270+(180/(rings + 1))*i))*cosf(DEG2RAD*(j*360/slices))); + rlVertex3f(cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1)))*sinf(DEG2RAD*(360.0f*j/slices)), + sinf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1))), + cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*(i + 1)))*cosf(DEG2RAD*(360.0f*j/slices))); + rlVertex3f(cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*i))*sinf(DEG2RAD*(360.0f*j/slices)), + sinf(DEG2RAD*(270 + (180.0f/(rings + 1))*i)), + cosf(DEG2RAD*(270 + (180.0f/(rings + 1))*i))*cosf(DEG2RAD*(360.0f*j/slices))); } } rlEnd(); @@ -531,7 +541,7 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h if (sides < 3) sides = 3; int numVertex = sides*6; - if (rlCheckBufferLimit(numVertex)) rlglDraw(); + rlCheckRenderBatchLimit(numVertex); rlPushMatrix(); rlTranslatef(position.x, position.y, position.z); @@ -545,12 +555,12 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h for (int i = 0; i < 360; i += 360/sides) { rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); //Bottom Left - rlVertex3f(sinf(DEG2RAD*(i + 360/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360/sides))*radiusBottom); //Bottom Right - rlVertex3f(sinf(DEG2RAD*(i + 360/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360/sides))*radiusTop); //Top Right + rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); //Bottom Right + rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); //Top Right rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); //Top Left rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); //Bottom Left - rlVertex3f(sinf(DEG2RAD*(i + 360/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360/sides))*radiusTop); //Top Right + rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); //Top Right } // Draw Cap -------------------------------------------------------------------------------------- @@ -558,7 +568,7 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h { rlVertex3f(0, height, 0); rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); - rlVertex3f(sinf(DEG2RAD*(i + 360/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360/sides))*radiusTop); + rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); } } else @@ -568,7 +578,7 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h { rlVertex3f(0, height, 0); rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); - rlVertex3f(sinf(DEG2RAD*(i + 360/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360/sides))*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); } } @@ -576,7 +586,7 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h for (int i = 0; i < 360; i += 360/sides) { rlVertex3f(0, 0, 0); - rlVertex3f(sinf(DEG2RAD*(i + 360/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360/sides))*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); } rlEnd(); @@ -590,7 +600,7 @@ void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, fl if (sides < 3) sides = 3; int numVertex = sides*8; - if (rlCheckBufferLimit(numVertex)) rlglDraw(); + rlCheckRenderBatchLimit(numVertex); rlPushMatrix(); rlTranslatef(position.x, position.y, position.z); @@ -601,12 +611,12 @@ void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, fl for (int i = 0; i < 360; i += 360/sides) { rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); - rlVertex3f(sinf(DEG2RAD*(i + 360/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360/sides))*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); - rlVertex3f(sinf(DEG2RAD*(i + 360/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360/sides))*radiusBottom); - rlVertex3f(sinf(DEG2RAD*(i + 360/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360/sides))*radiusTop); + rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusBottom, 0, cosf(DEG2RAD*(i + 360.0f/sides))*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); - rlVertex3f(sinf(DEG2RAD*(i + 360/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360/sides))*radiusTop); + rlVertex3f(sinf(DEG2RAD*(i + 360.0f/sides))*radiusTop, height, cosf(DEG2RAD*(i + 360.0f/sides))*radiusTop); rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); @@ -619,7 +629,7 @@ void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, fl // Draw a plane void DrawPlane(Vector3 centerPos, Vector2 size, Color color) { - if (rlCheckBufferLimit(4)) rlglDraw(); + rlCheckRenderBatchLimit(4); // NOTE: Plane is always created on XZ ground rlPushMatrix(); @@ -657,7 +667,7 @@ void DrawGrid(int slices, float spacing) { int halfSlices = slices/2; - if (rlCheckBufferLimit((slices + 2)*4)) rlglDraw(); + rlCheckRenderBatchLimit((slices + 2)*4); rlBegin(RL_LINES); for (int i = -halfSlices; i <= halfSlices; i++) @@ -686,29 +696,6 @@ void DrawGrid(int slices, float spacing) rlEnd(); } -// Draw gizmo -void DrawGizmo(Vector3 position) -{ - // NOTE: RGB = XYZ - float length = 1.0f; - - rlPushMatrix(); - rlTranslatef(position.x, position.y, position.z); - rlScalef(length, length, length); - - rlBegin(RL_LINES); - rlColor3f(1.0f, 0.0f, 0.0f); rlVertex3f(0.0f, 0.0f, 0.0f); - rlColor3f(1.0f, 0.0f, 0.0f); rlVertex3f(1.0f, 0.0f, 0.0f); - - rlColor3f(0.0f, 1.0f, 0.0f); rlVertex3f(0.0f, 0.0f, 0.0f); - rlColor3f(0.0f, 1.0f, 0.0f); rlVertex3f(0.0f, 1.0f, 0.0f); - - rlColor3f(0.0f, 0.0f, 1.0f); rlVertex3f(0.0f, 0.0f, 0.0f); - rlColor3f(0.0f, 0.0f, 1.0f); rlVertex3f(0.0f, 0.0f, 1.0f); - rlEnd(); - rlPopMatrix(); -} - // Load model from files (mesh and material) Model LoadModel(const char *fileName) { @@ -741,7 +728,7 @@ Model LoadModel(const char *fileName) else { // Upload vertex data to GPU (static mesh) - for (int i = 0; i < model.meshCount; i++) rlLoadMesh(&model.meshes[i], false); + for (int i = 0; i < model.meshCount; i++) UploadMesh(&model.meshes[i], false); } if (model.materialCount == 0) @@ -790,15 +777,11 @@ void UnloadModel(Model model) // Unload meshes for (int i = 0; i < model.meshCount; i++) UnloadMesh(model.meshes[i]); - // Unload materials maps and params + // Unload materials maps // NOTE: As the user could be sharing shaders and textures between models, - // we don't unload the material but just free it's maps and params, + // we don't unload the material but just free it's maps, // the user is responsible for freeing models shaders and textures - for (int i = 0; i < model.materialCount; i++) - { - RL_FREE(model.materials[i].maps); - RL_FREE(model.materials[i].params); - } + for (int i = 0; i < model.materialCount; i++) RL_FREE(model.materials[i].maps); // Unload arrays RL_FREE(model.meshes); @@ -815,15 +798,11 @@ void UnloadModel(Model model) // Unload model (but not meshes) from memory (RAM and/or VRAM) void UnloadModelKeepMeshes(Model model) { - // Unload materials maps and params + // Unload materials maps // NOTE: As the user could be sharing shaders and textures between models, - // we don't unload the material but just free it's maps and params, + // we don't unload the material but just free it's maps, // the user is responsible for freeing models shaders and textures - for (int i = 0; i < model.materialCount; i++) - { - RL_FREE(model.materials[i].maps); - RL_FREE(model.materials[i].params); - } + for (int i = 0; i < model.materialCount; i++) RL_FREE(model.materials[i].maps); // Unload arrays RL_FREE(model.meshes); @@ -837,23 +816,431 @@ void UnloadModelKeepMeshes(Model model) TRACELOG(LOG_INFO, "MODEL: Unloaded model (but not meshes) from RAM and VRAM"); } -// Load meshes from model file -Mesh *LoadMeshes(const char *fileName, int *meshCount) +// Upload vertex data into a VAO (if supported) and VBO +void UploadMesh(Mesh *mesh, bool dynamic) { - Mesh *meshes = NULL; - int count = 0; + if (mesh->vaoId > 0) + { + // Check if mesh has already been loaded in GPU + TRACELOG(LOG_WARNING, "VAO: [ID %i] Trying to re-load an already loaded mesh", mesh->vaoId); + return; + } - // TODO: Load meshes from file (OBJ, IQM, GLTF) + mesh->vboId = (unsigned int *)RL_CALLOC(MAX_MESH_VERTEX_BUFFERS, sizeof(unsigned int)); - *meshCount = count; - return meshes; + mesh->vaoId = 0; // Vertex Array Object + mesh->vboId[0] = 0; // Vertex buffer: positions + mesh->vboId[1] = 0; // Vertex buffer: texcoords + mesh->vboId[2] = 0; // Vertex buffer: normals + mesh->vboId[3] = 0; // Vertex buffer: colors + mesh->vboId[4] = 0; // Vertex buffer: tangents + mesh->vboId[5] = 0; // Vertex buffer: texcoords2 + mesh->vboId[6] = 0; // Vertex buffer: indices + +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + mesh->vaoId = rlLoadVertexArray(); + rlEnableVertexArray(mesh->vaoId); + + // NOTE: Attributes must be uploaded considering default locations points + + // Enable vertex attributes: position (shader-location = 0) + mesh->vboId[0] = rlLoadVertexBuffer(mesh->vertices, mesh->vertexCount*3*sizeof(float), dynamic); + rlSetVertexAttribute(0, 3, RL_FLOAT, 0, 0, 0); + rlEnableVertexAttribute(0); + + // Enable vertex attributes: texcoords (shader-location = 1) + mesh->vboId[1] = rlLoadVertexBuffer(mesh->texcoords, mesh->vertexCount*2*sizeof(float), dynamic); + rlSetVertexAttribute(1, 2, RL_FLOAT, 0, 0, 0); + rlEnableVertexAttribute(1); + + if (mesh->normals != NULL) + { + // Enable vertex attributes: normals (shader-location = 2) + mesh->vboId[2] = rlLoadVertexBuffer(mesh->normals, mesh->vertexCount*3*sizeof(float), dynamic); + rlSetVertexAttribute(2, 3, RL_FLOAT, 0, 0, 0); + rlEnableVertexAttribute(2); + } + else + { + // Default color vertex attribute set to WHITE + float value[3] = { 1.0f, 1.0f, 1.0f }; + rlSetVertexAttributeDefault(2, value, SHADER_ATTRIB_VEC3, 3); + rlDisableVertexAttribute(2); + } + + if (mesh->colors != NULL) + { + // Enable vertex attribute: color (shader-location = 3) + mesh->vboId[3] = rlLoadVertexBuffer(mesh->colors, mesh->vertexCount*4*sizeof(unsigned char), dynamic); + rlSetVertexAttribute(3, 4, RL_UNSIGNED_BYTE, 1, 0, 0); + rlEnableVertexAttribute(3); + } + else + { + // Default color vertex attribute set to WHITE + float value[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; + rlSetVertexAttributeDefault(3, value, SHADER_ATTRIB_VEC4, 4); + rlDisableVertexAttribute(3); + } + + if (mesh->tangents != NULL) + { + // Enable vertex attribute: tangent (shader-location = 4) + mesh->vboId[4] = rlLoadVertexBuffer(mesh->tangents, mesh->vertexCount*4*sizeof(float), dynamic); + rlSetVertexAttribute(4, 4, RL_FLOAT, 0, 0, 0); + rlEnableVertexAttribute(4); + } + else + { + // Default tangents vertex attribute + float value[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; + rlSetVertexAttributeDefault(4, value, SHADER_ATTRIB_VEC4, 4); + rlDisableVertexAttribute(4); + } + + if (mesh->texcoords2 != NULL) + { + // Enable vertex attribute: texcoord2 (shader-location = 5) + mesh->vboId[5] = rlLoadVertexBuffer(mesh->texcoords2, mesh->vertexCount*2*sizeof(float), dynamic); + rlSetVertexAttribute(5, 2, RL_FLOAT, 0, 0, 0); + rlEnableVertexAttribute(5); + } + else + { + // Default texcoord2 vertex attribute + float value[2] = { 0.0f, 0.0f }; + rlSetVertexAttributeDefault(5, value, SHADER_ATTRIB_VEC2, 2); + rlDisableVertexAttribute(5); + } + + if (mesh->indices != NULL) + { + mesh->vboId[6] = rlLoadVertexBufferElement(mesh->indices, mesh->triangleCount*3*sizeof(unsigned short), dynamic); + } + + if (mesh->vaoId > 0) TRACELOG(LOG_INFO, "VAO: [ID %i] Mesh uploaded successfully to VRAM (GPU)", mesh->vaoId); + else TRACELOG(LOG_INFO, "VBO: Mesh uploaded successfully to VRAM (GPU)"); + + rlDisableVertexArray(); +#endif } -// Unload mesh from memory (RAM and/or VRAM) +// Update mesh vertex data in GPU for a specific buffer index +void UpdateMeshBuffer(Mesh mesh, int index, void *data, int dataSize, int offset) +{ + rlUpdateVertexBuffer(mesh.vboId[index], data, dataSize, offset); +} + +// Draw a 3d mesh with material and transform +void DrawMesh(Mesh mesh, Material material, Matrix transform) +{ + DrawMeshInstanced(mesh, material, &transform, 1); +} + +// Draw multiple mesh instances with material and different transforms +void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int instances) +{ +#if defined(GRAPHICS_API_OPENGL_11) + #define GL_VERTEX_ARRAY 0x8074 + #define GL_NORMAL_ARRAY 0x8075 + #define GL_COLOR_ARRAY 0x8076 + #define GL_TEXTURE_COORD_ARRAY 0x8078 + + rlEnableTexture(material.maps[MATERIAL_MAP_DIFFUSE].texture.id); + + rlEnableStatePointer(GL_VERTEX_ARRAY, mesh.vertices); + rlEnableStatePointer(GL_TEXTURE_COORD_ARRAY, mesh.texcoords); + rlEnableStatePointer(GL_NORMAL_ARRAY, mesh.normals); + rlEnableStatePointer(GL_COLOR_ARRAY, mesh.colors); + + rlPushMatrix(); + rlMultMatrixf(MatrixToFloat(transforms[0])); + rlColor4ub(material.maps[MATERIAL_MAP_DIFFUSE].color.r, + material.maps[MATERIAL_MAP_DIFFUSE].color.g, + material.maps[MATERIAL_MAP_DIFFUSE].color.b, + material.maps[MATERIAL_MAP_DIFFUSE].color.a); + + if (mesh.indices != NULL) rlDrawVertexArrayElements(0, mesh.triangleCount*3, mesh.indices); + else rlDrawVertexArray(0, mesh.vertexCount); + rlPopMatrix(); + + rlDisableStatePointer(GL_VERTEX_ARRAY); + rlDisableStatePointer(GL_TEXTURE_COORD_ARRAY); + rlDisableStatePointer(GL_NORMAL_ARRAY); + rlDisableStatePointer(GL_COLOR_ARRAY); + + rlDisableTexture(); +#endif + +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + // Check instancing + bool instancing = false; + if (instances < 1) return; + else if (instances > 1) instancing = true; + float16 *instanceTransforms = NULL; + unsigned int instancesVboId = 0; + + // Bind shader program + rlEnableShader(material.shader.id); + + // Send required data to shader (matrices, values) + //----------------------------------------------------- + // Upload to shader material.colDiffuse + if (material.shader.locs[SHADER_LOC_COLOR_DIFFUSE] != -1) + { + float values[4] = { + (float)material.maps[MATERIAL_MAP_DIFFUSE].color.r/255.0f, + (float)material.maps[MATERIAL_MAP_DIFFUSE].color.g/255.0f, + (float)material.maps[MATERIAL_MAP_DIFFUSE].color.b/255.0f, + (float)material.maps[MATERIAL_MAP_DIFFUSE].color.a/255.0f + }; + + rlSetUniform(material.shader.locs[SHADER_LOC_COLOR_DIFFUSE], values, SHADER_UNIFORM_VEC4, 1); + } + + // Upload to shader material.colSpecular (if location available) + if (material.shader.locs[SHADER_LOC_COLOR_SPECULAR] != -1) + { + float values[4] = { + (float)material.maps[SHADER_LOC_COLOR_SPECULAR].color.r/255.0f, + (float)material.maps[SHADER_LOC_COLOR_SPECULAR].color.g/255.0f, + (float)material.maps[SHADER_LOC_COLOR_SPECULAR].color.b/255.0f, + (float)material.maps[SHADER_LOC_COLOR_SPECULAR].color.a/255.0f + }; + + rlSetUniform(material.shader.locs[SHADER_LOC_COLOR_SPECULAR], values, SHADER_UNIFORM_VEC4, 1); + } + + // Get a copy of current matrices to work with, + // just in case stereo render is required and we need to modify them + // NOTE: At this point the modelview matrix just contains the view matrix (camera) + // That's because BeginMode3D() sets it and there is no model-drawing function + // that modifies it, all use rlPushMatrix() and rlPopMatrix() + Matrix matView = rlGetMatrixModelview(); + Matrix matModelView = matView; + Matrix matProjection = rlGetMatrixProjection(); + + // Upload view and projection matrices (if locations available) + if (material.shader.locs[SHADER_LOC_MATRIX_VIEW] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_VIEW], matView); + if (material.shader.locs[SHADER_LOC_MATRIX_PROJECTION] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_PROJECTION], matProjection); + + if (instancing) + { + // Create instances buffer + instanceTransforms = (float16 *)RL_MALLOC(instances*sizeof(float16)); + + // Fill buffer with instances transformations as float16 arrays + for (int i = 0; i < instances; i++) instanceTransforms[i] = MatrixToFloatV(transforms[i]); + + // Enable mesh VAO to attach new buffer + rlEnableVertexArray(mesh.vaoId); + + // This could alternatively use a static VBO and either glMapBuffer() or glBufferSubData(). + // It isn't clear which would be reliably faster in all cases and on all platforms, + // anecdotally glMapBuffer() seems very slow (syncs) while glBufferSubData() seems + // no faster, since we're transferring all the transform matrices anyway + instancesVboId = rlLoadVertexBuffer(instanceTransforms, instances*sizeof(float16), false); + + // Instances transformation matrices are send to shader attribute location: SHADER_LOC_MATRIX_MODEL + for (unsigned int i = 0; i < 4; i++) + { + rlEnableVertexAttribute(material.shader.locs[SHADER_LOC_MATRIX_MODEL] + i); + rlSetVertexAttribute(material.shader.locs[SHADER_LOC_MATRIX_MODEL] + i, 4, RL_FLOAT, 0, sizeof(Matrix), (void *)(i*sizeof(Vector4))); + rlSetVertexAttributeDivisor(material.shader.locs[SHADER_LOC_MATRIX_MODEL] + i, 1); + } + + rlDisableVertexBuffer(); + rlDisableVertexArray(); + + // Accumulate internal matrix transform (push/pop) and view matrix + // NOTE: In this case, model instance transformation must be computed in the shader + matModelView = MatrixMultiply(rlGetMatrixTransform(), matView); + } + else + { + // Model transformation matrix is send to shader uniform location: SHADER_LOC_MATRIX_MODEL + if (material.shader.locs[SHADER_LOC_MATRIX_MODEL] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_MODEL], transforms[0]); + + // Accumulate several transformations: + // matView: rlgl internal modelview matrix (actually, just view matrix) + // rlGetMatrixTransform(): rlgl internal transform matrix due to push/pop matrix stack + // transform: function parameter transformation + matModelView = MatrixMultiply(transforms[0], MatrixMultiply(rlGetMatrixTransform(), matView)); + } + + // Upload model normal matrix (if locations available) + if (material.shader.locs[SHADER_LOC_MATRIX_NORMAL] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_NORMAL], MatrixTranspose(MatrixInvert(matModelView))); + //----------------------------------------------------- + + // Bind active texture maps (if available) + for (int i = 0; i < MAX_MATERIAL_MAPS; i++) + { + if (material.maps[i].texture.id > 0) + { + // Select current shader texture slot + rlActiveTextureSlot(i); + + // Enable texture for active slot + if ((i == MATERIAL_MAP_IRRADIANCE) || + (i == MATERIAL_MAP_PREFILTER) || + (i == MATERIAL_MAP_CUBEMAP)) rlEnableTextureCubemap(material.maps[i].texture.id); + else rlEnableTexture(material.maps[i].texture.id); + + rlSetUniform(material.shader.locs[SHADER_LOC_MAP_DIFFUSE + i], &i, SHADER_UNIFORM_INT, 1); + } + } + + // Try binding vertex array objects (VAO) + // or use VBOs if not possible + if (!rlEnableVertexArray(mesh.vaoId)) + { + // Bind mesh VBO data: vertex position (shader-location = 0) + rlEnableVertexBuffer(mesh.vboId[0]); + rlSetVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_POSITION], 3, RL_FLOAT, 0, 0, 0); + rlEnableVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_POSITION]); + + rlEnableVertexBuffer(mesh.vboId[0]); + rlSetVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_POSITION], 3, RL_FLOAT, 0, 0, 0); + rlEnableVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_POSITION]); + + // Bind mesh VBO data: vertex texcoords (shader-location = 1) + rlEnableVertexBuffer(mesh.vboId[1]); + rlSetVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_TEXCOORD01], 2, RL_FLOAT, 0, 0, 0); + rlEnableVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_TEXCOORD01]); + + if (material.shader.locs[SHADER_LOC_VERTEX_NORMAL] != -1) + { + // Bind mesh VBO data: vertex normals (shader-location = 2) + rlEnableVertexBuffer(mesh.vboId[2]); + rlSetVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_NORMAL], 3, RL_FLOAT, 0, 0, 0); + rlEnableVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_NORMAL]); + } + + // Bind mesh VBO data: vertex colors (shader-location = 3, if available) + if (material.shader.locs[SHADER_LOC_VERTEX_COLOR] != -1) + { + if (mesh.vboId[3] != 0) + { + rlEnableVertexBuffer(mesh.vboId[3]); + rlSetVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_COLOR], 4, RL_UNSIGNED_BYTE, 1, 0, 0); + rlEnableVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_COLOR]); + } + else + { + // Set default value for unused attribute + // NOTE: Required when using default shader and no VAO support + float value[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; + rlSetVertexAttributeDefault(material.shader.locs[SHADER_LOC_VERTEX_COLOR], value, SHADER_ATTRIB_VEC2, 4); + rlDisableVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_COLOR]); + } + } + + // Bind mesh VBO data: vertex tangents (shader-location = 4, if available) + if (material.shader.locs[SHADER_LOC_VERTEX_TANGENT] != -1) + { + rlEnableVertexBuffer(mesh.vboId[4]); + rlSetVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_TANGENT], 4, RL_FLOAT, 0, 0, 0); + rlEnableVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_TANGENT]); + } + + // Bind mesh VBO data: vertex texcoords2 (shader-location = 5, if available) + if (material.shader.locs[SHADER_LOC_VERTEX_TEXCOORD02] != -1) + { + rlEnableVertexBuffer(mesh.vboId[5]); + rlSetVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_TEXCOORD02], 2, RL_FLOAT, 0, 0, 0); + rlEnableVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_TEXCOORD02]); + } + + if (mesh.indices != NULL) rlEnableVertexBufferElement(mesh.vboId[6]); + } + + int eyesCount = 1; + if (rlIsStereoRenderEnabled()) eyesCount = 2; + + for (int eye = 0; eye < eyesCount; eye++) + { + // Calculate model-view-projection matrix (MVP) + Matrix matMVP = MatrixIdentity(); + if (eyesCount == 1) matMVP = MatrixMultiply(matModelView, matProjection); + else + { + // Setup current eye viewport (half screen width) + rlViewport(eye*rlGetFramebufferWidth()/2, 0, rlGetFramebufferWidth()/2, rlGetFramebufferHeight()); + matMVP = MatrixMultiply(MatrixMultiply(matModelView, rlGetMatrixViewOffsetStereo(eye)), rlGetMatrixProjectionStereo(eye)); + } + + // Send combined model-view-projection matrix to shader + rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_MVP], matMVP); + + if (instancing) // Draw mesh instanced + { + if (mesh.indices != NULL) rlDrawVertexArrayElementsInstanced(0, mesh.triangleCount*3, 0, instances); + else rlDrawVertexArrayInstanced(0, mesh.vertexCount, instances); + } + else // Draw mesh + { + if (mesh.indices != NULL) rlDrawVertexArrayElements(0, mesh.triangleCount*3, 0); + else rlDrawVertexArray(0, mesh.vertexCount); + } + } + + // Unbind all binded texture maps + for (int i = 0; i < MAX_MATERIAL_MAPS; i++) + { + // Select current shader texture slot + rlActiveTextureSlot(i); + + // Disable texture for active slot + if ((i == MATERIAL_MAP_IRRADIANCE) || + (i == MATERIAL_MAP_PREFILTER) || + (i == MATERIAL_MAP_CUBEMAP)) rlDisableTextureCubemap(); + else rlDisableTexture(); + } + + // Disable all possible vertex array objects (or VBOs) + rlDisableVertexArray(); + rlDisableVertexBuffer(); + rlDisableVertexBufferElement(); + + // Disable shader program + rlDisableShader(); + + if (instancing) + { + // Remove instance transforms buffer + rlUnloadVertexBuffer(instancesVboId); + RL_FREE(instanceTransforms); + } + else + { + // Restore rlgl internal modelview and projection matrices + rlSetMatrixModelview(matView); + rlSetMatrixProjection(matProjection); + } +#endif +} + +// Unload mesh from memory (RAM and VRAM) void UnloadMesh(Mesh mesh) { - rlUnloadMesh(mesh); + // Unload rlgl mesh vboId data + rlUnloadVertexArray(mesh.vaoId); + + for (int i = 0; i < MAX_MESH_VERTEX_BUFFERS; i++) rlUnloadVertexBuffer(mesh.vboId[i]); RL_FREE(mesh.vboId); + + RL_FREE(mesh.vertices); + RL_FREE(mesh.texcoords); + RL_FREE(mesh.normals); + RL_FREE(mesh.colors); + RL_FREE(mesh.tangents); + RL_FREE(mesh.texcoords2); + RL_FREE(mesh.indices); + + RL_FREE(mesh.animVertices); + RL_FREE(mesh.animNormals); + RL_FREE(mesh.boneWeights); + RL_FREE(mesh.boneIds); } // Export mesh data to file @@ -923,6 +1310,7 @@ bool ExportMesh(Mesh mesh, const char *fileName) return success; } + // Load materials from model file Material *LoadMaterials(const char *fileName, int *materialCount) { @@ -950,7 +1338,7 @@ Material *LoadMaterials(const char *fileName, int *materialCount) // Set materials shader to default (DIFFUSE, SPECULAR, NORMAL) if (materials != NULL) { - for (unsigned int i = 0; i < count; i++) materials[i].shader = GetShaderDefault(); + for (unsigned int i = 0; i < count; i++) materials[i].shader = rlGetShaderDefault(); } *materialCount = count; @@ -963,13 +1351,13 @@ Material LoadMaterialDefault(void) Material material = { 0 }; material.maps = (MaterialMap *)RL_CALLOC(MAX_MATERIAL_MAPS, sizeof(MaterialMap)); - material.shader = GetShaderDefault(); - material.maps[MAP_DIFFUSE].texture = GetTextureDefault(); // White texture (1x1 pixel) - //material.maps[MAP_NORMAL].texture; // NOTE: By default, not set - //material.maps[MAP_SPECULAR].texture; // NOTE: By default, not set + material.shader = rlGetShaderDefault(); + material.maps[MATERIAL_MAP_DIFFUSE].texture = rlGetTextureDefault(); // White texture (1x1 pixel) + //material.maps[MATERIAL_MAP_NORMAL].texture; // NOTE: By default, not set + //material.maps[MATERIAL_MAP_SPECULAR].texture; // NOTE: By default, not set - material.maps[MAP_DIFFUSE].color = WHITE; // Diffuse color - material.maps[MAP_SPECULAR].color = WHITE; // Specular color + material.maps[MATERIAL_MAP_DIFFUSE].color = WHITE; // Diffuse color + material.maps[MATERIAL_MAP_SPECULAR].color = WHITE; // Specular color return material; } @@ -978,19 +1366,18 @@ Material LoadMaterialDefault(void) void UnloadMaterial(Material material) { // Unload material shader (avoid unloading default shader, managed by raylib) - if (material.shader.id != GetShaderDefault().id) UnloadShader(material.shader); + if (material.shader.id != rlGetShaderDefault().id) UnloadShader(material.shader); // Unload loaded texture maps (avoid unloading default texture, managed by raylib) for (int i = 0; i < MAX_MATERIAL_MAPS; i++) { - if (material.maps[i].texture.id != GetTextureDefault().id) rlUnloadTexture(material.maps[i].texture.id); + if (material.maps[i].texture.id != rlGetTextureDefault().id) rlUnloadTexture(material.maps[i].texture.id); } RL_FREE(material.maps); - RL_FREE(material.params); } -// Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) +// Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) // NOTE: Previous texture should be manually unloaded void SetMaterialTexture(Material *material, int mapType, Texture2D texture) { @@ -1008,210 +1395,14 @@ void SetModelMeshMaterial(Model *model, int meshId, int materialId) // Load model animations from file ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount) { - #define IQM_MAGIC "INTERQUAKEMODEL" // IQM file magic number - #define IQM_VERSION 2 // only IQM version 2 supported + ModelAnimation *animations = NULL; - unsigned int fileSize = 0; - unsigned char *fileData = LoadFileData(fileName, &fileSize); - unsigned char *fileDataPtr = fileData; - - typedef struct IQMHeader { - char magic[16]; - unsigned int version; - unsigned int filesize; - unsigned int flags; - unsigned int num_text, ofs_text; - unsigned int num_meshes, ofs_meshes; - unsigned int num_vertexarrays, num_vertexes, ofs_vertexarrays; - unsigned int num_triangles, ofs_triangles, ofs_adjacency; - unsigned int num_joints, ofs_joints; - unsigned int num_poses, ofs_poses; - unsigned int num_anims, ofs_anims; - unsigned int num_frames, num_framechannels, ofs_frames, ofs_bounds; - unsigned int num_comment, ofs_comment; - unsigned int num_extensions, ofs_extensions; - } IQMHeader; - - typedef struct IQMPose { - int parent; - unsigned int mask; - float channeloffset[10]; - float channelscale[10]; - } IQMPose; - - typedef struct IQMAnim { - unsigned int name; - unsigned int first_frame, num_frames; - float framerate; - unsigned int flags; - } IQMAnim; - - // In case file can not be read, return an empty model - if (fileDataPtr == NULL) return NULL; - - // Read IQM header - IQMHeader *iqmHeader = (IQMHeader *)fileDataPtr; - - if (memcmp(iqmHeader->magic, IQM_MAGIC, sizeof(IQM_MAGIC)) != 0) - { - TRACELOG(LOG_WARNING, "MODEL: [%s] IQM file is not a valid model", fileName); - return NULL; - } - - if (iqmHeader->version != IQM_VERSION) - { - TRACELOG(LOG_WARNING, "MODEL: [%s] IQM file version not supported (%i)", fileName, iqmHeader->version); - return NULL; - } - - // Get bones data - IQMPose *poses = RL_MALLOC(iqmHeader->num_poses*sizeof(IQMPose)); - //fseek(iqmFile, iqmHeader->ofs_poses, SEEK_SET); - //fread(poses, iqmHeader->num_poses*sizeof(IQMPose), 1, iqmFile); - memcpy(poses, fileDataPtr + iqmHeader->ofs_poses, iqmHeader->num_poses*sizeof(IQMPose)); - - // Get animations data - *animCount = iqmHeader->num_anims; - IQMAnim *anim = RL_MALLOC(iqmHeader->num_anims*sizeof(IQMAnim)); - //fseek(iqmFile, iqmHeader->ofs_anims, SEEK_SET); - //fread(anim, iqmHeader->num_anims*sizeof(IQMAnim), 1, iqmFile); - memcpy(anim, fileDataPtr + iqmHeader->ofs_anims, iqmHeader->num_anims*sizeof(IQMAnim)); - - ModelAnimation *animations = RL_MALLOC(iqmHeader->num_anims*sizeof(ModelAnimation)); - - // frameposes - unsigned short *framedata = RL_MALLOC(iqmHeader->num_frames*iqmHeader->num_framechannels*sizeof(unsigned short)); - //fseek(iqmFile, iqmHeader->ofs_frames, SEEK_SET); - //fread(framedata, iqmHeader->num_frames*iqmHeader->num_framechannels*sizeof(unsigned short), 1, iqmFile); - memcpy(framedata, fileDataPtr + iqmHeader->ofs_frames, iqmHeader->num_frames*iqmHeader->num_framechannels*sizeof(unsigned short)); - - for (unsigned int a = 0; a < iqmHeader->num_anims; a++) - { - animations[a].frameCount = anim[a].num_frames; - animations[a].boneCount = iqmHeader->num_poses; - animations[a].bones = RL_MALLOC(iqmHeader->num_poses*sizeof(BoneInfo)); - animations[a].framePoses = RL_MALLOC(anim[a].num_frames*sizeof(Transform *)); - //animations[a].framerate = anim.framerate; // TODO: Use framerate? - - for (unsigned int j = 0; j < iqmHeader->num_poses; j++) - { - strcpy(animations[a].bones[j].name, "ANIMJOINTNAME"); - animations[a].bones[j].parent = poses[j].parent; - } - - for (unsigned int j = 0; j < anim[a].num_frames; j++) animations[a].framePoses[j] = RL_MALLOC(iqmHeader->num_poses*sizeof(Transform)); - - int dcounter = anim[a].first_frame*iqmHeader->num_framechannels; - - for (unsigned int frame = 0; frame < anim[a].num_frames; frame++) - { - for (unsigned int i = 0; i < iqmHeader->num_poses; i++) - { - animations[a].framePoses[frame][i].translation.x = poses[i].channeloffset[0]; - - if (poses[i].mask & 0x01) - { - animations[a].framePoses[frame][i].translation.x += framedata[dcounter]*poses[i].channelscale[0]; - dcounter++; - } - - animations[a].framePoses[frame][i].translation.y = poses[i].channeloffset[1]; - - if (poses[i].mask & 0x02) - { - animations[a].framePoses[frame][i].translation.y += framedata[dcounter]*poses[i].channelscale[1]; - dcounter++; - } - - animations[a].framePoses[frame][i].translation.z = poses[i].channeloffset[2]; - - if (poses[i].mask & 0x04) - { - animations[a].framePoses[frame][i].translation.z += framedata[dcounter]*poses[i].channelscale[2]; - dcounter++; - } - - animations[a].framePoses[frame][i].rotation.x = poses[i].channeloffset[3]; - - if (poses[i].mask & 0x08) - { - animations[a].framePoses[frame][i].rotation.x += framedata[dcounter]*poses[i].channelscale[3]; - dcounter++; - } - - animations[a].framePoses[frame][i].rotation.y = poses[i].channeloffset[4]; - - if (poses[i].mask & 0x10) - { - animations[a].framePoses[frame][i].rotation.y += framedata[dcounter]*poses[i].channelscale[4]; - dcounter++; - } - - animations[a].framePoses[frame][i].rotation.z = poses[i].channeloffset[5]; - - if (poses[i].mask & 0x20) - { - animations[a].framePoses[frame][i].rotation.z += framedata[dcounter]*poses[i].channelscale[5]; - dcounter++; - } - - animations[a].framePoses[frame][i].rotation.w = poses[i].channeloffset[6]; - - if (poses[i].mask & 0x40) - { - animations[a].framePoses[frame][i].rotation.w += framedata[dcounter]*poses[i].channelscale[6]; - dcounter++; - } - - animations[a].framePoses[frame][i].scale.x = poses[i].channeloffset[7]; - - if (poses[i].mask & 0x80) - { - animations[a].framePoses[frame][i].scale.x += framedata[dcounter]*poses[i].channelscale[7]; - dcounter++; - } - - animations[a].framePoses[frame][i].scale.y = poses[i].channeloffset[8]; - - if (poses[i].mask & 0x100) - { - animations[a].framePoses[frame][i].scale.y += framedata[dcounter]*poses[i].channelscale[8]; - dcounter++; - } - - animations[a].framePoses[frame][i].scale.z = poses[i].channeloffset[9]; - - if (poses[i].mask & 0x200) - { - animations[a].framePoses[frame][i].scale.z += framedata[dcounter]*poses[i].channelscale[9]; - dcounter++; - } - - animations[a].framePoses[frame][i].rotation = QuaternionNormalize(animations[a].framePoses[frame][i].rotation); - } - } - - // Build frameposes - for (unsigned int frame = 0; frame < anim[a].num_frames; frame++) - { - for (int i = 0; i < animations[a].boneCount; i++) - { - if (animations[a].bones[i].parent >= 0) - { - animations[a].framePoses[frame][i].rotation = QuaternionMultiply(animations[a].framePoses[frame][animations[a].bones[i].parent].rotation, animations[a].framePoses[frame][i].rotation); - animations[a].framePoses[frame][i].translation = Vector3RotateByQuaternion(animations[a].framePoses[frame][i].translation, animations[a].framePoses[frame][animations[a].bones[i].parent].rotation); - animations[a].framePoses[frame][i].translation = Vector3Add(animations[a].framePoses[frame][i].translation, animations[a].framePoses[frame][animations[a].bones[i].parent].translation); - animations[a].framePoses[frame][i].scale = Vector3Multiply(animations[a].framePoses[frame][i].scale, animations[a].framePoses[frame][animations[a].bones[i].parent].scale); - } - } - } - } - - RL_FREE(fileData); - - RL_FREE(framedata); - RL_FREE(poses); - RL_FREE(anim); +#if defined(SUPPORT_FILEFORMAT_IQM) + if (IsFileExtension(fileName, ".iqm")) animations = LoadIQMModelAnimations(fileName, animCount); +#endif +#if defined(SUPPORT_FILEFORMAT_GLTF) + if (IsFileExtension(fileName, ".gltf;.glb")) animations = LoadGLTFModelAnimations(fileName, animCount); +#endif return animations; } @@ -1240,47 +1431,69 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) int vCounter = 0; int boneCounter = 0; int boneId = 0; + float boneWeight = 0.0; for (int i = 0; i < model.meshes[m].vertexCount; i++) { - boneId = model.meshes[m].boneIds[boneCounter]; - inTranslation = model.bindPose[boneId].translation; - inRotation = model.bindPose[boneId].rotation; - //inScale = model.bindPose[boneId].scale; - outTranslation = anim.framePoses[frame][boneId].translation; - outRotation = anim.framePoses[frame][boneId].rotation; - outScale = anim.framePoses[frame][boneId].scale; + model.meshes[m].animVertices[vCounter] = 0; + model.meshes[m].animVertices[vCounter + 1] = 0; + model.meshes[m].animVertices[vCounter + 2] = 0; - // Vertices processing - // NOTE: We use meshes.vertices (default vertex position) to calculate meshes.animVertices (animated vertex position) - animVertex = (Vector3){ model.meshes[m].vertices[vCounter], model.meshes[m].vertices[vCounter + 1], model.meshes[m].vertices[vCounter + 2] }; - animVertex = Vector3Multiply(animVertex, outScale); - animVertex = Vector3Subtract(animVertex, inTranslation); - animVertex = Vector3RotateByQuaternion(animVertex, QuaternionMultiply(outRotation, QuaternionInvert(inRotation))); - animVertex = Vector3Add(animVertex, outTranslation); - model.meshes[m].animVertices[vCounter] = animVertex.x; - model.meshes[m].animVertices[vCounter + 1] = animVertex.y; - model.meshes[m].animVertices[vCounter + 2] = animVertex.z; + model.meshes[m].animNormals[vCounter] = 0; + model.meshes[m].animNormals[vCounter + 1] = 0; + model.meshes[m].animNormals[vCounter + 2] = 0; - // Normals processing - // NOTE: We use meshes.baseNormals (default normal) to calculate meshes.normals (animated normals) - animNormal = (Vector3){ model.meshes[m].normals[vCounter], model.meshes[m].normals[vCounter + 1], model.meshes[m].normals[vCounter + 2] }; - animNormal = Vector3RotateByQuaternion(animNormal, QuaternionMultiply(outRotation, QuaternionInvert(inRotation))); - model.meshes[m].animNormals[vCounter] = animNormal.x; - model.meshes[m].animNormals[vCounter + 1] = animNormal.y; - model.meshes[m].animNormals[vCounter + 2] = animNormal.z; + for (int j = 0; j < 4; j++) + { + boneId = model.meshes[m].boneIds[boneCounter]; + boneWeight = model.meshes[m].boneWeights[boneCounter]; + inTranslation = model.bindPose[boneId].translation; + inRotation = model.bindPose[boneId].rotation; + //inScale = model.bindPose[boneId].scale; + outTranslation = anim.framePoses[frame][boneId].translation; + outRotation = anim.framePoses[frame][boneId].rotation; + outScale = anim.framePoses[frame][boneId].scale; + + // Vertices processing + // NOTE: We use meshes.vertices (default vertex position) to calculate meshes.animVertices (animated vertex position) + animVertex = (Vector3){ model.meshes[m].vertices[vCounter], model.meshes[m].vertices[vCounter + 1], model.meshes[m].vertices[vCounter + 2] }; + animVertex = Vector3Multiply(animVertex, outScale); + animVertex = Vector3Subtract(animVertex, inTranslation); + animVertex = Vector3RotateByQuaternion(animVertex, QuaternionMultiply(outRotation, QuaternionInvert(inRotation))); + animVertex = Vector3Add(animVertex, outTranslation); + model.meshes[m].animVertices[vCounter] += animVertex.x*boneWeight; + model.meshes[m].animVertices[vCounter + 1] += animVertex.y*boneWeight; + model.meshes[m].animVertices[vCounter + 2] += animVertex.z*boneWeight; + + // Normals processing + // NOTE: We use meshes.baseNormals (default normal) to calculate meshes.normals (animated normals) + if (model.meshes[m].normals != NULL) + { + animNormal = (Vector3){ model.meshes[m].normals[vCounter], model.meshes[m].normals[vCounter + 1], model.meshes[m].normals[vCounter + 2] }; + animNormal = Vector3RotateByQuaternion(animNormal, QuaternionMultiply(outRotation, QuaternionInvert(inRotation))); + model.meshes[m].animNormals[vCounter] += animNormal.x*boneWeight; + model.meshes[m].animNormals[vCounter + 1] += animNormal.y*boneWeight; + model.meshes[m].animNormals[vCounter + 2] += animNormal.z*boneWeight; + } + boneCounter += 1; + } vCounter += 3; - - boneCounter += 4; } // Upload new vertex data to GPU for model drawing - rlUpdateBuffer(model.meshes[m].vboId[0], model.meshes[m].animVertices, model.meshes[m].vertexCount*3*sizeof(float)); // Update vertex position - rlUpdateBuffer(model.meshes[m].vboId[2], model.meshes[m].animNormals, model.meshes[m].vertexCount*3*sizeof(float)); // Update vertex normals + rlUpdateVertexBuffer(model.meshes[m].vboId[0], model.meshes[m].animVertices, model.meshes[m].vertexCount*3*sizeof(float), 0); // Update vertex position + rlUpdateVertexBuffer(model.meshes[m].vboId[2], model.meshes[m].animNormals, model.meshes[m].vertexCount*3*sizeof(float), 0); // Update vertex normals } } } +// Unload animation array data +void UnloadModelAnimations(ModelAnimation* animations, unsigned int count) +{ + for (unsigned int i = 0; i < count; i++) UnloadModelAnimation(animations[i]); + RL_FREE(animations); +} + // Unload animation data void UnloadModelAnimation(ModelAnimation anim) { @@ -1316,8 +1529,6 @@ Mesh GenMeshPoly(int sides, float radius) if (sides < 3) return mesh; - mesh.vboId = (unsigned int *)RL_CALLOC(DEFAULT_MESH_VERTEX_BUFFERS, sizeof(unsigned int)); - int vertexCount = sides*3; // Vertices definition @@ -1328,7 +1539,7 @@ Mesh GenMeshPoly(int sides, float radius) { vertices[v] = (Vector3){ 0.0f, 0.0f, 0.0f }; vertices[v + 1] = (Vector3){ sinf(DEG2RAD*d)*radius, 0.0f, cosf(DEG2RAD*d)*radius }; - vertices[v + 2] = (Vector3){sinf(DEG2RAD*(d+dStep)) * radius, 0.0f, cosf(DEG2RAD * (d+dStep)) * radius }; + vertices[v + 2] = (Vector3){sinf(DEG2RAD*(d+dStep))*radius, 0.0f, cosf(DEG2RAD*(d+dStep))*radius }; d += dStep; } @@ -1374,7 +1585,8 @@ Mesh GenMeshPoly(int sides, float radius) RL_FREE(texcoords); // Upload vertex data to GPU (static mesh) - rlLoadMesh(&mesh, false); + // NOTE: mesh.vboId array is allocated inside UploadMesh() + UploadMesh(&mesh, false); return mesh; } @@ -1383,7 +1595,6 @@ Mesh GenMeshPoly(int sides, float radius) Mesh GenMeshPlane(float width, float length, int resX, int resZ) { Mesh mesh = { 0 }; - mesh.vboId = (unsigned int *)RL_CALLOC(DEFAULT_MESH_VERTEX_BUFFERS, sizeof(unsigned int)); #define CUSTOM_MESH_GEN_PLANE #if defined(CUSTOM_MESH_GEN_PLANE) @@ -1508,7 +1719,7 @@ Mesh GenMeshPlane(float width, float length, int resX, int resZ) #endif // Upload vertex data to GPU (static mesh) - rlLoadMesh(&mesh, false); + UploadMesh(&mesh, false); return mesh; } @@ -1517,7 +1728,6 @@ Mesh GenMeshPlane(float width, float length, int resX, int resZ) Mesh GenMeshCube(float width, float height, float length) { Mesh mesh = { 0 }; - mesh.vboId = (unsigned int *)RL_CALLOC(DEFAULT_MESH_VERTEX_BUFFERS, sizeof(unsigned int)); #define CUSTOM_MESH_GEN_CUBE #if defined(CUSTOM_MESH_GEN_CUBE) @@ -1674,20 +1884,18 @@ par_shapes_mesh* par_shapes_create_icosahedron(); // 20 sides polyhedron #endif // Upload vertex data to GPU (static mesh) - rlLoadMesh(&mesh, false); + UploadMesh(&mesh, false); return mesh; } // Generate sphere mesh (standard sphere) -RLAPI Mesh GenMeshSphere(float radius, int rings, int slices) +Mesh GenMeshSphere(float radius, int rings, int slices) { Mesh mesh = { 0 }; if ((rings >= 3) && (slices >= 3)) { - mesh.vboId = (unsigned int *)RL_CALLOC(DEFAULT_MESH_VERTEX_BUFFERS, sizeof(unsigned int)); - par_shapes_mesh *sphere = par_shapes_create_parametric_sphere(slices, rings); par_shapes_scale(sphere, radius, radius, radius); // NOTE: Soft normals are computed internally @@ -1716,7 +1924,7 @@ RLAPI Mesh GenMeshSphere(float radius, int rings, int slices) par_shapes_free_mesh(sphere); // Upload vertex data to GPU (static mesh) - rlLoadMesh(&mesh, false); + UploadMesh(&mesh, false); } else TRACELOG(LOG_WARNING, "MESH: Failed to generate mesh: sphere"); @@ -1724,7 +1932,7 @@ RLAPI Mesh GenMeshSphere(float radius, int rings, int slices) } // Generate hemi-sphere mesh (half sphere, no bottom cap) -RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices) +Mesh GenMeshHemiSphere(float radius, int rings, int slices) { Mesh mesh = { 0 }; @@ -1732,8 +1940,6 @@ RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices) { if (radius < 0.0f) radius = 0.0f; - mesh.vboId = (unsigned int *)RL_CALLOC(DEFAULT_MESH_VERTEX_BUFFERS, sizeof(unsigned int)); - par_shapes_mesh *sphere = par_shapes_create_hemisphere(slices, rings); par_shapes_scale(sphere, radius, radius, radius); // NOTE: Soft normals are computed internally @@ -1762,7 +1968,7 @@ RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices) par_shapes_free_mesh(sphere); // Upload vertex data to GPU (static mesh) - rlLoadMesh(&mesh, false); + UploadMesh(&mesh, false); } else TRACELOG(LOG_WARNING, "MESH: Failed to generate mesh: hemisphere"); @@ -1776,8 +1982,6 @@ Mesh GenMeshCylinder(float radius, float height, int slices) if (slices >= 3) { - mesh.vboId = (unsigned int *)RL_CALLOC(DEFAULT_MESH_VERTEX_BUFFERS, sizeof(unsigned int)); - // Instance a cylinder that sits on the Z=0 plane using the given tessellation // levels across the UV domain. Think of "slices" like a number of pizza // slices, and "stacks" like a number of stacked rings. @@ -1827,7 +2031,7 @@ Mesh GenMeshCylinder(float radius, float height, int slices) par_shapes_free_mesh(cylinder); // Upload vertex data to GPU (static mesh) - rlLoadMesh(&mesh, false); + UploadMesh(&mesh, false); } else TRACELOG(LOG_WARNING, "MESH: Failed to generate mesh: cylinder"); @@ -1841,8 +2045,6 @@ Mesh GenMeshTorus(float radius, float size, int radSeg, int sides) if ((sides >= 3) && (radSeg >= 3)) { - mesh.vboId = (unsigned int *)RL_CALLOC(DEFAULT_MESH_VERTEX_BUFFERS, sizeof(unsigned int)); - if (radius > 1.0f) radius = 1.0f; else if (radius < 0.1f) radius = 0.1f; @@ -1875,7 +2077,7 @@ Mesh GenMeshTorus(float radius, float size, int radSeg, int sides) par_shapes_free_mesh(torus); // Upload vertex data to GPU (static mesh) - rlLoadMesh(&mesh, false); + UploadMesh(&mesh, false); } else TRACELOG(LOG_WARNING, "MESH: Failed to generate mesh: torus"); @@ -1889,8 +2091,6 @@ Mesh GenMeshKnot(float radius, float size, int radSeg, int sides) if ((sides >= 3) && (radSeg >= 3)) { - mesh.vboId = (unsigned int *)RL_CALLOC(DEFAULT_MESH_VERTEX_BUFFERS, sizeof(unsigned int)); - if (radius > 3.0f) radius = 3.0f; else if (radius < 0.5f) radius = 0.5f; @@ -1921,7 +2121,7 @@ Mesh GenMeshKnot(float radius, float size, int radSeg, int sides) par_shapes_free_mesh(knot); // Upload vertex data to GPU (static mesh) - rlLoadMesh(&mesh, false); + UploadMesh(&mesh, false); } else TRACELOG(LOG_WARNING, "MESH: Failed to generate mesh: knot"); @@ -1935,12 +2135,11 @@ Mesh GenMeshHeightmap(Image heightmap, Vector3 size) #define GRAY_VALUE(c) ((c.r+c.g+c.b)/3) Mesh mesh = { 0 }; - mesh.vboId = (unsigned int *)RL_CALLOC(DEFAULT_MESH_VERTEX_BUFFERS, sizeof(unsigned int)); int mapX = heightmap.width; int mapZ = heightmap.height; - Color *pixels = GetImageData(heightmap); + Color *pixels = LoadImageColors(heightmap); // NOTE: One vertex per pixel mesh.triangleCount = (mapX-1)*(mapZ-1)*2; // One quad every four pixels @@ -1960,10 +2159,10 @@ Mesh GenMeshHeightmap(Image heightmap, Vector3 size) Vector3 scaleFactor = { size.x/mapX, size.y/255.0f, size.z/mapZ }; - Vector3 vA; - Vector3 vB; - Vector3 vC; - Vector3 vN; + Vector3 vA = { 0 }; + Vector3 vB = { 0 }; + Vector3 vC = { 0 }; + Vector3 vN = { 0 }; for (int z = 0; z < mapZ-1; z++) { @@ -2056,10 +2255,10 @@ Mesh GenMeshHeightmap(Image heightmap, Vector3 size) } } - RL_FREE(pixels); + UnloadImageColors(pixels); // Unload pixels color data // Upload vertex data to GPU (static mesh) - rlLoadMesh(&mesh, false); + UploadMesh(&mesh, false); return mesh; } @@ -2071,9 +2270,8 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) #define COLOR_EQUAL(col1, col2) ((col1.r == col2.r)&&(col1.g == col2.g)&&(col1.b == col2.b)&&(col1.a == col2.a)) Mesh mesh = { 0 }; - mesh.vboId = (unsigned int *)RL_CALLOC(DEFAULT_MESH_VERTEX_BUFFERS, sizeof(unsigned int)); - Color *cubicmapPixels = GetImageData(cubicmap); + Color *pixels = LoadImageColors(cubicmap); int mapWidth = cubicmap.width; int mapHeight = cubicmap.height; @@ -2131,7 +2329,7 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) Vector3 v8 = { w*(x + 0.5f), 0, h*(z + 0.5f) }; // We check pixel color to be WHITE -> draw full cube - if (COLOR_EQUAL(cubicmapPixels[z*cubicmap.width + x], WHITE)) + if (COLOR_EQUAL(pixels[z*cubicmap.width + x], WHITE)) { // Define triangles and checking collateral cubes //------------------------------------------------ @@ -2188,7 +2386,7 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) tcCounter += 6; // Checking cube on bottom of current cube - if (((z < cubicmap.height - 1) && COLOR_EQUAL(cubicmapPixels[(z + 1)*cubicmap.width + x], BLACK)) || (z == cubicmap.height - 1)) + if (((z < cubicmap.height - 1) && COLOR_EQUAL(pixels[(z + 1)*cubicmap.width + x], BLACK)) || (z == cubicmap.height - 1)) { // Define front triangles (2 tris, 6 vertex) --> v2 v7 v3, v3 v7 v8 // NOTE: Collateral occluded faces are not generated @@ -2218,7 +2416,7 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) } // Checking cube on top of current cube - if (((z > 0) && COLOR_EQUAL(cubicmapPixels[(z - 1)*cubicmap.width + x], BLACK)) || (z == 0)) + if (((z > 0) && COLOR_EQUAL(pixels[(z - 1)*cubicmap.width + x], BLACK)) || (z == 0)) { // Define back triangles (2 tris, 6 vertex) --> v1 v5 v6, v1 v4 v5 // NOTE: Collateral occluded faces are not generated @@ -2248,7 +2446,7 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) } // Checking cube on right of current cube - if (((x < cubicmap.width - 1) && COLOR_EQUAL(cubicmapPixels[z*cubicmap.width + (x + 1)], BLACK)) || (x == cubicmap.width - 1)) + if (((x < cubicmap.width - 1) && COLOR_EQUAL(pixels[z*cubicmap.width + (x + 1)], BLACK)) || (x == cubicmap.width - 1)) { // Define right triangles (2 tris, 6 vertex) --> v3 v8 v4, v4 v8 v5 // NOTE: Collateral occluded faces are not generated @@ -2278,7 +2476,7 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) } // Checking cube on left of current cube - if (((x > 0) && COLOR_EQUAL(cubicmapPixels[z*cubicmap.width + (x - 1)], BLACK)) || (x == 0)) + if (((x > 0) && COLOR_EQUAL(pixels[z*cubicmap.width + (x - 1)], BLACK)) || (x == 0)) { // Define left triangles (2 tris, 6 vertex) --> v1 v7 v2, v1 v6 v7 // NOTE: Collateral occluded faces are not generated @@ -2308,7 +2506,7 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) } } // We check pixel color to be BLACK, we will only draw floor and roof - else if (COLOR_EQUAL(cubicmapPixels[z*cubicmap.width + x], BLACK)) + else if (COLOR_EQUAL(pixels[z*cubicmap.width + x], BLACK)) { // Define top triangles (2 tris, 6 vertex --> v1-v2-v3, v1-v3-v4) mapVertices[vCounter] = v1; @@ -2408,10 +2606,10 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) RL_FREE(mapNormals); RL_FREE(mapTexcoords); - RL_FREE(cubicmapPixels); // Free image pixel data + UnloadImageColors(pixels); // Unload pixels color data // Upload vertex data to GPU (static mesh) - rlLoadMesh(&mesh, false); + UploadMesh(&mesh, false); return mesh; } @@ -2419,7 +2617,7 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) // Compute mesh bounding box limits // NOTE: minVertex and maxVertex should be transformed by model transform matrix -BoundingBox MeshBoundingBox(Mesh mesh) +BoundingBox GetMeshBoundingBox(Mesh mesh) { // Get min and max vertex to construct bounds (AABB) Vector3 minVertex = { 0 }; @@ -2522,7 +2720,7 @@ void MeshTangents(Mesh *mesh) RL_FREE(tan2); // Load a new tangent attributes buffer - mesh->vboId[LOC_VERTEX_TANGENT] = rlLoadAttribBuffer(mesh->vaoId, LOC_VERTEX_TANGENT, mesh->tangents, mesh->vertexCount*4*sizeof(float), false); + mesh->vboId[SHADER_LOC_VERTEX_TANGENT] = rlLoadVertexBuffer(mesh->tangents, mesh->vertexCount*4*sizeof(float), false); TRACELOG(LOG_INFO, "MESH: Tangents data computed for provided mesh"); } @@ -2540,73 +2738,6 @@ void MeshBinormals(Mesh *mesh) } } -// Smooth (average) vertex normals -void MeshNormalsSmooth(Mesh *mesh) -{ - #define EPSILON 0.000001 // A small number - - int uvCounter = 0; - Vector3 *uniqueVertices = (Vector3 *)RL_CALLOC(mesh->vertexCount, sizeof(Vector3)); - Vector3 *summedNormals = (Vector3 *)RL_CALLOC(mesh->vertexCount, sizeof(Vector3)); - - int *uniqueIndices = (int *)RL_CALLOC(mesh->vertexCount, sizeof(int)); - - // Sum normals grouped by vertex - for (int i = 0; i < mesh->vertexCount; i++) - { - Vector3 v = { mesh->vertices[(i + 0)*3 + 0], mesh->vertices[(i + 0)*3 + 1], mesh->vertices[(i + 0)*3 + 2] }; - Vector3 n = { mesh->normals[(i + 0)*3 + 0], mesh->normals[(i + 0)*3 + 1], mesh->normals[(i + 0)*3 + 2] }; - - bool matched = false; - - // TODO: Matching vertices is brute force O(N^2). Do it more efficiently? - for (int j = 0; j < uvCounter; j++) - { - Vector3 uv = uniqueVertices[j]; - - bool match = true; - match = match && fabs(uv.x - v.x) < EPSILON; - match = match && fabs(uv.y - v.y) < EPSILON; - match = match && fabs(uv.z - v.z) < EPSILON; - - if (match) - { - matched = true; - summedNormals[j] = Vector3Add(summedNormals[j], n); - uniqueIndices[i] = j; - break; - } - } - - if (!matched) - { - int j = uvCounter++; - uniqueVertices[j] = v; - summedNormals[j] = n; - uniqueIndices[i] = j; - } - } - - // Average and update normals - for (int i = 0; i < mesh->vertexCount; i++) - { - int j = uniqueIndices[i]; - Vector3 n = Vector3Normalize(summedNormals[j]); - mesh->normals[(i + 0)*3 + 0] = n.x; - mesh->normals[(i + 0)*3 + 1] = n.y; - mesh->normals[(i + 0)*3 + 2] = n.z; - } - - // 2=normals, see rlUpdateMeshAt() - rlUpdateMesh(*mesh, 2, mesh->vertexCount); - - RL_FREE(uniqueVertices); - RL_FREE(summedNormals); - RL_FREE(uniqueIndices); - - TRACELOG(LOG_INFO, "MESH: Normals smoothed (%d vertices, %d unique)", mesh->vertexCount, uvCounter); -} - // Draw a model (with texture if set) void DrawModel(Model model, Vector3 position, float scale, Color tint) { @@ -2632,7 +2763,7 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota for (int i = 0; i < model.meshCount; i++) { - Color color = model.materials[model.meshMaterial[i]].maps[MAP_DIFFUSE].color; + Color color = model.materials[model.meshMaterial[i]].maps[MATERIAL_MAP_DIFFUSE].color; Color colorTint = WHITE; colorTint.r = (unsigned char)((((float)color.r/255.0)*((float)tint.r/255.0))*255.0f); @@ -2640,9 +2771,9 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota colorTint.b = (unsigned char)((((float)color.b/255.0)*((float)tint.b/255.0))*255.0f); colorTint.a = (unsigned char)((((float)color.a/255.0)*((float)tint.a/255.0))*255.0f); - model.materials[model.meshMaterial[i]].maps[MAP_DIFFUSE].color = colorTint; - rlDrawMesh(model.meshes[i], model.materials[model.meshMaterial[i]], model.transform); - model.materials[model.meshMaterial[i]].maps[MAP_DIFFUSE].color = color; + model.materials[model.meshMaterial[i]].maps[MATERIAL_MAP_DIFFUSE].color = colorTint; + DrawMesh(model.meshes[i], model.materials[model.meshMaterial[i]], model.transform); + model.materials[model.meshMaterial[i]].maps[MATERIAL_MAP_DIFFUSE].color = color; } } @@ -2667,19 +2798,24 @@ void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float } // Draw a billboard -void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint) +void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint) { Rectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; - DrawBillboardRec(camera, texture, source, center, size, tint); + DrawBillboardRec(camera, texture, source, position, (Vector2){ size, size }, tint); } // Draw a billboard (part of a texture defined by a rectangle) -void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 center, float size, Color tint) +void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint) +{ + DrawBillboardPro(camera, texture, source, position, size, Vector2Zero(), 0.0f, tint); +} + +void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Vector2 origin, float rotation, Color tint) { // NOTE: Billboard size will maintain source rectangle aspect ratio, size will represent billboard width - Vector2 sizeRatio = { size, size*(float)source.height/source.width }; - + Vector2 sizeRatio = { size.y, size.x*(float)source.height/source.width }; + Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); Vector3 right = { matView.m0, matView.m4, matView.m8 }; @@ -2687,55 +2823,92 @@ void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector // NOTE: Billboard locked on axis-Y Vector3 up = { 0.0f, 1.0f, 0.0f }; -/* - a-------b - | | - | * | - | | - d-------c -*/ - right = Vector3Scale(right, sizeRatio.x/2); - up = Vector3Scale(up, sizeRatio.y/2); - Vector3 p1 = Vector3Add(right, up); - Vector3 p2 = Vector3Subtract(right, up); + Vector3 rightScaled = Vector3Scale(right, sizeRatio.x/2); + Vector3 upScaled = Vector3Scale(up, sizeRatio.y/2); + + Vector3 p1 = Vector3Add(rightScaled, upScaled); + Vector3 p2 = Vector3Subtract(rightScaled, upScaled); - Vector3 a = Vector3Subtract(center, p2); - Vector3 b = Vector3Add(center, p1); - Vector3 c = Vector3Add(center, p2); - Vector3 d = Vector3Subtract(center, p1); + Vector3 topLeft = Vector3Scale(p2, -1); + Vector3 topRight = p1; + Vector3 bottomRight = p2; + Vector3 bottomLeft = Vector3Scale(p1, -1); + + if (rotation != 0.0f) + { + float sinRotation = sinf(rotation*DEG2RAD); + float cosRotation = cosf(rotation*DEG2RAD); + + // NOTE: (-1, 1) is the range where origin.x, origin.y is inside the texture + float rotateAboutX = sizeRatio.x*origin.x/2; + float rotateAboutY = sizeRatio.y*origin.y/2; + + float xtvalue, ytvalue; + float rotatedX, rotatedY; + + xtvalue = Vector3DotProduct(right, topLeft) - rotateAboutX; // Project points to x and y coordinates on the billboard plane + ytvalue = Vector3DotProduct(up, topLeft) - rotateAboutY; + rotatedX = xtvalue*cosRotation - ytvalue*sinRotation + rotateAboutX; // Rotate about the point origin + rotatedY = xtvalue*sinRotation + ytvalue*cosRotation + rotateAboutY; + topLeft = Vector3Add(Vector3Scale(up, rotatedY), Vector3Scale(right, rotatedX)); // Translate back to cartesian coordinates + + xtvalue = Vector3DotProduct(right, topRight) - rotateAboutX; + ytvalue = Vector3DotProduct(up, topRight) - rotateAboutY; + rotatedX = xtvalue*cosRotation - ytvalue*sinRotation + rotateAboutX; + rotatedY = xtvalue*sinRotation + ytvalue*cosRotation + rotateAboutY; + topRight = Vector3Add(Vector3Scale(up, rotatedY), Vector3Scale(right, rotatedX)); - if (rlCheckBufferLimit(4)) rlglDraw(); + xtvalue = Vector3DotProduct(right, bottomRight) - rotateAboutX; + ytvalue = Vector3DotProduct(up, bottomRight) - rotateAboutY; + rotatedX = xtvalue*cosRotation - ytvalue*sinRotation + rotateAboutX; + rotatedY = xtvalue*sinRotation + ytvalue*cosRotation + rotateAboutY; + bottomRight = Vector3Add(Vector3Scale(up, rotatedY), Vector3Scale(right, rotatedX)); + + xtvalue = Vector3DotProduct(right, bottomLeft)-rotateAboutX; + ytvalue = Vector3DotProduct(up, bottomLeft)-rotateAboutY; + rotatedX = xtvalue*cosRotation - ytvalue*sinRotation + rotateAboutX; + rotatedY = xtvalue*sinRotation + ytvalue*cosRotation + rotateAboutY; + bottomLeft = Vector3Add(Vector3Scale(up, rotatedY), Vector3Scale(right, rotatedX)); + } + + // Translate points to the draw center (position) + topLeft = Vector3Add(topLeft, position); + topRight = Vector3Add(topRight, position); + bottomRight = Vector3Add(bottomRight, position); + bottomLeft = Vector3Add(bottomLeft, position); + + rlCheckRenderBatchLimit(4); - rlEnableTexture(texture.id); + rlSetTexture(texture.id); rlBegin(RL_QUADS); rlColor4ub(tint.r, tint.g, tint.b, tint.a); // Bottom-left corner for texture and quad rlTexCoord2f((float)source.x/texture.width, (float)source.y/texture.height); - rlVertex3f(a.x, a.y, a.z); + rlVertex3f(topLeft.x, topLeft.y, topLeft.z); // Top-left corner for texture and quad rlTexCoord2f((float)source.x/texture.width, (float)(source.y + source.height)/texture.height); - rlVertex3f(d.x, d.y, d.z); + rlVertex3f(bottomLeft.x, bottomLeft.y, bottomLeft.z); // Top-right corner for texture and quad rlTexCoord2f((float)(source.x + source.width)/texture.width, (float)(source.y + source.height)/texture.height); - rlVertex3f(c.x, c.y, c.z); + rlVertex3f(bottomRight.x, bottomRight.y, bottomRight.z); // Bottom-right corner for texture and quad rlTexCoord2f((float)(source.x + source.width)/texture.width, (float)source.y/texture.height); - rlVertex3f(b.x, b.y, b.z); + rlVertex3f(topRight.x, topRight.y, topRight.z); rlEnd(); - rlDisableTexture(); + rlSetTexture(0); } // Draw a bounding box with wires void DrawBoundingBox(BoundingBox box, Color color) { - Vector3 size; + Vector3 size = { 0 }; size.x = fabsf(box.max.x - box.min.x); size.y = fabsf(box.max.y - box.min.y); @@ -2746,7 +2919,7 @@ void DrawBoundingBox(BoundingBox box, Color color) DrawCubeWires(center, size.x, size.y, size.z, color); } -// Detect collision between two spheres +// Check collision between two spheres bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2) { bool collision = false; @@ -2769,7 +2942,7 @@ bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, floa return collision; } -// Detect collision between two boxes +// Check collision between two boxes // NOTE: Boxes are defined by two points minimum and maximum bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2) { @@ -2785,7 +2958,7 @@ bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2) return collision; } -// Detect collision between box and sphere +// Check collision between box and sphere bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius) { bool collision = false; @@ -2806,78 +2979,113 @@ bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius) return collision; } -// Detect collision between ray and sphere -bool CheckCollisionRaySphere(Ray ray, Vector3 center, float radius) +// Get collision info between ray and sphere +RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius) { - bool collision = false; + RayCollision collision = { 0 }; Vector3 raySpherePos = Vector3Subtract(center, ray.position); - float distance = Vector3Length(raySpherePos); float vector = Vector3DotProduct(raySpherePos, ray.direction); + float distance = Vector3Length(raySpherePos); float d = radius*radius - (distance*distance - vector*vector); - if (d >= 0.0f) collision = true; - - return collision; -} - -// Detect collision between ray and sphere with extended parameters and collision point detection -bool CheckCollisionRaySphereEx(Ray ray, Vector3 center, float radius, Vector3 *collisionPoint) -{ - bool collision = false; - - Vector3 raySpherePos = Vector3Subtract(center, ray.position); - float distance = Vector3Length(raySpherePos); - float vector = Vector3DotProduct(raySpherePos, ray.direction); - float d = radius*radius - (distance*distance - vector*vector); - - if (d >= 0.0f) collision = true; + collision.hit = d >= 0.0f; // Check if ray origin is inside the sphere to calculate the correct collision point - float collisionDistance = 0; + if (distance < radius) + { + collision.distance = vector + sqrtf(d); - if (distance < radius) collisionDistance = vector + sqrtf(d); - else collisionDistance = vector - sqrtf(d); + // Calculate collision point + collision.point = Vector3Add(ray.position, Vector3Scale(ray.direction, collision.distance)); - // Calculate collision point - Vector3 cPoint = Vector3Add(ray.position, Vector3Scale(ray.direction, collisionDistance)); + // Calculate collision normal (pointing outwards) + collision.normal = Vector3Negate(Vector3Normalize(Vector3Subtract(collision.point, center))); + } + else + { + collision.distance = vector - sqrtf(d); - collisionPoint->x = cPoint.x; - collisionPoint->y = cPoint.y; - collisionPoint->z = cPoint.z; + // Calculate collision point + collision.point = Vector3Add(ray.position, Vector3Scale(ray.direction, collision.distance)); + // Calculate collision normal (pointing inwards) + collision.normal = Vector3Normalize(Vector3Subtract(collision.point, center)); + } + return collision; } -// Detect collision between ray and bounding box -bool CheckCollisionRayBox(Ray ray, BoundingBox box) +// Get collision info between ray and box +RayCollision GetRayCollisionBox(Ray ray, BoundingBox box) { - bool collision = false; + RayCollision collision = { 0 }; - float t[8]; - t[0] = (box.min.x - ray.position.x)/ray.direction.x; - t[1] = (box.max.x - ray.position.x)/ray.direction.x; - t[2] = (box.min.y - ray.position.y)/ray.direction.y; - t[3] = (box.max.y - ray.position.y)/ray.direction.y; - t[4] = (box.min.z - ray.position.z)/ray.direction.z; - t[5] = (box.max.z - ray.position.z)/ray.direction.z; + // Note: If ray.position is inside the box, the distance is negative (as if the ray was reversed) + // Reversing ray.direction will give use the correct result. + bool insideBox = (ray.position.x > box.min.x) && (ray.position.x < box.max.x) && + (ray.position.y > box.min.y) && (ray.position.y < box.max.y) && + (ray.position.z > box.min.z) && (ray.position.z < box.max.z); + + if (insideBox) ray.direction = Vector3Negate(ray.direction); + + float t[11] = { 0 }; + + t[8] = 1.0f/ray.direction.x; + t[9] = 1.0f/ray.direction.y; + t[10] = 1.0f/ray.direction.z; + + t[0] = (box.min.x - ray.position.x)*t[8]; + t[1] = (box.max.x - ray.position.x)*t[8]; + t[2] = (box.min.y - ray.position.y)*t[9]; + t[3] = (box.max.y - ray.position.y)*t[9]; + t[4] = (box.min.z - ray.position.z)*t[10]; + t[5] = (box.max.z - ray.position.z)*t[10]; t[6] = (float)fmax(fmax(fmin(t[0], t[1]), fmin(t[2], t[3])), fmin(t[4], t[5])); t[7] = (float)fmin(fmin(fmax(t[0], t[1]), fmax(t[2], t[3])), fmax(t[4], t[5])); - collision = !(t[7] < 0 || t[6] > t[7]); + collision.hit = !((t[7] < 0) || (t[6] > t[7])); + collision.distance = t[6]; + collision.point = Vector3Add(ray.position, Vector3Scale(ray.direction, collision.distance)); + + // Get box center point + collision.normal = Vector3Lerp(box.min, box.max, 0.5f); + // Get vector center point->hit point + collision.normal = Vector3Subtract(collision.point, collision.normal); + // Scale vector to unit cube + // NOTE: We use an additional .01 to fix numerical errors + collision.normal = Vector3Scale(collision.normal, 2.01f); + collision.normal = Vector3Divide(collision.normal, Vector3Subtract(box.max, box.min)); + // The relevant elemets of the vector are now slightly larger than 1.0f (or smaller than -1.0f) + // and the others are somewhere between -1.0 and 1.0 + // casting to int is exactly our wanted normal! + collision.normal.x = (int)collision.normal.x; + collision.normal.y = (int)collision.normal.y; + collision.normal.z = (int)collision.normal.z; + + collision.normal = Vector3Normalize(collision.normal); + + if (insideBox) + { + // Reset ray.direction + ray.direction = Vector3Negate(ray.direction); + // Fix result + collision.distance *= -1.0f; + collision.normal = Vector3Negate(collision.normal); + } return collision; } + // Get collision info between ray and mesh -RayHitInfo GetCollisionRayMesh(Ray ray, Mesh mesh, Matrix transform) +RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform) { - RayHitInfo result = { 0 }; + RayCollision collision = { 0 }; // Check if mesh vertex data on CPU for testing if (mesh.vertices != NULL) { - // model->mesh.triangleCount may not be set, vertexCount is more reliable - int triangleCount = mesh.vertexCount / 3; + int triangleCount = mesh.triangleCount; // Test against all triangles in mesh for (int i = 0; i < triangleCount; i++) @@ -2887,62 +3095,65 @@ RayHitInfo GetCollisionRayMesh(Ray ray, Mesh mesh, Matrix transform) if (mesh.indices) { - a = vertdata[mesh.indices[i * 3 + 0]]; - b = vertdata[mesh.indices[i * 3 + 1]]; - c = vertdata[mesh.indices[i * 3 + 2]]; + a = vertdata[mesh.indices[i*3 + 0]]; + b = vertdata[mesh.indices[i*3 + 1]]; + c = vertdata[mesh.indices[i*3 + 2]]; } else { - a = vertdata[i * 3 + 0]; - b = vertdata[i * 3 + 1]; - c = vertdata[i * 3 + 2]; + a = vertdata[i*3 + 0]; + b = vertdata[i*3 + 1]; + c = vertdata[i*3 + 2]; } a = Vector3Transform(a, transform); b = Vector3Transform(b, transform); c = Vector3Transform(c, transform); - RayHitInfo triHitInfo = GetCollisionRayTriangle(ray, a, b, c); + RayCollision triHitInfo = GetRayCollisionTriangle(ray, a, b, c); if (triHitInfo.hit) { // Save the closest hit triangle - if ((!result.hit) || (result.distance > triHitInfo.distance)) result = triHitInfo; + if ((!collision.hit) || (collision.distance > triHitInfo.distance)) collision = triHitInfo; } } } - return result; + + return collision; } // Get collision info between ray and model -RayHitInfo GetCollisionRayModel(Ray ray, Model model) +RayCollision GetRayCollisionModel(Ray ray, Model model) { - RayHitInfo result = { 0 }; + RayCollision collision = { 0 }; for (int m = 0; m < model.meshCount; m++) { - RayHitInfo meshHitInfo = GetCollisionRayMesh(ray, model.meshes[m], model.transform); + RayCollision meshHitInfo = GetRayCollisionMesh(ray, model.meshes[m], model.transform); if (meshHitInfo.hit) { // Save the closest hit mesh - if ((!result.hit) || (result.distance > meshHitInfo.distance)) result = meshHitInfo; + if ((!collision.hit) || (collision.distance > meshHitInfo.distance)) collision = meshHitInfo; } } - return result; + return collision; } // Get collision info between ray and triangle +// NOTE: The points are expected to be in counter-clockwise winding // NOTE: Based on https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm -RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3) +RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3) { #define EPSILON 0.000001 // A small number - Vector3 edge1, edge2; + RayCollision collision = { 0 }; + Vector3 edge1 = { 0 }; + Vector3 edge2 = { 0 }; Vector3 p, q, tv; float det, invDet, u, v, t; - RayHitInfo result = {0}; // Find vectors for two edges sharing V1 edge1 = Vector3Subtract(p2, p1); @@ -2955,7 +3166,7 @@ RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3) det = Vector3DotProduct(edge1, p); // Avoid culling! - if ((det > -EPSILON) && (det < EPSILON)) return result; + if ((det > -EPSILON) && (det < EPSILON)) return collision; invDet = 1.0f/det; @@ -2966,7 +3177,7 @@ RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3) u = Vector3DotProduct(tv, p)*invDet; // The intersection lies outside of the triangle - if ((u < 0.0f) || (u > 1.0f)) return result; + if ((u < 0.0f) || (u > 1.0f)) return collision; // Prepare to test v parameter q = Vector3CrossProduct(tv, edge1); @@ -2975,45 +3186,33 @@ RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3) v = Vector3DotProduct(ray.direction, q)*invDet; // The intersection lies outside of the triangle - if ((v < 0.0f) || ((u + v) > 1.0f)) return result; + if ((v < 0.0f) || ((u + v) > 1.0f)) return collision; t = Vector3DotProduct(edge2, q)*invDet; if (t > EPSILON) { // Ray hit, get hit point and normal - result.hit = true; - result.distance = t; - result.hit = true; - result.normal = Vector3Normalize(Vector3CrossProduct(edge1, edge2)); - result.position = Vector3Add(ray.position, Vector3Scale(ray.direction, t)); + collision.hit = true; + collision.distance = t; + collision.normal = Vector3Normalize(Vector3CrossProduct(edge1, edge2)); + collision.point = Vector3Add(ray.position, Vector3Scale(ray.direction, t)); } - return result; + return collision; } -// Get collision info between ray and ground plane (Y-normal plane) -RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight) +// Get collision info between ray and quad +// NOTE: The points are expected to be in counter-clockwise winding +RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4) { - #define EPSILON 0.000001 // A small number + RayCollision collision = { 0 }; - RayHitInfo result = { 0 }; + collision = GetRayCollisionTriangle(ray, p1, p2, p4); - if (fabsf(ray.direction.y) > EPSILON) - { - float distance = (ray.position.y - groundHeight)/-ray.direction.y; + if (!collision.hit) collision = GetRayCollisionTriangle(ray, p2, p3, p4); - if (distance >= 0.0) - { - result.hit = true; - result.distance = distance; - result.normal = (Vector3){ 0.0, 1.0, 0.0 }; - result.position = Vector3Add(ray.position, Vector3Scale(ray.direction, distance)); - result.position.y = groundHeight; - } - } - - return result; + return collision; } //---------------------------------------------------------------------------------- @@ -3033,20 +3232,24 @@ static Model LoadOBJ(const char *fileName) tinyobj_material_t *materials = NULL; unsigned int materialCount = 0; - char *fileData = LoadFileText(fileName); + char *fileText = LoadFileText(fileName); - if (fileData != NULL) + if (fileText != NULL) { - unsigned int dataSize = (unsigned int)strlen(fileData); + unsigned int dataSize = (unsigned int)strlen(fileText); char currentDir[1024] = { 0 }; strcpy(currentDir, GetWorkingDirectory()); - chdir(GetDirectoryPath(fileName)); + const char *workingDir = GetDirectoryPath(fileName); + if (CHDIR(workingDir) != 0) + { + TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to change working directory", workingDir); + } unsigned int flags = TINYOBJ_FLAG_TRIANGULATE; - int ret = tinyobj_parse_obj(&attrib, &meshes, &meshCount, &materials, &materialCount, fileData, dataSize, flags); + int ret = tinyobj_parse_obj(&attrib, &meshes, &meshCount, &materials, &materialCount, fileText, dataSize, flags); if (ret != TINYOBJ_SUCCESS) TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to load OBJ data", fileName); - else TRACELOG(LOG_INFO, "MODEL: [%s] OBJ data loaded successfully: %i meshes / %i materials", fileName, meshCount, materialCount); + else TRACELOG(LOG_INFO, "MODEL: [%s] OBJ data loaded successfully: %i meshes/%i materials", fileName, meshCount, materialCount); model.meshCount = materialCount; @@ -3082,7 +3285,7 @@ static Model LoadOBJ(const char *fileName) //-------------------------------------- // create the material meshes - // running counts / indexes for each material mesh as we are + // running counts/indexes for each material mesh as we are // building them at the same time int *vCount = RL_CALLOC(model.meshCount, sizeof(int)); int *vtCount = RL_CALLOC(model.meshCount, sizeof(int)); @@ -3092,12 +3295,11 @@ static Model LoadOBJ(const char *fileName) // allocate space for each of the material meshes for (int mi = 0; mi < model.meshCount; mi++) { - model.meshes[mi].vertexCount = matFaces[mi] * 3; + model.meshes[mi].vertexCount = matFaces[mi]*3; model.meshes[mi].triangleCount = matFaces[mi]; model.meshes[mi].vertices = (float *)RL_CALLOC(model.meshes[mi].vertexCount*3, sizeof(float)); model.meshes[mi].texcoords = (float *)RL_CALLOC(model.meshes[mi].vertexCount*2, sizeof(float)); model.meshes[mi].normals = (float *)RL_CALLOC(model.meshes[mi].vertexCount*3, sizeof(float)); - model.meshes[mi].vboId = (unsigned int *)RL_CALLOC(DEFAULT_MESH_VERTEX_BUFFERS, sizeof(unsigned int)); model.meshMaterial[mi] = mi; } @@ -3108,9 +3310,9 @@ static Model LoadOBJ(const char *fileName) if (mm == -1) { mm = 0; } // no material object.. // Get indices for the face - tinyobj_vertex_index_t idx0 = attrib.faces[3 * af + 0]; - tinyobj_vertex_index_t idx1 = attrib.faces[3 * af + 1]; - tinyobj_vertex_index_t idx2 = attrib.faces[3 * af + 2]; + tinyobj_vertex_index_t idx0 = attrib.faces[3*af + 0]; + tinyobj_vertex_index_t idx1 = attrib.faces[3*af + 1]; + tinyobj_vertex_index_t idx2 = attrib.faces[3*af + 2]; // Fill vertices buffer (float) using vertex index of the face for (int v = 0; v < 3; v++) { model.meshes[mm].vertices[vCount[mm] + v] = attrib.vertices[idx0.v_idx*3 + v]; } vCount[mm] +=3; @@ -3143,43 +3345,46 @@ static Model LoadOBJ(const char *fileName) for (unsigned int m = 0; m < materialCount; m++) { // Init material to default - // NOTE: Uses default shader, which only supports MAP_DIFFUSE + // NOTE: Uses default shader, which only supports MATERIAL_MAP_DIFFUSE model.materials[m] = LoadMaterialDefault(); - model.materials[m].maps[MAP_DIFFUSE].texture = GetTextureDefault(); // Get default texture, in case no texture is defined + model.materials[m].maps[MATERIAL_MAP_DIFFUSE].texture = rlGetTextureDefault(); // Get default texture, in case no texture is defined - if (materials[m].diffuse_texname != NULL) model.materials[m].maps[MAP_DIFFUSE].texture = LoadTexture(materials[m].diffuse_texname); //char *diffuse_texname; // map_Kd - else model.materials[m].maps[MAP_DIFFUSE].texture = GetTextureDefault(); + if (materials[m].diffuse_texname != NULL) model.materials[m].maps[MATERIAL_MAP_DIFFUSE].texture = LoadTexture(materials[m].diffuse_texname); //char *diffuse_texname; // map_Kd + else model.materials[m].maps[MATERIAL_MAP_DIFFUSE].texture = rlGetTextureDefault(); - model.materials[m].maps[MAP_DIFFUSE].color = (Color){ (unsigned char)(materials[m].diffuse[0]*255.0f), (unsigned char)(materials[m].diffuse[1]*255.0f), (unsigned char)(materials[m].diffuse[2]*255.0f), 255 }; //float diffuse[3]; - model.materials[m].maps[MAP_DIFFUSE].value = 0.0f; + model.materials[m].maps[MATERIAL_MAP_DIFFUSE].color = (Color){ (unsigned char)(materials[m].diffuse[0]*255.0f), (unsigned char)(materials[m].diffuse[1]*255.0f), (unsigned char)(materials[m].diffuse[2]*255.0f), 255 }; //float diffuse[3]; + model.materials[m].maps[MATERIAL_MAP_DIFFUSE].value = 0.0f; - if (materials[m].specular_texname != NULL) model.materials[m].maps[MAP_SPECULAR].texture = LoadTexture(materials[m].specular_texname); //char *specular_texname; // map_Ks - model.materials[m].maps[MAP_SPECULAR].color = (Color){ (unsigned char)(materials[m].specular[0]*255.0f), (unsigned char)(materials[m].specular[1]*255.0f), (unsigned char)(materials[m].specular[2]*255.0f), 255 }; //float specular[3]; - model.materials[m].maps[MAP_SPECULAR].value = 0.0f; + if (materials[m].specular_texname != NULL) model.materials[m].maps[MATERIAL_MAP_SPECULAR].texture = LoadTexture(materials[m].specular_texname); //char *specular_texname; // map_Ks + model.materials[m].maps[MATERIAL_MAP_SPECULAR].color = (Color){ (unsigned char)(materials[m].specular[0]*255.0f), (unsigned char)(materials[m].specular[1]*255.0f), (unsigned char)(materials[m].specular[2]*255.0f), 255 }; //float specular[3]; + model.materials[m].maps[MATERIAL_MAP_SPECULAR].value = 0.0f; - if (materials[m].bump_texname != NULL) model.materials[m].maps[MAP_NORMAL].texture = LoadTexture(materials[m].bump_texname); //char *bump_texname; // map_bump, bump - model.materials[m].maps[MAP_NORMAL].color = WHITE; - model.materials[m].maps[MAP_NORMAL].value = materials[m].shininess; + if (materials[m].bump_texname != NULL) model.materials[m].maps[MATERIAL_MAP_NORMAL].texture = LoadTexture(materials[m].bump_texname); //char *bump_texname; // map_bump, bump + model.materials[m].maps[MATERIAL_MAP_NORMAL].color = WHITE; + model.materials[m].maps[MATERIAL_MAP_NORMAL].value = materials[m].shininess; - model.materials[m].maps[MAP_EMISSION].color = (Color){ (unsigned char)(materials[m].emission[0]*255.0f), (unsigned char)(materials[m].emission[1]*255.0f), (unsigned char)(materials[m].emission[2]*255.0f), 255 }; //float emission[3]; + model.materials[m].maps[MATERIAL_MAP_EMISSION].color = (Color){ (unsigned char)(materials[m].emission[0]*255.0f), (unsigned char)(materials[m].emission[1]*255.0f), (unsigned char)(materials[m].emission[2]*255.0f), 255 }; //float emission[3]; - if (materials[m].displacement_texname != NULL) model.materials[m].maps[MAP_HEIGHT].texture = LoadTexture(materials[m].displacement_texname); //char *displacement_texname; // disp + if (materials[m].displacement_texname != NULL) model.materials[m].maps[MATERIAL_MAP_HEIGHT].texture = LoadTexture(materials[m].displacement_texname); //char *displacement_texname; // disp } tinyobj_attrib_free(&attrib); tinyobj_shapes_free(meshes, meshCount); tinyobj_materials_free(materials, materialCount); - RL_FREE(fileData); + UnloadFileText(fileText); + RL_FREE(matFaces); - RL_FREE(vCount); RL_FREE(vtCount); RL_FREE(vnCount); RL_FREE(faceCount); - chdir(currentDir); + if (CHDIR(currentDir) != 0) + { + TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to change working directory", currentDir); + } } return model; @@ -3280,7 +3485,7 @@ static Model LoadIQM(const char *fileName) IQM_TANGENT = 3, // NOTE: Tangents unused by default IQM_BLENDINDEXES = 4, IQM_BLENDWEIGHTS = 5, - IQM_COLOR = 6, // NOTE: Vertex colors unused by default + IQM_COLOR = 6, IQM_CUSTOM = 0x10 // NOTE: Custom vertex values unused by default }; @@ -3296,6 +3501,7 @@ static Model LoadIQM(const char *fileName) float *text = NULL; char *blendi = NULL; unsigned char *blendw = NULL; + unsigned char *color = NULL; // In case file can not be read, return an empty model if (fileDataPtr == NULL) return model; @@ -3318,7 +3524,7 @@ static Model LoadIQM(const char *fileName) //fileDataPtr += sizeof(IQMHeader); // Move file data pointer // Meshes data processing - imesh = RL_MALLOC(sizeof(IQMMesh)*iqmHeader->num_meshes); + imesh = RL_MALLOC(iqmHeader->num_meshes*sizeof(IQMMesh)); //fseek(iqmFile, iqmHeader->ofs_meshes, SEEK_SET); //fread(imesh, sizeof(IQMMesh)*iqmHeader->num_meshes, 1, iqmFile); memcpy(imesh, fileDataPtr + iqmHeader->ofs_meshes, iqmHeader->num_meshes*sizeof(IQMMesh)); @@ -3363,8 +3569,6 @@ static Model LoadIQM(const char *fileName) // NOTE: Animated vertex should be re-uploaded to GPU (if not using GPU skinning) model.meshes[i].animVertices = RL_CALLOC(model.meshes[i].vertexCount*3, sizeof(float)); model.meshes[i].animNormals = RL_CALLOC(model.meshes[i].vertexCount*3, sizeof(float)); - - model.meshes[i].vboId = (unsigned int *)RL_CALLOC(DEFAULT_MESH_VERTEX_BUFFERS, sizeof(unsigned int)); } // Triangles data processing @@ -3486,6 +3690,25 @@ static Model LoadIQM(const char *fileName) } } } break; + case IQM_COLOR: + { + color = RL_MALLOC(iqmHeader->num_vertexes*4*sizeof(unsigned char)); + //fseek(iqmFile, va[i].offset, SEEK_SET); + //fread(blendw, iqmHeader->num_vertexes*4*sizeof(unsigned char), 1, iqmFile); + memcpy(color, fileDataPtr + va[i].offset, iqmHeader->num_vertexes*4*sizeof(unsigned char)); + + for (unsigned int m = 0; m < iqmHeader->num_meshes; m++) + { + model.meshes[m].colors = RL_CALLOC(model.meshes[m].vertexCount*4, sizeof(unsigned char)); + + int vCounter = 0; + for (unsigned int i = imesh[m].first_vertex*4; i < (imesh[m].first_vertex + imesh[m].num_vertexes)*4; i++) + { + model.meshes[m].colors[vCounter] = color[i]; + vCounter++; + } + } + } break; } } @@ -3548,6 +3771,218 @@ static Model LoadIQM(const char *fileName) return model; } + +// Load IQM animation data +static ModelAnimation* LoadIQMModelAnimations(const char *fileName, int *animCount) +{ +#define IQM_MAGIC "INTERQUAKEMODEL" // IQM file magic number +#define IQM_VERSION 2 // only IQM version 2 supported + + unsigned int fileSize = 0; + unsigned char *fileData = LoadFileData(fileName, &fileSize); + unsigned char *fileDataPtr = fileData; + + typedef struct IQMHeader { + char magic[16]; + unsigned int version; + unsigned int filesize; + unsigned int flags; + unsigned int num_text, ofs_text; + unsigned int num_meshes, ofs_meshes; + unsigned int num_vertexarrays, num_vertexes, ofs_vertexarrays; + unsigned int num_triangles, ofs_triangles, ofs_adjacency; + unsigned int num_joints, ofs_joints; + unsigned int num_poses, ofs_poses; + unsigned int num_anims, ofs_anims; + unsigned int num_frames, num_framechannels, ofs_frames, ofs_bounds; + unsigned int num_comment, ofs_comment; + unsigned int num_extensions, ofs_extensions; + } IQMHeader; + + typedef struct IQMPose { + int parent; + unsigned int mask; + float channeloffset[10]; + float channelscale[10]; + } IQMPose; + + typedef struct IQMAnim { + unsigned int name; + unsigned int first_frame, num_frames; + float framerate; + unsigned int flags; + } IQMAnim; + + // In case file can not be read, return an empty model + if (fileDataPtr == NULL) return NULL; + + // Read IQM header + IQMHeader *iqmHeader = (IQMHeader *)fileDataPtr; + + if (memcmp(iqmHeader->magic, IQM_MAGIC, sizeof(IQM_MAGIC)) != 0) + { + TRACELOG(LOG_WARNING, "MODEL: [%s] IQM file is not a valid model", fileName); + return NULL; + } + + if (iqmHeader->version != IQM_VERSION) + { + TRACELOG(LOG_WARNING, "MODEL: [%s] IQM file version not supported (%i)", fileName, iqmHeader->version); + return NULL; + } + + // Get bones data + IQMPose *poses = RL_MALLOC(iqmHeader->num_poses*sizeof(IQMPose)); + //fseek(iqmFile, iqmHeader->ofs_poses, SEEK_SET); + //fread(poses, iqmHeader->num_poses*sizeof(IQMPose), 1, iqmFile); + memcpy(poses, fileDataPtr + iqmHeader->ofs_poses, iqmHeader->num_poses*sizeof(IQMPose)); + + // Get animations data + *animCount = iqmHeader->num_anims; + IQMAnim *anim = RL_MALLOC(iqmHeader->num_anims*sizeof(IQMAnim)); + //fseek(iqmFile, iqmHeader->ofs_anims, SEEK_SET); + //fread(anim, iqmHeader->num_anims*sizeof(IQMAnim), 1, iqmFile); + memcpy(anim, fileDataPtr + iqmHeader->ofs_anims, iqmHeader->num_anims*sizeof(IQMAnim)); + + ModelAnimation *animations = RL_MALLOC(iqmHeader->num_anims*sizeof(ModelAnimation)); + + // frameposes + unsigned short *framedata = RL_MALLOC(iqmHeader->num_frames*iqmHeader->num_framechannels*sizeof(unsigned short)); + //fseek(iqmFile, iqmHeader->ofs_frames, SEEK_SET); + //fread(framedata, iqmHeader->num_frames*iqmHeader->num_framechannels*sizeof(unsigned short), 1, iqmFile); + memcpy(framedata, fileDataPtr + iqmHeader->ofs_frames, iqmHeader->num_frames*iqmHeader->num_framechannels*sizeof(unsigned short)); + + for (unsigned int a = 0; a < iqmHeader->num_anims; a++) + { + animations[a].frameCount = anim[a].num_frames; + animations[a].boneCount = iqmHeader->num_poses; + animations[a].bones = RL_MALLOC(iqmHeader->num_poses*sizeof(BoneInfo)); + animations[a].framePoses = RL_MALLOC(anim[a].num_frames*sizeof(Transform *)); + // animations[a].framerate = anim.framerate; // TODO: Use framerate? + + for (unsigned int j = 0; j < iqmHeader->num_poses; j++) + { + strcpy(animations[a].bones[j].name, "ANIMJOINTNAME"); + animations[a].bones[j].parent = poses[j].parent; + } + + for (unsigned int j = 0; j < anim[a].num_frames; j++) animations[a].framePoses[j] = RL_MALLOC(iqmHeader->num_poses*sizeof(Transform)); + + int dcounter = anim[a].first_frame*iqmHeader->num_framechannels; + + for (unsigned int frame = 0; frame < anim[a].num_frames; frame++) + { + for (unsigned int i = 0; i < iqmHeader->num_poses; i++) + { + animations[a].framePoses[frame][i].translation.x = poses[i].channeloffset[0]; + + if (poses[i].mask & 0x01) + { + animations[a].framePoses[frame][i].translation.x += framedata[dcounter]*poses[i].channelscale[0]; + dcounter++; + } + + animations[a].framePoses[frame][i].translation.y = poses[i].channeloffset[1]; + + if (poses[i].mask & 0x02) + { + animations[a].framePoses[frame][i].translation.y += framedata[dcounter]*poses[i].channelscale[1]; + dcounter++; + } + + animations[a].framePoses[frame][i].translation.z = poses[i].channeloffset[2]; + + if (poses[i].mask & 0x04) + { + animations[a].framePoses[frame][i].translation.z += framedata[dcounter]*poses[i].channelscale[2]; + dcounter++; + } + + animations[a].framePoses[frame][i].rotation.x = poses[i].channeloffset[3]; + + if (poses[i].mask & 0x08) + { + animations[a].framePoses[frame][i].rotation.x += framedata[dcounter]*poses[i].channelscale[3]; + dcounter++; + } + + animations[a].framePoses[frame][i].rotation.y = poses[i].channeloffset[4]; + + if (poses[i].mask & 0x10) + { + animations[a].framePoses[frame][i].rotation.y += framedata[dcounter]*poses[i].channelscale[4]; + dcounter++; + } + + animations[a].framePoses[frame][i].rotation.z = poses[i].channeloffset[5]; + + if (poses[i].mask & 0x20) + { + animations[a].framePoses[frame][i].rotation.z += framedata[dcounter]*poses[i].channelscale[5]; + dcounter++; + } + + animations[a].framePoses[frame][i].rotation.w = poses[i].channeloffset[6]; + + if (poses[i].mask & 0x40) + { + animations[a].framePoses[frame][i].rotation.w += framedata[dcounter]*poses[i].channelscale[6]; + dcounter++; + } + + animations[a].framePoses[frame][i].scale.x = poses[i].channeloffset[7]; + + if (poses[i].mask & 0x80) + { + animations[a].framePoses[frame][i].scale.x += framedata[dcounter]*poses[i].channelscale[7]; + dcounter++; + } + + animations[a].framePoses[frame][i].scale.y = poses[i].channeloffset[8]; + + if (poses[i].mask & 0x100) + { + animations[a].framePoses[frame][i].scale.y += framedata[dcounter]*poses[i].channelscale[8]; + dcounter++; + } + + animations[a].framePoses[frame][i].scale.z = poses[i].channeloffset[9]; + + if (poses[i].mask & 0x200) + { + animations[a].framePoses[frame][i].scale.z += framedata[dcounter]*poses[i].channelscale[9]; + dcounter++; + } + + animations[a].framePoses[frame][i].rotation = QuaternionNormalize(animations[a].framePoses[frame][i].rotation); + } + } + + // Build frameposes + for (unsigned int frame = 0; frame < anim[a].num_frames; frame++) + { + for (int i = 0; i < animations[a].boneCount; i++) + { + if (animations[a].bones[i].parent >= 0) + { + animations[a].framePoses[frame][i].rotation = QuaternionMultiply(animations[a].framePoses[frame][animations[a].bones[i].parent].rotation, animations[a].framePoses[frame][i].rotation); + animations[a].framePoses[frame][i].translation = Vector3RotateByQuaternion(animations[a].framePoses[frame][i].translation, animations[a].framePoses[frame][animations[a].bones[i].parent].rotation); + animations[a].framePoses[frame][i].translation = Vector3Add(animations[a].framePoses[frame][i].translation, animations[a].framePoses[frame][animations[a].bones[i].parent].translation); + animations[a].framePoses[frame][i].scale = Vector3Multiply(animations[a].framePoses[frame][i].scale, animations[a].framePoses[frame][animations[a].bones[i].parent].scale); + } + } + } + } + + RL_FREE(fileData); + + RL_FREE(framedata); + RL_FREE(poses); + RL_FREE(anim); + + return animations; +} + #endif #if defined(SUPPORT_FILEFORMAT_GLTF) @@ -3655,7 +4090,7 @@ static Image LoadImageFromCgltfImage(cgltf_image *image, const char *texPath, Co rimage.data = raw; rimage.width = width; rimage.height = height; - rimage.format = UNCOMPRESSED_R8G8B8A8; + rimage.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; rimage.mipmaps = 1; // TODO: Tint shouldn't be applied here! @@ -3689,7 +4124,7 @@ static Image LoadImageFromCgltfImage(cgltf_image *image, const char *texPath, Co rimage.data = raw; rimage.width = width; rimage.height = height; - rimage.format = UNCOMPRESSED_R8G8B8A8; + rimage.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; rimage.mipmaps = 1; // TODO: Tint shouldn't be applied here! @@ -3700,12 +4135,33 @@ static Image LoadImageFromCgltfImage(cgltf_image *image, const char *texPath, Co return rimage; } + +static bool GLTFReadValue(cgltf_accessor* acc, unsigned int index, void *variable, unsigned int elements, unsigned int size) +{ + if (acc->count == 2) + { + if (index > 1) return false; + + memcpy(variable, index == 0 ? acc->min : acc->max, elements*size); + return true; + } + + unsigned int stride = size*elements; + memset(variable, 0, stride); + + if (acc->buffer_view == NULL || acc->buffer_view->buffer == NULL || acc->buffer_view->buffer->data == NULL) return false; + + void* readPosition = ((char *)acc->buffer_view->buffer->data) + (index*stride) + acc->buffer_view->offset + acc->offset; + memcpy(variable, readPosition, stride); + return true; +} + // LoadGLTF loads in model data from given filename, supporting both .gltf and .glb static Model LoadGLTF(const char *fileName) { /*********************************************************************************** - Function implemented by Wilhem Barbier(@wbrbr), with modifications by Tyler Bezera(@gamerfiend) + Function implemented by Wilhem Barbier(@wbrbr), with modifications by Tyler Bezera(@gamerfiend) and Hristo Stamenov(@object71) Features: - Supports .gltf and .glb files @@ -3721,18 +4177,6 @@ static Model LoadGLTF(const char *fileName) *************************************************************************************/ - #define LOAD_ACCESSOR(type, nbcomp, acc, dst) \ - { \ - int n = 0; \ - type* buf = (type*)acc->buffer_view->buffer->data + acc->buffer_view->offset/sizeof(type) + acc->offset/sizeof(type); \ - for (unsigned int k = 0; k < acc->count; k++) {\ - for (int l = 0; l < nbcomp; l++) {\ - dst[nbcomp*k + l] = buf[n + l];\ - }\ - n += (int)(acc->stride/sizeof(type));\ - }\ - } - Model model = { 0 }; // glTF file loading @@ -3757,7 +4201,8 @@ static Model LoadGLTF(const char *fileName) int primitivesCount = 0; - for (unsigned int i = 0; i < data->meshes_count; i++) primitivesCount += (int)data->meshes[i].primitives_count; + for (unsigned int i = 0; i < data->meshes_count; i++) + primitivesCount += (int)data->meshes[i].primitives_count; // Process glTF data and map to model model.meshCount = primitivesCount; @@ -3765,76 +4210,12 @@ static Model LoadGLTF(const char *fileName) model.materialCount = (int)data->materials_count + 1; model.materials = RL_MALLOC(model.materialCount*sizeof(Material)); model.meshMaterial = RL_MALLOC(model.meshCount*sizeof(int)); + model.boneCount = (int)data->nodes_count; + model.bones = RL_CALLOC(model.boneCount, sizeof(BoneInfo)); + model.bindPose = RL_CALLOC(model.boneCount, sizeof(Transform)); - for (int i = 0; i < model.meshCount; i++) model.meshes[i].vboId = (unsigned int *)RL_CALLOC(DEFAULT_MESH_VERTEX_BUFFERS, sizeof(unsigned int)); - - for (int i = 0; i < model.materialCount - 1; i++) - { - model.materials[i] = LoadMaterialDefault(); - Color tint = (Color){ 255, 255, 255, 255 }; - const char *texPath = GetDirectoryPath(fileName); - - //Ensure material follows raylib support for PBR (metallic/roughness flow) - if (data->materials[i].has_pbr_metallic_roughness) - { - tint.r = (unsigned char)(data->materials[i].pbr_metallic_roughness.base_color_factor[0] * 255); - tint.g = (unsigned char)(data->materials[i].pbr_metallic_roughness.base_color_factor[1] * 255); - tint.b = (unsigned char)(data->materials[i].pbr_metallic_roughness.base_color_factor[2] * 255); - tint.a = (unsigned char)(data->materials[i].pbr_metallic_roughness.base_color_factor[3] * 255); - - model.materials[i].maps[MAP_ALBEDO].color = tint; - - if (data->materials[i].pbr_metallic_roughness.base_color_texture.texture) - { - Image albedo = LoadImageFromCgltfImage(data->materials[i].pbr_metallic_roughness.base_color_texture.texture->image, texPath, tint); - model.materials[i].maps[MAP_ALBEDO].texture = LoadTextureFromImage(albedo); - UnloadImage(albedo); - } - - tint = WHITE; // Set tint to white after it's been used by Albedo - - if (data->materials[i].pbr_metallic_roughness.metallic_roughness_texture.texture) - { - Image metallicRoughness = LoadImageFromCgltfImage(data->materials[i].pbr_metallic_roughness.metallic_roughness_texture.texture->image, texPath, tint); - model.materials[i].maps[MAP_ROUGHNESS].texture = LoadTextureFromImage(metallicRoughness); - - float roughness = data->materials[i].pbr_metallic_roughness.roughness_factor; - model.materials[i].maps[MAP_ROUGHNESS].value = roughness; - - float metallic = data->materials[i].pbr_metallic_roughness.metallic_factor; - model.materials[i].maps[MAP_METALNESS].value = metallic; - - UnloadImage(metallicRoughness); - } - - if (data->materials[i].normal_texture.texture) - { - Image normalImage = LoadImageFromCgltfImage(data->materials[i].normal_texture.texture->image, texPath, tint); - model.materials[i].maps[MAP_NORMAL].texture = LoadTextureFromImage(normalImage); - UnloadImage(normalImage); - } - - if (data->materials[i].occlusion_texture.texture) - { - Image occulsionImage = LoadImageFromCgltfImage(data->materials[i].occlusion_texture.texture->image, texPath, tint); - model.materials[i].maps[MAP_OCCLUSION].texture = LoadTextureFromImage(occulsionImage); - UnloadImage(occulsionImage); - } - - if (data->materials[i].emissive_texture.texture) - { - Image emissiveImage = LoadImageFromCgltfImage(data->materials[i].emissive_texture.texture->image, texPath, tint); - model.materials[i].maps[MAP_EMISSION].texture = LoadTextureFromImage(emissiveImage); - tint.r = (unsigned char)(data->materials[i].emissive_factor[0]*255); - tint.g = (unsigned char)(data->materials[i].emissive_factor[1]*255); - tint.b = (unsigned char)(data->materials[i].emissive_factor[2]*255); - model.materials[i].maps[MAP_EMISSION].color = tint; - UnloadImage(emissiveImage); - } - } - } - - model.materials[model.materialCount - 1] = LoadMaterialDefault(); + InitGLTFBones(&model, data); + LoadGLTFMaterial(&model, fileName, data); int primitiveIndex = 0; @@ -3848,16 +4229,69 @@ static Model LoadGLTF(const char *fileName) { cgltf_accessor *acc = data->meshes[i].primitives[p].attributes[j].data; model.meshes[primitiveIndex].vertexCount = (int)acc->count; - model.meshes[primitiveIndex].vertices = RL_MALLOC(model.meshes[primitiveIndex].vertexCount*3*sizeof(float)); + int bufferSize = model.meshes[primitiveIndex].vertexCount*3*sizeof(float); + model.meshes[primitiveIndex].vertices = RL_MALLOC(bufferSize); + model.meshes[primitiveIndex].animVertices = RL_MALLOC(bufferSize); - LOAD_ACCESSOR(float, 3, acc, model.meshes[primitiveIndex].vertices) + if (acc->component_type == cgltf_component_type_r_32f) + { + for (unsigned int a = 0; a < acc->count; a++) + { + GLTFReadValue(acc, a, model.meshes[primitiveIndex].vertices + (a*3), 3, sizeof(float)); + } + } + else if (acc->component_type == cgltf_component_type_r_32u) + { + int readValue[3]; + for (unsigned int a = 0; a < acc->count; a++) + { + GLTFReadValue(acc, a, readValue, 3, sizeof(int)); + model.meshes[primitiveIndex].vertices[(a*3) + 0] = (float)readValue[0]; + model.meshes[primitiveIndex].vertices[(a*3) + 1] = (float)readValue[1]; + model.meshes[primitiveIndex].vertices[(a*3) + 2] = (float)readValue[2]; + } + } + else + { + // TODO: Support normalized unsigned byte/unsigned short vertices + TRACELOG(LOG_WARNING, "MODEL: [%s] glTF vertices must be float or int", fileName); + } + + memcpy(model.meshes[primitiveIndex].animVertices, model.meshes[primitiveIndex].vertices, bufferSize); } else if (data->meshes[i].primitives[p].attributes[j].type == cgltf_attribute_type_normal) { cgltf_accessor *acc = data->meshes[i].primitives[p].attributes[j].data; - model.meshes[primitiveIndex].normals = RL_MALLOC(acc->count*3*sizeof(float)); - LOAD_ACCESSOR(float, 3, acc, model.meshes[primitiveIndex].normals) + int bufferSize = (int)(acc->count*3*sizeof(float)); + model.meshes[primitiveIndex].normals = RL_MALLOC(bufferSize); + model.meshes[primitiveIndex].animNormals = RL_MALLOC(bufferSize); + + if (acc->component_type == cgltf_component_type_r_32f) + { + for (unsigned int a = 0; a < acc->count; a++) + { + GLTFReadValue(acc, a, model.meshes[primitiveIndex].normals + (a*3), 3, sizeof(float)); + } + } + else if (acc->component_type == cgltf_component_type_r_32u) + { + int readValue[3]; + for (unsigned int a = 0; a < acc->count; a++) + { + GLTFReadValue(acc, a, readValue, 3, sizeof(int)); + model.meshes[primitiveIndex].normals[(a*3) + 0] = (float)readValue[0]; + model.meshes[primitiveIndex].normals[(a*3) + 1] = (float)readValue[1]; + model.meshes[primitiveIndex].normals[(a*3) + 2] = (float)readValue[2]; + } + } + else + { + // TODO: Support normalized unsigned byte/unsigned short normals + TRACELOG(LOG_WARNING, "MODEL: [%s] glTF normals must be float or int", fileName); + } + + memcpy(model.meshes[primitiveIndex].animNormals, model.meshes[primitiveIndex].normals, bufferSize); } else if (data->meshes[i].primitives[p].attributes[j].type == cgltf_attribute_type_texcoord) { @@ -3866,7 +4300,11 @@ static Model LoadGLTF(const char *fileName) if (acc->component_type == cgltf_component_type_r_32f) { model.meshes[primitiveIndex].texcoords = RL_MALLOC(acc->count*2*sizeof(float)); - LOAD_ACCESSOR(float, 2, acc, model.meshes[primitiveIndex].texcoords) + + for (unsigned int a = 0; a < acc->count; a++) + { + GLTFReadValue(acc, a, model.meshes[primitiveIndex].texcoords + (a*2), 2, sizeof(float)); + } } else { @@ -3874,29 +4312,80 @@ static Model LoadGLTF(const char *fileName) TRACELOG(LOG_WARNING, "MODEL: [%s] glTF texture coordinates must be float", fileName); } } + else if (data->meshes[i].primitives[p].attributes[j].type == cgltf_attribute_type_joints) + { + cgltf_accessor *acc = data->meshes[i].primitives[p].attributes[j].data; + LoadGLTFBoneAttribute(&model, acc, data, primitiveIndex); + } + else if (data->meshes[i].primitives[p].attributes[j].type == cgltf_attribute_type_weights) + { + cgltf_accessor *acc = data->meshes[i].primitives[p].attributes[j].data; + + model.meshes[primitiveIndex].boneWeights = RL_MALLOC(acc->count*4*sizeof(float)); + + if (acc->component_type == cgltf_component_type_r_32f) + { + for (unsigned int a = 0; a < acc->count; a++) + { + GLTFReadValue(acc, a, model.meshes[primitiveIndex].boneWeights + (a*4), 4, sizeof(float)); + } + } + else if (acc->component_type == cgltf_component_type_r_32u) + { + unsigned int readValue[4]; + for (unsigned int a = 0; a < acc->count; a++) + { + GLTFReadValue(acc, a, readValue, 4, sizeof(unsigned int)); + model.meshes[primitiveIndex].boneWeights[(a*4) + 0] = (float)readValue[0]; + model.meshes[primitiveIndex].boneWeights[(a*4) + 1] = (float)readValue[1]; + model.meshes[primitiveIndex].boneWeights[(a*4) + 2] = (float)readValue[2]; + model.meshes[primitiveIndex].boneWeights[(a*4) + 3] = (float)readValue[3]; + } + } + else + { + // TODO: Support normalized unsigned byte/unsigned short weights + TRACELOG(LOG_WARNING, "MODEL: [%s] glTF normals must be float or int", fileName); + } + } + else if (data->meshes[i].primitives[p].attributes[j].type == cgltf_attribute_type_color) + { + cgltf_accessor *acc = data->meshes[i].primitives[p].attributes[j].data; + model.meshes[primitiveIndex].colors = RL_MALLOC(acc->count*4*sizeof(unsigned char)); + + if (acc->component_type == cgltf_component_type_r_8u) + { + for (int a = 0; a < acc->count; a++) + { + GLTFReadValue(acc, a, model.meshes[primitiveIndex].colors + (a*4), 4, sizeof(unsigned char)); + } + } + if (acc->component_type == cgltf_component_type_r_16u) + { + TRACELOG(LOG_WARNING, "MODEL: [%s] converting glTF colors to unsigned char", fileName); + for (int a = 0; a < acc->count; a++) + { + unsigned short readValue[4]; + for (int a = 0; a < acc->count; a++) + { + GLTFReadValue(acc, a, readValue, 4, sizeof(unsigned short)); + // 257 = 65535/255 + model.meshes[primitiveIndex].colors[(a*4) + 0] = (unsigned char)(readValue[0]/257); + model.meshes[primitiveIndex].colors[(a*4) + 1] = (unsigned char)(readValue[1]/257); + model.meshes[primitiveIndex].colors[(a*4) + 2] = (unsigned char)(readValue[2]/257); + model.meshes[primitiveIndex].colors[(a*4) + 3] = (unsigned char)(readValue[3]/257); + } + } + } + else + { + TRACELOG(LOG_WARNING, "MODEL: [%s] glTF colors must be uchar or ushort", fileName); + } + } } cgltf_accessor *acc = data->meshes[i].primitives[p].indices; - - if (acc) - { - if (acc->component_type == cgltf_component_type_r_16u) - { - model.meshes[primitiveIndex].triangleCount = (int)acc->count/3; - model.meshes[primitiveIndex].indices = RL_MALLOC(model.meshes[primitiveIndex].triangleCount*3*sizeof(unsigned short)); - LOAD_ACCESSOR(unsigned short, 1, acc, model.meshes[primitiveIndex].indices) - } - else - { - // TODO: Support unsigned byte/unsigned int - TRACELOG(LOG_WARNING, "MODEL: [%s] glTF index data must be unsigned short", fileName); - } - } - else - { - // Unindexed mesh - model.meshes[primitiveIndex].triangleCount = model.meshes[primitiveIndex].vertexCount/3; - } + LoadGLTFModelIndices(&model, acc, primitiveIndex); if (data->meshes[i].primitives[p].material) { @@ -3905,11 +4394,14 @@ static Model LoadGLTF(const char *fileName) } else { - model.meshMaterial[primitiveIndex] = model.materialCount - 1;; + model.meshMaterial[primitiveIndex] = model.materialCount - 1; } + BindGLTFPrimitiveToBones(&model, data, primitiveIndex); + primitiveIndex++; } + } cgltf_free(data); @@ -3920,4 +4412,542 @@ static Model LoadGLTF(const char *fileName) return model; } + +static void InitGLTFBones(Model* model, const cgltf_data* data) +{ + for (unsigned int j = 0; j < data->nodes_count; j++) + { + strcpy(model->bones[j].name, data->nodes[j].name == 0 ? "ANIMJOINT" : data->nodes[j].name); + model->bones[j].parent = (data->nodes[j].parent != NULL) ? (int)(data->nodes[j].parent - data->nodes) : -1; + } + + for (unsigned int i = 0; i < data->nodes_count; i++) + { + if (data->nodes[i].has_translation) memcpy(&model->bindPose[i].translation, data->nodes[i].translation, 3*sizeof(float)); + else model->bindPose[i].translation = Vector3Zero(); + + if (data->nodes[i].has_rotation) memcpy(&model->bindPose[i].rotation, data->nodes[i].rotation, 4*sizeof(float)); + else model->bindPose[i].rotation = QuaternionIdentity(); + + model->bindPose[i].rotation = QuaternionNormalize(model->bindPose[i].rotation); + + if (data->nodes[i].has_scale) memcpy(&model->bindPose[i].scale, data->nodes[i].scale, 3*sizeof(float)); + else model->bindPose[i].scale = Vector3One(); + } + + { + bool* completedBones = RL_CALLOC(model->boneCount, sizeof(bool)); + int numberCompletedBones = 0; + + while (numberCompletedBones < model->boneCount) + { + for (int i = 0; i < model->boneCount; i++) + { + if (completedBones[i]) continue; + + if (model->bones[i].parent < 0) + { + completedBones[i] = true; + numberCompletedBones++; + continue; + } + + if (!completedBones[model->bones[i].parent]) continue; + + Transform* currentTransform = &model->bindPose[i]; + BoneInfo* currentBone = &model->bones[i]; + int root = currentBone->parent; + if (root >= model->boneCount) root = 0; + Transform* parentTransform = &model->bindPose[root]; + + currentTransform->rotation = QuaternionMultiply(parentTransform->rotation, currentTransform->rotation); + currentTransform->translation = Vector3RotateByQuaternion(currentTransform->translation, parentTransform->rotation); + currentTransform->translation = Vector3Add(currentTransform->translation, parentTransform->translation); + currentTransform->scale = Vector3Multiply(currentTransform->scale, parentTransform->scale); + completedBones[i] = true; + numberCompletedBones++; + } + } + + RL_FREE(completedBones); + } +} + +static void LoadGLTFMaterial(Model *model, const char *fileName, const cgltf_data *data) +{ + for (int i = 0; i < model->materialCount - 1; i++) + { + model->materials[i] = LoadMaterialDefault(); + Color tint = (Color){ 255, 255, 255, 255 }; + const char *texPath = GetDirectoryPath(fileName); + + // Ensure material follows raylib support for PBR (metallic/roughness flow) + if (data->materials[i].has_pbr_metallic_roughness) + { + tint.r = (unsigned char)(data->materials[i].pbr_metallic_roughness.base_color_factor[0]*255); + tint.g = (unsigned char)(data->materials[i].pbr_metallic_roughness.base_color_factor[1]*255); + tint.b = (unsigned char)(data->materials[i].pbr_metallic_roughness.base_color_factor[2]*255); + tint.a = (unsigned char)(data->materials[i].pbr_metallic_roughness.base_color_factor[3]*255); + + model->materials[i].maps[MATERIAL_MAP_ALBEDO].color = tint; + + if (data->materials[i].pbr_metallic_roughness.base_color_texture.texture) + { + Image albedo = LoadImageFromCgltfImage(data->materials[i].pbr_metallic_roughness.base_color_texture.texture->image, texPath, tint); + model->materials[i].maps[MATERIAL_MAP_ALBEDO].texture = LoadTextureFromImage(albedo); + UnloadImage(albedo); + } + + tint = WHITE; // Set tint to white after it's been used by Albedo + + if (data->materials[i].pbr_metallic_roughness.metallic_roughness_texture.texture) + { + Image metallicRoughness = LoadImageFromCgltfImage(data->materials[i].pbr_metallic_roughness.metallic_roughness_texture.texture->image, texPath, tint); + model->materials[i].maps[MATERIAL_MAP_ROUGHNESS].texture = LoadTextureFromImage(metallicRoughness); + + float roughness = data->materials[i].pbr_metallic_roughness.roughness_factor; + model->materials[i].maps[MATERIAL_MAP_ROUGHNESS].value = roughness; + + float metallic = data->materials[i].pbr_metallic_roughness.metallic_factor; + model->materials[i].maps[MATERIAL_MAP_METALNESS].value = metallic; + + UnloadImage(metallicRoughness); + } + + if (data->materials[i].normal_texture.texture) + { + Image normalImage = LoadImageFromCgltfImage(data->materials[i].normal_texture.texture->image, texPath, tint); + model->materials[i].maps[MATERIAL_MAP_NORMAL].texture = LoadTextureFromImage(normalImage); + UnloadImage(normalImage); + } + + if (data->materials[i].occlusion_texture.texture) + { + Image occulsionImage = LoadImageFromCgltfImage(data->materials[i].occlusion_texture.texture->image, texPath, tint); + model->materials[i].maps[MATERIAL_MAP_OCCLUSION].texture = LoadTextureFromImage(occulsionImage); + UnloadImage(occulsionImage); + } + + if (data->materials[i].emissive_texture.texture) + { + Image emissiveImage = LoadImageFromCgltfImage(data->materials[i].emissive_texture.texture->image, texPath, tint); + model->materials[i].maps[MATERIAL_MAP_EMISSION].texture = LoadTextureFromImage(emissiveImage); + tint.r = (unsigned char)(data->materials[i].emissive_factor[0]*255); + tint.g = (unsigned char)(data->materials[i].emissive_factor[1]*255); + tint.b = (unsigned char)(data->materials[i].emissive_factor[2]*255); + model->materials[i].maps[MATERIAL_MAP_EMISSION].color = tint; + UnloadImage(emissiveImage); + } + } + } + + model->materials[model->materialCount - 1] = LoadMaterialDefault(); +} + +static void LoadGLTFBoneAttribute(Model *model, cgltf_accessor *jointsAccessor, const cgltf_data *data, int primitiveIndex) +{ + if (jointsAccessor->component_type == cgltf_component_type_r_16u) + { + model->meshes[primitiveIndex].boneIds = RL_MALLOC(jointsAccessor->count*4*sizeof(int)); + short* bones = RL_MALLOC(jointsAccessor->count*4*sizeof(short)); + + for (unsigned int a = 0; a < jointsAccessor->count; a++) + { + GLTFReadValue(jointsAccessor, a, bones + (a*4), 4, sizeof(short)); + } + + for (unsigned int a = 0; a < jointsAccessor->count*4; a++) + { + cgltf_node* skinJoint = data->skins->joints[bones[a]]; + + for (unsigned int k = 0; k < data->nodes_count; k++) + { + if (&(data->nodes[k]) == skinJoint) + { + model->meshes[primitiveIndex].boneIds[a] = k; + break; + } + } + } + RL_FREE(bones); + } + else if (jointsAccessor->component_type == cgltf_component_type_r_8u) + { + model->meshes[primitiveIndex].boneIds = RL_MALLOC(jointsAccessor->count*4*sizeof(int)); + unsigned char *bones = RL_MALLOC(jointsAccessor->count*4*sizeof(unsigned char)); + + for (unsigned int a = 0; a < jointsAccessor->count; a++) + { + GLTFReadValue(jointsAccessor, a, bones + (a*4), 4, sizeof(unsigned char)); + } + + for (unsigned int a = 0; a < jointsAccessor->count*4; a++) + { + cgltf_node* skinJoint = data->skins->joints[bones[a]]; + + for (unsigned int k = 0; k < data->nodes_count; k++) + { + if (&(data->nodes[k]) == skinJoint) + { + model->meshes[primitiveIndex].boneIds[a] = k; + break; + } + } + } + RL_FREE(bones); + } + else + { + // TODO: Support other size of bone index? + TRACELOG(LOG_WARNING, "MODEL: glTF bones in unexpected format"); + } +} + +static void BindGLTFPrimitiveToBones(Model* model, const cgltf_data* data, int primitiveIndex) +{ + if (model->meshes[primitiveIndex].boneIds == NULL && data->nodes_count > 0) + { + for (unsigned int nodeId = 0; nodeId < data->nodes_count; nodeId++) + { + if (data->nodes[nodeId].mesh == &(data->meshes[primitiveIndex])) + { + model->meshes[primitiveIndex].boneIds = RL_CALLOC(4*model->meshes[primitiveIndex].vertexCount, sizeof(int)); + model->meshes[primitiveIndex].boneWeights = RL_CALLOC(4*model->meshes[primitiveIndex].vertexCount, sizeof(float)); + + for (int b = 0; b < 4*model->meshes[primitiveIndex].vertexCount; b++) + { + if (b%4 == 0) + { + model->meshes[primitiveIndex].boneIds[b] = nodeId; + model->meshes[primitiveIndex].boneWeights[b] = 1.0f; + } + else + { + model->meshes[primitiveIndex].boneIds[b] = 0; + model->meshes[primitiveIndex].boneWeights[b] = 0.0f; + } + + } + + Vector3 boundVertex = { 0 }; + Vector3 boundNormal = { 0 }; + + Vector3 outTranslation = { 0 }; + Quaternion outRotation = { 0 }; + Vector3 outScale = { 0 }; + + int vCounter = 0; + int boneCounter = 0; + int boneId = 0; + + for (int i = 0; i < model->meshes[primitiveIndex].vertexCount; i++) + { + boneId = model->meshes[primitiveIndex].boneIds[boneCounter]; + outTranslation = model->bindPose[boneId].translation; + outRotation = model->bindPose[boneId].rotation; + outScale = model->bindPose[boneId].scale; + + // Vertices processing + boundVertex = (Vector3){ model->meshes[primitiveIndex].vertices[vCounter], model->meshes[primitiveIndex].vertices[vCounter + 1], model->meshes[primitiveIndex].vertices[vCounter + 2] }; + boundVertex = Vector3Multiply(boundVertex, outScale); + boundVertex = Vector3RotateByQuaternion(boundVertex, outRotation); + boundVertex = Vector3Add(boundVertex, outTranslation); + model->meshes[primitiveIndex].vertices[vCounter] = boundVertex.x; + model->meshes[primitiveIndex].vertices[vCounter + 1] = boundVertex.y; + model->meshes[primitiveIndex].vertices[vCounter + 2] = boundVertex.z; + + // Normals processing + if (model->meshes[primitiveIndex].normals != NULL) + { + boundNormal = (Vector3){ model->meshes[primitiveIndex].normals[vCounter], model->meshes[primitiveIndex].normals[vCounter + 1], model->meshes[primitiveIndex].normals[vCounter + 2] }; + boundNormal = Vector3RotateByQuaternion(boundNormal, outRotation); + model->meshes[primitiveIndex].normals[vCounter] = boundNormal.x; + model->meshes[primitiveIndex].normals[vCounter + 1] = boundNormal.y; + model->meshes[primitiveIndex].normals[vCounter + 2] = boundNormal.z; + } + + vCounter += 3; + boneCounter += 4; + } + } + } + } +} + +static void LoadGLTFModelIndices(Model* model, cgltf_accessor* indexAccessor, int primitiveIndex) +{ + if (indexAccessor) + { + if (indexAccessor->component_type == cgltf_component_type_r_16u || indexAccessor->component_type == cgltf_component_type_r_16) + { + model->meshes[primitiveIndex].triangleCount = (int)indexAccessor->count/3; + model->meshes[primitiveIndex].indices = RL_MALLOC(model->meshes[primitiveIndex].triangleCount*3*sizeof(unsigned short)); + + unsigned short readValue = 0; + for (unsigned int a = 0; a < indexAccessor->count; a++) + { + GLTFReadValue(indexAccessor, a, &readValue, 1, sizeof(short)); + model->meshes[primitiveIndex].indices[a] = readValue; + } + } + else if (indexAccessor->component_type == cgltf_component_type_r_8u || indexAccessor->component_type == cgltf_component_type_r_8) + { + model->meshes[primitiveIndex].triangleCount = (int)indexAccessor->count/3; + model->meshes[primitiveIndex].indices = RL_MALLOC(model->meshes[primitiveIndex].triangleCount*3*sizeof(unsigned short)); + + unsigned char readValue = 0; + for (unsigned int a = 0; a < indexAccessor->count; a++) + { + GLTFReadValue(indexAccessor, a, &readValue, 1, sizeof(char)); + model->meshes[primitiveIndex].indices[a] = (unsigned short)readValue; + } + } + else if (indexAccessor->component_type == cgltf_component_type_r_32u) + { + model->meshes[primitiveIndex].triangleCount = (int)indexAccessor->count/3; + model->meshes[primitiveIndex].indices = RL_MALLOC(model->meshes[primitiveIndex].triangleCount*3*sizeof(unsigned short)); + + unsigned int readValue; + for (unsigned int a = 0; a < indexAccessor->count; a++) + { + GLTFReadValue(indexAccessor, a, &readValue, 1, sizeof(unsigned int)); + model->meshes[primitiveIndex].indices[a] = (unsigned short)readValue; + } + } + } + else + { + // Unindexed mesh + model->meshes[primitiveIndex].triangleCount = model->meshes[primitiveIndex].vertexCount/3; + } +} + +// LoadGLTF loads in animation data from given filename +static ModelAnimation *LoadGLTFModelAnimations(const char *fileName, int *animCount) +{ + /*********************************************************************************** + + Function implemented by Hristo Stamenov (@object71) + + Features: + - Supports .gltf and .glb files + + Some restrictions (not exhaustive): + - ... + + *************************************************************************************/ + + // glTF file loading + unsigned int dataSize = 0; + unsigned char *fileData = LoadFileData(fileName, &dataSize); + + ModelAnimation *animations = NULL; + + if (fileData == NULL) return animations; + + // glTF data loading + cgltf_options options = { 0 }; + cgltf_data *data = NULL; + cgltf_result result = cgltf_parse(&options, fileData, dataSize, &data); + + if (result == cgltf_result_success) + { + TRACELOG(LOG_INFO, "MODEL: [%s] glTF animations (%s) count: %i", fileName, (data->file_type == 2)? "glb" : + "gltf", data->animations_count); + + result = cgltf_load_buffers(&options, data, fileName); + if (result != cgltf_result_success) TRACELOG(LOG_WARNING, "MODEL: [%s] unable to load glTF animations data", fileName); + animations = RL_MALLOC(data->animations_count*sizeof(ModelAnimation)); + *animCount = (int)data->animations_count; + + for (unsigned int a = 0; a < data->animations_count; a++) + { + // gltf animation consists of the following structures: + // - nodes - bones + // - channels - single transformation type on a single bone + // - node - bone + // - transformation type (path) - translation, rotation, scale + // - sampler - animation samples + // - input - points in time this transformation happens + // - output - the transformation amount at the given input points in time + // - interpolation - the type of interpolation to use between the frames + + cgltf_animation *animation = data->animations + a; + + ModelAnimation *output = animations + a; + + // 30 frames sampled per second + const float timeStep = (1.0f/30.0f); + float animationDuration = 0.0f; + + // Getting the max animation time to consider for animation duration + for (unsigned int i = 0; i < animation->channels_count; i++) + { + cgltf_animation_channel* channel = animation->channels + i; + int frameCounts = (int)channel->sampler->input->count; + float lastFrameTime = 0.0f; + + if (GLTFReadValue(channel->sampler->input, frameCounts - 1, &lastFrameTime, 1, sizeof(float))) + { + animationDuration = fmaxf(lastFrameTime, animationDuration); + } + } + + output->frameCount = (int)(animationDuration/timeStep); + output->boneCount = (int)data->nodes_count; + output->bones = RL_MALLOC(output->boneCount*sizeof(BoneInfo)); + output->framePoses = RL_MALLOC(output->frameCount*sizeof(Transform *)); + // output->framerate = // TODO: Use framerate instead of const timestep + + // Name and parent bones + for (unsigned int j = 0; j < output->boneCount; j++) + { + strcpy(output->bones[j].name, data->nodes[j].name == 0 ? "ANIMJOINT" : data->nodes[j].name); + output->bones[j].parent = (data->nodes[j].parent != NULL) ? (int)(data->nodes[j].parent - data->nodes) : -1; + } + + // Allocate data for frames + // Initiate with zero bone translations + for (int frame = 0; frame < output->frameCount; frame++) + { + output->framePoses[frame] = RL_MALLOC(output->boneCount*sizeof(Transform)); + + for (unsigned int i = 0; i < output->boneCount; i++) + { + output->framePoses[frame][i].translation = Vector3Zero(); + output->framePoses[frame][i].rotation = QuaternionIdentity(); + output->framePoses[frame][i].rotation = QuaternionNormalize(output->framePoses[frame][i].rotation); + output->framePoses[frame][i].scale = Vector3One(); + } + } + + // for each single transformation type on single bone + for (unsigned int channelId = 0; channelId < animation->channels_count; channelId++) + { + cgltf_animation_channel* channel = animation->channels + channelId; + cgltf_animation_sampler* sampler = channel->sampler; + + int boneId = (int)(channel->target_node - data->nodes); + + for (int frame = 0; frame < output->frameCount; frame++) + { + bool shouldSkipFurtherTransformation = true; + int outputMin = 0; + int outputMax = 0; + float frameTime = frame*timeStep; + float lerpPercent = 0.0f; + + // For this transformation: + // getting between which input values the current frame time position + // and also what is the percent to use in the linear interpolation later + for (unsigned int j = 0; j < sampler->input->count; j++) + { + float inputFrameTime; + if (GLTFReadValue(sampler->input, j, &inputFrameTime, 1, sizeof(float))) + { + if (frameTime < inputFrameTime) + { + shouldSkipFurtherTransformation = false; + outputMin = (j == 0) ? 0 : j - 1; + outputMax = j; + + float previousInputTime = 0.0f; + if (GLTFReadValue(sampler->input, outputMin, &previousInputTime, 1, sizeof(float))) + { + if ((inputFrameTime - previousInputTime) != 0) + { + lerpPercent = (frameTime - previousInputTime)/(inputFrameTime - previousInputTime); + } + } + + break; + } + } + else break; + } + + // If the current transformation has no information for the current frame time point + if (shouldSkipFurtherTransformation) continue; + + if (channel->target_path == cgltf_animation_path_type_translation) + { + Vector3 translationStart; + Vector3 translationEnd; + + bool success = GLTFReadValue(sampler->output, outputMin, &translationStart, 3, sizeof(float)); + success = GLTFReadValue(sampler->output, outputMax, &translationEnd, 3, sizeof(float)) || success; + + if (success) output->framePoses[frame][boneId].translation = Vector3Lerp(translationStart, translationEnd, lerpPercent); + } + if (channel->target_path == cgltf_animation_path_type_rotation) + { + Quaternion rotationStart; + Quaternion rotationEnd; + + bool success = GLTFReadValue(sampler->output, outputMin, &rotationStart, 4, sizeof(float)); + success = GLTFReadValue(sampler->output, outputMax, &rotationEnd, 4, sizeof(float)) || success; + + if (success) + { + output->framePoses[frame][boneId].rotation = QuaternionLerp(rotationStart, rotationEnd, lerpPercent); + output->framePoses[frame][boneId].rotation = QuaternionNormalize(output->framePoses[frame][boneId].rotation); + } + } + if (channel->target_path == cgltf_animation_path_type_scale) + { + Vector3 scaleStart; + Vector3 scaleEnd; + + bool success = GLTFReadValue(sampler->output, outputMin, &scaleStart, 3, sizeof(float)); + success = GLTFReadValue(sampler->output, outputMax, &scaleEnd, 3, sizeof(float)) || success; + + if (success) output->framePoses[frame][boneId].scale = Vector3Lerp(scaleStart, scaleEnd, lerpPercent); + } + } + } + + // Build frameposes + for (int frame = 0; frame < output->frameCount; frame++) + { + bool *completedBones = RL_CALLOC(output->boneCount, sizeof(bool)); + int numberCompletedBones = 0; + + while (numberCompletedBones < output->boneCount) + { + for (int i = 0; i < output->boneCount; i++) + { + if (completedBones[i]) continue; + + if (output->bones[i].parent < 0) + { + completedBones[i] = true; + numberCompletedBones++; + continue; + } + + if (!completedBones[output->bones[i].parent]) continue; + + output->framePoses[frame][i].rotation = QuaternionMultiply(output->framePoses[frame][output->bones[i].parent].rotation, output->framePoses[frame][i].rotation); + output->framePoses[frame][i].translation = Vector3RotateByQuaternion(output->framePoses[frame][i].translation, output->framePoses[frame][output->bones[i].parent].rotation); + output->framePoses[frame][i].translation = Vector3Add(output->framePoses[frame][i].translation, output->framePoses[frame][output->bones[i].parent].translation); + output->framePoses[frame][i].scale = Vector3Multiply(output->framePoses[frame][i].scale, output->framePoses[frame][output->bones[i].parent].scale); + completedBones[i] = true; + numberCompletedBones++; + } + } + + RL_FREE(completedBones); + } + + } + + cgltf_free(data); + } + else TRACELOG(LOG_WARNING, ": [%s] Failed to load glTF data", fileName); + + RL_FREE(fileData); + + return animations; +} + #endif diff --git a/src/raudio.c b/src/raudio.c index f4ae9efaa..1ff956a14 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -163,6 +163,7 @@ typedef struct tagBITMAPINFOHEADER { #define MA_NO_FLAC #define MA_NO_MP3 #define MINIAUDIO_IMPLEMENTATION +//#define MA_DEBUG_OUTPUT #include "external/miniaudio.h" // miniaudio library #undef PlaySound // Win32 API: windows.h > mmsystem.h defines PlaySound macro @@ -255,8 +256,9 @@ typedef struct tagBITMAPINFOHEADER { #ifndef AUDIO_DEVICE_CHANNELS #define AUDIO_DEVICE_CHANNELS 2 // Device output channels: stereo #endif + #ifndef AUDIO_DEVICE_SAMPLE_RATE - #define AUDIO_DEVICE_SAMPLE_RATE 44100 // Device output sample rate + #define AUDIO_DEVICE_SAMPLE_RATE 0 // Device output channels: stereo #endif #ifndef MAX_AUDIO_BUFFER_POOL_CHANNELS #define MAX_AUDIO_BUFFER_POOL_CHANNELS 16 // Audio pool channels @@ -274,25 +276,28 @@ typedef struct tagBITMAPINFOHEADER { // NOTE: Depends on data structure provided by the library // in charge of reading the different file types typedef enum { - MUSIC_AUDIO_WAV = 0, - MUSIC_AUDIO_OGG, - MUSIC_AUDIO_FLAC, - MUSIC_AUDIO_MP3, - MUSIC_MODULE_XM, - MUSIC_MODULE_MOD + MUSIC_AUDIO_NONE = 0, // No audio context loaded + MUSIC_AUDIO_WAV, // WAV audio context + MUSIC_AUDIO_OGG, // OGG audio context + MUSIC_AUDIO_FLAC, // FLAC audio context + MUSIC_AUDIO_MP3, // MP3 audio context + MUSIC_MODULE_XM, // XM module audio context + MUSIC_MODULE_MOD // MOD module audio context } MusicContextType; #if defined(RAUDIO_STANDALONE) +// Trace log level +// NOTE: Organized by priority level typedef enum { - LOG_ALL, - LOG_TRACE, - LOG_DEBUG, - LOG_INFO, - LOG_WARNING, - LOG_ERROR, - LOG_FATAL, - LOG_NONE -} TraceLogType; + LOG_ALL = 0, // Display all logs + LOG_TRACE, // Trace logging, intended for internal use only + LOG_DEBUG, // Debug logging, used for internal debugging, it should be disabled on release builds + LOG_INFO, // Info logging, used for program execution info + LOG_WARNING, // Warning logging, used on recoverable failures + LOG_ERROR, // Error logging, used on unrecoverable failures + LOG_FATAL, // Fatal logging, used to abort program: exit(EXIT_FAILURE) + LOG_NONE // Disable logging +} TraceLogLevel; #endif // NOTE: Different logic is used when feeding data to the playback device @@ -341,8 +346,8 @@ typedef struct AudioData { int defaultSize; // Default audio buffer size for audio streams } Buffer; struct { - AudioBuffer *pool[MAX_AUDIO_BUFFER_POOL_CHANNELS]; // Multichannel AudioBuffer pointers pool unsigned int poolCounter; // AudioBuffer pointers pool counter + AudioBuffer *pool[MAX_AUDIO_BUFFER_POOL_CHANNELS]; // Multichannel AudioBuffer pointers pool unsigned int channels[MAX_AUDIO_BUFFER_POOL_CHANNELS]; // AudioBuffer pool channels } MultiChannel; } AudioData; @@ -356,7 +361,7 @@ static AudioData AUDIO = { // Global AUDIO context // After some math, considering a sampleRate of 48000, a buffer refill rate of 1/60 seconds and a // standard double-buffering system, a 4096 samples buffer has been chosen, it should be enough // In case of music-stalls, just increase this number - .Buffer.defaultSize = DEFAULT_AUDIO_BUFFER_SIZE + .Buffer.defaultSize = 0 }; //---------------------------------------------------------------------------------- @@ -366,9 +371,6 @@ static void OnLog(ma_context *pContext, ma_device *pDevice, ma_uint32 logLevel, static void OnSendAudioDataToDevice(ma_device *pDevice, void *pFramesOut, const void *pFramesInput, ma_uint32 frameCount); static void MixAudioFrames(float *framesOut, const float *framesIn, ma_uint32 frameCount, float localVolume); -static void InitAudioBufferPool(void); // Initialise the multichannel buffer pool -static void CloseAudioBufferPool(void); // Close the audio buffers pool - #if defined(SUPPORT_FILEFORMAT_WAV) static Wave LoadWAV(const unsigned char *fileData, unsigned int fileSize); // Load WAV file static int SaveWAV(Wave wave, const char *fileName); // Save wave data as WAV file @@ -385,6 +387,10 @@ static Wave LoadMP3(const unsigned char *fileData, unsigned int fileSize); // #if defined(RAUDIO_STANDALONE) static bool IsFileExtension(const char *fileName, const char *ext); // Check file extension +static const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes the dot: .png) +static bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal +static const char *TextToLower(const char *text); // Get lower case version of provided string + static unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read) static bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write) static bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated @@ -422,7 +428,7 @@ void InitAudioDevice(void) ma_result result = ma_context_init(NULL, 0, &ctxConfig, &AUDIO.System.context); if (result != MA_SUCCESS) { - TRACELOG(LOG_ERROR, "AUDIO: Failed to initialize context"); + TRACELOG(LOG_WARNING, "AUDIO: Failed to initialize context"); return; } @@ -442,7 +448,7 @@ void InitAudioDevice(void) result = ma_device_init(&AUDIO.System.context, &config, &AUDIO.System.device); if (result != MA_SUCCESS) { - TRACELOG(LOG_ERROR, "AUDIO: Failed to initialize playback device"); + TRACELOG(LOG_WARNING, "AUDIO: Failed to initialize playback device"); ma_context_uninit(&AUDIO.System.context); return; } @@ -452,7 +458,7 @@ void InitAudioDevice(void) result = ma_device_start(&AUDIO.System.device); if (result != MA_SUCCESS) { - TRACELOG(LOG_ERROR, "AUDIO: Failed to start playback device"); + TRACELOG(LOG_WARNING, "AUDIO: Failed to start playback device"); ma_device_uninit(&AUDIO.System.device); ma_context_uninit(&AUDIO.System.context); return; @@ -462,12 +468,20 @@ void InitAudioDevice(void) // want to look at something a bit smarter later on to keep everything real-time, if that's necessary. if (ma_mutex_init(&AUDIO.System.lock) != MA_SUCCESS) { - TRACELOG(LOG_ERROR, "AUDIO: Failed to create mutex for mixing"); + TRACELOG(LOG_WARNING, "AUDIO: Failed to create mutex for mixing"); ma_device_uninit(&AUDIO.System.device); ma_context_uninit(&AUDIO.System.context); return; } + // Init dummy audio buffers pool for multichannel sound playing + for (int i = 0; i < MAX_AUDIO_BUFFER_POOL_CHANNELS; i++) + { + // WARNING: An empty audio buffer is created (data = 0) + // AudioBuffer data just points to loaded sound data + AUDIO.MultiChannel.pool[i] = LoadAudioBuffer(AUDIO_DEVICE_FORMAT, AUDIO_DEVICE_CHANNELS, AUDIO.System.device.sampleRate, 0, AUDIO_BUFFER_USAGE_STATIC); + } + TRACELOG(LOG_INFO, "AUDIO: Device initialized successfully"); TRACELOG(LOG_INFO, " > Backend: miniaudio / %s", ma_get_backend_name(AUDIO.System.context.backend)); TRACELOG(LOG_INFO, " > Format: %s -> %s", ma_get_format_name(AUDIO.System.device.playback.format), ma_get_format_name(AUDIO.System.device.playback.internalFormat)); @@ -475,8 +489,6 @@ void InitAudioDevice(void) TRACELOG(LOG_INFO, " > Sample rate: %d -> %d", AUDIO.System.device.sampleRate, AUDIO.System.device.playback.internalSampleRate); TRACELOG(LOG_INFO, " > Periods size: %d", AUDIO.System.device.playback.internalPeriodSizeInFrames*AUDIO.System.device.playback.internalPeriods); - InitAudioBufferPool(); - AUDIO.System.isReady = true; } @@ -485,11 +497,25 @@ void CloseAudioDevice(void) { if (AUDIO.System.isReady) { + // Unload dummy audio buffers pool + // WARNING: They can be pointing to already unloaded data + for (int i = 0; i < MAX_AUDIO_BUFFER_POOL_CHANNELS; i++) + { + //UnloadAudioBuffer(AUDIO.MultiChannel.pool[i]); + if (AUDIO.MultiChannel.pool[i] != NULL) + { + ma_data_converter_uninit(&AUDIO.MultiChannel.pool[i]->converter); + UntrackAudioBuffer(AUDIO.MultiChannel.pool[i]); + //RL_FREE(buffer->data); // Already unloaded by UnloadSound() + RL_FREE(AUDIO.MultiChannel.pool[i]); + } + } + ma_mutex_uninit(&AUDIO.System.lock); ma_device_uninit(&AUDIO.System.device); ma_context_uninit(&AUDIO.System.context); - CloseAudioBufferPool(); + AUDIO.System.isReady = false; TRACELOG(LOG_INFO, "AUDIO: Device closed successfully"); } @@ -519,21 +545,21 @@ AudioBuffer *LoadAudioBuffer(ma_format format, ma_uint32 channels, ma_uint32 sam if (audioBuffer == NULL) { - TRACELOG(LOG_ERROR, "AUDIO: Failed to allocate memory for buffer"); + TRACELOG(LOG_WARNING, "AUDIO: Failed to allocate memory for buffer"); return NULL; } if (sizeInFrames > 0) audioBuffer->data = RL_CALLOC(sizeInFrames*channels*ma_get_bytes_per_sample(format), 1); // Audio data runs through a format converter - ma_data_converter_config converterConfig = ma_data_converter_config_init(format, AUDIO_DEVICE_FORMAT, channels, AUDIO_DEVICE_CHANNELS, sampleRate, AUDIO_DEVICE_SAMPLE_RATE); + ma_data_converter_config converterConfig = ma_data_converter_config_init(format, AUDIO_DEVICE_FORMAT, channels, AUDIO_DEVICE_CHANNELS, sampleRate, AUDIO.System.device.sampleRate); converterConfig.resampling.allowDynamicSampleRate = true; // Required for pitch shifting ma_result result = ma_data_converter_init(&converterConfig, &audioBuffer->converter); if (result != MA_SUCCESS) { - TRACELOG(LOG_ERROR, "AUDIO: Failed to create data conversion pipeline"); + TRACELOG(LOG_WARNING, "AUDIO: Failed to create data conversion pipeline"); RL_FREE(audioBuffer); return NULL; } @@ -703,7 +729,7 @@ Wave LoadWave(const char *fileName) return wave; } -// Load wave from memory buffer, fileType refers to extension: i.e. "wav" +// Load wave from memory buffer, fileType refers to extension: i.e. ".wav" Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize) { Wave wave = { 0 }; @@ -713,16 +739,16 @@ Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int if (false) { } #if defined(SUPPORT_FILEFORMAT_WAV) - else if (TextIsEqual(fileExtLower, "wav")) wave = LoadWAV(fileData, dataSize); + else if (TextIsEqual(fileExtLower, ".wav")) wave = LoadWAV(fileData, dataSize); #endif #if defined(SUPPORT_FILEFORMAT_OGG) - else if (TextIsEqual(fileExtLower, "ogg")) wave = LoadOGG(fileData, dataSize); + else if (TextIsEqual(fileExtLower, ".ogg")) wave = LoadOGG(fileData, dataSize); #endif #if defined(SUPPORT_FILEFORMAT_FLAC) - else if (TextIsEqual(fileExtLower, "flac")) wave = LoadFLAC(fileData, dataSize); + else if (TextIsEqual(fileExtLower, ".flac")) wave = LoadFLAC(fileData, dataSize); #endif #if defined(SUPPORT_FILEFORMAT_MP3) - else if (TextIsEqual(fileExtLower, "mp3")) wave = LoadMP3(fileData, dataSize); + else if (TextIsEqual(fileExtLower, ".mp3")) wave = LoadMP3(fileData, dataSize); #endif else TRACELOG(LOG_WARNING, "WAVE: File format not supported"); @@ -759,24 +785,24 @@ Sound LoadSoundFromWave(Wave wave) // // First option has been selected, format conversion is done on the loading stage. // The downside is that it uses more memory if the original sound is u8 or s16. - ma_format formatIn = ((wave.sampleSize == 8)? ma_format_u8 : ((wave.sampleSize == 16)? ma_format_s16 : ma_format_f32)); + ma_format formatIn = ((wave.sampleSize == 8)? ma_format_u8 : ((wave.sampleSize == 16)? ma_format_s16 : ma_format_f32)); ma_uint32 frameCountIn = wave.sampleCount/wave.channels; - ma_uint32 frameCount = (ma_uint32)ma_convert_frames(NULL, 0, AUDIO_DEVICE_FORMAT, AUDIO_DEVICE_CHANNELS, AUDIO_DEVICE_SAMPLE_RATE, NULL, frameCountIn, formatIn, wave.channels, wave.sampleRate); + ma_uint32 frameCount = (ma_uint32)ma_convert_frames(NULL, 0, AUDIO_DEVICE_FORMAT, AUDIO_DEVICE_CHANNELS, AUDIO.System.device.sampleRate, NULL, frameCountIn, formatIn, wave.channels, wave.sampleRate); if (frameCount == 0) TRACELOG(LOG_WARNING, "SOUND: Failed to get frame count for format conversion"); - AudioBuffer *audioBuffer = LoadAudioBuffer(AUDIO_DEVICE_FORMAT, AUDIO_DEVICE_CHANNELS, AUDIO_DEVICE_SAMPLE_RATE, frameCount, AUDIO_BUFFER_USAGE_STATIC); + AudioBuffer *audioBuffer = LoadAudioBuffer(AUDIO_DEVICE_FORMAT, AUDIO_DEVICE_CHANNELS, AUDIO.System.device.sampleRate, frameCount, AUDIO_BUFFER_USAGE_STATIC); if (audioBuffer == NULL) { TRACELOG(LOG_WARNING, "SOUND: Failed to create buffer"); return sound; // early return to avoid dereferencing the audioBuffer null pointer } - frameCount = (ma_uint32)ma_convert_frames(audioBuffer->data, frameCount, AUDIO_DEVICE_FORMAT, AUDIO_DEVICE_CHANNELS, AUDIO_DEVICE_SAMPLE_RATE, wave.data, frameCountIn, formatIn, wave.channels, wave.sampleRate); + frameCount = (ma_uint32)ma_convert_frames(audioBuffer->data, frameCount, AUDIO_DEVICE_FORMAT, AUDIO_DEVICE_CHANNELS, AUDIO.System.device.sampleRate, wave.data, frameCountIn, formatIn, wave.channels, wave.sampleRate); if (frameCount == 0) TRACELOG(LOG_WARNING, "SOUND: Failed format conversion"); sound.sampleCount = frameCount*AUDIO_DEVICE_CHANNELS; - sound.stream.sampleRate = AUDIO_DEVICE_SAMPLE_RATE; + sound.stream.sampleRate = AUDIO.System.device.sampleRate; sound.stream.sampleSize = 32; sound.stream.channels = AUDIO_DEVICE_CHANNELS; sound.stream.buffer = audioBuffer; @@ -1094,9 +1120,9 @@ float *LoadWaveSamples(Wave wave) for (unsigned int i = 0; i < wave.sampleCount; i++) { - if (wave.sampleSize == 8) samples[i] = (float)(((unsigned char *)wave.data)[i] - 127)/256.0f; - else if (wave.sampleSize == 16) samples[i] = (float)(((short *)wave.data)[i])/32767.0f; - else if (wave.sampleSize == 32) samples[i] = ((float *)wave.data)[i]; + if (wave.sampleSize == 8) samples[i] = (float)(((unsigned char *)wave.data)[i] - 127)/256.0f; + else if (wave.sampleSize == 16) samples[i] = (float)(((short *)wave.data)[i])/32767.0f; + else if (wave.sampleSize == 32) samples[i] = ((float *)wave.data)[i]; } return samples; @@ -1122,18 +1148,18 @@ Music LoadMusicStream(const char *fileName) #if defined(SUPPORT_FILEFORMAT_WAV) else if (IsFileExtension(fileName, ".wav")) { - drwav *ctxWav = RL_MALLOC(sizeof(drwav)); + drwav *ctxWav = RL_CALLOC(1, sizeof(drwav)); bool success = drwav_init_file(ctxWav, fileName, NULL); + music.ctxType = MUSIC_AUDIO_WAV; + music.ctxData = ctxWav; + if (success) { - music.ctxType = MUSIC_AUDIO_WAV; - music.ctxData = ctxWav; - int sampleSize = ctxWav->bitsPerSample; if (ctxWav->bitsPerSample == 24) sampleSize = 16; // Forcing conversion to s16 on UpdateMusicStream() - music.stream = InitAudioStream(ctxWav->sampleRate, sampleSize, ctxWav->channels); + music.stream = LoadAudioStream(ctxWav->sampleRate, sampleSize, ctxWav->channels); music.sampleCount = (unsigned int)ctxWav->totalPCMFrameCount*ctxWav->channels; music.looping = true; // Looping enabled by default musicLoaded = true; @@ -1144,15 +1170,15 @@ Music LoadMusicStream(const char *fileName) else if (IsFileExtension(fileName, ".ogg")) { // Open ogg audio stream + music.ctxType = MUSIC_AUDIO_OGG; music.ctxData = stb_vorbis_open_filename(fileName, NULL, NULL); if (music.ctxData != NULL) { - music.ctxType = MUSIC_AUDIO_OGG; stb_vorbis_info info = stb_vorbis_get_info((stb_vorbis *)music.ctxData); // Get Ogg file info // OGG bit rate defaults to 16 bit, it's enough for compressed format - music.stream = InitAudioStream(info.sample_rate, 16, info.channels); + music.stream = LoadAudioStream(info.sample_rate, 16, info.channels); // WARNING: It seems this function returns length in frames, not samples, so we multiply by channels music.sampleCount = (unsigned int)stb_vorbis_stream_length_in_samples((stb_vorbis *)music.ctxData)*info.channels; @@ -1164,14 +1190,14 @@ Music LoadMusicStream(const char *fileName) #if defined(SUPPORT_FILEFORMAT_FLAC) else if (IsFileExtension(fileName, ".flac")) { + music.ctxType = MUSIC_AUDIO_FLAC; music.ctxData = drflac_open_file(fileName, NULL); if (music.ctxData != NULL) { - music.ctxType = MUSIC_AUDIO_FLAC; drflac *ctxFlac = (drflac *)music.ctxData; - music.stream = InitAudioStream(ctxFlac->sampleRate, ctxFlac->bitsPerSample, ctxFlac->channels); + music.stream = LoadAudioStream(ctxFlac->sampleRate, ctxFlac->bitsPerSample, ctxFlac->channels); music.sampleCount = (unsigned int)ctxFlac->totalPCMFrameCount*ctxFlac->channels; music.looping = true; // Looping enabled by default musicLoaded = true; @@ -1181,16 +1207,15 @@ Music LoadMusicStream(const char *fileName) #if defined(SUPPORT_FILEFORMAT_MP3) else if (IsFileExtension(fileName, ".mp3")) { - drmp3 *ctxMp3 = RL_MALLOC(sizeof(drmp3)); - music.ctxData = ctxMp3; - + drmp3 *ctxMp3 = RL_CALLOC(1, sizeof(drmp3)); int result = drmp3_init_file(ctxMp3, fileName, NULL); + music.ctxType = MUSIC_AUDIO_MP3; + music.ctxData = ctxMp3; + if (result > 0) { - music.ctxType = MUSIC_AUDIO_MP3; - - music.stream = InitAudioStream(ctxMp3->sampleRate, 32, ctxMp3->channels); + music.stream = LoadAudioStream(ctxMp3->sampleRate, 32, ctxMp3->channels); music.sampleCount = (unsigned int)drmp3_get_pcm_frame_count(ctxMp3)*ctxMp3->channels; music.looping = true; // Looping enabled by default musicLoaded = true; @@ -1201,44 +1226,47 @@ Music LoadMusicStream(const char *fileName) else if (IsFileExtension(fileName, ".xm")) { jar_xm_context_t *ctxXm = NULL; + int result = jar_xm_create_context_from_file(&ctxXm, AUDIO.System.device.sampleRate, fileName); - int result = jar_xm_create_context_from_file(&ctxXm, 48000, fileName); + music.ctxType = MUSIC_MODULE_XM; + music.ctxData = ctxXm; if (result == 0) // XM AUDIO.System.context created successfully { - music.ctxType = MUSIC_MODULE_XM; jar_xm_set_max_loop_count(ctxXm, 0); // Set infinite number of loops + unsigned int bits = 32; + if (AUDIO_DEVICE_FORMAT == ma_format_s16) + bits = 16; + else if (AUDIO_DEVICE_FORMAT == ma_format_u8) + bits = 8; + // NOTE: Only stereo is supported for XM - music.stream = InitAudioStream(48000, 16, 2); + music.stream = LoadAudioStream(AUDIO.System.device.sampleRate, bits, AUDIO_DEVICE_CHANNELS); music.sampleCount = (unsigned int)jar_xm_get_remaining_samples(ctxXm)*2; // 2 channels music.looping = true; // Looping enabled by default jar_xm_reset(ctxXm); // make sure we start at the beginning of the song musicLoaded = true; - - music.ctxData = ctxXm; } } #endif #if defined(SUPPORT_FILEFORMAT_MOD) else if (IsFileExtension(fileName, ".mod")) { - jar_mod_context_t *ctxMod = RL_MALLOC(sizeof(jar_mod_context_t)); - + jar_mod_context_t *ctxMod = RL_CALLOC(1, sizeof(jar_mod_context_t)); jar_mod_init(ctxMod); int result = jar_mod_load_file(ctxMod, fileName); + music.ctxType = MUSIC_MODULE_MOD; + music.ctxData = ctxMod; + if (result > 0) { - music.ctxType = MUSIC_MODULE_MOD; - // NOTE: Only stereo is supported for MOD - music.stream = InitAudioStream(48000, 16, 2); + music.stream = LoadAudioStream(AUDIO.System.device.sampleRate, 16, AUDIO_DEVICE_CHANNELS); music.sampleCount = (unsigned int)jar_mod_max_samples(ctxMod)*2; // 2 channels music.looping = true; // Looping enabled by default musicLoaded = true; - - music.ctxData = ctxMod; } } #endif @@ -1266,6 +1294,7 @@ Music LoadMusicStream(const char *fileName) else if (music.ctxType == MUSIC_MODULE_MOD) { jar_mod_unload((jar_mod_context_t *)music.ctxData); RL_FREE(music.ctxData); } #endif + music.ctxData = NULL; TRACELOG(LOG_WARNING, "FILEIO: [%s] Music file could not be opened", fileName); } else @@ -1281,30 +1310,227 @@ Music LoadMusicStream(const char *fileName) return music; } -// Unload music stream -void UnloadMusicStream(Music music) +// extension including period ".mod" +Music LoadMusicStreamFromMemory(const char *fileType, unsigned char *data, int dataSize) { - CloseAudioStream(music.stream); + Music music = { 0 }; + bool musicLoaded = false; + + char fileExtLower[16] = { 0 }; + strcpy(fileExtLower, TextToLower(fileType)); if (false) { } #if defined(SUPPORT_FILEFORMAT_WAV) - else if (music.ctxType == MUSIC_AUDIO_WAV) drwav_uninit((drwav *)music.ctxData); -#endif -#if defined(SUPPORT_FILEFORMAT_OGG) - else if (music.ctxType == MUSIC_AUDIO_OGG) stb_vorbis_close((stb_vorbis *)music.ctxData); + else if (TextIsEqual(fileExtLower, ".wav")) + { + drwav *ctxWav = RL_CALLOC(1, sizeof(drwav)); + + bool success = drwav_init_memory(ctxWav, (const void *)data, dataSize, NULL); + + music.ctxType = MUSIC_AUDIO_WAV; + music.ctxData = ctxWav; + + if (success) + { + int sampleSize = ctxWav->bitsPerSample; + if (ctxWav->bitsPerSample == 24) sampleSize = 16; // Forcing conversion to s16 on UpdateMusicStream() + + music.stream = LoadAudioStream(ctxWav->sampleRate, sampleSize, ctxWav->channels); + music.sampleCount = (unsigned int)ctxWav->totalPCMFrameCount*ctxWav->channels; + music.looping = true; // Looping enabled by default + musicLoaded = true; + } + } #endif #if defined(SUPPORT_FILEFORMAT_FLAC) - else if (music.ctxType == MUSIC_AUDIO_FLAC) drflac_free((drflac *)music.ctxData, NULL); + else if (TextIsEqual(fileExtLower, ".flac")) + { + music.ctxType = MUSIC_AUDIO_FLAC; + music.ctxData = drflac_open_memory((const void*)data, dataSize, NULL); + + if (music.ctxData != NULL) + { + drflac *ctxFlac = (drflac *)music.ctxData; + + music.stream = LoadAudioStream(ctxFlac->sampleRate, ctxFlac->bitsPerSample, ctxFlac->channels); + music.sampleCount = (unsigned int)ctxFlac->totalPCMFrameCount*ctxFlac->channels; + music.looping = true; // Looping enabled by default + musicLoaded = true; + } + } +#endif +#if defined(SUPPORT_FILEFORMAT_MP3) + else if (TextIsEqual(fileExtLower, ".mp3")) + { + drmp3 *ctxMp3 = RL_CALLOC(1, sizeof(drmp3)); + int success = drmp3_init_memory(ctxMp3, (const void*)data, dataSize, NULL); + + music.ctxType = MUSIC_AUDIO_MP3; + music.ctxData = ctxMp3; + + if (success) + { + music.stream = LoadAudioStream(ctxMp3->sampleRate, 32, ctxMp3->channels); + music.sampleCount = (unsigned int)drmp3_get_pcm_frame_count(ctxMp3)*ctxMp3->channels; + music.looping = true; // Looping enabled by default + musicLoaded = true; + } + } +#endif +#if defined(SUPPORT_FILEFORMAT_OGG) + else if (TextIsEqual(fileExtLower, ".ogg")) + { + // Open ogg audio stream + music.ctxType = MUSIC_AUDIO_OGG; + //music.ctxData = stb_vorbis_open_filename(fileName, NULL, NULL); + music.ctxData = stb_vorbis_open_memory((const unsigned char *)data, dataSize, NULL, NULL); + + if (music.ctxData != NULL) + { + stb_vorbis_info info = stb_vorbis_get_info((stb_vorbis *)music.ctxData); // Get Ogg file info + + // OGG bit rate defaults to 16 bit, it's enough for compressed format + music.stream = LoadAudioStream(info.sample_rate, 16, info.channels); + + // WARNING: It seems this function returns length in frames, not samples, so we multiply by channels + music.sampleCount = (unsigned int)stb_vorbis_stream_length_in_samples((stb_vorbis *)music.ctxData)*info.channels; + music.looping = true; // Looping enabled by default + musicLoaded = true; + } + } +#endif +#if defined(SUPPORT_FILEFORMAT_XM) + else if (TextIsEqual(fileExtLower, ".xm")) + { + jar_xm_context_t *ctxXm = NULL; + int result = jar_xm_create_context_safe(&ctxXm, (const char *)data, dataSize, AUDIO.System.device.sampleRate); + if (result == 0) // XM AUDIO.System.context created successfully + { + music.ctxType = MUSIC_MODULE_XM; + jar_xm_set_max_loop_count(ctxXm, 0); // Set infinite number of loops + + unsigned int bits = 32; + if (AUDIO_DEVICE_FORMAT == ma_format_s16) + bits = 16; + else if (AUDIO_DEVICE_FORMAT == ma_format_u8) + bits = 8; + + // NOTE: Only stereo is supported for XM + music.stream = LoadAudioStream(AUDIO.System.device.sampleRate, bits, 2); + music.sampleCount = (unsigned int)jar_xm_get_remaining_samples(ctxXm)*2; // 2 channels + music.looping = true; // Looping enabled by default + jar_xm_reset(ctxXm); // make sure we start at the beginning of the song + + music.ctxData = ctxXm; + musicLoaded = true; + } + } +#endif +#if defined(SUPPORT_FILEFORMAT_MOD) + else if (TextIsEqual(fileExtLower, ".mod")) + { + jar_mod_context_t *ctxMod = (jar_mod_context_t *)RL_MALLOC(sizeof(jar_mod_context_t)); + int result = 0; + + jar_mod_init(ctxMod); + + // Copy data to allocated memory for default UnloadMusicStream + unsigned char *newData = (unsigned char *)RL_MALLOC(dataSize); + int it = dataSize/sizeof(unsigned char); + for (int i = 0; i < it; i++){ + newData[i] = data[i]; + } + + // Memory loaded version for jar_mod_load_file() + if (dataSize && dataSize < 32*1024*1024) + { + ctxMod->modfilesize = dataSize; + ctxMod->modfile = newData; + if (jar_mod_load(ctxMod, (void *)ctxMod->modfile, dataSize)) result = dataSize; + } + + if (result > 0) + { + music.ctxType = MUSIC_MODULE_MOD; + + // NOTE: Only stereo is supported for MOD + music.stream = LoadAudioStream(AUDIO.System.device.sampleRate, 16, 2); + music.sampleCount = (unsigned int)jar_mod_max_samples(ctxMod)*2; // 2 channels + music.looping = true; // Looping enabled by default + musicLoaded = true; + + music.ctxData = ctxMod; + musicLoaded = true; + } + } +#endif + else TRACELOG(LOG_WARNING, "STREAM: [%s] Fileformat not supported", fileType); + + if (!musicLoaded) + { + if (false) { } + #if defined(SUPPORT_FILEFORMAT_WAV) + else if (music.ctxType == MUSIC_AUDIO_WAV) drwav_uninit((drwav *)music.ctxData); + #endif + #if defined(SUPPORT_FILEFORMAT_FLAC) + else if (music.ctxType == MUSIC_AUDIO_FLAC) drflac_free((drflac *)music.ctxData, NULL); + #endif + #if defined(SUPPORT_FILEFORMAT_MP3) + else if (music.ctxType == MUSIC_AUDIO_MP3) { drmp3_uninit((drmp3 *)music.ctxData); RL_FREE(music.ctxData); } + #endif + #if defined(SUPPORT_FILEFORMAT_OGG) + else if (music.ctxType == MUSIC_AUDIO_OGG) stb_vorbis_close((stb_vorbis *)music.ctxData); + #endif + #if defined(SUPPORT_FILEFORMAT_XM) + else if (music.ctxType == MUSIC_MODULE_XM) jar_xm_free_context((jar_xm_context_t *)music.ctxData); + #endif + #if defined(SUPPORT_FILEFORMAT_MOD) + else if (music.ctxType == MUSIC_MODULE_MOD) { jar_mod_unload((jar_mod_context_t *)music.ctxData); RL_FREE(music.ctxData); } + #endif + + music.ctxData = NULL; + TRACELOG(LOG_WARNING, "FILEIO: [%s] Music memory could not be opened", fileType); + } + else + { + // Show some music stream info + TRACELOG(LOG_INFO, "FILEIO: [%s] Music memory successfully loaded:", fileType); + TRACELOG(LOG_INFO, " > Total samples: %i", music.sampleCount); + TRACELOG(LOG_INFO, " > Sample rate: %i Hz", music.stream.sampleRate); + TRACELOG(LOG_INFO, " > Sample size: %i bits", music.stream.sampleSize); + TRACELOG(LOG_INFO, " > Channels: %i (%s)", music.stream.channels, (music.stream.channels == 1)? "Mono" : (music.stream.channels == 2)? "Stereo" : "Multi"); + } + + return music; +} + +// Unload music stream +void UnloadMusicStream(Music music) +{ + UnloadAudioStream(music.stream); + + if (music.ctxData != NULL) + { + if (false) { } +#if defined(SUPPORT_FILEFORMAT_WAV) + else if (music.ctxType == MUSIC_AUDIO_WAV) drwav_uninit((drwav *)music.ctxData); +#endif +#if defined(SUPPORT_FILEFORMAT_OGG) + else if (music.ctxType == MUSIC_AUDIO_OGG) stb_vorbis_close((stb_vorbis *)music.ctxData); +#endif +#if defined(SUPPORT_FILEFORMAT_FLAC) + else if (music.ctxType == MUSIC_AUDIO_FLAC) drflac_free((drflac *)music.ctxData, NULL); #endif #if defined(SUPPORT_FILEFORMAT_MP3) else if (music.ctxType == MUSIC_AUDIO_MP3) { drmp3_uninit((drmp3 *)music.ctxData); RL_FREE(music.ctxData); } #endif #if defined(SUPPORT_FILEFORMAT_XM) - else if (music.ctxType == MUSIC_MODULE_XM) jar_xm_free_context((jar_xm_context_t *)music.ctxData); + else if (music.ctxType == MUSIC_MODULE_XM) jar_xm_free_context((jar_xm_context_t *)music.ctxData); #endif #if defined(SUPPORT_FILEFORMAT_MOD) - else if (music.ctxType == MUSIC_MODULE_MOD) { jar_mod_unload((jar_mod_context_t *)music.ctxData); RL_FREE(music.ctxData); } + else if (music.ctxType == MUSIC_MODULE_MOD) { jar_mod_unload((jar_mod_context_t *)music.ctxData); RL_FREE(music.ctxData); } #endif + } } // Start music playing (open stream) @@ -1315,7 +1541,7 @@ void PlayMusicStream(Music music) // For music streams, we need to make sure we maintain the frame cursor position // This is a hack for this section of code in UpdateMusicStream() // NOTE: In case window is minimized, music stream is stopped, just make sure to - // play again on window restore: if (IsMusicPlaying(music)) PlayMusicStream(music); + // play again on window restore: if (IsMusicStreamPlaying(music)) PlayMusicStream(music); ma_uint32 frameCursorPos = music.stream.buffer->frameCursorPos; PlayAudioStream(music.stream); // WARNING: This resets the cursor position. music.stream.buffer->frameCursorPos = frameCursorPos; @@ -1368,6 +1594,10 @@ void UpdateMusicStream(Music music) { if (music.stream.buffer == NULL) return; +#if defined(SUPPORT_FILEFORMAT_XM) + if (music.ctxType == MUSIC_MODULE_XM) jar_xm_set_max_loop_count(music.ctxData, music.looping ? 0 : 1); +#endif + bool streamEnding = false; unsigned int subBufferSizeInFrames = music.stream.buffer->sizeInFrames/2; @@ -1381,6 +1611,8 @@ void UpdateMusicStream(Music music) //ma_uint32 frameSizeInBytes = ma_get_bytes_per_sample(music.stream.buffer->dsp.formatConverterIn.config.formatIn)*music.stream.buffer->dsp.formatConverterIn.config.channels; int sampleLeft = music.sampleCount - (music.stream.buffer->totalFramesProcessed*music.stream.channels); + if (music.ctxType == MUSIC_MODULE_XM && music.looping) sampleLeft = subBufferSizeInFrames*4; + while (IsAudioStreamProcessed(music.stream)) { if ((sampleLeft/music.stream.channels) >= subBufferSizeInFrames) samplesCount = subBufferSizeInFrames*music.stream.channels; @@ -1424,8 +1656,24 @@ void UpdateMusicStream(Music music) #if defined(SUPPORT_FILEFORMAT_XM) case MUSIC_MODULE_XM: { - // NOTE: Internally this function considers 2 channels generation, so samplesCount/2 - jar_xm_generate_samples_16bit((jar_xm_context_t *)music.ctxData, (short *)pcm, samplesCount/2); + switch (AUDIO_DEVICE_FORMAT) + { + case ma_format_f32: + // NOTE: Internally this function considers 2 channels generation, so samplesCount/2 + jar_xm_generate_samples((jar_xm_context_t*)music.ctxData, (float *)pcm, samplesCount/2); + break; + + case ma_format_s16: + // NOTE: Internally this function considers 2 channels generation, so samplesCount/2 + jar_xm_generate_samples_16bit((jar_xm_context_t*)music.ctxData, (short *)pcm, samplesCount/2); + break; + + case ma_format_u8: + // NOTE: Internally this function considers 2 channels generation, so samplesCount/2 + jar_xm_generate_samples_8bit((jar_xm_context_t*)music.ctxData, (char *)pcm, samplesCount/2); + break; + } + } break; #endif #if defined(SUPPORT_FILEFORMAT_MOD) @@ -1440,7 +1688,7 @@ void UpdateMusicStream(Music music) UpdateAudioStream(music.stream, pcm, samplesCount); - if ((music.ctxType == MUSIC_MODULE_XM) || (music.ctxType == MUSIC_MODULE_MOD)) + if ((music.ctxType == MUSIC_MODULE_XM) || music.ctxType == MUSIC_MODULE_MOD) { if (samplesCount > 1) sampleLeft -= samplesCount/2; else sampleLeft -= samplesCount; @@ -1467,12 +1715,12 @@ void UpdateMusicStream(Music music) { // NOTE: In case window is minimized, music stream is stopped, // just make sure to play again on window restore - if (IsMusicPlaying(music)) PlayMusicStream(music); + if (IsMusicStreamPlaying(music)) PlayMusicStream(music); } } // Check if any music is playing -bool IsMusicPlaying(Music music) +bool IsMusicStreamPlaying(Music music) { return IsAudioStreamPlaying(music.stream); } @@ -1502,8 +1750,17 @@ float GetMusicTimeLength(Music music) // Get current music time played (in seconds) float GetMusicTimePlayed(Music music) { - float secondsPlayed = 0.0f; +#if defined(SUPPORT_FILEFORMAT_XM) + if (music.ctxType == MUSIC_MODULE_XM) + { + uint64_t samples = 0; + jar_xm_get_position(music.ctxData, NULL, NULL, NULL, &samples); + samples = samples % (music.sampleCount); + return (float)(samples)/(music.stream.sampleRate*music.stream.channels); + } +#endif + float secondsPlayed = 0.0f; if (music.stream.buffer != NULL) { //ma_uint32 frameSizeInBytes = ma_get_bytes_per_sample(music.stream.buffer->dsp.formatConverterIn.config.formatIn)*music.stream.buffer->dsp.formatConverterIn.config.channels; @@ -1514,8 +1771,8 @@ float GetMusicTimePlayed(Music music) return secondsPlayed; } -// Init audio stream (to stream audio pcm data) -AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels) +// Load audio stream (to stream audio pcm data) +AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels) { AudioStream stream = { 0 }; @@ -1527,7 +1784,9 @@ AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, un // The size of a streaming buffer must be at least double the size of a period unsigned int periodSize = AUDIO.System.device.playback.internalPeriodSizeInFrames; - unsigned int subBufferSize = AUDIO.Buffer.defaultSize; // Default buffer size (audio stream) + + // If the buffer is not set, compute one that would give us a buffer good enough for a decent frame rate + unsigned int subBufferSize = (AUDIO.Buffer.defaultSize == 0)? AUDIO.Buffer.defaultSize : AUDIO.System.device.sampleRate/30; if (subBufferSize < periodSize) subBufferSize = periodSize; @@ -1544,8 +1803,8 @@ AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, un return stream; } -// Close audio stream and free memory -void CloseAudioStream(AudioStream stream) +// Unload audio stream and free memory +void UnloadAudioStream(AudioStream stream) { UnloadAudioBuffer(stream.buffer); @@ -1672,7 +1931,7 @@ static void OnLog(ma_context *pContext, ma_device *pDevice, ma_uint32 logLevel, (void)pContext; (void)pDevice; - TRACELOG(LOG_ERROR, "miniaudio: %s", message); // All log messages from miniaudio are errors + TRACELOG(LOG_WARNING, "miniaudio: %s", message); // All log messages from miniaudio are errors } // Reads audio data from an AudioBuffer object in internal format. @@ -1782,7 +2041,7 @@ static ma_uint32 ReadAudioBufferFramesInMixingFormat(AudioBuffer *audioBuffer, f inputFramesToProcessThisIteration = inputBufferFrameCap; } - float *runningFramesOut = framesOut + (totalOutputFramesProcessed * audioBuffer->converter.config.channelsOut); + float *runningFramesOut = framesOut + (totalOutputFramesProcessed*audioBuffer->converter.config.channelsOut); /* At this point we can convert the data to our mixing format. */ ma_uint64 inputFramesProcessedThisIteration = ReadAudioBufferFramesInInternalFormat(audioBuffer, inputBuffer, (ma_uint32)inputFramesToProcessThisIteration); /* Safe cast. */ @@ -1808,6 +2067,7 @@ static ma_uint32 ReadAudioBufferFramesInMixingFormat(AudioBuffer *audioBuffer, f // Sending audio data to device callback function +// This function will be called when miniaudio needs more data // NOTE: All the mixing takes place here static void OnSendAudioDataToDevice(ma_device *pDevice, void *pFramesOut, const void *pFramesInput, ma_uint32 frameCount) { @@ -1848,7 +2108,7 @@ static void OnSendAudioDataToDevice(ma_device *pDevice, void *pFramesOut, const if (framesJustRead > 0) { float *framesOut = (float *)pFramesOut + (framesRead*AUDIO.System.device.playback.channels); - float *framesIn = tempBuffer; + float *framesIn = tempBuffer; MixAudioFrames(framesOut, framesIn, framesJustRead, audioBuffer->volume); @@ -1899,33 +2159,13 @@ static void MixAudioFrames(float *framesOut, const float *framesIn, ma_uint32 fr for (ma_uint32 iChannel = 0; iChannel < AUDIO.System.device.playback.channels; ++iChannel) { float *frameOut = framesOut + (iFrame*AUDIO.System.device.playback.channels); - const float *frameIn = framesIn + (iFrame*AUDIO.System.device.playback.channels); + const float *frameIn = framesIn + (iFrame*AUDIO.System.device.playback.channels); frameOut[iChannel] += (frameIn[iChannel]*localVolume); } } } -// Initialise the multichannel buffer pool -static void InitAudioBufferPool(void) -{ - // Dummy buffers - for (int i = 0; i < MAX_AUDIO_BUFFER_POOL_CHANNELS; i++) - { - // WARNING: An empty audioBuffer is created (data = 0) - AUDIO.MultiChannel.pool[i] = LoadAudioBuffer(AUDIO_DEVICE_FORMAT, AUDIO_DEVICE_CHANNELS, AUDIO_DEVICE_SAMPLE_RATE, 0, AUDIO_BUFFER_USAGE_STATIC); - } - - // TODO: Verification required for log - TRACELOG(LOG_INFO, "AUDIO: Multichannel pool size: %i", MAX_AUDIO_BUFFER_POOL_CHANNELS); -} - -// Close the audio buffers pool -static void CloseAudioBufferPool(void) -{ - for (int i = 0; i < MAX_AUDIO_BUFFER_POOL_CHANNELS; i++) RL_FREE(AUDIO.MultiChannel.pool[i]); -} - #if defined(SUPPORT_FILEFORMAT_WAV) // Load WAV file data into Wave structure // NOTE: Using dr_wav library @@ -2086,6 +2326,48 @@ static bool IsFileExtension(const char *fileName, const char *ext) return result; } +// Get pointer to extension for a filename string (includes the dot: .png) +static const char *GetFileExtension(const char *fileName) +{ + const char *dot = strrchr(fileName, '.'); + + if (!dot || dot == fileName) return NULL; + + return dot; +} + +// Check if two text string are equal +// REQUIRES: strcmp() +static bool TextIsEqual(const char *text1, const char *text2) +{ + bool result = false; + + if (strcmp(text1, text2) == 0) result = true; + + return result; +} + +// Get lower case version of provided string +// REQUIRES: tolower() +static const char *TextToLower(const char *text) +{ + #define MAX_TEXT_BUFFER_LENGTH 1024 + + static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; + + for (int i = 0; i < MAX_TEXT_BUFFER_LENGTH; i++) + { + if (text[i] != '\0') + { + buffer[i] = (char)tolower(text[i]); + //if ((text[i] >= 'A') && (text[i] <= 'Z')) buffer[i] = text[i] + 32; + } + else { buffer[i] = '\0'; break; } + } + + return buffer; +} + // Load data from file into a buffer static unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead) { diff --git a/src/raudio.h b/src/raudio.h index 8178deec8..e8a1ebaff 100644 --- a/src/raudio.h +++ b/src/raudio.h @@ -138,13 +138,14 @@ void SetMasterVolume(float volume); // Set master vo // Wave/Sound loading/unloading functions Wave LoadWave(const char *fileName); // Load wave data from file +Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. ".wav" Sound LoadSound(const char *fileName); // Load sound from file Sound LoadSoundFromWave(Wave wave); // Load sound from wave data void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data void UnloadWave(Wave wave); // Unload wave data void UnloadSound(Sound sound); // Unload sound -void ExportWave(Wave wave, const char *fileName); // Export wave data to file -void ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h) +bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success +bool ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h), returns true on success // Wave/Sound management functions void PlaySound(Sound sound); // Play a sound @@ -160,26 +161,28 @@ void SetSoundPitch(Sound sound, float pitch); // Set pitch for void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format Wave WaveCopy(Wave wave); // Copy a wave to a new wave void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range -float *GetWaveData(Wave wave); // Get samples data from wave as a floats array +float *LoadWaveSamples(Wave wave); // Load samples data from wave as a floats array +void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() // Music management functions Music LoadMusicStream(const char *fileName); // Load music stream from file +Music LoadMusicStreamFromMemory(const char *fileType, unsigned char* data, int dataSize); // Load music stream from data void UnloadMusicStream(Music music); // Unload music stream void PlayMusicStream(Music music); // Start music playing +bool IsMusicStreamPlaying(Music music); // Check if music is playing void UpdateMusicStream(Music music); // Updates buffers for music streaming void StopMusicStream(Music music); // Stop music playing void PauseMusicStream(Music music); // Pause music playing void ResumeMusicStream(Music music); // Resume playing paused music -bool IsMusicPlaying(Music music); // Check if music is playing void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) float GetMusicTimeLength(Music music); // Get music time length (in seconds) float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) // AudioStream management functions -AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream raw audio pcm data) +AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data) void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data -void CloseAudioStream(AudioStream stream); // Close audio stream and free memory +void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill void PlayAudioStream(AudioStream stream); // Play audio stream void PauseAudioStream(AudioStream stream); // Pause audio stream diff --git a/src/raylib.dll.rc b/src/raylib.dll.rc index 65bb644e2..f4d90f415 100644 --- a/src/raylib.dll.rc +++ b/src/raylib.dll.rc @@ -1,8 +1,8 @@ GLFW_ICON ICON "raylib.ico" 1 VERSIONINFO -FILEVERSION 3,1,0,0 -PRODUCTVERSION 3,1,0,0 +FILEVERSION 3,7,0,0 +PRODUCTVERSION 3,7,0,0 BEGIN BLOCK "StringFileInfo" BEGIN @@ -11,12 +11,12 @@ BEGIN BEGIN //VALUE "CompanyName", "raylib technologies" VALUE "FileDescription", "raylib dynamic library (www.raylib.com)" - VALUE "FileVersion", "3.1.0" + VALUE "FileVersion", "3.7.0" VALUE "InternalName", "raylib.dll" - VALUE "LegalCopyright", "(c) 2020 Ramon Santamaria (@raysan5)" + VALUE "LegalCopyright", "(c) 2021 Ramon Santamaria (@raysan5)" VALUE "OriginalFilename", "raylib.dll" VALUE "ProductName", "raylib" - VALUE "ProductVersion", "3.1.0" + VALUE "ProductVersion", "3.7.0" END END BLOCK "VarFileInfo" diff --git a/src/raylib.dll.rc.data b/src/raylib.dll.rc.data index 0c1e2dae8..f4e5b3f35 100644 Binary files a/src/raylib.dll.rc.data and b/src/raylib.dll.rc.data differ diff --git a/src/raylib.h b/src/raylib.h index 24992a4f6..cedf4f5dc 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -4,7 +4,8 @@ * * FEATURES: * - NO external dependencies, all required libraries included with raylib -* - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, MacOS, UWP, Android, Raspberry Pi, HTML5. +* - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, +* MacOS, Haiku, UWP, Android, Raspberry Pi, HTML5. * - Written in plain C code (C99) in PascalCase/camelCase notation * - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2 - choose at compile) * - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] @@ -12,7 +13,7 @@ * - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC) * - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more! * - Flexible Materials system, supporting classic maps and PBR maps -* - Skeletal Animation support (CPU bones-based animation) +* - Animated 3D models supported (skeletal bones animation) (IQM, glTF) * - Shaders support, including Model shaders and Postprocessing shaders * - Powerful math module for Vector, Matrix and Quaternion operations: [raymath] * - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD) @@ -20,17 +21,20 @@ * - Bindings to multiple programming languages available! * * NOTES: -* One custom font is loaded by default when InitWindow() [core] -* If using OpenGL 3.3 or ES2, one default shader is loaded automatically (internally defined) [rlgl] -* If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads +* One default Font is loaded on InitWindow()->LoadFontDefault() [core, text] +* One default Texture2D is loaded on rlglInit() [rlgl] (OpenGL 3.3 or ES2) +* One default Shader is loaded on rlglInit()->rlLoadShaderDefault() [rlgl] (OpenGL 3.3 or ES2) +* One default RenderBatch is loaded on rlglInit()->rlLoadRenderBatch() [rlgl] (OpenGL 3.3 or ES2) * * DEPENDENCIES (included): -* [core] rglfw (github.com/glfw/glfw) for window/context management and input (only PLATFORM_DESKTOP) -* [rlgl] glad (github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading (only PLATFORM_DESKTOP) -* [raudio] miniaudio (github.com/dr-soft/miniaudio) for audio device/context management +* [core] rglfw (Camilla Löwy - github.com/glfw/glfw) for window/context management and input (PLATFORM_DESKTOP) +* [rlgl] glad (David Herberth - github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading (PLATFORM_DESKTOP) +* [raudio] miniaudio (David Reid - github.com/dr-soft/miniaudio) for audio device/context management * * OPTIONAL DEPENDENCIES (included): -* [core] rgif (Charlie Tangora, Ramon Santamaria) for GIF recording +* [core] msf_gif (Miles Fogle) for GIF recording +* [core] sinfl (Micha Mettke) for DEFLATE decompression algorythm +* [core] sdefl (Micha Mettke) for DEFLATE compression algorythm * [textures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...) * [textures] stb_image_write (Sean Barret) for image writting (BMP, TGA, PNG, JPG) * [textures] stb_image_resize (Sean Barret) for image resizing algorithms @@ -40,9 +44,10 @@ * [models] par_shapes (Philip Rideout) for parametric 3d shapes generation * [models] tinyobj_loader_c (Syoyo Fujita) for models loading (OBJ, MTL) * [models] cgltf (Johannes Kuhlmann) for models loading (glTF) -* [raudio] stb_vorbis (Sean Barret) for OGG audio loading +* [raudio] dr_wav (David Reid) for WAV audio file loading * [raudio] dr_flac (David Reid) for FLAC audio file loading * [raudio] dr_mp3 (David Reid) for MP3 audio file loading +* [raudio] stb_vorbis (Sean Barret) for OGG audio loading * [raudio] jar_xm (Joshua Reisenauer) for XM audio module loading * [raudio] jar_mod (Joshua Reisenauer) for MOD audio module loading * @@ -76,6 +81,8 @@ #include // Required for: va_list - Only used by TraceLogCallback +#define RAYLIB_VERSION "3.8-dev" + #if defined(_WIN32) // Microsoft attibutes to tell compiler that symbols are imported/exported from a .dll #if defined(BUILD_LIBTYPE_SHARED) @@ -113,8 +120,8 @@ #define RL_FREE(ptr) free(ptr) #endif -// NOTE: MSC C++ compiler does not support compound literals (C99 feature) -// Plain structures in C++ (without constructors) can be initialized from { } initializers. +// NOTE: MSVC C++ compiler does not support compound literals (C99 feature) +// Plain structures in C++ (without constructors) can be initialized with { } #if defined(__cplusplus) #define CLITERAL(type) type #else @@ -151,13 +158,17 @@ #define MAGENTA CLITERAL(Color){ 255, 0, 255, 255 } // Magenta #define RAYWHITE CLITERAL(Color){ 245, 245, 245, 255 } // My own White (raylib logo) -// Temporal hack to avoid breaking old codebases using -// deprecated raylib implementation of these functions -#define FormatText TextFormat -#define LoadText LoadFileText -#define GetExtension GetFileExtension -#define GetImageData LoadImageColors -//#define Fade(c, a) ColorAlpha(c, a) +// Temporal hacks to avoid breaking old codebases using +// deprecated raylib implementation or definitions +#define SpriteFont Font +#define FormatText TextFormat +#define LoadText LoadFileText +#define GetExtension GetFileExtension +#define GetImageData LoadImageColors +#define FILTER_POINT TEXTURE_FILTER_POINT +#define FILTER_BILINEAR TEXTURE_FILTER_BILINEAR +#define MAP_DIFFUSE MATERIAL_MAP_DIFFUSE +#define UNCOMPRESSED_R8G8B8A8 PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 //---------------------------------------------------------------------------------- // Structures Definition @@ -166,59 +177,58 @@ #if defined(__STDC__) && __STDC_VERSION__ >= 199901L #include #elif !defined(__cplusplus) && !defined(bool) - typedef enum { false, true } bool; + typedef enum bool { false, true } bool; #endif -// Vector2 type +// Vector2, 2 components typedef struct Vector2 { - float x; - float y; + float x; // Vector x component + float y; // Vector y component } Vector2; -// Vector3 type +// Vector3, 3 components typedef struct Vector3 { - float x; - float y; - float z; + float x; // Vector x component + float y; // Vector y component + float z; // Vector z component } Vector3; -// Vector4 type +// Vector4, 4 components typedef struct Vector4 { - float x; - float y; - float z; - float w; + float x; // Vector x component + float y; // Vector y component + float z; // Vector z component + float w; // Vector w component } Vector4; -// Quaternion type, same as Vector4 +// Quaternion, 4 components (Vector4 alias) typedef Vector4 Quaternion; -// Matrix type (OpenGL style 4x4 - right handed, column major) +// Matrix, 4x4 components, column major, OpenGL style, right handed typedef struct Matrix { - float m0, m4, m8, m12; - float m1, m5, m9, m13; - float m2, m6, m10, m14; - float m3, m7, m11, m15; + float m0, m4, m8, m12; // Matrix first row (4 components) + float m1, m5, m9, m13; // Matrix second row (4 components) + float m2, m6, m10, m14; // Matrix third row (4 components) + float m3, m7, m11, m15; // Matrix fourth row (4 components) } Matrix; -// Color type, RGBA (32bit) +// Color, 4 components, R8G8B8A8 (32bit) typedef struct Color { - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; + unsigned char r; // Color red value + unsigned char g; // Color green value + unsigned char b; // Color blue value + unsigned char a; // Color alpha value } Color; -// Rectangle type +// Rectangle, 4 components typedef struct Rectangle { - float x; - float y; - float width; - float height; + float x; // Rectangle top-left corner position x + float y; // Rectangle top-left corner position y + float width; // Rectangle width + float height; // Rectangle height } Rectangle; -// Image type, bpp always RGBA (32bit) -// NOTE: Data stored in CPU memory (RAM) +// Image, pixel data stored in CPU memory (RAM) typedef struct Image { void *data; // Image raw data int width; // Image base width @@ -227,8 +237,7 @@ typedef struct Image { int format; // Data format (PixelFormat type) } Image; -// Texture type -// NOTE: Data stored in GPU memory +// Texture, tex data stored in GPU memory (VRAM) typedef struct Texture { unsigned int id; // OpenGL texture id int width; // Texture base width @@ -237,33 +246,33 @@ typedef struct Texture { int format; // Data format (PixelFormat type) } Texture; -// Texture2D type, same as Texture +// Texture2D, same as Texture typedef Texture Texture2D; -// TextureCubemap type, actually, same as Texture +// TextureCubemap, same as Texture typedef Texture TextureCubemap; -// RenderTexture type, for texture rendering +// RenderTexture, fbo for texture rendering typedef struct RenderTexture { - unsigned int id; // OpenGL Framebuffer Object (FBO) id - Texture texture; // Color buffer attachment texture - Texture depth; // Depth buffer attachment texture + unsigned int id; // OpenGL framebuffer object id + Texture texture; // Color buffer attachment texture + Texture depth; // Depth buffer attachment texture } RenderTexture; -// RenderTexture2D type, same as RenderTexture +// RenderTexture2D, same as RenderTexture typedef RenderTexture RenderTexture2D; -// N-Patch layout info +// NPatchInfo, n-patch layout info typedef struct NPatchInfo { - Rectangle source; // Region in the texture - int left; // left border offset - int top; // top border offset - int right; // right border offset - int bottom; // bottom border offset - int type; // layout of the n-patch: 3x3, 1x3 or 3x1 + Rectangle source; // Texture source rectangle + int left; // Left border offset + int top; // Top border offset + int right; // Right border offset + int bottom; // Bottom border offset + int layout; // Layout of the n-patch: 3x3, 1x3 or 3x1 } NPatchInfo; -// Font character info +// CharInfo, font character info typedef struct CharInfo { int value; // Character value (Unicode) int offsetX; // Character offset X when drawing @@ -272,7 +281,7 @@ typedef struct CharInfo { Image image; // Character image data } CharInfo; -// Font type, includes texture and charSet array data +// Font, font texture and CharInfo array data typedef struct Font { int baseSize; // Base size (default chars height) int charsCount; // Number of characters @@ -282,20 +291,18 @@ typedef struct Font { CharInfo *chars; // Characters info data } Font; -#define SpriteFont Font // SpriteFont type fallback, defaults to Font - -// Camera type, defines a camera position/orientation in 3d space +// Camera, defines position/orientation in 3d space typedef struct Camera3D { Vector3 position; // Camera position Vector3 target; // Camera target it looks-at Vector3 up; // Camera up vector (rotation over its axis) float fovy; // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic - int type; // Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC + int projection; // Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC } Camera3D; typedef Camera3D Camera; // Camera type fallback, defaults to Camera3D -// Camera2D type, defines a 2d camera +// Camera2D, defines position/orientation in 2d space typedef struct Camera2D { Vector2 offset; // Camera offset (displacement from target) Vector2 target; // Camera target (rotation and zoom origin) @@ -303,161 +310,170 @@ typedef struct Camera2D { float zoom; // Camera zoom (scaling), should be 1.0f by default } Camera2D; -// Vertex data definning a mesh -// NOTE: Data stored in CPU memory (and GPU) +// Mesh, vertex data and vao/vbo typedef struct Mesh { - int vertexCount; // Number of vertices stored in arrays - int triangleCount; // Number of triangles stored (indexed or not) + int vertexCount; // Number of vertices stored in arrays + int triangleCount; // Number of triangles stored (indexed or not) // Default vertex data - float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) - float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) - float *texcoords2; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5) - float *normals; // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) - float *tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) - unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) - unsigned short *indices;// Vertex indices (in case vertex data comes indexed) + float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) + float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) + float *texcoords2; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5) + float *normals; // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) + float *tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) + unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) + unsigned short *indices; // Vertex indices (in case vertex data comes indexed) // Animation vertex data - float *animVertices; // Animated vertex positions (after bones transformations) - float *animNormals; // Animated normals (after bones transformations) - int *boneIds; // Vertex bone ids, up to 4 bones influence by vertex (skinning) - float *boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning) + float *animVertices; // Animated vertex positions (after bones transformations) + float *animNormals; // Animated normals (after bones transformations) + int *boneIds; // Vertex bone ids, up to 4 bones influence by vertex (skinning) + float *boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning) // OpenGL identifiers - unsigned int vaoId; // OpenGL Vertex Array Object id - unsigned int *vboId; // OpenGL Vertex Buffer Objects id (default vertex data) + unsigned int vaoId; // OpenGL Vertex Array Object id + unsigned int *vboId; // OpenGL Vertex Buffer Objects id (default vertex data) } Mesh; -// Shader type (generic) +// Shader typedef struct Shader { - unsigned int id; // Shader program id - int *locs; // Shader locations array (MAX_SHADER_LOCATIONS) + unsigned int id; // Shader program id + int *locs; // Shader locations array (MAX_SHADER_LOCATIONS) } Shader; -// Material texture map +// MaterialMap typedef struct MaterialMap { - Texture2D texture; // Material map texture - Color color; // Material map color - float value; // Material map value + Texture2D texture; // Material map texture + Color color; // Material map color + float value; // Material map value } MaterialMap; -// Material type (generic) +// Material, includes shader and maps typedef struct Material { - Shader shader; // Material shader - MaterialMap *maps; // Material maps array (MAX_MATERIAL_MAPS) - float *params; // Material generic parameters (if required) + Shader shader; // Material shader + MaterialMap *maps; // Material maps array (MAX_MATERIAL_MAPS) + float params[4]; // Material generic parameters (if required) } Material; -// Transformation properties +// Transform, vectex transformation data typedef struct Transform { - Vector3 translation; // Translation - Quaternion rotation; // Rotation - Vector3 scale; // Scale + Vector3 translation; // Translation + Quaternion rotation; // Rotation + Vector3 scale; // Scale } Transform; -// Bone information +// Bone, skeletal animation bone typedef struct BoneInfo { - char name[32]; // Bone name - int parent; // Bone parent + char name[32]; // Bone name + int parent; // Bone parent } BoneInfo; -// Model type +// Model, meshes, materials and animation data typedef struct Model { - Matrix transform; // Local transform matrix + Matrix transform; // Local transform matrix - int meshCount; // Number of meshes - int materialCount; // Number of materials - Mesh *meshes; // Meshes array - Material *materials; // Materials array - int *meshMaterial; // Mesh material number + int meshCount; // Number of meshes + int materialCount; // Number of materials + Mesh *meshes; // Meshes array + Material *materials; // Materials array + int *meshMaterial; // Mesh material number // Animation data - int boneCount; // Number of bones - BoneInfo *bones; // Bones information (skeleton) - Transform *bindPose; // Bones base transformation (pose) + int boneCount; // Number of bones + BoneInfo *bones; // Bones information (skeleton) + Transform *bindPose; // Bones base transformation (pose) } Model; -// Model animation +// ModelAnimation typedef struct ModelAnimation { - int boneCount; // Number of bones - int frameCount; // Number of animation frames - BoneInfo *bones; // Bones information (skeleton) - Transform **framePoses; // Poses array by frame + int boneCount; // Number of bones + int frameCount; // Number of animation frames + BoneInfo *bones; // Bones information (skeleton) + Transform **framePoses; // Poses array by frame } ModelAnimation; -// Ray type (useful for raycast) +// Ray, ray for raycasting typedef struct Ray { - Vector3 position; // Ray position (origin) - Vector3 direction; // Ray direction + Vector3 position; // Ray position (origin) + Vector3 direction; // Ray direction } Ray; -// Raycast hit information -typedef struct RayHitInfo { - bool hit; // Did the ray hit something? - float distance; // Distance to nearest hit - Vector3 position; // Position of nearest hit - Vector3 normal; // Surface normal of hit -} RayHitInfo; +// RayCollision, ray hit information +typedef struct RayCollision { + bool hit; // Did the ray hit something? + float distance; // Distance to nearest hit + Vector3 point; // Point of nearest hit + Vector3 normal; // Surface normal of hit +} RayCollision; -// Bounding box type +// BoundingBox typedef struct BoundingBox { - Vector3 min; // Minimum vertex box-corner - Vector3 max; // Maximum vertex box-corner + Vector3 min; // Minimum vertex box-corner + Vector3 max; // Maximum vertex box-corner } BoundingBox; -// Wave type, defines audio wave data +// Wave, audio wave data typedef struct Wave { - unsigned int sampleCount; // Total number of samples - unsigned int sampleRate; // Frequency (samples per second) - unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) - unsigned int channels; // Number of channels (1-mono, 2-stereo) - void *data; // Buffer data pointer + unsigned int sampleCount; // Total number of samples (considering channels!) + unsigned int sampleRate; // Frequency (samples per second) + unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) + unsigned int channels; // Number of channels (1-mono, 2-stereo) + void *data; // Buffer data pointer } Wave; typedef struct rAudioBuffer rAudioBuffer; -// Audio stream type -// NOTE: Useful to create custom audio streams not bound to a specific file +// AudioStream, custom audio stream typedef struct AudioStream { - rAudioBuffer *buffer; // Pointer to internal data used by the audio system + rAudioBuffer *buffer; // Pointer to internal data used by the audio system - unsigned int sampleRate; // Frequency (samples per second) - unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) - unsigned int channels; // Number of channels (1-mono, 2-stereo) + unsigned int sampleRate; // Frequency (samples per second) + unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) + unsigned int channels; // Number of channels (1-mono, 2-stereo) } AudioStream; -// Sound source type +// Sound typedef struct Sound { - AudioStream stream; // Audio stream - unsigned int sampleCount; // Total number of samples + AudioStream stream; // Audio stream + unsigned int sampleCount; // Total number of samples } Sound; -// Music stream type (audio file streaming from memory) -// NOTE: Anything longer than ~10 seconds should be streamed +// Music, audio stream, anything longer than ~10 seconds should be streamed typedef struct Music { - AudioStream stream; // Audio stream - unsigned int sampleCount; // Total number of samples - bool looping; // Music looping enable + AudioStream stream; // Audio stream + unsigned int sampleCount; // Total number of samples + bool looping; // Music looping enable - int ctxType; // Type of music context (audio filetype) - void *ctxData; // Audio context data, depends on type + int ctxType; // Type of music context (audio filetype) + void *ctxData; // Audio context data, depends on type } Music; -// Head-Mounted-Display device parameters +// VrDeviceInfo, Head-Mounted-Display device parameters typedef struct VrDeviceInfo { - int hResolution; // HMD horizontal resolution in pixels - int vResolution; // HMD vertical resolution in pixels - float hScreenSize; // HMD horizontal size in meters - float vScreenSize; // HMD vertical size in meters - float vScreenCenter; // HMD screen center in meters - float eyeToScreenDistance; // HMD distance between eye and display in meters - float lensSeparationDistance; // HMD lens separation distance in meters - float interpupillaryDistance; // HMD IPD (distance between pupils) in meters - float lensDistortionValues[4]; // HMD lens distortion constant parameters - float chromaAbCorrection[4]; // HMD chromatic aberration correction parameters + int hResolution; // Horizontal resolution in pixels + int vResolution; // Vertical resolution in pixels + float hScreenSize; // Horizontal size in meters + float vScreenSize; // Vertical size in meters + float vScreenCenter; // Screen center in meters + float eyeToScreenDistance; // Distance between eye and display in meters + float lensSeparationDistance; // Lens separation distance in meters + float interpupillaryDistance; // IPD (distance between pupils) in meters + float lensDistortionValues[4]; // Lens distortion constant parameters + float chromaAbCorrection[4]; // Chromatic aberration correction parameters } VrDeviceInfo; +// VrStereoConfig, VR stereo rendering configuration for simulator +typedef struct VrStereoConfig { + Matrix projection[2]; // VR projection matrices (per eye) + Matrix viewOffset[2]; // VR view offset matrices (per eye) + float leftLensCenter[2]; // VR left lens center + float rightLensCenter[2]; // VR right lens center + float leftScreenCenter[2]; // VR left screen center + float rightScreenCenter[2]; // VR right screen center + float scale[2]; // VR distortion scale + float scaleIn[2]; // VR distortion scale in +} VrStereoConfig; + //---------------------------------------------------------------------------------- // Enumerators Definition //---------------------------------------------------------------------------------- @@ -479,24 +495,26 @@ typedef enum { FLAG_WINDOW_HIGHDPI = 0x00002000, // Set to support HighDPI FLAG_MSAA_4X_HINT = 0x00000020, // Set to try enabling MSAA 4X FLAG_INTERLACED_HINT = 0x00010000 // Set to try enabling interlaced video format (for V3D) -} ConfigFlag; +} ConfigFlags; -// Trace log type +// Trace log level +// NOTE: Organized by priority level typedef enum { LOG_ALL = 0, // Display all logs - LOG_TRACE, - LOG_DEBUG, - LOG_INFO, - LOG_WARNING, - LOG_ERROR, - LOG_FATAL, + LOG_TRACE, // Trace logging, intended for internal use only + LOG_DEBUG, // Debug logging, used for internal debugging, it should be disabled on release builds + LOG_INFO, // Info logging, used for program execution info + LOG_WARNING, // Warning logging, used on recoverable failures + LOG_ERROR, // Error logging, used on unrecoverable failures + LOG_FATAL, // Fatal logging, used to abort program: exit(EXIT_FAILURE) LOG_NONE // Disable logging -} TraceLogType; +} TraceLogLevel; // Keyboard keys (US keyboard layout) // NOTE: Use GetKeyPressed() to allow redefining // required keys for alternative layouts typedef enum { + KEY_NULL = 0, // Alphanumeric keys KEY_APOSTROPHE = 39, KEY_COMMA = 44, @@ -606,25 +624,31 @@ typedef enum { KEY_KP_SUBTRACT = 333, KEY_KP_ADD = 334, KEY_KP_ENTER = 335, - KEY_KP_EQUAL = 336 -} KeyboardKey; - -// Android buttons -typedef enum { + KEY_KP_EQUAL = 336, + // Android key buttons KEY_BACK = 4, KEY_MENU = 82, KEY_VOLUME_UP = 24, KEY_VOLUME_DOWN = 25 -} AndroidButton; +} KeyboardKey; + +// Add backwards compatibility support for deprecated names +#define MOUSE_LEFT_BUTTON MOUSE_BUTTON_LEFT +#define MOUSE_RIGHT_BUTTON MOUSE_BUTTON_RIGHT +#define MOUSE_MIDDLE_BUTTON MOUSE_BUTTON_MIDDLE // Mouse buttons typedef enum { - MOUSE_LEFT_BUTTON = 0, - MOUSE_RIGHT_BUTTON = 1, - MOUSE_MIDDLE_BUTTON = 2 + MOUSE_BUTTON_LEFT = 0, + MOUSE_BUTTON_RIGHT = 1, + MOUSE_BUTTON_MIDDLE = 2, + MOUSE_BUTTON_SIDE = 3, + MOUSE_BUTTON_EXTRA = 4, + MOUSE_BUTTON_FORWARD = 5, + MOUSE_BUTTON_BACK = 6, } MouseButton; -// Mouse cursor types +// Mouse cursor typedef enum { MOUSE_CURSOR_DEFAULT = 0, MOUSE_CURSOR_ARROW = 1, @@ -639,14 +663,6 @@ typedef enum { MOUSE_CURSOR_NOT_ALLOWED = 10 // The operation-not-allowed shape } MouseCursor; -// Gamepad number -typedef enum { - GAMEPAD_PLAYER1 = 0, - GAMEPAD_PLAYER2 = 1, - GAMEPAD_PLAYER3 = 2, - GAMEPAD_PLAYER4 = 3 -} GamepadNumber; - // Gamepad buttons typedef enum { // This is here just for error checking @@ -674,9 +690,9 @@ typedef enum { GAMEPAD_BUTTON_RIGHT_TRIGGER_2, // These are buttons in the center of the gamepad - GAMEPAD_BUTTON_MIDDLE_LEFT, //PS3 Select - GAMEPAD_BUTTON_MIDDLE, //PS Button/XBOX Button - GAMEPAD_BUTTON_MIDDLE_RIGHT, //PS3 Start + GAMEPAD_BUTTON_MIDDLE_LEFT, // PS3 Select + GAMEPAD_BUTTON_MIDDLE, // PS Button/XBOX Button + GAMEPAD_BUTTON_MIDDLE_RIGHT, // PS3 Start // These are the joystick press in buttons GAMEPAD_BUTTON_LEFT_THUMB, @@ -694,186 +710,201 @@ typedef enum { GAMEPAD_AXIS_RIGHT_Y = 3, // Pressure levels for the back triggers - GAMEPAD_AXIS_LEFT_TRIGGER = 4, // [1..-1] (pressure-level) - GAMEPAD_AXIS_RIGHT_TRIGGER = 5 // [1..-1] (pressure-level) + GAMEPAD_AXIS_LEFT_TRIGGER = 4, // [1..-1] (pressure-level) + GAMEPAD_AXIS_RIGHT_TRIGGER = 5 // [1..-1] (pressure-level) } GamepadAxis; -// Shader location points +// Material map index typedef enum { - LOC_VERTEX_POSITION = 0, - LOC_VERTEX_TEXCOORD01, - LOC_VERTEX_TEXCOORD02, - LOC_VERTEX_NORMAL, - LOC_VERTEX_TANGENT, - LOC_VERTEX_COLOR, - LOC_MATRIX_MVP, - LOC_MATRIX_MODEL, - LOC_MATRIX_VIEW, - LOC_MATRIX_PROJECTION, - LOC_VECTOR_VIEW, - LOC_COLOR_DIFFUSE, - LOC_COLOR_SPECULAR, - LOC_COLOR_AMBIENT, - LOC_MAP_ALBEDO, // LOC_MAP_DIFFUSE - LOC_MAP_METALNESS, // LOC_MAP_SPECULAR - LOC_MAP_NORMAL, - LOC_MAP_ROUGHNESS, - LOC_MAP_OCCLUSION, - LOC_MAP_EMISSION, - LOC_MAP_HEIGHT, - LOC_MAP_CUBEMAP, - LOC_MAP_IRRADIANCE, - LOC_MAP_PREFILTER, - LOC_MAP_BRDF + MATERIAL_MAP_ALBEDO = 0, // Albedo material (same as: MATERIAL_MAP_DIFFUSE) + MATERIAL_MAP_METALNESS, // Metalness material (same as: MATERIAL_MAP_SPECULAR) + MATERIAL_MAP_NORMAL, // Normal material + MATERIAL_MAP_ROUGHNESS, // Roughness material + MATERIAL_MAP_OCCLUSION, // Ambient occlusion material + MATERIAL_MAP_EMISSION, // Emission material + MATERIAL_MAP_HEIGHT, // Heightmap material + MATERIAL_MAP_CUBEMAP, // Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + MATERIAL_MAP_IRRADIANCE, // Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + MATERIAL_MAP_PREFILTER, // Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + MATERIAL_MAP_BRDG // Brdg material +} MaterialMapIndex; + +#define MATERIAL_MAP_DIFFUSE MATERIAL_MAP_ALBEDO +#define MATERIAL_MAP_SPECULAR MATERIAL_MAP_METALNESS + +// Shader location index +typedef enum { + SHADER_LOC_VERTEX_POSITION = 0, // Shader location point: position + SHADER_LOC_VERTEX_TEXCOORD01, // Shader location point: texcoord01 + SHADER_LOC_VERTEX_TEXCOORD02, // Shader location point: texcoord02 + SHADER_LOC_VERTEX_NORMAL, // Shader location point: normal + SHADER_LOC_VERTEX_TANGENT, // Shader location point: tangent + SHADER_LOC_VERTEX_COLOR, // Shader location point: color + SHADER_LOC_MATRIX_MVP, // Shader location point: model-view-projection matrix + SHADER_LOC_MATRIX_VIEW, // Shader location point: view matrix + SHADER_LOC_MATRIX_PROJECTION, // Shader location point: projection matrix + SHADER_LOC_MATRIX_MODEL, // Shader location point: model matrix + SHADER_LOC_MATRIX_NORMAL, // Shader location point: normal matrix + SHADER_LOC_VECTOR_VIEW, // Shader location point: view vector + SHADER_LOC_COLOR_DIFFUSE, // Shader location point: diffuse color + SHADER_LOC_COLOR_SPECULAR, // Shader location point: specular color + SHADER_LOC_COLOR_AMBIENT, // Shader location point: ambient color + SHADER_LOC_MAP_ALBEDO, // Shader location point: albedo texture (same as: SHADER_LOC_MAP_DIFFUSE) + SHADER_LOC_MAP_METALNESS, // Shader location point: metalness texture (same as: SHADER_LOC_MAP_SPECULAR) + SHADER_LOC_MAP_NORMAL, // Shader location point: normal texture + SHADER_LOC_MAP_ROUGHNESS, // Shader location point: roughness texture + SHADER_LOC_MAP_OCCLUSION, // Shader location point: occlusion texture + SHADER_LOC_MAP_EMISSION, // Shader location point: emission texture + SHADER_LOC_MAP_HEIGHT, // Shader location point: height texture + SHADER_LOC_MAP_CUBEMAP, // Shader location point: cubemap texture_cube_map + SHADER_LOC_MAP_IRRADIANCE, // Shader location point: irradiance texture_cube_map + SHADER_LOC_MAP_PREFILTER, // Shader location point: prefilter texture_cube_map + SHADER_LOC_MAP_BRDF // Shader location point: brdf texture } ShaderLocationIndex; -#define LOC_MAP_DIFFUSE LOC_MAP_ALBEDO -#define LOC_MAP_SPECULAR LOC_MAP_METALNESS +#define SHADER_LOC_MAP_DIFFUSE SHADER_LOC_MAP_ALBEDO +#define SHADER_LOC_MAP_SPECULAR SHADER_LOC_MAP_METALNESS -// Shader uniform data types +// Shader uniform data type typedef enum { - UNIFORM_FLOAT = 0, - UNIFORM_VEC2, - UNIFORM_VEC3, - UNIFORM_VEC4, - UNIFORM_INT, - UNIFORM_IVEC2, - UNIFORM_IVEC3, - UNIFORM_IVEC4, - UNIFORM_SAMPLER2D + SHADER_UNIFORM_FLOAT = 0, // Shader uniform type: float + SHADER_UNIFORM_VEC2, // Shader uniform type: vec2 (2 float) + SHADER_UNIFORM_VEC3, // Shader uniform type: vec3 (3 float) + SHADER_UNIFORM_VEC4, // Shader uniform type: vec4 (4 float) + SHADER_UNIFORM_INT, // Shader uniform type: int + SHADER_UNIFORM_IVEC2, // Shader uniform type: ivec2 (2 int) + SHADER_UNIFORM_IVEC3, // Shader uniform type: ivec3 (3 int) + SHADER_UNIFORM_IVEC4, // Shader uniform type: ivec4 (4 int) + SHADER_UNIFORM_SAMPLER2D // Shader uniform type: sampler2d } ShaderUniformDataType; -// Material maps +// Shader attribute data types typedef enum { - MAP_ALBEDO = 0, // MAP_DIFFUSE - MAP_METALNESS = 1, // MAP_SPECULAR - MAP_NORMAL = 2, - MAP_ROUGHNESS = 3, - MAP_OCCLUSION, - MAP_EMISSION, - MAP_HEIGHT, - MAP_CUBEMAP, // NOTE: Uses GL_TEXTURE_CUBE_MAP - MAP_IRRADIANCE, // NOTE: Uses GL_TEXTURE_CUBE_MAP - MAP_PREFILTER, // NOTE: Uses GL_TEXTURE_CUBE_MAP - MAP_BRDF -} MaterialMapType; - -#define MAP_DIFFUSE MAP_ALBEDO -#define MAP_SPECULAR MAP_METALNESS + SHADER_ATTRIB_FLOAT = 0, // Shader attribute type: float + SHADER_ATTRIB_VEC2, // Shader attribute type: vec2 (2 float) + SHADER_ATTRIB_VEC3, // Shader attribute type: vec3 (3 float) + SHADER_ATTRIB_VEC4 // Shader attribute type: vec4 (4 float) +} ShaderAttributeDataType; // Pixel formats // NOTE: Support depends on OpenGL version and platform typedef enum { - UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) - UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels) - UNCOMPRESSED_R5G6B5, // 16 bpp - UNCOMPRESSED_R8G8B8, // 24 bpp - UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha) - UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha) - UNCOMPRESSED_R8G8B8A8, // 32 bpp - UNCOMPRESSED_R32, // 32 bpp (1 channel - float) - UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float) - UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float) - COMPRESSED_DXT1_RGB, // 4 bpp (no alpha) - COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha) - COMPRESSED_DXT3_RGBA, // 8 bpp - COMPRESSED_DXT5_RGBA, // 8 bpp - COMPRESSED_ETC1_RGB, // 4 bpp - COMPRESSED_ETC2_RGB, // 4 bpp - COMPRESSED_ETC2_EAC_RGBA, // 8 bpp - COMPRESSED_PVRT_RGB, // 4 bpp - COMPRESSED_PVRT_RGBA, // 4 bpp - COMPRESSED_ASTC_4x4_RGBA, // 8 bpp - COMPRESSED_ASTC_8x8_RGBA // 2 bpp + PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) + PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels) + PIXELFORMAT_UNCOMPRESSED_R5G6B5, // 16 bpp + PIXELFORMAT_UNCOMPRESSED_R8G8B8, // 24 bpp + PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha) + PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha) + PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, // 32 bpp + PIXELFORMAT_UNCOMPRESSED_R32, // 32 bpp (1 channel - float) + PIXELFORMAT_UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float) + PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float) + PIXELFORMAT_COMPRESSED_DXT1_RGB, // 4 bpp (no alpha) + PIXELFORMAT_COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha) + PIXELFORMAT_COMPRESSED_DXT3_RGBA, // 8 bpp + PIXELFORMAT_COMPRESSED_DXT5_RGBA, // 8 bpp + PIXELFORMAT_COMPRESSED_ETC1_RGB, // 4 bpp + PIXELFORMAT_COMPRESSED_ETC2_RGB, // 4 bpp + PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, // 8 bpp + PIXELFORMAT_COMPRESSED_PVRT_RGB, // 4 bpp + PIXELFORMAT_COMPRESSED_PVRT_RGBA, // 4 bpp + PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, // 8 bpp + PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA // 2 bpp } PixelFormat; // Texture parameters: filter mode // NOTE 1: Filtering considers mipmaps if available in the texture // NOTE 2: Filter is accordingly set for minification and magnification typedef enum { - FILTER_POINT = 0, // No filter, just pixel aproximation - FILTER_BILINEAR, // Linear filtering - FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps) - FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x - FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x - FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x -} TextureFilterMode; + TEXTURE_FILTER_POINT = 0, // No filter, just pixel aproximation + TEXTURE_FILTER_BILINEAR, // Linear filtering + TEXTURE_FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps) + TEXTURE_FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x + TEXTURE_FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x + TEXTURE_FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x +} TextureFilter; // Texture parameters: wrap mode typedef enum { - WRAP_REPEAT = 0, // Repeats texture in tiled mode - WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode - WRAP_MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode - WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode -} TextureWrapMode; + TEXTURE_WRAP_REPEAT = 0, // Repeats texture in tiled mode + TEXTURE_WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode + TEXTURE_WRAP_MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode + TEXTURE_WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode +} TextureWrap; // Cubemap layouts typedef enum { - CUBEMAP_AUTO_DETECT = 0, // Automatically detect layout type - CUBEMAP_LINE_VERTICAL, // Layout is defined by a vertical line with faces - CUBEMAP_LINE_HORIZONTAL, // Layout is defined by an horizontal line with faces - CUBEMAP_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces - CUBEMAP_CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces - CUBEMAP_PANORAMA // Layout is defined by a panorama image (equirectangular map) -} CubemapLayoutType; + CUBEMAP_LAYOUT_AUTO_DETECT = 0, // Automatically detect layout type + CUBEMAP_LAYOUT_LINE_VERTICAL, // Layout is defined by a vertical line with faces + CUBEMAP_LAYOUT_LINE_HORIZONTAL, // Layout is defined by an horizontal line with faces + CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces + CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces + CUBEMAP_LAYOUT_PANORAMA // Layout is defined by a panorama image (equirectangular map) +} CubemapLayout; // Font type, defines generation method typedef enum { - FONT_DEFAULT = 0, // Default font generation, anti-aliased - FONT_BITMAP, // Bitmap font generation, no anti-aliasing - FONT_SDF // SDF font generation, requires external shader + FONT_DEFAULT = 0, // Default font generation, anti-aliased + FONT_BITMAP, // Bitmap font generation, no anti-aliasing + FONT_SDF // SDF font generation, requires external shader } FontType; // Color blending modes (pre-defined) typedef enum { - BLEND_ALPHA = 0, // Blend textures considering alpha (default) - BLEND_ADDITIVE, // Blend textures adding colors - BLEND_MULTIPLIED, // Blend textures multiplying colors - BLEND_ADD_COLORS, // Blend textures adding colors (alternative) - BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative) - BLEND_CUSTOM // Belnd textures using custom src/dst factors (use rlSetBlendMode()) + BLEND_ALPHA = 0, // Blend textures considering alpha (default) + BLEND_ADDITIVE, // Blend textures adding colors + BLEND_MULTIPLIED, // Blend textures multiplying colors + BLEND_ADD_COLORS, // Blend textures adding colors (alternative) + BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative) + BLEND_CUSTOM // Belnd textures using custom src/dst factors (use rlSetBlendMode()) } BlendMode; -// Gestures type +// Gestures // NOTE: It could be used as flags to enable only some gestures typedef enum { - GESTURE_NONE = 0, - GESTURE_TAP = 1, - GESTURE_DOUBLETAP = 2, - GESTURE_HOLD = 4, - GESTURE_DRAG = 8, - GESTURE_SWIPE_RIGHT = 16, - GESTURE_SWIPE_LEFT = 32, - GESTURE_SWIPE_UP = 64, - GESTURE_SWIPE_DOWN = 128, - GESTURE_PINCH_IN = 256, - GESTURE_PINCH_OUT = 512 -} GestureType; + GESTURE_NONE = 0, // No gesture + GESTURE_TAP = 1, // Tap gesture + GESTURE_DOUBLETAP = 2, // Double tap gesture + GESTURE_HOLD = 4, // Hold gesture + GESTURE_DRAG = 8, // Drag gesture + GESTURE_SWIPE_RIGHT = 16, // Swipe right gesture + GESTURE_SWIPE_LEFT = 32, // Swipe left gesture + GESTURE_SWIPE_UP = 64, // Swipe up gesture + GESTURE_SWIPE_DOWN = 128, // Swipe down gesture + GESTURE_PINCH_IN = 256, // Pinch in gesture + GESTURE_PINCH_OUT = 512 // Pinch out gesture +} Gesture; // Camera system modes typedef enum { - CAMERA_CUSTOM = 0, - CAMERA_FREE, - CAMERA_ORBITAL, - CAMERA_FIRST_PERSON, - CAMERA_THIRD_PERSON + CAMERA_CUSTOM = 0, // Custom camera + CAMERA_FREE, // Free camera + CAMERA_ORBITAL, // Orbital camera + CAMERA_FIRST_PERSON, // First person camera + CAMERA_THIRD_PERSON // Third person camera } CameraMode; -// Camera projection modes +// Camera projection typedef enum { - CAMERA_PERSPECTIVE = 0, - CAMERA_ORTHOGRAPHIC -} CameraType; + CAMERA_PERSPECTIVE = 0, // Perspective projection + CAMERA_ORTHOGRAPHIC // Orthographic projection +} CameraProjection; -// N-patch types +// N-patch layout typedef enum { - NPT_9PATCH = 0, // Npatch defined by 3x3 tiles - NPT_3PATCH_VERTICAL, // Npatch defined by 1x3 tiles - NPT_3PATCH_HORIZONTAL // Npatch defined by 3x1 tiles -} NPatchType; + NPATCH_NINE_PATCH = 0, // Npatch layout: 3x3 tiles + NPATCH_THREE_PATCH_VERTICAL, // Npatch layout: 1x3 tiles + NPATCH_THREE_PATCH_HORIZONTAL // Npatch layout: 3x1 tiles +} NPatchLayout; + +// Callbacks to hook some internal functions +// WARNING: This callbacks are intended for advance users +typedef void (*TraceLogCallback)(int logLevel, const char *text, va_list args); // Logging: Redirect trace log messages +typedef unsigned char *(*LoadFileDataCallback)(const char *fileName, unsigned int *bytesRead); // FileIO: Load binary data +typedef bool (*SaveFileDataCallback)(const char *fileName, void *data, unsigned int bytesToWrite); // FileIO: Save binary data +typedef char *(*LoadFileTextCallback)(const char *fileName); // FileIO: Load text data +typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileIO: Save text data -// Callbacks to be implemented by users -typedef void (*TraceLogCallback)(int logType, const char *text, va_list args); #if defined(__cplusplus) extern "C" { // Prevents name mangling of functions @@ -918,8 +949,8 @@ RLAPI int GetScreenHeight(void); // Get current RLAPI int GetMonitorCount(void); // Get number of connected monitors RLAPI int GetCurrentMonitor(void); // Get current connected monitor RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position -RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width -RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height +RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width (max available by monitor) +RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height (max available by monitor) RLAPI int GetMonitorPhysicalWidth(int monitor); // Get specified monitor physical width in millimetres RLAPI int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres RLAPI int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate @@ -935,60 +966,88 @@ RLAPI void HideCursor(void); // Hides curso RLAPI bool IsCursorHidden(void); // Check if cursor is not visible RLAPI void EnableCursor(void); // Enables cursor (unlock cursor) RLAPI void DisableCursor(void); // Disables cursor (lock cursor) -RLAPI bool IsCursorOnScreen(void); // Check if cursor is on the current screen. +RLAPI bool IsCursorOnScreen(void); // Check if cursor is on the screen // Drawing-related functions RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color) RLAPI void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing RLAPI void EndDrawing(void); // End canvas drawing and swap buffers (double buffering) -RLAPI void BeginMode2D(Camera2D camera); // Initialize 2D mode with custom camera (2D) +RLAPI void BeginMode2D(Camera2D camera); // Begin 2D mode with custom camera (2D) RLAPI void EndMode2D(void); // Ends 2D mode with custom camera -RLAPI void BeginMode3D(Camera3D camera); // Initializes 3D mode with custom camera (3D) +RLAPI void BeginMode3D(Camera3D camera); // Begin 3D mode with custom camera (3D) RLAPI void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode -RLAPI void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing +RLAPI void BeginTextureMode(RenderTexture2D target); // Begin drawing to render texture RLAPI void EndTextureMode(void); // Ends drawing to render texture +RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing +RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) +RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied, subtract, custom) +RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) RLAPI void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) RLAPI void EndScissorMode(void); // End scissor mode +RLAPI void BeginVrStereoMode(VrStereoConfig config); // Begin stereo rendering (requires VR simulator) +RLAPI void EndVrStereoMode(void); // End stereo rendering (requires VR simulator) + +// VR stereo config functions for VR simulator +RLAPI VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device); // Load VR stereo config for VR simulator device parameters +RLAPI void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR stereo config + +// Shader management functions +// NOTE: Shader functionality is not available on OpenGL 1.1 +RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations +RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations +RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location +RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location +RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value +RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector +RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4) +RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d) +RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) // Screen-space-related functions -RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position -RLAPI Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) -RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Returns camera 2d transform matrix -RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position for a 3d world space position -RLAPI Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Returns size position for a 3d world space position -RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Returns the screen space position for a 2d camera world space position -RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Returns the world space position for a 2d camera screen space position +RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Get a ray trace from mouse position +RLAPI Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix) +RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix +RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position +RLAPI Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Get size position for a 3d world space position +RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position +RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position // Timing-related functions RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) -RLAPI int GetFPS(void); // Returns current FPS -RLAPI float GetFrameTime(void); // Returns time in seconds for last frame drawn -RLAPI double GetTime(void); // Returns elapsed time in seconds since InitWindow() +RLAPI int GetFPS(void); // Get current FPS +RLAPI float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time) +RLAPI double GetTime(void); // Get elapsed time in seconds since InitWindow() // Misc. functions +RLAPI int GetRandomValue(int min, int max); // Get a random value between min and max (both included) +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 SetTraceLogLevel(int logType); // Set the current threshold (minimum) log level -RLAPI void SetTraceLogExit(int logType); // Set the exit threshold (minimum) log level -RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging -RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR) - +RLAPI void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) +RLAPI void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level RLAPI void *MemAlloc(int size); // Internal memory allocator +RLAPI void *MemRealloc(void *ptr, int size); // Internal memory reallocator RLAPI void MemFree(void *ptr); // Internal memory free -RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png) -RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included) + +// Set custom callbacks +// WARNING: Callbacks setup is intended for advance users +RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log +RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader +RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver +RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader +RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver // Files management functions RLAPI unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read) RLAPI void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData() RLAPI bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write), returns true on success RLAPI char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string -RLAPI void UnloadFileText(unsigned char *text); // Unload file text data allocated by LoadFileText() +RLAPI void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText() RLAPI bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success RLAPI bool FileExists(const char *fileName); // Check if file exists RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension (including point: .png, .wav) -RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (including point: ".png") +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) @@ -1016,73 +1075,77 @@ RLAPI void OpenURL(const char *url); // Open URL wi //------------------------------------------------------------------------------------ // Input-related functions: keyboard -RLAPI bool IsKeyPressed(int key); // Detect if a key has been pressed once -RLAPI bool IsKeyDown(int key); // Detect if a key is being pressed -RLAPI bool IsKeyReleased(int key); // Detect if a key has been released once -RLAPI bool IsKeyUp(int key); // Detect if a key is NOT being pressed +RLAPI bool IsKeyPressed(int key); // Check if a key has been pressed once +RLAPI bool IsKeyDown(int key); // Check if a key is being pressed +RLAPI bool IsKeyReleased(int key); // Check if a key has been released once +RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued // Input-related functions: gamepads -RLAPI bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available +RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available RLAPI bool IsGamepadName(int gamepad, const char *name); // Check gamepad name (if available) -RLAPI const char *GetGamepadName(int gamepad); // Return gamepad internal name id -RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad button has been pressed once -RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed -RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once -RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed +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); // Return gamepad axis count for a gamepad -RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis +RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad +RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis +RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) // Input-related functions: mouse -RLAPI bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once -RLAPI bool IsMouseButtonDown(int button); // Detect if a mouse button is being pressed -RLAPI bool IsMouseButtonReleased(int button); // Detect if a mouse button has been released once -RLAPI bool IsMouseButtonUp(int button); // Detect if a mouse button is NOT being pressed -RLAPI int GetMouseX(void); // Returns mouse position X -RLAPI int GetMouseY(void); // Returns mouse position Y -RLAPI Vector2 GetMousePosition(void); // Returns mouse position XY +RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once +RLAPI bool IsMouseButtonDown(int button); // Check if a mouse button is being pressed +RLAPI bool IsMouseButtonReleased(int button); // Check if a mouse button has been released once +RLAPI bool IsMouseButtonUp(int button); // Check if a mouse button is NOT being pressed +RLAPI int GetMouseX(void); // Get mouse position X +RLAPI int GetMouseY(void); // Get mouse position Y +RLAPI Vector2 GetMousePosition(void); // Get mouse position XY RLAPI void SetMousePosition(int x, int y); // Set mouse position XY RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling -RLAPI float GetMouseWheelMove(void); // Returns mouse wheel movement Y -RLAPI int GetMouseCursor(void); // Returns mouse cursor if (MouseCursor enum) +RLAPI float GetMouseWheelMove(void); // Get mouse wheel movement Y RLAPI void SetMouseCursor(int cursor); // Set mouse cursor // Input-related functions: touch -RLAPI int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size) -RLAPI int GetTouchY(void); // Returns touch position Y for touch point 0 (relative to screen size) -RLAPI Vector2 GetTouchPosition(int index); // Returns touch position XY for a touch point index (relative to screen size) +RLAPI int GetTouchX(void); // Get touch position X for touch point 0 (relative to screen size) +RLAPI int GetTouchY(void); // Get touch position Y for touch point 0 (relative to screen size) +RLAPI Vector2 GetTouchPosition(int index); // Get touch position XY for a touch point index (relative to screen size) //------------------------------------------------------------------------------------ // Gestures and Touch Handling Functions (Module: gestures) //------------------------------------------------------------------------------------ -RLAPI void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags -RLAPI bool IsGestureDetected(int gesture); // Check if a gesture have been detected -RLAPI int GetGestureDetected(void); // Get latest detected gesture -RLAPI int GetTouchPointsCount(void); // Get touch points count -RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds -RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector -RLAPI float GetGestureDragAngle(void); // Get gesture drag angle -RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta -RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle +RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags +RLAPI bool IsGestureDetected(int gesture); // Check if a gesture have been detected +RLAPI int GetGestureDetected(void); // Get latest detected gesture +RLAPI int GetTouchPointsCount(void); // Get touch points count +RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds +RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector +RLAPI float GetGestureDragAngle(void); // Get gesture drag angle +RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta +RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle //------------------------------------------------------------------------------------ // Camera System Functions (Module: camera) //------------------------------------------------------------------------------------ -RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) -RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode +RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) +RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode -RLAPI void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera) -RLAPI void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera) -RLAPI void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera) +RLAPI void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera) +RLAPI void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera) +RLAPI void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera) RLAPI void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown); // Set camera move controls (1st person and 3rd person cameras) //------------------------------------------------------------------------------------ // Basic Shapes Drawing Functions (Module: shapes) //------------------------------------------------------------------------------------ +// 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 // Basic shapes drawing functions RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel @@ -1094,15 +1157,15 @@ RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color c RLAPI void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color); //Draw line using quadratic bezier curves with a control point RLAPI void DrawLineStrip(Vector2 *points, int pointsCount, Color color); // Draw lines sequence RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle -RLAPI void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw a piece of a circle -RLAPI void DrawCircleSectorLines(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw circle sector outline +RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle +RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline -RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring -RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring outline +RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring +RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle @@ -1111,15 +1174,16 @@ RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Col RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline -RLAPI void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color); // Draw rectangle outline with extended parameters +RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges -RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int lineThick, Color color); // Draw rectangle with rounded edges outline +RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) RLAPI void DrawTriangleFan(Vector2 *points, int pointsCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) RLAPI void DrawTriangleStrip(Vector2 *points, int pointsCount, Color color); // Draw a triangle strip defined by points RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides +RLAPI void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters // Basic shapes collision detection functions RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles @@ -1140,7 +1204,7 @@ RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) -RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. "png" +RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png' RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) RLAPI bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success @@ -1170,7 +1234,7 @@ RLAPI void ImageAlphaPremultiply(Image *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 ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color -RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image +RLAPI void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) RLAPI void ImageFlipVertical(Image *image); // Flip image vertically RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally @@ -1209,7 +1273,7 @@ RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 posi // NOTE: These functions require GPU access RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data -RLAPI TextureCubemap LoadTextureCubemap(Image image, int layoutType); // Load cubemap from image, multiple image cubemap layouts supported +RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) @@ -1220,28 +1284,29 @@ RLAPI Image GetScreenData(void); // Texture configuration functions RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture -RLAPI void SetTextureFilter(Texture2D texture, int filterMode); // Set texture scaling filter mode -RLAPI void SetTextureWrap(Texture2D texture, int wrapMode); // Set texture wrapping mode +RLAPI void SetTextureFilter(Texture2D texture, int filter); // Set texture scaling filter mode +RLAPI void SetTextureWrap(Texture2D texture, int wrap); // Set texture wrapping mode // Texture drawing functions RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters -RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle +RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle RLAPI void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters -RLAPI void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. -RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters -RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely +RLAPI void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. +RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters +RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely +RLAPI void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointsCount, Color tint); // Draw a textured polygon // Color/pixel related functions -RLAPI Color Fade(Color color, float alpha); // Returns color with alpha applied, alpha goes from 0.0f to 1.0f -RLAPI int ColorToInt(Color color); // Returns hexadecimal value for a Color -RLAPI Vector4 ColorNormalize(Color color); // Returns Color normalized as float [0..1] -RLAPI Color ColorFromNormalized(Vector4 normalized); // Returns Color from normalized values [0..1] -RLAPI Vector3 ColorToHSV(Color color); // Returns HSV values for a Color -RLAPI Color ColorFromHSV(float hue, float saturation, float value); // Returns a Color from HSV values -RLAPI Color ColorAlpha(Color color, float alpha); // Returns color with alpha applied, alpha goes from 0.0f to 1.0f -RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Returns src alpha-blended into dst color with tint +RLAPI Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f +RLAPI int ColorToInt(Color color); // Get hexadecimal value for a Color +RLAPI Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1] +RLAPI Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1] +RLAPI Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1] +RLAPI Color ColorFromHSV(float hue, float saturation, float value); // Get a Color from HSV values, hue [0..360], saturation/value [0..1] +RLAPI Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f +RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint RLAPI Color GetColor(int hexValue); // Get Color structure from hexadecimal value RLAPI Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format RLAPI void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer @@ -1256,19 +1321,18 @@ RLAPI Font GetFontDefault(void); RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCount); // Load font from file with extended parameters RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) -RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount); // 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, int *fontChars, int charsCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' RLAPI CharInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount, int type); // Load font data for further use RLAPI Image GenImageFontAtlas(const CharInfo *chars, Rectangle **recs, int charsCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info RLAPI void UnloadFontData(CharInfo *chars, int charsCount); // Unload font chars info data (RAM) RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM) // Text drawing functions -RLAPI void DrawFPS(int posX, int posY); // Shows current FPS +RLAPI void DrawFPS(int posX, int posY); // Draw current FPS RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters RLAPI void DrawTextRec(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); // Draw text using font inside rectangle limits -RLAPI void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, - int selectStart, int selectLength, Color selectTint, Color selectBackTint); // Draw text using font inside rectangle limits with support for text selection +RLAPI void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectTint, Color selectBackTint); // Draw text using font inside rectangle limits with support for text selection RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) // Text misc. functions @@ -1298,7 +1362,7 @@ RLAPI char *TextToUtf8(int *codepoints, int length); // Encode // UTF8 text strings management functions RLAPI int *GetCodepoints(const char *text, int *count); // Get all codepoints in a string, codepoints count returned by parameters RLAPI int GetCodepointsCount(const char *text); // Get total number of characters (codepoints) in a UTF8 encoded string -RLAPI int GetNextCodepoint(const char *text, int *bytesProcessed); // Returns next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure +RLAPI int GetNextCodepoint(const char *text, int *bytesProcessed); // Get next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure RLAPI const char *CodepointToUtf8(int codepoint, int *byteLength); // Encode codepoint into utf8 text (char array length returned as parameter) //------------------------------------------------------------------------------------ @@ -1324,53 +1388,55 @@ RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBott RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) -RLAPI void DrawGizmo(Vector3 position); // Draw simple gizmo //------------------------------------------------------------------------------------ // Model 3d Loading and Drawing Functions (Module: models) //------------------------------------------------------------------------------------ // Model loading/unloading functions -RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) -RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) -RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) -RLAPI void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM) +RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) +RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) +RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) +RLAPI void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM) // Mesh loading/unloading functions -RLAPI Mesh *LoadMeshes(const char *fileName, int *meshCount); // Load meshes from model file -RLAPI void UnloadMesh(Mesh mesh); // Unload mesh from memory (RAM and/or VRAM) -RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success +RLAPI void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids +RLAPI void UpdateMeshBuffer(Mesh mesh, int index, void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index +RLAPI void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform +RLAPI void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms +RLAPI void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU +RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success // Material loading/unloading functions -RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file -RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) -RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) -RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) -RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh +RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file +RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) +RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) +RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) +RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh // Model animations loading/unloading functions -RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animsCount); // Load model animations from file -RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose -RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data -RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match +RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animsCount); // Load model animations from file +RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose +RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data +RLAPI void UnloadModelAnimations(ModelAnimation* animations, unsigned int count); // Unload animation array data +RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match // Mesh generation functions -RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh -RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) -RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh -RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) -RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) -RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh -RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh -RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh -RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data -RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data +RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh +RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) +RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh +RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) +RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) +RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh +RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh +RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh +RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data +RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data // Mesh manipulation functions -RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits -RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents -RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals -RLAPI void MeshNormalsSmooth(Mesh *mesh); // Smooth (average) vertex normals +RLAPI BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits +RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents +RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals // Model drawing functions RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) @@ -1378,71 +1444,20 @@ 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 center, float size, Color tint); // Draw a billboard texture -RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 center, float size, Color tint); // Draw a billboard texture defined by source +RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); // Draw a billboard texture +RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source +RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation // Collision detection functions -RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Detect collision between two spheres -RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes -RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Detect collision between box and sphere -RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 center, float radius); // Detect collision between ray and sphere -RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 center, float radius, Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point -RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box -RLAPI RayHitInfo GetCollisionRayMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh -RLAPI RayHitInfo GetCollisionRayModel(Ray ray, Model model); // Get collision info between ray and model -RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle -RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane) - -//------------------------------------------------------------------------------------ -// Shaders System Functions (Module: rlgl) -// NOTE: This functions are useless when using OpenGL 1.1 -//------------------------------------------------------------------------------------ - -// Shader loading/unloading functions -RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations -RLAPI Shader LoadShaderCode(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations -RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) - -RLAPI Shader GetShaderDefault(void); // Get default shader -RLAPI Texture2D GetTextureDefault(void); // Get default texture -RLAPI Texture2D GetShapesTexture(void); // Get texture to draw shapes -RLAPI Rectangle GetShapesTextureRec(void); // Get texture rectangle to draw shapes -RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Define default texture used to draw shapes - -// Shader configuration functions -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 uniformLoc, const void *value, int uniformType); // Set shader uniform value -RLAPI void SetShaderValueV(Shader shader, int uniformLoc, const void *value, int uniformType, int count); // Set shader uniform value vector -RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) -RLAPI void SetShaderValueTexture(Shader shader, int uniformLoc, Texture2D texture); // Set shader uniform value for texture -RLAPI void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) -RLAPI void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) -RLAPI Matrix GetMatrixModelview(void); // Get internal modelview matrix -RLAPI Matrix GetMatrixProjection(void); // Get internal projection matrix - -// Texture maps generation (PBR) -// NOTE: Required shaders should be provided -RLAPI TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int size, int format); // Generate cubemap texture from 2D panorama texture -RLAPI TextureCubemap GenTextureIrradiance(Shader shader, TextureCubemap cubemap, int size); // Generate irradiance texture using cubemap data -RLAPI TextureCubemap GenTexturePrefilter(Shader shader, TextureCubemap cubemap, int size); // Generate prefilter texture using cubemap data -RLAPI Texture2D GenTextureBRDF(Shader shader, int size); // Generate BRDF texture - -// Shading begin/end functions -RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing -RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) -RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) -RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) - -// VR control functions -RLAPI void InitVrSimulator(void); // Init VR simulator for selected device parameters -RLAPI void CloseVrSimulator(void); // Close VR simulator for current device -RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera -RLAPI void SetVrConfiguration(VrDeviceInfo info, Shader distortion); // Set stereo rendering configuration parameters -RLAPI bool IsVrSimulatorReady(void); // Detect if VR simulator is ready -RLAPI void ToggleVrMode(void); // Enable/Disable VR experience -RLAPI void BeginVrDrawing(void); // Begin VR simulator stereo rendering -RLAPI void EndVrDrawing(void); // End VR simulator stereo rendering +RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres +RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes +RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere +RLAPI RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere +RLAPI RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box +RLAPI RayCollision GetRayCollisionModel(Ray ray, Model model); // Get collision info between ray and model +RLAPI RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh +RLAPI RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle +RLAPI RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad //------------------------------------------------------------------------------------ // Audio Loading and Playing Functions (Module: audio) @@ -1456,7 +1471,7 @@ RLAPI void SetMasterVolume(float volume); // Set mas // Wave/Sound loading/unloading functions RLAPI Wave LoadWave(const char *fileName); // Load wave data from file -RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. "wav" +RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav' RLAPI Sound LoadSound(const char *fileName); // Load sound from file RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data @@ -1484,22 +1499,23 @@ RLAPI void UnloadWaveSamples(float *samples); // Unload // Music management functions RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file +RLAPI Music LoadMusicStreamFromMemory(const char *fileType, unsigned char *data, int dataSize); // Load music stream from data RLAPI void UnloadMusicStream(Music music); // Unload music stream RLAPI void PlayMusicStream(Music music); // Start music playing +RLAPI bool IsMusicStreamPlaying(Music music); // Check if music is playing RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming RLAPI void StopMusicStream(Music music); // Stop music playing RLAPI void PauseMusicStream(Music music); // Pause music playing RLAPI void ResumeMusicStream(Music music); // Resume playing paused music -RLAPI bool IsMusicPlaying(Music music); // Check if music is playing 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 float GetMusicTimeLength(Music music); // Get music time length (in seconds) RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) // AudioStream management functions -RLAPI AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream raw audio pcm data) +RLAPI AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data) +RLAPI void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data -RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream diff --git a/src/raylib.rc b/src/raylib.rc index f0ccc729b..4c500b2bc 100644 --- a/src/raylib.rc +++ b/src/raylib.rc @@ -1,8 +1,8 @@ GLFW_ICON ICON "raylib.ico" 1 VERSIONINFO -FILEVERSION 3,5,0,0 -PRODUCTVERSION 3,5,0,0 +FILEVERSION 3,7,0,0 +PRODUCTVERSION 3,7,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", "3.5.0" + VALUE "FileVersion", "3.7.0" VALUE "InternalName", "raylib app" - VALUE "LegalCopyright", "(c) 2020 Ramon Santamaria (@raysan5)" + VALUE "LegalCopyright", "(c) 2021 Ramon Santamaria (@raysan5)" //VALUE "OriginalFilename", "raylib_app.exe" VALUE "ProductName", "raylib app" - VALUE "ProductVersion", "3.5.0" + VALUE "ProductVersion", "3.7.0" END END BLOCK "VarFileInfo" diff --git a/src/raylib.rc.data b/src/raylib.rc.data index 07ec22e09..4da6b882b 100644 Binary files a/src/raylib.rc.data and b/src/raylib.rc.data differ diff --git a/src/raymath.h b/src/raymath.h index 44d41d4d7..4be5739c4 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -42,11 +42,11 @@ #ifndef RAYMATH_H #define RAYMATH_H -//#define RAYMATH_STANDALONE // NOTE: To use raymath as standalone lib, just uncomment this line -//#define RAYMATH_HEADER_ONLY // NOTE: To compile functions as static inline, uncomment this line +//#define RAYMATH_STANDALONE // NOTE: To use raymath as standalone lib, just uncomment this line +//#define RAYMATH_HEADER_ONLY // NOTE: To compile functions as static inline, uncomment this line #ifndef RAYMATH_STANDALONE - #include "raylib.h" // Required for structs: Vector3, Matrix + #include "raylib.h" // Required for structs: Vector3, Matrix #endif #if defined(RAYMATH_IMPLEMENTATION) && defined(RAYMATH_HEADER_ONLY) @@ -55,17 +55,17 @@ #if defined(RAYMATH_IMPLEMENTATION) #if defined(_WIN32) && defined(BUILD_LIBTYPE_SHARED) - #define RMDEF __declspec(dllexport) extern inline // We are building raylib as a Win32 shared library (.dll). + #define RMDEF __declspec(dllexport) extern inline // We are building raylib as a Win32 shared library (.dll). #elif defined(_WIN32) && defined(USE_LIBTYPE_SHARED) - #define RMDEF __declspec(dllimport) // We are using raylib as a Win32 shared library (.dll) + #define RMDEF __declspec(dllimport) // We are using raylib as a Win32 shared library (.dll) #else #define RMDEF extern inline // Provide external definition #endif #elif defined(RAYMATH_HEADER_ONLY) - #define RMDEF static inline // Functions may be inlined, no external out-of-line definition + #define RMDEF static inline // Functions may be inlined, no external out-of-line definition #else #if defined(__TINYC__) - #define RMDEF static inline // plain inline not supported by tinycc (See issue #435) + #define RMDEF static inline // WARNING: Plain inline not supported by tinycc (See issue #435) #else #define RMDEF inline // Functions may be inlined or external definition used #endif @@ -75,7 +75,7 @@ // Defines and Macros //---------------------------------------------------------------------------------- #ifndef PI - #define PI 3.14159265358979323846 + #define PI 3.14159265358979323846f #endif #ifndef DEG2RAD @@ -86,12 +86,12 @@ #define RAD2DEG (180.0f/PI) #endif -// Return float vector for Matrix +// Get float vector for Matrix #ifndef MatrixToFloat #define MatrixToFloat(mat) (MatrixToFloatV(mat).v) #endif -// Return float vector for Vector3 +// Get float vector for Vector3 #ifndef Vector3ToFloat #define Vector3ToFloat(vec) (Vector3ToFloatV(vec).v) #endif @@ -160,13 +160,13 @@ RMDEF float Lerp(float start, float end, float amount) // Normalize input value within input range RMDEF float Normalize(float value, float start, float end) { - return (value - start) / (end - start); + return (value - start)/(end - start); } // Remap input value within input range to output range RMDEF float Remap(float value, float inputStart, float inputEnd, float outputStart, float outputEnd) { - return (value - inputStart) / (inputEnd - inputStart) * (outputEnd - outputStart) + outputStart; + return (value - inputStart)/(inputEnd - inputStart)*(outputEnd - outputStart) + outputStart; } //---------------------------------------------------------------------------------- @@ -314,7 +314,7 @@ RMDEF Vector2 Vector2Reflect(Vector2 v, Vector2 normal) RMDEF Vector2 Vector2Rotate(Vector2 v, float degs) { float rads = degs*DEG2RAD; - Vector2 result = {v.x * cosf(rads) - v.y * sinf(rads) , v.x * sinf(rads) + v.y * cosf(rads) }; + Vector2 result = {v.x*cosf(rads) - v.y*sinf(rads) , v.x*sinf(rads) + v.y*cosf(rads) }; return result; } @@ -326,7 +326,7 @@ RMDEF Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance) float dy = target.y - v.y; float value = (dx*dx) + (dy*dy); - if ((value == 0) || ((maxDistance >= 0) && (value <= maxDistance*maxDistance))) result = target; + if ((value == 0) || ((maxDistance >= 0) && (value <= maxDistance*maxDistance))) return target; float dist = sqrtf(value); @@ -559,7 +559,7 @@ RMDEF Vector3 Vector3Reflect(Vector3 v, Vector3 normal) return result; } -// Return min value for each pair of components +// Get min value for each pair of components RMDEF Vector3 Vector3Min(Vector3 v1, Vector3 v2) { Vector3 result = { 0 }; @@ -571,7 +571,7 @@ RMDEF Vector3 Vector3Min(Vector3 v1, Vector3 v2) return result; } -// Return max value for each pair of components +// Get max value for each pair of components RMDEF Vector3 Vector3Max(Vector3 v1, Vector3 v2) { Vector3 result = { 0 }; @@ -609,7 +609,7 @@ RMDEF Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c) return result; } -// Returns Vector3 as float array +// Get Vector3 as float array RMDEF float3 Vector3ToFloatV(Vector3 v) { float3 buffer = { 0 }; @@ -644,7 +644,7 @@ RMDEF float MatrixDeterminant(Matrix mat) return result; } -// Returns the trace of the matrix (sum of the values along the diagonal) +// Get the trace of the matrix (sum of the values along the diagonal) RMDEF float MatrixTrace(Matrix mat) { float result = (mat.m0 + mat.m5 + mat.m10 + mat.m15); @@ -750,7 +750,7 @@ RMDEF Matrix MatrixNormalize(Matrix mat) return result; } -// Returns identity matrix +// Get identity matrix RMDEF Matrix MatrixIdentity(void) { Matrix result = { 1.0f, 0.0f, 0.0f, 0.0f, @@ -811,7 +811,7 @@ RMDEF Matrix MatrixSubtract(Matrix left, Matrix right) return result; } -// Returns two matrix multiplication +// Get two matrix multiplication // NOTE: When multiplying matrices... the order matters! RMDEF Matrix MatrixMultiply(Matrix left, Matrix right) { @@ -837,7 +837,7 @@ RMDEF Matrix MatrixMultiply(Matrix left, Matrix right) return result; } -// Returns translation matrix +// Get translation matrix RMDEF Matrix MatrixTranslate(float x, float y, float z) { Matrix result = { 1.0f, 0.0f, 0.0f, x, @@ -856,32 +856,32 @@ RMDEF Matrix MatrixRotate(Vector3 axis, float angle) float x = axis.x, y = axis.y, z = axis.z; - float length = sqrtf(x*x + y*y + z*z); + float lengthSquared = x*x + y*y + z*z; - if ((length != 1.0f) && (length != 0.0f)) + if ((lengthSquared != 1.0f) && (lengthSquared != 0.0f)) { - length = 1.0f/length; - x *= length; - y *= length; - z *= length; + float inverseLength = 1.0f/sqrtf(lengthSquared); + x *= inverseLength; + y *= inverseLength; + z *= inverseLength; } float sinres = sinf(angle); float cosres = cosf(angle); float t = 1.0f - cosres; - result.m0 = x*x*t + cosres; - result.m1 = y*x*t + z*sinres; - result.m2 = z*x*t - y*sinres; - result.m3 = 0.0f; + result.m0 = x*x*t + cosres; + result.m1 = y*x*t + z*sinres; + result.m2 = z*x*t - y*sinres; + result.m3 = 0.0f; - result.m4 = x*y*t - z*sinres; - result.m5 = y*y*t + cosres; - result.m6 = z*y*t + x*sinres; - result.m7 = 0.0f; + result.m4 = x*y*t - z*sinres; + result.m5 = y*y*t + cosres; + result.m6 = z*y*t + x*sinres; + result.m7 = 0.0f; - result.m8 = x*z*t + y*sinres; - result.m9 = y*z*t - x*sinres; + result.m8 = x*z*t + y*sinres; + result.m9 = y*z*t - x*sinres; result.m10 = z*z*t + cosres; result.m11 = 0.0f; @@ -893,7 +893,7 @@ RMDEF Matrix MatrixRotate(Vector3 axis, float angle) return result; } -// Returns x-rotation matrix (angle in radians) +// Get x-rotation matrix (angle in radians) RMDEF Matrix MatrixRotateX(float angle) { Matrix result = MatrixIdentity(); @@ -909,7 +909,7 @@ RMDEF Matrix MatrixRotateX(float angle) return result; } -// Returns y-rotation matrix (angle in radians) +// Get y-rotation matrix (angle in radians) RMDEF Matrix MatrixRotateY(float angle) { Matrix result = MatrixIdentity(); @@ -925,7 +925,7 @@ RMDEF Matrix MatrixRotateY(float angle) return result; } -// Returns z-rotation matrix (angle in radians) +// Get z-rotation matrix (angle in radians) RMDEF Matrix MatrixRotateZ(float angle) { Matrix result = MatrixIdentity(); @@ -942,7 +942,7 @@ RMDEF Matrix MatrixRotateZ(float angle) } -// Returns xyz-rotation matrix (angles in radians) +// Get xyz-rotation matrix (angles in radians) RMDEF Matrix MatrixRotateXYZ(Vector3 ang) { Matrix result = MatrixIdentity(); @@ -954,34 +954,57 @@ RMDEF Matrix MatrixRotateXYZ(Vector3 ang) float cosx = cosf(-ang.x); float sinx = sinf(-ang.x); - result.m0 = cosz * cosy; - result.m4 = (cosz * siny * sinx) - (sinz * cosx); - result.m8 = (cosz * siny * cosx) + (sinz * sinx); + result.m0 = cosz*cosy; + result.m4 = (cosz*siny*sinx) - (sinz*cosx); + result.m8 = (cosz*siny*cosx) + (sinz*sinx); - result.m1 = sinz * cosy; - result.m5 = (sinz * siny * sinx) + (cosz * cosx); - result.m9 = (sinz * siny * cosx) - (cosz * sinx); + result.m1 = sinz*cosy; + result.m5 = (sinz*siny*sinx) + (cosz*cosx); + result.m9 = (sinz*siny*cosx) - (cosz*sinx); result.m2 = -siny; - result.m6 = cosy * sinx; - result.m10= cosy * cosx; + result.m6 = cosy*sinx; + result.m10= cosy*cosx; return result; } -// Returns zyx-rotation matrix (angles in radians) -// TODO: This solution is suboptimal, it should be possible to create this matrix in one go -// instead of using a 3 matrix multiplication +// Get zyx-rotation matrix (angles in radians) RMDEF Matrix MatrixRotateZYX(Vector3 ang) { - Matrix result = MatrixRotateZ(ang.z); - result = MatrixMultiply(result, MatrixRotateY(ang.y)); - result = MatrixMultiply(result, MatrixRotateX(ang.x)); + Matrix result = { 0 }; + + float cz = cosf(ang.z); + float sz = sinf(ang.z); + float cy = cosf(ang.y); + float sy = sinf(ang.y); + float cx = cosf(ang.x); + float sx = sinf(ang.x); + + result.m0 = cz*cy; + result.m1 = cz*sy*sx - cx*sz; + result.m2 = sz*sx + cz*cx*sy; + result.m3 = 0; + + result.m4 = cy*sz; + result.m5 = cz*cx + sz*sy*sx; + result.m6 = cx*sz*sy - cz*sx; + result.m7 = 0; + + result.m8 = -sy; + result.m9 = cy*sx; + result.m10 = cy*cx; + result.m11 = 0; + + result.m12 = 0; + result.m13 = 0; + result.m14 = 0; + result.m15 = 1; return result; } -// Returns scaling matrix +// Get scaling matrix RMDEF Matrix MatrixScale(float x, float y, float z) { Matrix result = { x, 0.0f, 0.0f, 0.0f, @@ -992,7 +1015,7 @@ RMDEF Matrix MatrixScale(float x, float y, float z) return result; } -// Returns perspective projection matrix +// Get perspective projection matrix RMDEF Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far) { Matrix result = { 0 }; @@ -1024,7 +1047,7 @@ RMDEF Matrix MatrixFrustum(double left, double right, double bottom, double top, return result; } -// Returns perspective projection matrix +// Get perspective projection matrix // NOTE: Angle should be provided in radians RMDEF Matrix MatrixPerspective(double fovy, double aspect, double near, double far) { @@ -1035,7 +1058,7 @@ RMDEF Matrix MatrixPerspective(double fovy, double aspect, double near, double f return result; } -// Returns orthographic projection matrix +// Get orthographic projection matrix RMDEF Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far) { Matrix result = { 0 }; @@ -1064,7 +1087,7 @@ RMDEF Matrix MatrixOrtho(double left, double right, double bottom, double top, d return result; } -// Returns camera look-at matrix (view matrix) +// Get camera look-at matrix (view matrix) RMDEF Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up) { Matrix result = { 0 }; @@ -1095,7 +1118,7 @@ RMDEF Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up) return result; } -// Returns float array of matrix data +// Get float array of matrix data RMDEF float16 MatrixToFloatV(Matrix mat) { float16 buffer = { 0 }; @@ -1152,7 +1175,7 @@ RMDEF Quaternion QuaternionSubtractValue(Quaternion q, float sub) return result; } -// Returns identity quaternion +// Get identity quaternion RMDEF Quaternion QuaternionIdentity(void) { Quaternion result = { 0.0f, 0.0f, 0.0f, 1.0f }; @@ -1162,7 +1185,7 @@ RMDEF Quaternion QuaternionIdentity(void) // Computes the length of a quaternion RMDEF float QuaternionLength(Quaternion q) { - float result = (float)sqrt(q.x*q.x + q.y*q.y + q.z*q.z + q.w*q.w); + float result = sqrtf(q.x*q.x + q.y*q.y + q.z*q.z + q.w*q.w); return result; } @@ -1227,10 +1250,10 @@ RMDEF Quaternion QuaternionScale(Quaternion q, float mul) float qax = q.x, qay = q.y, qaz = q.z, qaw = q.w; - result.x = qax * mul + qaw * mul + qay * mul - qaz * mul; - result.y = qay * mul + qaw * mul + qaz * mul - qax * mul; - result.z = qaz * mul + qaw * mul + qax * mul - qay * mul; - result.w = qaw * mul - qax * mul - qay * mul - qaz * mul; + result.x = qax*mul + qaw*mul + qay*mul - qaz*mul; + result.y = qay*mul + qaw*mul + qaz*mul - qax*mul; + result.z = qaz*mul + qaw*mul + qax*mul - qay*mul; + result.w = qaw*mul - qax*mul - qay*mul - qaz*mul; return result; } @@ -1238,7 +1261,7 @@ RMDEF Quaternion QuaternionScale(Quaternion q, float mul) // Divide two quaternions RMDEF Quaternion QuaternionDivide(Quaternion q1, Quaternion q2) { - Quaternion result = {q1.x / q2.x, q1.y / q2.y, q1.z / q2.z, q1.w / q2.w}; + Quaternion result = { q1.x/q2.x, q1.y/q2.y, q1.z/q2.z, q1.w/q2.w }; return result; } @@ -1269,7 +1292,13 @@ RMDEF Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount) { Quaternion result = { 0 }; - float cosHalfTheta = q1.x*q2.x + q1.y*q2.y + q1.z*q2.z + q1.w*q2.w; + float cosHalfTheta = q1.x*q2.x + q1.y*q2.y + q1.z*q2.z + q1.w*q2.w; + + if (cosHalfTheta < 0) + { + q2.x = -q2.x; q2.y = -q2.y; q2.z = -q2.z; q2.w = -q2.w; + cosHalfTheta = -cosHalfTheta; + } if (fabs(cosHalfTheta) >= 1.0f) result = q1; else if (cosHalfTheta > 0.95f) result = QuaternionNlerp(q1, q2, amount); @@ -1322,7 +1351,7 @@ RMDEF Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to) return result; } -// Returns a quaternion for a given rotation matrix +// Get a quaternion for a given rotation matrix RMDEF Quaternion QuaternionFromMatrix(Matrix mat) { Quaternion result = { 0 }; @@ -1346,7 +1375,7 @@ RMDEF Quaternion QuaternionFromMatrix(Matrix mat) } else { - float s = sqrtf(1.0f + mat.m10 - mat.m0 - mat.m5)*2; + float s = sqrtf(1.0f + mat.m10 - mat.m0 - mat.m5)*2; result.x = (mat.m2 + mat.m8)/s; result.y = (mat.m9 + mat.m6)/s; result.z = 0.25f*s; @@ -1356,32 +1385,37 @@ RMDEF Quaternion QuaternionFromMatrix(Matrix mat) return result; } -// Returns a matrix for a given quaternion +// Get a matrix for a given quaternion RMDEF Matrix QuaternionToMatrix(Quaternion q) { Matrix result = MatrixIdentity(); + + float a2 = q.x*q.x; + float b2 = q.y*q.y; + float c2 = q.z*q.z; + float ac = q.x*q.z; + float ab = q.x*q.y; + float bc = q.y*q.z; + float ad = q.w*q.x; + float bd = q.w*q.y; + float cd = q.w*q.z; - float a2 = 2*(q.x*q.x), b2=2*(q.y*q.y), c2=2*(q.z*q.z); //, d2=2*(q.w*q.w); + result.m0 = 1 - 2*(b2 + c2); + result.m1 = 2*(ab + cd); + result.m2 = 2*(ac - bd); - float ab = 2*(q.x*q.y), ac=2*(q.x*q.z), bc=2*(q.y*q.z); - float ad = 2*(q.x*q.w), bd=2*(q.y*q.w), cd=2*(q.z*q.w); + result.m4 = 2*(ab - cd); + result.m5 = 1 - 2*(a2 + c2); + result.m6 = 2*(bc + ad); - result.m0 = 1 - b2 - c2; - result.m1 = ab - cd; - result.m2 = ac + bd; - - result.m4 = ab + cd; - result.m5 = 1 - a2 - c2; - result.m6 = bc - ad; - - result.m8 = ac - bd; - result.m9 = bc + ad; - result.m10 = 1 - a2 - b2; + result.m8 = 2*(ac + bd); + result.m9 = 2*(bc - ad); + result.m10 = 1 - 2*(a2 + b2); return result; } -// Returns rotation quaternion for an angle and axis +// Get rotation quaternion for an angle and axis // NOTE: angle must be provided in radians RMDEF Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle) { @@ -1406,7 +1440,7 @@ RMDEF Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle) return result; } -// Returns the rotation angle and axis for a given quaternion +// Get the rotation angle and axis for a given quaternion RMDEF void QuaternionToAxisAngle(Quaternion q, Vector3 *outAxis, float *outAngle) { if (fabs(q.w) > 1.0f) q = QuaternionNormalize(q); @@ -1432,17 +1466,18 @@ RMDEF void QuaternionToAxisAngle(Quaternion q, Vector3 *outAxis, float *outAngle *outAngle = resAngle; } -// Returns he quaternion equivalent to Euler angles -RMDEF Quaternion QuaternionFromEuler(float roll, float pitch, float yaw) +// Get the quaternion equivalent to Euler angles +// NOTE: Rotation order is ZYX +RMDEF Quaternion QuaternionFromEuler(float pitch, float yaw, float roll) { Quaternion q = { 0 }; - float x0 = cosf(roll*0.5f); - float x1 = sinf(roll*0.5f); - float y0 = cosf(pitch*0.5f); - float y1 = sinf(pitch*0.5f); - float z0 = cosf(yaw*0.5f); - float z1 = sinf(yaw*0.5f); + float x0 = cosf(pitch*0.5f); + float x1 = sinf(pitch*0.5f); + float y0 = cosf(yaw*0.5f); + float y1 = sinf(yaw*0.5f); + float z0 = cosf(roll*0.5f); + float z1 = sinf(roll*0.5f); q.x = x1*y0*z0 - x0*y1*z1; q.y = x0*y1*z0 + x1*y0*z1; @@ -1452,7 +1487,7 @@ RMDEF Quaternion QuaternionFromEuler(float roll, float pitch, float yaw) return q; } -// Return the Euler angles equivalent to quaternion (roll, pitch, yaw) +// Get the Euler angles equivalent to quaternion (roll, pitch, yaw) // NOTE: Angles are returned in a Vector3 struct in degrees RMDEF Vector3 QuaternionToEuler(Quaternion q) { diff --git a/src/rlgl.h b/src/rlgl.h index d8e3de9d6..4b88e09df 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -1,14 +1,13 @@ /********************************************************************************************** * -* rlgl v3.1 - raylib OpenGL abstraction layer +* rlgl v3.7 - raylib OpenGL abstraction layer * * rlgl is a wrapper for multiple OpenGL versions (1.1, 2.1, 3.3 Core, ES 2.0) to * pseudo-OpenGL 1.1 style functions (rlVertex, rlTranslate, rlRotate...). * * When chosing an OpenGL version greater than OpenGL 1.1, rlgl stores vertex data on internal * VBO buffers (and VAOs if available). It requires calling 3 functions: -* rlglInit() - Initialize internal buffers and auxiliar resources -* rlglDraw() - Process internal buffers and send required draw calls +* rlglInit() - Initialize internal buffers and auxiliary resources * rlglClose() - De-initialize internal buffers data and other auxiliar resources * * CONFIGURATION: @@ -19,7 +18,7 @@ * #define GRAPHICS_API_OPENGL_ES2 * Use selected OpenGL graphics backend, should be supported by platform * Those preprocessor defines are only used on rlgl module, if OpenGL version is -* required by any other module, use rlGetVersion() tocheck it +* required by any other module, use rlGetVersion() to check it * * #define RLGL_IMPLEMENTATION * Generates the implementation of the library into the included file. @@ -29,8 +28,8 @@ * #define RLGL_STANDALONE * Use rlgl as standalone library (no raylib dependency) * -* #define SUPPORT_VR_SIMULATOR -* Support VR simulation functionality (stereo rendering) +* #define SUPPORT_GL_DETAILS_INFO +* Show OpenGL extensions and capabilities detailed logs on init * * DEPENDENCIES: * raymath - 3D math functionality (Vector3, Matrix, Quaternion) @@ -95,7 +94,7 @@ #define RL_FREE(p) free(p) #endif #else - #include "raylib.h" // Required for: Model, Shader, Texture2D, TRACELOG() + #include "raylib.h" // Required for: Shader, Texture2D #endif #include "raymath.h" // Required for: Vector3, Matrix @@ -121,6 +120,8 @@ #endif #endif +// OpenGL 2.1 uses most of OpenGL 3.3 Core functionality +// WARNING: Specific parts are checked with #if defines #if defined(GRAPHICS_API_OPENGL_21) #define GRAPHICS_API_OPENGL_33 #endif @@ -136,7 +137,8 @@ // This is the maximum amount of elements (quads) per batch // NOTE: Be careful with text, every letter maps to a quad #define DEFAULT_BATCH_BUFFER_ELEMENTS 8192 - #elif defined(GRAPHICS_API_OPENGL_ES2) + #endif + #if defined(GRAPHICS_API_OPENGL_ES2) // We reduce memory sizes for embedded systems (RPI and HTML5) // NOTE: On HTML5 (emscripten) this is allocated on heap, // by default it's only 16MB!...just take care... @@ -158,6 +160,11 @@ #define MAX_MATRIX_STACK_SIZE 32 // Maximum size of Matrix stack #endif +// Vertex buffers id limit +#ifndef MAX_MESH_VERTEX_BUFFERS + #define MAX_MESH_VERTEX_BUFFERS 7 // Maximum vertex buffers (VBO) per mesh +#endif + // Shader and material limits #ifndef MAX_SHADER_LOCATIONS #define MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported @@ -175,33 +182,37 @@ #endif // Texture parameters (equivalent to OpenGL defines) -#define RL_TEXTURE_WRAP_S 0x2802 // GL_TEXTURE_WRAP_S -#define RL_TEXTURE_WRAP_T 0x2803 // GL_TEXTURE_WRAP_T -#define RL_TEXTURE_MAG_FILTER 0x2800 // GL_TEXTURE_MAG_FILTER -#define RL_TEXTURE_MIN_FILTER 0x2801 // GL_TEXTURE_MIN_FILTER -#define RL_TEXTURE_ANISOTROPIC_FILTER 0x3000 // Anisotropic filter (custom identifier) +#define RL_TEXTURE_WRAP_S 0x2802 // GL_TEXTURE_WRAP_S +#define RL_TEXTURE_WRAP_T 0x2803 // GL_TEXTURE_WRAP_T +#define RL_TEXTURE_MAG_FILTER 0x2800 // GL_TEXTURE_MAG_FILTER +#define RL_TEXTURE_MIN_FILTER 0x2801 // GL_TEXTURE_MIN_FILTER -#define RL_FILTER_NEAREST 0x2600 // GL_NEAREST -#define RL_FILTER_LINEAR 0x2601 // GL_LINEAR -#define RL_FILTER_MIP_NEAREST 0x2700 // GL_NEAREST_MIPMAP_NEAREST -#define RL_FILTER_NEAREST_MIP_LINEAR 0x2702 // GL_NEAREST_MIPMAP_LINEAR -#define RL_FILTER_LINEAR_MIP_NEAREST 0x2701 // GL_LINEAR_MIPMAP_NEAREST -#define RL_FILTER_MIP_LINEAR 0x2703 // GL_LINEAR_MIPMAP_LINEAR +#define RL_TEXTURE_FILTER_NEAREST 0x2600 // GL_NEAREST +#define RL_TEXTURE_FILTER_LINEAR 0x2601 // GL_LINEAR +#define RL_TEXTURE_FILTER_MIP_NEAREST 0x2700 // GL_NEAREST_MIPMAP_NEAREST +#define RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR 0x2702 // GL_NEAREST_MIPMAP_LINEAR +#define RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST 0x2701 // GL_LINEAR_MIPMAP_NEAREST +#define RL_TEXTURE_FILTER_MIP_LINEAR 0x2703 // GL_LINEAR_MIPMAP_LINEAR +#define RL_TEXTURE_FILTER_ANISOTROPIC 0x3000 // Anisotropic filter (custom identifier) -#define RL_WRAP_REPEAT 0x2901 // GL_REPEAT -#define RL_WRAP_CLAMP 0x812F // GL_CLAMP_TO_EDGE -#define RL_WRAP_MIRROR_REPEAT 0x8370 // GL_MIRRORED_REPEAT -#define RL_WRAP_MIRROR_CLAMP 0x8742 // GL_MIRROR_CLAMP_EXT +#define RL_TEXTURE_WRAP_REPEAT 0x2901 // GL_REPEAT +#define RL_TEXTURE_WRAP_CLAMP 0x812F // GL_CLAMP_TO_EDGE +#define RL_TEXTURE_WRAP_MIRROR_REPEAT 0x8370 // GL_MIRRORED_REPEAT +#define RL_TEXTURE_WRAP_MIRROR_CLAMP 0x8742 // GL_MIRROR_CLAMP_EXT // Matrix modes (equivalent to OpenGL) -#define RL_MODELVIEW 0x1700 // GL_MODELVIEW -#define RL_PROJECTION 0x1701 // GL_PROJECTION -#define RL_TEXTURE 0x1702 // GL_TEXTURE +#define RL_MODELVIEW 0x1700 // GL_MODELVIEW +#define RL_PROJECTION 0x1701 // GL_PROJECTION +#define RL_TEXTURE 0x1702 // GL_TEXTURE // Primitive assembly draw modes -#define RL_LINES 0x0001 // GL_LINES -#define RL_TRIANGLES 0x0004 // GL_TRIANGLES -#define RL_QUADS 0x0007 // GL_QUADS +#define RL_LINES 0x0001 // GL_LINES +#define RL_TRIANGLES 0x0004 // GL_TRIANGLES +#define RL_QUADS 0x0007 // GL_QUADS + +// GL equivalent data types +#define RL_UNSIGNED_BYTE 0x1401 // GL_UNSIGNED_BYTE +#define RL_FLOAT 0x1406 // GL_FLOAT //---------------------------------------------------------------------------------- // Types and Structures Definition @@ -230,7 +241,55 @@ typedef enum { RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z, RL_ATTACHMENT_TEXTURE2D = 100, RL_ATTACHMENT_RENDERBUFFER = 200, -} FramebufferTexType; +} FramebufferAttachTextureType; + +// Dynamic vertex buffers (position + texcoords + colors + indices arrays) +typedef struct VertexBuffer { + int elementsCount; // Number of elements in the buffer (QUADS) + + int vCounter; // Vertex position counter to process (and draw) from full buffer + int tcCounter; // Vertex texcoord counter to process (and draw) from full buffer + int cCounter; // Vertex color counter to process (and draw) from full buffer + + float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) + float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) + unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) +#if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) + unsigned int *indices; // Vertex indices (in case vertex data comes indexed) (6 indices per quad) +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) + unsigned short *indices; // Vertex indices (in case vertex data comes indexed) (6 indices per quad) +#endif + unsigned int vaoId; // OpenGL Vertex Array Object id + unsigned int vboId[4]; // OpenGL Vertex Buffer Objects id (4 types of vertex data) +} VertexBuffer; + +// Draw call type +// NOTE: Only texture changes register a new draw, other state-change-related elements are not +// used at this moment (vaoId, shaderId, matrices), raylib just forces a batch draw call if any +// of those state-change happens (this is done in core module) +typedef struct DrawCall { + int mode; // Drawing mode: LINES, TRIANGLES, QUADS + int vertexCount; // Number of vertex of the draw + int vertexAlignment; // Number of vertex required for index alignment (LINES, TRIANGLES) + //unsigned int vaoId; // Vertex array id to be used on the draw -> Using RLGL.currentBatch->vertexBuffer.vaoId + //unsigned int shaderId; // Shader id to be used on the draw -> Using RLGL.currentShader.id + unsigned int textureId; // Texture id to be used on the draw -> Use to create new draw call if changes + + //Matrix projection; // Projection matrix for this draw -> Using RLGL.projection by default + //Matrix modelview; // Modelview matrix for this draw -> Using RLGL.modelview by default +} DrawCall; + +// RenderBatch type +typedef struct RenderBatch { + int buffersCount; // Number of vertex buffers (multi-buffering support) + int currentBuffer; // Current buffer tracking in case of multi-buffering + VertexBuffer *vertexBuffer; // Dynamic buffer(s) for vertex data + + DrawCall *draws; // Draw calls array, depends on textureId + int drawsCounter; // Draw calls counter + float currentDepth; // Current depth value for next draw +} RenderBatch; #if defined(RLGL_STANDALONE) #ifndef __cplusplus @@ -238,60 +297,23 @@ typedef enum { typedef enum { false, true } bool; #endif - // Color type, RGBA (32bit) + // Color, 4 components, R8G8B8A8 (32bit) typedef struct Color { - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; + unsigned char r; // Color red value + unsigned char g; // Color green value + unsigned char b; // Color blue value + unsigned char a; // Color alpha value } Color; - // Rectangle type - typedef struct Rectangle { - float x; - float y; - float width; - float height; - } Rectangle; - // Texture type // NOTE: Data stored in GPU memory - typedef struct Texture { + typedef struct Texture2D { unsigned int id; // OpenGL texture id int width; // Texture base width int height; // Texture base height int mipmaps; // Mipmap levels, 1 by default int format; // Data format (PixelFormat) - } Texture; - - // Texture2D type, same as Texture - typedef Texture Texture2D; - - // TextureCubemap type, actually, same as Texture - typedef Texture TextureCubemap; - - // Vertex data definning a mesh - typedef struct Mesh { - int vertexCount; // number of vertices stored in arrays - int triangleCount; // number of triangles stored (indexed or not) - float *vertices; // vertex position (XYZ - 3 components per vertex) (shader-location = 0) - float *texcoords; // vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) - float *texcoords2; // vertex second texture coordinates (useful for lightmaps) (shader-location = 5) - float *normals; // vertex normals (XYZ - 3 components per vertex) (shader-location = 2) - float *tangents; // vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) - unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) (shader-location = 3) - unsigned short *indices;// vertex indices (in case vertex data comes indexed) - - // Animation vertex data - float *animVertices; // Animated vertex positions (after bones transformations) - float *animNormals; // Animated normals (after bones transformations) - int *boneIds; // Vertex bone ids, up to 4 bones influence by vertex (skinning) - float *boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning) - - // OpenGL identifiers - unsigned int vaoId; // OpenGL Vertex Array Object id - unsigned int *vboId; // OpenGL Vertex Buffer Objects id (7 types of vertex data) - } Mesh; + } Texture2D; // Shader type (generic) typedef struct Shader { @@ -299,99 +321,63 @@ typedef enum { int *locs; // Shader locations array (MAX_SHADER_LOCATIONS) } Shader; - // Material texture map - typedef struct MaterialMap { - Texture2D texture; // Material map texture - Color color; // Material map color - float value; // Material map value - } MaterialMap; - - // Material type (generic) - typedef struct Material { - Shader shader; // Material shader - MaterialMap *maps; // Material maps (MAX_MATERIAL_MAPS) - float *params; // Material generic parameters (if required) - } Material; - - // Camera type, defines a camera position/orientation in 3d space - typedef struct Camera { - Vector3 position; // Camera position - Vector3 target; // Camera target it looks-at - Vector3 up; // Camera up vector (rotation over its axis) - float fovy; // Camera field-of-view apperture in Y (degrees) - } Camera; - - // Head-Mounted-Display device parameters - typedef struct VrDeviceInfo { - int hResolution; // HMD horizontal resolution in pixels - int vResolution; // HMD vertical resolution in pixels - float hScreenSize; // HMD horizontal size in meters - float vScreenSize; // HMD vertical size in meters - float vScreenCenter; // HMD screen center in meters - float eyeToScreenDistance; // HMD distance between eye and display in meters - float lensSeparationDistance; // HMD lens separation distance in meters - float interpupillaryDistance; // HMD IPD (distance between pupils) in meters - float lensDistortionValues[4]; // HMD lens distortion constant parameters - float chromaAbCorrection[4]; // HMD chromatic aberration correction parameters - } VrDeviceInfo; - - // VR Stereo rendering configuration for simulator - typedef struct VrStereoConfig { - Shader distortionShader; // VR stereo rendering distortion shader - Matrix eyesProjection[2]; // VR stereo rendering eyes projection matrices - Matrix eyesViewOffset[2]; // VR stereo rendering eyes view offset matrices - int eyeViewportRight[4]; // VR stereo rendering right eye viewport [x, y, w, h] - int eyeViewportLeft[4]; // VR stereo rendering left eye viewport [x, y, w, h] - } VrStereoConfig; - - // TraceLog message types + // Trace log level + // NOTE: Organized by priority level typedef enum { - LOG_ALL, - LOG_TRACE, - LOG_DEBUG, - LOG_INFO, - LOG_WARNING, - LOG_ERROR, - LOG_FATAL, - LOG_NONE - } TraceLogType; + LOG_ALL = 0, // Display all logs + LOG_TRACE, // Trace logging, intended for internal use only + LOG_DEBUG, // Debug logging, used for internal debugging, it should be disabled on release builds + LOG_INFO, // Info logging, used for program execution info + LOG_WARNING, // Warning logging, used on recoverable failures + LOG_ERROR, // Error logging, used on unrecoverable failures + LOG_FATAL, // Fatal logging, used to abort program: exit(EXIT_FAILURE) + LOG_NONE // Disable logging + } TraceLogLevel; // Texture formats (support depends on OpenGL version) typedef enum { - UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) - UNCOMPRESSED_GRAY_ALPHA, - UNCOMPRESSED_R5G6B5, // 16 bpp - UNCOMPRESSED_R8G8B8, // 24 bpp - UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha) - UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha) - UNCOMPRESSED_R8G8B8A8, // 32 bpp - UNCOMPRESSED_R32, // 32 bpp (1 channel - float) - UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float) - UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float) - COMPRESSED_DXT1_RGB, // 4 bpp (no alpha) - COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha) - COMPRESSED_DXT3_RGBA, // 8 bpp - COMPRESSED_DXT5_RGBA, // 8 bpp - COMPRESSED_ETC1_RGB, // 4 bpp - COMPRESSED_ETC2_RGB, // 4 bpp - COMPRESSED_ETC2_EAC_RGBA, // 8 bpp - COMPRESSED_PVRT_RGB, // 4 bpp - COMPRESSED_PVRT_RGBA, // 4 bpp - COMPRESSED_ASTC_4x4_RGBA, // 8 bpp - COMPRESSED_ASTC_8x8_RGBA // 2 bpp + PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) + PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels) + PIXELFORMAT_UNCOMPRESSED_R5G6B5, // 16 bpp + PIXELFORMAT_UNCOMPRESSED_R8G8B8, // 24 bpp + PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha) + PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha) + PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, // 32 bpp + PIXELFORMAT_UNCOMPRESSED_R32, // 32 bpp (1 channel - float) + PIXELFORMAT_UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float) + PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float) + PIXELFORMAT_COMPRESSED_DXT1_RGB, // 4 bpp (no alpha) + PIXELFORMAT_COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha) + PIXELFORMAT_COMPRESSED_DXT3_RGBA, // 8 bpp + PIXELFORMAT_COMPRESSED_DXT5_RGBA, // 8 bpp + PIXELFORMAT_COMPRESSED_ETC1_RGB, // 4 bpp + PIXELFORMAT_COMPRESSED_ETC2_RGB, // 4 bpp + PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, // 8 bpp + PIXELFORMAT_COMPRESSED_PVRT_RGB, // 4 bpp + PIXELFORMAT_COMPRESSED_PVRT_RGBA, // 4 bpp + PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, // 8 bpp + PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA // 2 bpp } PixelFormat; // Texture parameters: filter mode // NOTE 1: Filtering considers mipmaps if available in the texture // NOTE 2: Filter is accordingly set for minification and magnification typedef enum { - FILTER_POINT = 0, // No filter, just pixel aproximation - FILTER_BILINEAR, // Linear filtering - FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps) - FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x - FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x - FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x - } TextureFilterMode; + TEXTURE_FILTER_POINT = 0, // No filter, just pixel aproximation + TEXTURE_FILTER_BILINEAR, // Linear filtering + TEXTURE_FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps) + TEXTURE_FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x + TEXTURE_FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x + TEXTURE_FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x + } TextureFilter; + + // Texture parameters: wrap mode + typedef enum { + TEXTURE_WRAP_REPEAT = 0, // Repeats texture in tiled mode + TEXTURE_WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode + TEXTURE_WRAP_MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode + TEXTURE_WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode + } TextureWrap; // Color blending modes (pre-defined) typedef enum { @@ -405,66 +391,57 @@ typedef enum { // Shader location point type typedef enum { - LOC_VERTEX_POSITION = 0, - LOC_VERTEX_TEXCOORD01, - LOC_VERTEX_TEXCOORD02, - LOC_VERTEX_NORMAL, - LOC_VERTEX_TANGENT, - LOC_VERTEX_COLOR, - LOC_MATRIX_MVP, - LOC_MATRIX_MODEL, - LOC_MATRIX_VIEW, - LOC_MATRIX_PROJECTION, - LOC_VECTOR_VIEW, - LOC_COLOR_DIFFUSE, - LOC_COLOR_SPECULAR, - LOC_COLOR_AMBIENT, - LOC_MAP_ALBEDO, // LOC_MAP_DIFFUSE - LOC_MAP_METALNESS, // LOC_MAP_SPECULAR - LOC_MAP_NORMAL, - LOC_MAP_ROUGHNESS, - LOC_MAP_OCCLUSION, - LOC_MAP_EMISSION, - LOC_MAP_HEIGHT, - LOC_MAP_CUBEMAP, - LOC_MAP_IRRADIANCE, - LOC_MAP_PREFILTER, - LOC_MAP_BRDF + SHADER_LOC_VERTEX_POSITION = 0, // Shader location point: position + SHADER_LOC_VERTEX_TEXCOORD01, // Shader location point: texcoord01 + SHADER_LOC_VERTEX_TEXCOORD02, // Shader location point: texcoord02 + SHADER_LOC_VERTEX_NORMAL, // Shader location point: normal + SHADER_LOC_VERTEX_TANGENT, // Shader location point: tangent + SHADER_LOC_VERTEX_COLOR, // Shader location point: color + SHADER_LOC_MATRIX_MVP, // Shader location point: model-view-projection matrix + SHADER_LOC_MATRIX_VIEW, // Shader location point: view matrix + SHADER_LOC_MATRIX_PROJECTION, // Shader location point: projection matrix + SHADER_LOC_MATRIX_MODEL, // Shader location point: model matrix + SHADER_LOC_MATRIX_NORMAL, // Shader location point: normal matrix + SHADER_LOC_VECTOR_VIEW, // Shader location point: view vector + SHADER_LOC_COLOR_DIFFUSE, // Shader location point: diffuse color + SHADER_LOC_COLOR_SPECULAR, // Shader location point: specular color + SHADER_LOC_COLOR_AMBIENT, // Shader location point: ambient color + SHADER_LOC_MAP_ALBEDO, // Shader location point: albedo texture (same as: SHADER_LOC_MAP_DIFFUSE) + SHADER_LOC_MAP_METALNESS, // Shader location point: metalness texture (same as: SHADER_LOC_MAP_SPECULAR) + SHADER_LOC_MAP_NORMAL, // Shader location point: normal texture + SHADER_LOC_MAP_ROUGHNESS, // Shader location point: roughness texture + SHADER_LOC_MAP_OCCLUSION, // Shader location point: occlusion texture + SHADER_LOC_MAP_EMISSION, // Shader location point: emission texture + SHADER_LOC_MAP_HEIGHT, // Shader location point: height texture + SHADER_LOC_MAP_CUBEMAP, // Shader location point: cubemap texture_cube_map + SHADER_LOC_MAP_IRRADIANCE, // Shader location point: irradiance texture_cube_map + SHADER_LOC_MAP_PREFILTER, // Shader location point: prefilter texture_cube_map + SHADER_LOC_MAP_BRDF // Shader location point: brdf texture } ShaderLocationIndex; - // Shader uniform data types + #define SHADER_LOC_MAP_DIFFUSE SHADER_LOC_MAP_ALBEDO + #define SHADER_LOC_MAP_SPECULAR SHADER_LOC_MAP_METALNESS + + // Shader uniform data type typedef enum { - UNIFORM_FLOAT = 0, - UNIFORM_VEC2, - UNIFORM_VEC3, - UNIFORM_VEC4, - UNIFORM_INT, - UNIFORM_IVEC2, - UNIFORM_IVEC3, - UNIFORM_IVEC4, - UNIFORM_SAMPLER2D + SHADER_UNIFORM_FLOAT = 0, // Shader uniform type: float + SHADER_UNIFORM_VEC2, // Shader uniform type: vec2 (2 float) + SHADER_UNIFORM_VEC3, // Shader uniform type: vec3 (3 float) + SHADER_UNIFORM_VEC4, // Shader uniform type: vec4 (4 float) + SHADER_UNIFORM_INT, // Shader uniform type: int + SHADER_UNIFORM_IVEC2, // Shader uniform type: ivec2 (2 int) + SHADER_UNIFORM_IVEC3, // Shader uniform type: ivec3 (3 int) + SHADER_UNIFORM_IVEC4, // Shader uniform type: ivec4 (4 int) + SHADER_UNIFORM_SAMPLER2D // Shader uniform type: sampler2d } ShaderUniformDataType; - #define LOC_MAP_DIFFUSE LOC_MAP_ALBEDO - #define LOC_MAP_SPECULAR LOC_MAP_METALNESS - - // Material map type + // Shader attribute data types typedef enum { - MAP_ALBEDO = 0, // MAP_DIFFUSE - MAP_METALNESS = 1, // MAP_SPECULAR - MAP_NORMAL = 2, - MAP_ROUGHNESS = 3, - MAP_OCCLUSION, - MAP_EMISSION, - MAP_HEIGHT, - MAP_CUBEMAP, // NOTE: Uses GL_TEXTURE_CUBE_MAP - MAP_IRRADIANCE, // NOTE: Uses GL_TEXTURE_CUBE_MAP - MAP_PREFILTER, // NOTE: Uses GL_TEXTURE_CUBE_MAP - MAP_BRDF - } MaterialMapType; - - #define MAP_DIFFUSE MAP_ALBEDO - #define MAP_SPECULAR MAP_METALNESS + SHADER_ATTRIB_FLOAT = 0, // Shader attribute type: float + SHADER_ATTRIB_VEC2, // Shader attribute type: vec2 (2 float) + SHADER_ATTRIB_VEC3, // Shader attribute type: vec3 (3 float) + SHADER_ATTRIB_VEC4 // Shader attribute type: vec4 (4 float) + } ShaderAttributeDataType; #endif #if defined(__cplusplus) @@ -501,132 +478,152 @@ RLAPI void rlColor3f(float x, float y, float z); // Define one vertex ( RLAPI void rlColor4f(float x, float y, float z, float w); // Define one vertex (color) - 4 float //------------------------------------------------------------------------------------ -// Functions Declaration - OpenGL equivalent functions (common to 1.1, 3.3+, ES2) -// NOTE: This functions are used to completely abstract raylib code from OpenGL layer +// Functions Declaration - OpenGL style functions (common to 1.1, 3.3+, ES2) +// NOTE: This functions are used to completely abstract raylib code from OpenGL layer, +// some of them are direct wrappers over OpenGL calls, some others are custom //------------------------------------------------------------------------------------ -RLAPI void rlEnableTexture(unsigned int id); // Enable texture usage -RLAPI void rlDisableTexture(void); // Disable texture usage -RLAPI void rlTextureParameters(unsigned int id, int param, int value); // Set texture parameters (filter, wrap) -RLAPI void rlEnableShader(unsigned int id); // Enable shader program usage -RLAPI void rlDisableShader(void); // Disable shader program usage -RLAPI void rlEnableFramebuffer(unsigned int id); // Enable render texture (fbo) -RLAPI void rlDisableFramebuffer(void); // Disable render texture (fbo), return to default framebuffer -RLAPI void rlEnableDepthTest(void); // Enable depth test -RLAPI void rlDisableDepthTest(void); // Disable depth test -RLAPI void rlEnableDepthMask(void); // Enable depth write -RLAPI void rlDisableDepthMask(void); // Disable depth write -RLAPI void rlEnableBackfaceCulling(void); // Enable backface culling -RLAPI void rlDisableBackfaceCulling(void); // Disable backface culling -RLAPI void rlEnableScissorTest(void); // Enable scissor test -RLAPI void rlDisableScissorTest(void); // Disable scissor test -RLAPI void rlScissor(int x, int y, int width, int height); // Scissor test -RLAPI void rlEnableWireMode(void); // Enable wire mode -RLAPI void rlDisableWireMode(void); // Disable wire mode -RLAPI void rlSetLineWidth(float width); // Set the line drawing width -RLAPI float rlGetLineWidth(void); // Get the line drawing width -RLAPI void rlEnableSmoothLines(void); // Enable line aliasing -RLAPI void rlDisableSmoothLines(void); // Disable line aliasing -RLAPI void rlClearColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a); // Clear color buffer with color -RLAPI void rlClearScreenBuffers(void); // Clear used screen buffers (color and depth) -RLAPI void rlUpdateBuffer(int bufferId, void *data, int dataSize); // Update GPU buffer with new data -RLAPI unsigned int rlLoadAttribBuffer(unsigned int vaoId, int shaderLoc, void *buffer, int size, bool dynamic); // Load a new attributes buffer +// Vertex buffers state +RLAPI bool rlEnableVertexArray(unsigned int vaoId); // Enable vertex array (VAO, if supported) +RLAPI void rlDisableVertexArray(void); // Disable vertex array (VAO, if supported) +RLAPI void rlEnableVertexBuffer(unsigned int id); // Enable vertex buffer (VBO) +RLAPI void rlDisableVertexBuffer(void); // Disable vertex buffer (VBO) +RLAPI void rlEnableVertexBufferElement(unsigned int id);// Enable vertex buffer element (VBO element) +RLAPI void rlDisableVertexBufferElement(void); // Disable vertex buffer element (VBO element) +RLAPI void rlEnableVertexAttribute(unsigned int index); // Enable vertex attribute index +RLAPI void rlDisableVertexAttribute(unsigned int index);// Disable vertex attribute index +#if defined(GRAPHICS_API_OPENGL_11) +RLAPI void rlEnableStatePointer(int vertexAttribType, void *buffer); +RLAPI void rlDisableStatePointer(int vertexAttribType); +#endif + +// Textures state +RLAPI void rlActiveTextureSlot(int slot); // Select and active a texture slot +RLAPI void rlEnableTexture(unsigned int id); // Enable texture +RLAPI void rlDisableTexture(void); // Disable texture +RLAPI void rlEnableTextureCubemap(unsigned int id); // Enable texture cubemap +RLAPI void rlDisableTextureCubemap(void); // Disable texture cubemap +RLAPI void rlTextureParameters(unsigned int id, int param, int value); // Set texture parameters (filter, wrap) + +// Shader state +RLAPI void rlEnableShader(unsigned int id); // Enable shader program +RLAPI void rlDisableShader(void); // Disable shader program + +// Framebuffer state +RLAPI void rlEnableFramebuffer(unsigned int id); // Enable render texture (fbo) +RLAPI void rlDisableFramebuffer(void); // Disable render texture (fbo), return to default framebuffer + +// General render state +RLAPI void rlEnableDepthTest(void); // Enable depth test +RLAPI void rlDisableDepthTest(void); // Disable depth test +RLAPI void rlEnableDepthMask(void); // Enable depth write +RLAPI void rlDisableDepthMask(void); // Disable depth write +RLAPI void rlEnableBackfaceCulling(void); // Enable backface culling +RLAPI void rlDisableBackfaceCulling(void); // Disable backface culling +RLAPI void rlEnableScissorTest(void); // Enable scissor test +RLAPI void rlDisableScissorTest(void); // Disable scissor test +RLAPI void rlScissor(int x, int y, int width, int height); // Scissor test +RLAPI void rlEnableWireMode(void); // Enable wire mode +RLAPI void rlDisableWireMode(void); // Disable wire mode +RLAPI void rlSetLineWidth(float width); // Set the line drawing width +RLAPI float rlGetLineWidth(void); // Get the line drawing width +RLAPI void rlEnableSmoothLines(void); // Enable line aliasing +RLAPI void rlDisableSmoothLines(void); // Disable line aliasing +RLAPI void rlEnableStereoRender(void); // Enable stereo rendering +RLAPI void rlDisableStereoRender(void); // Disable stereo rendering +RLAPI bool rlIsStereoRenderEnabled(void); // Check if stereo render is enabled + +RLAPI void rlClearColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a); // Clear color buffer with color +RLAPI void rlClearScreenBuffers(void); // Clear used screen buffers (color and depth) +RLAPI void rlCheckErrors(void); // Check and log OpenGL error codes +RLAPI void rlSetBlendMode(int mode); // Set blending mode +RLAPI void rlSetBlendFactors(int glSrcFactor, int glDstFactor, int glEquation); // Set blending mode factor and equation (using OpenGL factors) //------------------------------------------------------------------------------------ // Functions Declaration - rlgl functionality //------------------------------------------------------------------------------------ +// rlgl initialization functions RLAPI void rlglInit(int width, int height); // Initialize rlgl (buffers, shaders, textures, states) RLAPI void rlglClose(void); // De-inititialize rlgl (buffers, shaders, textures) -RLAPI void rlglDraw(void); // Update and draw default internal buffers -RLAPI void rlCheckErrors(void); // Check and log OpenGL error codes +RLAPI void rlLoadExtensions(void *loader); // Load OpenGL extensions (loader function required) +RLAPI int rlGetVersion(void); // Get current OpenGL version +RLAPI int rlGetFramebufferWidth(void); // Get default framebuffer width +RLAPI int rlGetFramebufferHeight(void); // Get default framebuffer height -RLAPI int rlGetVersion(void); // Returns current OpenGL version -RLAPI bool rlCheckBufferLimit(int vCount); // Check internal buffer overflow for a given number of vertex -RLAPI void rlSetDebugMarker(const char *text); // Set debug marker for analysis -RLAPI void rlSetBlendMode(int glSrcFactor, int glDstFactor, int glEquation); // // Set blending mode factor and equation (using OpenGL factors) -RLAPI void rlLoadExtensions(void *loader); // Load OpenGL extensions +RLAPI Shader rlGetShaderDefault(void); // Get default shader +RLAPI Texture2D rlGetTextureDefault(void); // Get default texture -// Textures data management +// Render batch management +// NOTE: rlgl provides a default render batch to behave like OpenGL 1.1 immediate mode +// but this render batch API is exposed in case of custom batches are required +RLAPI RenderBatch rlLoadRenderBatch(int numBuffers, int bufferElements); // Load a render batch system +RLAPI void rlUnloadRenderBatch(RenderBatch batch); // Unload render batch system +RLAPI void rlDrawRenderBatch(RenderBatch *batch); // Draw render batch data (Update->Draw->Reset) +RLAPI void rlSetRenderBatchActive(RenderBatch *batch); // Set the active render batch for rlgl (NULL for default internal) +RLAPI void rlDrawRenderBatchActive(void); // Update and draw internal render batch +RLAPI bool rlCheckRenderBatchLimit(int vCount); // Check internal buffer overflow for a given number of vertex +RLAPI void rlSetTexture(unsigned int id); // Set current texture for render batch and check buffers limits + +//------------------------------------------------------------------------------------------------------------------------ + +// Vertex buffers management +RLAPI unsigned int rlLoadVertexArray(void); // Load vertex array (vao) if supported +RLAPI unsigned int rlLoadVertexBuffer(void *buffer, int size, bool dynamic); // Load a vertex buffer attribute +RLAPI unsigned int rlLoadVertexBufferElement(void *buffer, int size, bool dynamic); // Load a new attributes element buffer +RLAPI void rlUpdateVertexBuffer(int bufferId, void *data, int dataSize, int offset); // Update GPU buffer with new data +RLAPI void rlUnloadVertexArray(unsigned int vaoId); +RLAPI void rlUnloadVertexBuffer(unsigned int vboId); +RLAPI void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, void *pointer); +RLAPI void rlSetVertexAttributeDivisor(unsigned int index, int divisor); +RLAPI void rlSetVertexAttributeDefault(int locIndex, const void *value, int attribType, int count); // Set vertex attribute default value +RLAPI void rlDrawVertexArray(int offset, int count); +RLAPI void rlDrawVertexArrayElements(int offset, int count, void *buffer); +RLAPI void rlDrawVertexArrayInstanced(int offset, int count, int instances); +RLAPI void rlDrawVertexArrayElementsInstanced(int offset, int count, void *buffer, int instances); + +// Textures management RLAPI unsigned int rlLoadTexture(void *data, int width, int height, int format, int mipmapCount); // Load texture in GPU RLAPI unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer); // Load depth texture/renderbuffer (to be attached to fbo) RLAPI unsigned int rlLoadTextureCubemap(void *data, int size, int format); // Load texture cubemap RLAPI void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data); // Update GPU texture with new data RLAPI void rlGetGlTextureFormats(int format, unsigned int *glInternalFormat, unsigned int *glFormat, unsigned int *glType); // Get OpenGL internal formats RLAPI void rlUnloadTexture(unsigned int id); // Unload texture from GPU memory - RLAPI void rlGenerateMipmaps(Texture2D *texture); // Generate mipmap data for selected texture RLAPI void *rlReadTexturePixels(Texture2D texture); // Read texture pixel data RLAPI unsigned char *rlReadScreenPixels(int width, int height); // Read screen pixel data (color buffer) // Framebuffer management (fbo) RLAPI unsigned int rlLoadFramebuffer(int width, int height); // Load an empty framebuffer -RLAPI void rlFramebufferAttach(unsigned int fboId, unsigned int texId, int attachType, int texType); // Attach texture/renderbuffer to a framebuffer +RLAPI void rlFramebufferAttach(unsigned int fboId, unsigned int texId, int attachType, int texType, int mipLevel); // Attach texture/renderbuffer to a framebuffer RLAPI bool rlFramebufferComplete(unsigned int id); // Verify framebuffer is complete RLAPI void rlUnloadFramebuffer(unsigned int id); // Delete framebuffer from GPU -// Vertex data management -RLAPI void rlLoadMesh(Mesh *mesh, bool dynamic); // Upload vertex data into GPU and provided VAO/VBO ids -RLAPI void rlUpdateMesh(Mesh mesh, int buffer, int count); // Update vertex or index data on GPU (upload new data to one buffer) -RLAPI void rlUpdateMeshAt(Mesh mesh, int buffer, int count, int index); // Update vertex or index data on GPU, at index -RLAPI void rlDrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform -RLAPI void rlDrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int count); // Draw a 3d mesh with material and transform -RLAPI void rlUnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU +// Shaders management +RLAPI unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode); // Load shader from code strings +RLAPI unsigned int rlCompileShader(const char *shaderCode, int type); // Compile custom shader and return shader id (type: GL_VERTEX_SHADER, GL_FRAGMENT_SHADER) +RLAPI unsigned int rlLoadShaderProgram(unsigned int vShaderId, unsigned int fShaderId); // Load custom shader program +RLAPI void rlUnloadShaderProgram(unsigned int id); // Unload shader program +RLAPI int rlGetLocationUniform(unsigned int shaderId, const char *uniformName); // Get shader location uniform +RLAPI int rlGetLocationAttrib(unsigned int shaderId, const char *attribName); // Get shader location attribute +RLAPI void rlSetUniform(int locIndex, const void *value, int uniformType, int count); // Set shader value uniform +RLAPI void rlSetUniformMatrix(int locIndex, Matrix mat); // Set shader value matrix +RLAPI void rlSetUniformSampler(int locIndex, unsigned int textureId); // Set shader value sampler +RLAPI void rlSetShader(Shader shader); // Set shader currently active -// NOTE: There is a set of shader related functions that are available to end user, -// to avoid creating function wrappers through core module, they have been directly declared in raylib.h - -#if defined(RLGL_STANDALONE) -//------------------------------------------------------------------------------------ -// Shaders System Functions (Module: rlgl) -// NOTE: This functions are useless when using OpenGL 1.1 -//------------------------------------------------------------------------------------ -// Shader loading/unloading functions -RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations -RLAPI Shader LoadShaderCode(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations -RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) - -RLAPI Shader GetShaderDefault(void); // Get default shader -RLAPI Texture2D GetTextureDefault(void); // Get default texture -RLAPI Texture2D GetShapesTexture(void); // Get texture to draw shapes -RLAPI Rectangle GetShapesTextureRec(void); // Get texture rectangle to draw shapes - -// Shader configuration functions -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 uniformLoc, const void *value, int uniformType); // Set shader uniform value -RLAPI void SetShaderValueV(Shader shader, int uniformLoc, const void *value, int uniformType, int count); // Set shader uniform value vector -RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) -RLAPI void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) -RLAPI void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) -RLAPI Matrix GetMatrixModelview(void); // Get internal modelview matrix - -// Texture maps generation (PBR) -// NOTE: Required shaders should be provided -RLAPI TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int size, int format); // Generate cubemap texture from 2D panorama texture -RLAPI TextureCubemap GenTextureIrradiance(Shader shader, TextureCubemap cubemap, int size); // Generate irradiance texture using cubemap data -RLAPI TextureCubemap GenTexturePrefilter(Shader shader, TextureCubemap cubemap, int size); // Generate prefilter texture using cubemap data -RLAPI Texture2D GenTextureBRDF(Shader shader, int size); // Generate BRDF texture using cubemap data - -// Shading begin/end functions -RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing -RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) -RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) -RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) - -// VR control functions -RLAPI void InitVrSimulator(void); // Init VR simulator for selected device parameters -RLAPI void CloseVrSimulator(void); // Close VR simulator for current device -RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera -RLAPI void SetVrConfiguration(VrDeviceInfo info, Shader distortion); // Set stereo rendering configuration parameters -RLAPI bool IsVrSimulatorReady(void); // Detect if VR simulator is ready -RLAPI void ToggleVrMode(void); // Enable/Disable VR experience -RLAPI void BeginVrDrawing(void); // Begin VR simulator stereo rendering -RLAPI void EndVrDrawing(void); // End VR simulator stereo rendering - -RLAPI char *LoadFileText(const char *fileName); // Load chars array from text file -RLAPI int GetPixelDataSize(int width, int height, int format);// Get pixel data size in bytes (image or texture) -#endif +// Matrix state management +RLAPI Matrix rlGetMatrixModelview(void); // Get internal modelview matrix +RLAPI Matrix rlGetMatrixProjection(void); // Get internal projection matrix +RLAPI Matrix rlGetMatrixTransform(void); // Get internal accumulated transform matrix +RLAPI Matrix rlGetMatrixProjectionStereo(int eye); // Get internal projection matrix for stereo render (selected eye) +RLAPI Matrix rlGetMatrixViewOffsetStereo(int eye); // Get internal view offset matrix for stereo render (selected eye) +RLAPI void rlSetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) +RLAPI void rlSetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) +RLAPI void rlSetMatrixProjectionStereo(Matrix right, Matrix left); // Set eyes projection matrices for stereo rendering +RLAPI void rlSetMatrixViewOffsetStereo(Matrix right, Matrix left); // Set eyes view offsets matrices for stereo rendering +// Quick and dirty cube/quad buffers load->draw->unload +RLAPI void rlLoadDrawCube(void); // Load and draw a cube +RLAPI void rlLoadDrawQuad(void); // Load and draw a quad #if defined(__cplusplus) } #endif @@ -641,9 +638,7 @@ RLAPI int GetPixelDataSize(int width, int height, int format);// Get pixel data #if defined(RLGL_IMPLEMENTATION) -#if defined(RLGL_STANDALONE) - #include // Required for: fopen(), fseek(), fread(), fclose() [LoadFileText] -#else +#if !defined(RLGL_STANDALONE) // Check if config flags have been externally provided on compilation line #if !defined(EXTERNAL_CONFIG_FLAGS) #include "config.h" // Defines module configuration flags @@ -653,7 +648,6 @@ RLAPI int GetPixelDataSize(int width, int height, int format);// Get pixel data #include // Required for: malloc(), free() #include // Required for: strcmp(), strlen() [Used in rlglInit(), on extensions loading] -#include // Required for: atan2f() #if defined(GRAPHICS_API_OPENGL_11) #if defined(__APPLE__) @@ -677,10 +671,6 @@ RLAPI int GetPixelDataSize(int width, int height, int format);// Get pixel data #endif #endif -#if defined(GRAPHICS_API_OPENGL_21) - #define GRAPHICS_API_OPENGL_33 // OpenGL 2.1 uses mostly OpenGL 3.3 Core functionality -#endif - #if defined(GRAPHICS_API_OPENGL_33) #if defined(__APPLE__) #include // OpenGL 3 library for OSX @@ -700,9 +690,17 @@ RLAPI int GetPixelDataSize(int width, int height, int format);// Get pixel data #if defined(GRAPHICS_API_OPENGL_ES2) #define GL_GLEXT_PROTOTYPES - #include // EGL library + //#include // EGL library -> not required, platform layer #include // OpenGL ES 2.0 library #include // OpenGL ES 2.0 extensions library + + // It seems OpenGL ES 2.0 instancing entry points are not defined on Raspberry Pi + // provided headers (despite being defined in official Khronos GLES2 headers) + #if defined(PLATFORM_RPI) || defined(PLATFORM_DRM) + typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); + typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); + typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); + #endif #endif //---------------------------------------------------------------------------------- @@ -758,6 +756,7 @@ RLAPI int GetPixelDataSize(int width, int height, int format);// Get pixel data #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #endif + #if defined(GRAPHICS_API_OPENGL_21) #define GL_LUMINANCE 0x1909 #define GL_LUMINANCE_ALPHA 0x190A @@ -792,65 +791,6 @@ RLAPI int GetPixelDataSize(int width, int height, int format);// Get pixel data //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- - -// Dynamic vertex buffers (position + texcoords + colors + indices arrays) -typedef struct VertexBuffer { - int elementsCount; // Number of elements in the buffer (QUADS) - - int vCounter; // Vertex position counter to process (and draw) from full buffer - int tcCounter; // Vertex texcoord counter to process (and draw) from full buffer - int cCounter; // Vertex color counter to process (and draw) from full buffer - - float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) - float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) - unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) -#if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) - unsigned int *indices; // Vertex indices (in case vertex data comes indexed) (6 indices per quad) -#elif defined(GRAPHICS_API_OPENGL_ES2) - unsigned short *indices; // Vertex indices (in case vertex data comes indexed) (6 indices per quad) -#endif - unsigned int vaoId; // OpenGL Vertex Array Object id - unsigned int vboId[4]; // OpenGL Vertex Buffer Objects id (4 types of vertex data) -} VertexBuffer; - -// Draw call type -// NOTE: Only texture changes register a new draw, other state-change-related elements are not -// used at this moment (vaoId, shaderId, matrices), raylib just forces a batch draw call if any -// of those state-change happens (this is done in core module) -typedef struct DrawCall { - int mode; // Drawing mode: LINES, TRIANGLES, QUADS - int vertexCount; // Number of vertex of the draw - int vertexAlignment; // Number of vertex required for index alignment (LINES, TRIANGLES) - //unsigned int vaoId; // Vertex array id to be used on the draw -> Using RLGL.currentBatch->vertexBuffer.vaoId - //unsigned int shaderId; // Shader id to be used on the draw -> Using RLGL.currentShader.id - unsigned int textureId; // Texture id to be used on the draw -> Use to create new draw call if changes - - //Matrix projection; // Projection matrix for this draw -> Using RLGL.projection - //Matrix modelview; // Modelview matrix for this draw -> Using RLGL.modelview -} DrawCall; - -// RenderBatch type -typedef struct RenderBatch { - int buffersCount; // Number of vertex buffers (multi-buffering support) - int currentBuffer; // Current buffer tracking in case of multi-buffering - VertexBuffer *vertexBuffer; // Dynamic buffer(s) for vertex data - - DrawCall *draws; // Draw calls array, depends on textureId - int drawsCounter; // Draw calls counter - float currentDepth; // Current depth value for next draw -} RenderBatch; - -#if defined(SUPPORT_VR_SIMULATOR) -// VR Stereo rendering configuration for simulator -typedef struct VrStereoConfig { - Shader distortionShader; // VR stereo rendering distortion shader - Matrix eyesProjection[2]; // VR stereo rendering eyes projection matrices - Matrix eyesViewOffset[2]; // VR stereo rendering eyes view offset matrices - int eyeViewportRight[4]; // VR stereo rendering right eye viewport [x, y, w, h] - int eyeViewportLeft[4]; // VR stereo rendering left eye viewport [x, y, w, h] -} VrStereoConfig; -#endif - #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) typedef struct rlglData { RenderBatch *currentBatch; // Current render batch @@ -866,15 +806,17 @@ typedef struct rlglData { Matrix stack[MAX_MATRIX_STACK_SIZE];// Matrix stack for push/pop int stackCounter; // Matrix stack counter - Texture2D shapesTexture; // Texture used on shapes drawing (usually a white pixel) - Rectangle shapesTextureRec; // Texture source rectangle used on shapes drawing unsigned int defaultTextureId; // Default texture used on shapes/poly drawing (required by shader) - unsigned int activeTextureId[4]; // Active texture ids to be enabled on batch drawing (0 active by default) + unsigned int activeTextureId[MAX_BATCH_ACTIVE_TEXTURES]; // Active texture ids to be enabled on batch drawing (0 active by default) unsigned int defaultVShaderId; // Default vertex shader id (used by default shader program) unsigned int defaultFShaderId; // Default fragment shader Id (used by default shader program) Shader defaultShader; // Basic shader, support vertex color and diffuse texture Shader currentShader; // Shader to be used on rendering (by default, defaultShader) + bool stereoRender; // Stereo rendering flag + Matrix projectionStereo[2]; // VR stereo rendering eyes projection matrices + Matrix viewOffsetStereo[2]; // VR stereo rendering eyes view offset matrices + int currentBlendMode; // Blending mode active int glBlendSrcFactor; // Blending source factor int glBlendDstFactor; // Blending destination factor @@ -883,35 +825,29 @@ typedef struct rlglData { int framebufferWidth; // Default framebuffer width int framebufferHeight; // Default framebuffer height - } State; + } State; // Renderer state struct { - bool vao; // VAO support (OpenGL ES2 could not support VAO extension) - bool texNPOT; // NPOT textures full support - bool texDepth; // Depth textures supported - bool texFloat32; // float textures support (32 bit per channel) - bool texCompDXT; // DDS texture compression support - bool texCompETC1; // ETC1 texture compression support - bool texCompETC2; // ETC2/EAC texture compression support - bool texCompPVRT; // PVR texture compression support - bool texCompASTC; // ASTC texture compression support - bool texMirrorClamp; // Clamp mirror wrap mode supported - bool texAnisoFilter; // Anisotropic texture filtering support - bool debugMarker; // Debug marker support + bool vao; // VAO support (OpenGL ES2 could not support VAO extension) (GL_ARB_vertex_array_object) + bool instancing; // Instancing supported (GL_ANGLE_instanced_arrays, GL_EXT_draw_instanced + GL_EXT_instanced_arrays) + bool texNPOT; // NPOT textures full support (GL_ARB_texture_non_power_of_two, GL_OES_texture_npot) + bool texDepth; // Depth textures supported (GL_ARB_depth_texture, GL_WEBGL_depth_texture, GL_OES_depth_texture) + bool texFloat32; // float textures support (32 bit per channel) (GL_OES_texture_float) + bool texCompDXT; // DDS texture compression support (GL_EXT_texture_compression_s3tc, GL_WEBGL_compressed_texture_s3tc, GL_WEBKIT_WEBGL_compressed_texture_s3tc) + bool texCompETC1; // ETC1 texture compression support (GL_OES_compressed_ETC1_RGB8_texture, GL_WEBGL_compressed_texture_etc1) + bool texCompETC2; // ETC2/EAC texture compression support (GL_ARB_ES3_compatibility) + bool texCompPVRT; // PVR texture compression support (GL_IMG_texture_compression_pvrtc) + bool texCompASTC; // ASTC texture compression support (GL_KHR_texture_compression_astc_hdr, GL_KHR_texture_compression_astc_ldr) + bool texMirrorClamp; // Clamp mirror wrap mode supported (GL_EXT_texture_mirror_clamp) + bool texAnisoFilter; // Anisotropic texture filtering support (GL_EXT_texture_filter_anisotropic) - float maxAnisotropicLevel; // Maximum anisotropy level supported (minimum is 2.0f) + float maxAnisotropyLevel; // Maximum anisotropy level supported (minimum is 2.0f) int maxDepthBits; // Maximum bits for depth component } ExtSupported; // Extensions supported flags -#if defined(SUPPORT_VR_SIMULATOR) - struct { - VrStereoConfig config; // VR stereo configuration for simulator - unsigned int stereoFboId; // VR stereo rendering framebuffer id - unsigned int stereoTexId; // VR stereo color texture (attached to framebuffer) - bool simulatorReady; // VR simulator ready flag - bool stereoRender; // VR stereo rendering enabled/disabled flag - } Vr; -#endif // SUPPORT_VR_SIMULATOR } rlglData; + +typedef void *(*rlglLoadProc)(const char *name); // OpenGL extension functions loader signature (same as GLADloadproc) + #endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2 //---------------------------------------------------------------------------------- @@ -923,49 +859,37 @@ static rlglData RLGL = { 0 }; #if defined(GRAPHICS_API_OPENGL_ES2) // NOTE: VAO functionality is exposed through extensions (OES) -static PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays; // Entry point pointer to function glGenVertexArrays() -static PFNGLBINDVERTEXARRAYOESPROC glBindVertexArray; // Entry point pointer to function glBindVertexArray() -static PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays; // Entry point pointer to function glDeleteVertexArrays() +static PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays = NULL; +static PFNGLBINDVERTEXARRAYOESPROC glBindVertexArray = NULL; +static PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays = NULL; + +// NOTE: Instancing functionality could also be available through extension +static PFNGLDRAWARRAYSINSTANCEDEXTPROC glDrawArraysInstanced = NULL; +static PFNGLDRAWELEMENTSINSTANCEDEXTPROC glDrawElementsInstanced = NULL; +static PFNGLVERTEXATTRIBDIVISOREXTPROC glVertexAttribDivisor = NULL; #endif //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -static unsigned int CompileShader(const char *shaderStr, int type); // Compile custom shader and return shader id -static unsigned int LoadShaderProgram(unsigned int vShaderId, unsigned int fShaderId); // Load custom shader program - -static Shader LoadShaderDefault(void); // Load default shader (just vertex positioning and texture coloring) -static void SetShaderDefaultLocations(Shader *shader); // Bind default shader locations (attributes and uniforms) -static void UnloadShaderDefault(void); // Unload default shader - -static RenderBatch LoadRenderBatch(int numBuffers, int bufferElements); // Load a render batch system -static void UnloadRenderBatch(RenderBatch batch); // Unload render batch system -static void DrawRenderBatch(RenderBatch *batch); // Draw render batch data (Update->Draw->Reset) -static void SetRenderBatchActive(RenderBatch *batch); // Set the active render batch for rlgl -static void SetRenderBatchDefault(void); // Set default render batch for rlgl -//static bool CheckRenderBatchLimit(RenderBatch batch, int vCount); // Check render batch vertex buffer limits - -static void GenDrawCube(void); // Generate and draw cube -static void GenDrawQuad(void); // Generate and draw quad - -#if defined(SUPPORT_VR_SIMULATOR) -static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView); // Set internal projection and modelview matrix depending on eye -#endif - +static void rlLoadShaderDefault(void); // Load default shader (RLGL.State.defaultShader) +static void rlUnloadShaderDefault(void); // Unload default shader (RLGL.State.defaultShader) +#if defined(SUPPORT_GL_DETAILS_INFO) +static char *rlGetCompressedFormatName(int format); // Get compressed format official GL identifier name +#endif // SUPPORT_GL_DETAILS_INFO #endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2 - #if defined(GRAPHICS_API_OPENGL_11) -static int GenerateMipmaps(unsigned char *data, int baseWidth, int baseHeight); -static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight); +static int rlGenerateMipmapsData(unsigned char *data, int baseWidth, int baseHeight); // Generate mipmaps data on CPU side +static Color *rlGenNextMipmapData(Color *srcData, int srcWidth, int srcHeight); // Generate next mipmap level on CPU side #endif +static int rlGetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture) //---------------------------------------------------------------------------------- // Module Functions Definition - Matrix operations //---------------------------------------------------------------------------------- #if defined(GRAPHICS_API_OPENGL_11) - // Fallback to OpenGL 1.1 function calls //--------------------------------------- void rlMatrixMode(int mode) @@ -996,9 +920,8 @@ void rlTranslatef(float x, float y, float z) { glTranslatef(x, y, z); } void rlRotatef(float angleDeg, float x, float y, float z) { glRotatef(angleDeg, x, y, z); } void rlScalef(float x, float y, float z) { glScalef(x, y, z); } void rlMultMatrixf(float *matf) { glMultMatrixf(matf); } - -#elif defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - +#endif +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) // Choose the current matrix to be transformed void rlMatrixMode(int mode) { @@ -1106,7 +1029,6 @@ void rlOrtho(double left, double right, double bottom, double top, double znear, *RLGL.State.currentMatrix = MatrixMultiply(*RLGL.State.currentMatrix, matOrtho); } - #endif // Set the viewport area (transformation from normalized device coordinates to window coordinates) @@ -1119,7 +1041,6 @@ void rlViewport(int x, int y, int width, int height) // Module Functions Definition - Vertex level operations //---------------------------------------------------------------------------------- #if defined(GRAPHICS_API_OPENGL_11) - // Fallback to OpenGL 1.1 function calls //--------------------------------------- void rlBegin(int mode) @@ -1142,9 +1063,8 @@ void rlNormal3f(float x, float y, float z) { glNormal3f(x, y, z); } void rlColor4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a) { glColor4ub(r, g, b, a); } void rlColor3f(float x, float y, float z) { glColor3f(x, y, z); } void rlColor4f(float x, float y, float z, float w) { glColor4f(x, y, z, w); } - -#elif defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - +#endif +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) // Initialize drawing mode (how to organize vertex) void rlBegin(int mode) { @@ -1161,11 +1081,9 @@ void rlBegin(int mode) // for the next set of vertex to be drawn if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].mode == RL_LINES) RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = ((RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount < 4)? RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount : RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount%4); else if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].mode == RL_TRIANGLES) RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = ((RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount < 4)? 1 : (4 - (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount%4))); - else RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = 0; - if (rlCheckBufferLimit(RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment)) DrawRenderBatch(RLGL.currentBatch); - else + if (!rlCheckRenderBatchLimit(RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment)) { RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment; RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment; @@ -1175,7 +1093,7 @@ void rlBegin(int mode) } } - if (RLGL.currentBatch->drawsCounter >= DEFAULT_BATCH_DRAWCALLS) DrawRenderBatch(RLGL.currentBatch); + if (RLGL.currentBatch->drawsCounter >= DEFAULT_BATCH_DRAWCALLS) rlDrawRenderBatch(RLGL.currentBatch); RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].mode = mode; RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount = 0; @@ -1225,14 +1143,15 @@ void rlEnd(void) RLGL.currentBatch->currentDepth += (1.0f/20000.0f); // Verify internal buffers limits - // NOTE: This check is combined with usage of rlCheckBufferLimit() - if ((RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter) >= (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].elementsCount*4 - 4)) + // NOTE: This check is combined with usage of rlCheckRenderBatchLimit() + if ((RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter) >= + (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].elementsCount*4 - 4)) { - // WARNING: If we are between rlPushMatrix() and rlPopMatrix() and we need to force a DrawRenderBatch(), + // WARNING: If we are between rlPushMatrix() and rlPopMatrix() and we need to force a rlDrawRenderBatch(), // we need to call rlPopMatrix() before to recover *RLGL.State.currentMatrix (RLGL.State.modelview) for the next forced draw call! // If we have multiple matrix pushed, it will require "RLGL.State.stackCounter" pops before launching the draw for (int i = RLGL.State.stackCounter; i >= 0; i--) rlPopMatrix(); - DrawRenderBatch(RLGL.currentBatch); + rlDrawRenderBatch(RLGL.currentBatch); } } @@ -1310,62 +1229,104 @@ void rlColor3f(float x, float y, float z) #endif -//---------------------------------------------------------------------------------- -// Module Functions Definition - OpenGL equivalent functions (common to 1.1, 3.3+, ES2) -//---------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------- +// Module Functions Definition - OpenGL style functions (common to 1.1, 3.3+, ES2) +//-------------------------------------------------------------------------------------- -// Enable texture usage +// Set current texture to use +void rlSetTexture(unsigned int id) +{ + if (id == 0) + { +#if defined(GRAPHICS_API_OPENGL_11) + rlDisableTexture(); +#else + // NOTE: If quads batch limit is reached, we force a draw call and next batch starts + if (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter >= + RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].elementsCount*4) + { + rlDrawRenderBatch(RLGL.currentBatch); + } +#endif + } + else + { +#if defined(GRAPHICS_API_OPENGL_11) + rlEnableTexture(id); +#else + if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].textureId != id) + { + if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount > 0) + { + // Make sure current RLGL.currentBatch->draws[i].vertexCount is aligned a multiple of 4, + // that way, following QUADS drawing will keep aligned with index processing + // It implies adding some extra alignment vertex at the end of the draw, + // those vertex are not processed but they are considered as an additional offset + // for the next set of vertex to be drawn + if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].mode == RL_LINES) RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = ((RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount < 4)? RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount : RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount%4); + else if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].mode == RL_TRIANGLES) RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = ((RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount < 4)? 1 : (4 - (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount%4))); + else RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = 0; + + if (!rlCheckRenderBatchLimit(RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment)) + { + RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment; + RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment; + RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].tcCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment; + + RLGL.currentBatch->drawsCounter++; + } + } + + if (RLGL.currentBatch->drawsCounter >= DEFAULT_BATCH_DRAWCALLS) rlDrawRenderBatch(RLGL.currentBatch); + + RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].textureId = id; + RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount = 0; + } +#endif + } +} + +// Select and active a texture slot +void rlActiveTextureSlot(int slot) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glActiveTexture(GL_TEXTURE0 + slot); +#endif +} + +// Enable texture void rlEnableTexture(unsigned int id) { #if defined(GRAPHICS_API_OPENGL_11) glEnable(GL_TEXTURE_2D); +#endif glBindTexture(GL_TEXTURE_2D, id); -#endif - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].textureId != id) - { - if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount > 0) - { - // Make sure current RLGL.currentBatch->draws[i].vertexCount is aligned a multiple of 4, - // that way, following QUADS drawing will keep aligned with index processing - // It implies adding some extra alignment vertex at the end of the draw, - // those vertex are not processed but they are considered as an additional offset - // for the next set of vertex to be drawn - if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].mode == RL_LINES) RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = ((RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount < 4)? RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount : RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount%4); - else if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].mode == RL_TRIANGLES) RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = ((RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount < 4)? 1 : (4 - (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount%4))); - - else RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = 0; - - if (rlCheckBufferLimit(RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment)) DrawRenderBatch(RLGL.currentBatch); - else - { - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].tcCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment; - - RLGL.currentBatch->drawsCounter++; - } - } - - if (RLGL.currentBatch->drawsCounter >= DEFAULT_BATCH_DRAWCALLS) DrawRenderBatch(RLGL.currentBatch); - - RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].textureId = id; - RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount = 0; - } -#endif } -// Disable texture usage +// Disable texture void rlDisableTexture(void) { #if defined(GRAPHICS_API_OPENGL_11) glDisable(GL_TEXTURE_2D); +#endif glBindTexture(GL_TEXTURE_2D, 0); -#else - // NOTE: If quads batch limit is reached, - // we force a draw call and next batch starts - if (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter >= (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].elementsCount*4)) DrawRenderBatch(RLGL.currentBatch); +} + +// Enable texture cubemap +void rlEnableTextureCubemap(unsigned int id) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glEnable(GL_TEXTURE_CUBE_MAP); // Core in OpenGL 1.4 + glBindTexture(GL_TEXTURE_CUBE_MAP, id); +#endif +} + +// Disable texture cubemap +void rlDisableTextureCubemap(void) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glDisable(GL_TEXTURE_CUBE_MAP); + glBindTexture(GL_TEXTURE_CUBE_MAP, 0); #endif } @@ -1379,7 +1340,7 @@ void rlTextureParameters(unsigned int id, int param, int value) case RL_TEXTURE_WRAP_S: case RL_TEXTURE_WRAP_T: { - if (value == RL_WRAP_MIRROR_CLAMP) + if (value == RL_TEXTURE_WRAP_MIRROR_CLAMP) { #if !defined(GRAPHICS_API_OPENGL_11) if (RLGL.ExtSupported.texMirrorClamp) glTexParameteri(GL_TEXTURE_2D, param, value); @@ -1391,13 +1352,13 @@ void rlTextureParameters(unsigned int id, int param, int value) } break; case RL_TEXTURE_MAG_FILTER: case RL_TEXTURE_MIN_FILTER: glTexParameteri(GL_TEXTURE_2D, param, value); break; - case RL_TEXTURE_ANISOTROPIC_FILTER: + case RL_TEXTURE_FILTER_ANISOTROPIC: { #if !defined(GRAPHICS_API_OPENGL_11) - if (value <= RLGL.ExtSupported.maxAnisotropicLevel) glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)value); - else if (RLGL.ExtSupported.maxAnisotropicLevel > 0.0f) + if (value <= RLGL.ExtSupported.maxAnisotropyLevel) glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)value); + else if (RLGL.ExtSupported.maxAnisotropyLevel > 0.0f) { - TRACELOG(LOG_WARNING, "GL: Maximum anisotropic filter level supported is %iX", id, RLGL.ExtSupported.maxAnisotropicLevel); + TRACELOG(LOG_WARNING, "GL: Maximum anisotropic filter level supported is %iX", id, RLGL.ExtSupported.maxAnisotropyLevel); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)value); } else TRACELOG(LOG_WARNING, "GL: Anisotropic filtering not supported"); @@ -1409,7 +1370,7 @@ void rlTextureParameters(unsigned int id, int param, int value) glBindTexture(GL_TEXTURE_2D, 0); } -// Enable shader program usage +// Enable shader program void rlEnableShader(unsigned int id) { #if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) @@ -1417,7 +1378,7 @@ void rlEnableShader(unsigned int id) #endif } -// Disable shader program usage +// Disable shader program void rlDisableShader(void) { #if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) @@ -1460,13 +1421,13 @@ void rlEnableBackfaceCulling(void) { glEnable(GL_CULL_FACE); } void rlDisableBackfaceCulling(void) { glDisable(GL_CULL_FACE); } // Enable scissor test -RLAPI void rlEnableScissorTest(void) { glEnable(GL_SCISSOR_TEST); } +void rlEnableScissorTest(void) { glEnable(GL_SCISSOR_TEST); } // Disable scissor test -RLAPI void rlDisableScissorTest(void) { glDisable(GL_SCISSOR_TEST); } +void rlDisableScissorTest(void) { glDisable(GL_SCISSOR_TEST); } // Scissor test -RLAPI void rlScissor(int x, int y, int width, int height) { glScissor(x, y, width, height); } +void rlScissor(int x, int y, int width, int height) { glScissor(x, y, width, height); } // Enable wire mode void rlEnableWireMode(void) @@ -1502,7 +1463,7 @@ float rlGetLineWidth(void) // Enable line aliasing void rlEnableSmoothLines(void) { -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_21) || defined(GRAPHICS_API_OPENGL_11) +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_11) glEnable(GL_LINE_SMOOTH); #endif } @@ -1510,34 +1471,34 @@ void rlEnableSmoothLines(void) // Disable line aliasing void rlDisableSmoothLines(void) { -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_21) || defined(GRAPHICS_API_OPENGL_11) +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_11) glDisable(GL_LINE_SMOOTH); #endif } -// Unload framebuffer from GPU memory -// NOTE: All attached textures/cubemaps/renderbuffers are also deleted -void rlUnloadFramebuffer(unsigned int id) +// Enable stereo rendering +void rlEnableStereoRender(void) { -#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) && defined(SUPPORT_RENDER_TEXTURES_HINT) +#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) + RLGL.State.stereoRender = true; +#endif +} - // Query depth attachment to automatically delete texture/renderbuffer - int depthType = 0, depthId = 0; - glBindFramebuffer(GL_FRAMEBUFFER, id); // Bind framebuffer to query depth texture type - glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &depthType); - glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &depthId); +// Disable stereo rendering +void rlDisableStereoRender(void) +{ +#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) + RLGL.State.stereoRender = false; +#endif +} - unsigned int depthIdU = (unsigned int)depthId; - if (depthType == GL_RENDERBUFFER) glDeleteRenderbuffers(1, &depthIdU); - else if (depthType == GL_RENDERBUFFER) glDeleteTextures(1, &depthIdU); - - // NOTE: If a texture object is deleted while its image is attached to the *currently bound* framebuffer, - // the texture image is automatically detached from the currently bound framebuffer. - - glBindFramebuffer(GL_FRAMEBUFFER, 0); - glDeleteFramebuffers(1, &id); - - TRACELOG(LOG_INFO, "FBO: [ID %i] Unloaded framebuffer from VRAM (GPU)", id); +// Check if stereo render is enabled +bool rlIsStereoRenderEnabled(void) +{ +#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) + return RLGL.State.stereoRender; +#else + return false; #endif } @@ -1560,216 +1521,85 @@ void rlClearScreenBuffers(void) //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); // Stencil buffer not used... } -// Update GPU buffer with new data -void rlUpdateBuffer(int bufferId, void *data, int dataSize) +// Check and log OpenGL error codes +void rlCheckErrors() { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glBindBuffer(GL_ARRAY_BUFFER, bufferId); - glBufferSubData(GL_ARRAY_BUFFER, 0, dataSize, data); + int check = 1; + while (check) + { + const GLenum err = glGetError(); + switch (err) + { + case GL_NO_ERROR: check = 0; break; + case 0x0500: TRACELOG(LOG_WARNING, "GL: Error detected: GL_INVALID_ENUM"); break; + case 0x0501: TRACELOG(LOG_WARNING, "GL: Error detected: GL_INVALID_VALUE"); break; + case 0x0502: TRACELOG(LOG_WARNING, "GL: Error detected: GL_INVALID_OPERATION"); break; + case 0x0503: TRACELOG(LOG_WARNING, "GL: Error detected: GL_STACK_OVERFLOW"); break; + case 0x0504: TRACELOG(LOG_WARNING, "GL: Error detected: GL_STACK_UNDERFLOW"); break; + case 0x0505: TRACELOG(LOG_WARNING, "GL: Error detected: GL_OUT_OF_MEMORY"); break; + case 0x0506: TRACELOG(LOG_WARNING, "GL: Error detected: GL_INVALID_FRAMEBUFFER_OPERATION"); break; + default: TRACELOG(LOG_WARNING, "GL: Error detected: Unknown error code: %x", err); break; + } + } +#endif +} + +// Set blend mode +void rlSetBlendMode(int mode) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + if (RLGL.State.currentBlendMode != mode) + { + rlDrawRenderBatch(RLGL.currentBatch); + + switch (mode) + { + case BLEND_ALPHA: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendEquation(GL_FUNC_ADD); break; + case BLEND_ADDITIVE: glBlendFunc(GL_SRC_ALPHA, GL_ONE); glBlendEquation(GL_FUNC_ADD); break; + case BLEND_MULTIPLIED: glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA); glBlendEquation(GL_FUNC_ADD); break; + case BLEND_ADD_COLORS: glBlendFunc(GL_ONE, GL_ONE); glBlendEquation(GL_FUNC_ADD); break; + case BLEND_SUBTRACT_COLORS: glBlendFunc(GL_ONE, GL_ONE); glBlendEquation(GL_FUNC_SUBTRACT); break; + case BLEND_CUSTOM: glBlendFunc(RLGL.State.glBlendSrcFactor, RLGL.State.glBlendDstFactor); glBlendEquation(RLGL.State.glBlendEquation); break; + default: break; + } + + RLGL.State.currentBlendMode = mode; + } +#endif +} + +// Set blending mode factor and equation +void rlSetBlendFactors(int glSrcFactor, int glDstFactor, int glEquation) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + RLGL.State.glBlendSrcFactor = glSrcFactor; + RLGL.State.glBlendDstFactor = glDstFactor; + RLGL.State.glBlendEquation = glEquation; #endif } //---------------------------------------------------------------------------------- -// Module Functions Definition - rlgl Functions +// Module Functions Definition - rlgl functionality //---------------------------------------------------------------------------------- // Initialize rlgl: OpenGL extensions, default buffers/shaders/textures, OpenGL states void rlglInit(int width, int height) { - // Check OpenGL information and capabilities - //------------------------------------------------------------------------------ - // Print current OpenGL and GLSL version - TRACELOG(LOG_INFO, "GL: OpenGL device information:"); - TRACELOG(LOG_INFO, " > Vendor: %s", glGetString(GL_VENDOR)); - TRACELOG(LOG_INFO, " > Renderer: %s", glGetString(GL_RENDERER)); - TRACELOG(LOG_INFO, " > Version: %s", glGetString(GL_VERSION)); - TRACELOG(LOG_INFO, " > GLSL: %s", glGetString(GL_SHADING_LANGUAGE_VERSION)); - - // NOTE: We can get a bunch of extra information about GPU capabilities (glGet*) - //int maxTexSize; - //glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTexSize); - //TRACELOG(LOG_INFO, "GL: Maximum texture size: %i", maxTexSize); - - //GL_MAX_TEXTURE_IMAGE_UNITS - //GL_MAX_VIEWPORT_DIMS - - //int numAuxBuffers; - //glGetIntegerv(GL_AUX_BUFFERS, &numAuxBuffers); - //TRACELOG(LOG_INFO, "GL: Number of aixiliar buffers: %i", numAuxBuffers); - - //GLint numComp = 0; - //GLint format[32] = { 0 }; - //glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numComp); - //glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, format); - //for (int i = 0; i < numComp; i++) TRACELOG(LOG_INFO, "GL: Supported compressed format: 0x%x", format[i]); - - // NOTE: We don't need that much data on screen... right now... - - // TODO: Automatize extensions loading using rlLoadExtensions() and GLAD - // Actually, when rlglInit() is called in InitWindow() in core.c, - // OpenGL context has already been created and required extensions loaded - #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Get supported extensions list - GLint numExt = 0; - -#if defined(GRAPHICS_API_OPENGL_33) && !defined(GRAPHICS_API_OPENGL_21) - // NOTE: On OpenGL 3.3 VAO and NPOT are supported by default - RLGL.ExtSupported.vao = true; - - // Multiple texture extensions supported by default - RLGL.ExtSupported.texNPOT = true; - RLGL.ExtSupported.texFloat32 = true; - RLGL.ExtSupported.texDepth = true; - - // We get a list of available extensions and we check for some of them (compressed textures) - // NOTE: We don't need to check again supported extensions but we do (GLAD already dealt with that) - glGetIntegerv(GL_NUM_EXTENSIONS, &numExt); - - // Allocate numExt strings pointers - char **extList = RL_MALLOC(sizeof(char *)*numExt); - - // Get extensions strings - for (int i = 0; i < numExt; i++) extList[i] = (char *)glGetStringi(GL_EXTENSIONS, i); - -#endif -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) - // Allocate 512 strings pointers (2 KB) - const char **extList = RL_MALLOC(512*sizeof(const char *)); - - const char *extensions = (const char *)glGetString(GL_EXTENSIONS); // One big const string - - // NOTE: We have to duplicate string because glGetString() returns a const string - int len = strlen(extensions) + 1; - char *extensionsDup = (char *)RL_CALLOC(len, sizeof(char)); - strcpy(extensionsDup, extensions); - - extList[numExt] = extensionsDup; - - for (int i = 0; i < len; i++) - { - if (extensionsDup[i] == ' ') - { - extensionsDup[i] = '\0'; - - numExt++; - extList[numExt] = &extensionsDup[i + 1]; - } - } - - // NOTE: Duplicated string (extensionsDup) must be deallocated -#endif - - TRACELOG(LOG_INFO, "GL: Supported extensions count: %i", numExt); - - // Show supported extensions - //for (int i = 0; i < numExt; i++) TRACELOG(LOG_INFO, "Supported extension: %s", extList[i]); - - // Check required extensions - for (int i = 0; i < numExt; i++) - { -#if defined(GRAPHICS_API_OPENGL_ES2) - // Check VAO support - // NOTE: Only check on OpenGL ES, OpenGL 3.3 has VAO support as core feature - if (strcmp(extList[i], (const char *)"GL_OES_vertex_array_object") == 0) - { - // The extension is supported by our hardware and driver, try to get related functions pointers - // NOTE: emscripten does not support VAOs natively, it uses emulation and it reduces overall performance... - glGenVertexArrays = (PFNGLGENVERTEXARRAYSOESPROC)eglGetProcAddress("glGenVertexArraysOES"); - glBindVertexArray = (PFNGLBINDVERTEXARRAYOESPROC)eglGetProcAddress("glBindVertexArrayOES"); - glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSOESPROC)eglGetProcAddress("glDeleteVertexArraysOES"); - //glIsVertexArray = (PFNGLISVERTEXARRAYOESPROC)eglGetProcAddress("glIsVertexArrayOES"); // NOTE: Fails in WebGL, omitted - - if ((glGenVertexArrays != NULL) && (glBindVertexArray != NULL) && (glDeleteVertexArrays != NULL)) RLGL.ExtSupported.vao = true; - } - - // Check NPOT textures support - // NOTE: Only check on OpenGL ES, OpenGL 3.3 has NPOT textures full support as core feature - if (strcmp(extList[i], (const char *)"GL_OES_texture_npot") == 0) RLGL.ExtSupported.texNPOT = true; - - // Check texture float support - if (strcmp(extList[i], (const char *)"GL_OES_texture_float") == 0) RLGL.ExtSupported.texFloat32 = true; - - // Check depth texture support - if ((strcmp(extList[i], (const char *)"GL_OES_depth_texture") == 0) || - (strcmp(extList[i], (const char *)"GL_WEBGL_depth_texture") == 0)) RLGL.ExtSupported.texDepth = true; - - if (strcmp(extList[i], (const char *)"GL_OES_depth24") == 0) RLGL.ExtSupported.maxDepthBits = 24; - if (strcmp(extList[i], (const char *)"GL_OES_depth32") == 0) RLGL.ExtSupported.maxDepthBits = 32; -#endif - // DDS texture compression support - if ((strcmp(extList[i], (const char *)"GL_EXT_texture_compression_s3tc") == 0) || - (strcmp(extList[i], (const char *)"GL_WEBGL_compressed_texture_s3tc") == 0) || - (strcmp(extList[i], (const char *)"GL_WEBKIT_WEBGL_compressed_texture_s3tc") == 0)) RLGL.ExtSupported.texCompDXT = true; - - // ETC1 texture compression support - if ((strcmp(extList[i], (const char *)"GL_OES_compressed_ETC1_RGB8_texture") == 0) || - (strcmp(extList[i], (const char *)"GL_WEBGL_compressed_texture_etc1") == 0)) RLGL.ExtSupported.texCompETC1 = true; - - // ETC2/EAC texture compression support - if (strcmp(extList[i], (const char *)"GL_ARB_ES3_compatibility") == 0) RLGL.ExtSupported.texCompETC2 = true; - - // PVR texture compression support - if (strcmp(extList[i], (const char *)"GL_IMG_texture_compression_pvrtc") == 0) RLGL.ExtSupported.texCompPVRT = true; - - // ASTC texture compression support - if (strcmp(extList[i], (const char *)"GL_KHR_texture_compression_astc_hdr") == 0) RLGL.ExtSupported.texCompASTC = true; - - // Anisotropic texture filter support - if (strcmp(extList[i], (const char *)"GL_EXT_texture_filter_anisotropic") == 0) - { - RLGL.ExtSupported.texAnisoFilter = true; - glGetFloatv(0x84FF, &RLGL.ExtSupported.maxAnisotropicLevel); // GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT - } - - // Clamp mirror wrap mode supported - if (strcmp(extList[i], (const char *)"GL_EXT_texture_mirror_clamp") == 0) RLGL.ExtSupported.texMirrorClamp = true; - - // Debug marker support - if (strcmp(extList[i], (const char *)"GL_EXT_debug_marker") == 0) RLGL.ExtSupported.debugMarker = true; - } - - // Free extensions pointers - RL_FREE(extList); - -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) - RL_FREE(extensionsDup); // Duplicated string must be deallocated -#endif - -#if defined(GRAPHICS_API_OPENGL_ES2) - if (RLGL.ExtSupported.vao) TRACELOG(LOG_INFO, "GL: VAO extension detected, VAO functions initialized successfully"); - else TRACELOG(LOG_WARNING, "GL: VAO extension not found, VAO usage not supported"); - - if (RLGL.ExtSupported.texNPOT) TRACELOG(LOG_INFO, "GL: NPOT textures extension detected, full NPOT textures supported"); - else TRACELOG(LOG_WARNING, "GL: NPOT textures extension not found, limited NPOT support (no-mipmaps, no-repeat)"); -#endif - - if (RLGL.ExtSupported.texCompDXT) TRACELOG(LOG_INFO, "GL: DXT compressed textures supported"); - if (RLGL.ExtSupported.texCompETC1) TRACELOG(LOG_INFO, "GL: ETC1 compressed textures supported"); - if (RLGL.ExtSupported.texCompETC2) TRACELOG(LOG_INFO, "GL: ETC2/EAC compressed textures supported"); - if (RLGL.ExtSupported.texCompPVRT) TRACELOG(LOG_INFO, "GL: PVRT compressed textures supported"); - if (RLGL.ExtSupported.texCompASTC) TRACELOG(LOG_INFO, "GL: ASTC compressed textures supported"); - - if (RLGL.ExtSupported.texAnisoFilter) TRACELOG(LOG_INFO, "GL: Anisotropic textures filtering supported (max: %.0fX)", RLGL.ExtSupported.maxAnisotropicLevel); - if (RLGL.ExtSupported.texMirrorClamp) TRACELOG(LOG_INFO, "GL: Mirror clamp wrap texture mode supported"); - - if (RLGL.ExtSupported.debugMarker) TRACELOG(LOG_INFO, "GL: Debug Marker supported"); - - // Initialize buffers, default shaders and default textures - //---------------------------------------------------------- // Init default white texture unsigned char pixels[4] = { 255, 255, 255, 255 }; // 1 pixel RGBA (4 bytes) - RLGL.State.defaultTextureId = rlLoadTexture(pixels, 1, 1, UNCOMPRESSED_R8G8B8A8, 1); + RLGL.State.defaultTextureId = rlLoadTexture(pixels, 1, 1, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, 1); if (RLGL.State.defaultTextureId != 0) TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Default texture loaded successfully", RLGL.State.defaultTextureId); else TRACELOG(LOG_WARNING, "TEXTURE: Failed to load default texture"); // Init default Shader (customized for GL 3.3 and ES2) - RLGL.State.defaultShader = LoadShaderDefault(); + rlLoadShaderDefault(); // RLGL.State.defaultShader RLGL.State.currentShader = RLGL.State.defaultShader; // Init default vertex arrays buffers - RLGL.defaultBatch = LoadRenderBatch(DEFAULT_BATCH_BUFFERS, DEFAULT_BATCH_BUFFER_ELEMENTS); + RLGL.defaultBatch = rlLoadRenderBatch(DEFAULT_BATCH_BUFFERS, DEFAULT_BATCH_BUFFER_ELEMENTS); RLGL.currentBatch = &RLGL.defaultBatch; // Init stack matrices (emulating OpenGL 1.1) @@ -1780,8 +1610,7 @@ void rlglInit(int width, int height) RLGL.State.projection = MatrixIdentity(); RLGL.State.modelview = MatrixIdentity(); RLGL.State.currentMatrix = &RLGL.State.modelview; - -#endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2 +#endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2 // Initialize OpenGL default states //---------------------------------------------------------- @@ -1815,11 +1644,8 @@ void rlglInit(int width, int height) RLGL.State.framebufferWidth = width; RLGL.State.framebufferHeight = height; - // Init texture and rectangle used on basic shapes drawing - RLGL.State.shapesTexture = GetTextureDefault(); - RLGL.State.shapesTextureRec = (Rectangle){ 0.0f, 0.0f, 1.0f, 1.0f }; - - TRACELOG(LOG_INFO, "RLGL: Default state initialized successfully"); + TRACELOG(LOG_INFO, "RLGL: Default OpenGL state initialized successfully"); + //---------------------------------------------------------- #endif // Init state: Color/Depth buffers clear @@ -1832,68 +1658,247 @@ void rlglInit(int width, int height) void rlglClose(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - UnloadRenderBatch(RLGL.defaultBatch); + rlUnloadRenderBatch(RLGL.defaultBatch); + + rlUnloadShaderDefault(); // Unload default shader - UnloadShaderDefault(); // Unload default shader glDeleteTextures(1, &RLGL.State.defaultTextureId); // Unload default texture - - TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Unloaded default texture data from VRAM (GPU)", RLGL.State.defaultTextureId); + TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Default texture unloaded successfully", RLGL.State.defaultTextureId); #endif } -// Update and draw internal buffers -void rlglDraw(void) +// Load OpenGL extensions +// NOTE: External loader function must be provided +void rlLoadExtensions(void *loader) { -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - DrawRenderBatch(RLGL.currentBatch); // NOTE: Stereo rendering is checked inside -#endif -} +#if defined(GRAPHICS_API_OPENGL_33) // Also defined for GRAPHICS_API_OPENGL_21 + // NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions (and lower versions) + #if !defined(__APPLE__) + if (!gladLoadGLLoader((GLADloadproc)loader)) TRACELOG(LOG_WARNING, "GLAD: Cannot load OpenGL extensions"); + else TRACELOG(LOG_INFO, "GLAD: OpenGL extensions loaded successfully"); + #endif -// Check and log OpenGL error codes -void rlCheckErrors() { -#if defined(GRAPHICS_API_OPENGL_21) || defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - int check = 1; - while (check) { - const GLenum err = glGetError(); - switch (err) { - case GL_NO_ERROR: - check = 0; - break; - case 0x0500: // GL_INVALID_ENUM: - TRACELOG(LOG_WARNING, "GL: Error detected: GL_INVALID_ENUM"); - break; - case 0x0501: //GL_INVALID_VALUE: - TRACELOG(LOG_WARNING, "GL: Error detected: GL_INVALID_VALUE"); - break; - case 0x0502: //GL_INVALID_OPERATION: - TRACELOG(LOG_WARNING, "GL: Error detected: GL_INVALID_OPERATION"); - break; - case 0x0503: // GL_STACK_OVERFLOW: - TRACELOG(LOG_WARNING, "GL: Error detected: GL_STACK_OVERFLOW"); - break; - case 0x0504: // GL_STACK_UNDERFLOW: - TRACELOG(LOG_WARNING, "GL: Error detected: GL_STACK_UNDERFLOW"); - break; - case 0x0505: // GL_OUT_OF_MEMORY: - TRACELOG(LOG_WARNING, "GL: Error detected: GL_OUT_OF_MEMORY"); - break; - case 0x0506: // GL_INVALID_FRAMEBUFFER_OPERATION: - TRACELOG(LOG_WARNING, "GL: Error detected: GL_INVALID_FRAMEBUFFER_OPERATION"); - break; - default: - TRACELOG(LOG_WARNING, "GL: Error detected: unknown error code %x", err); - break; + // Get number of supported extensions + GLint numExt = 0; + glGetIntegerv(GL_NUM_EXTENSIONS, &numExt); + TRACELOG(LOG_INFO, "GL: Supported extensions count: %i", numExt); + +#if defined(SUPPORT_GL_DETAILS_INFO) + // Get supported extensions list + // WARNING: glGetStringi() not available on OpenGL 2.1 + char **extList = RL_MALLOC(numExt*sizeof(char *)); + TRACELOG(LOG_INFO, "GL: OpenGL extensions:"); + for (int i = 0; i < numExt; i++) + { + extList[i] = (char *)glGetStringi(GL_EXTENSIONS, i); + TRACELOG(LOG_INFO, " %s", extList[i]); + } + RL_FREE(extList); // Free extensions pointers +#endif + + // Register supported extensions flags + // OpenGL 3.3 extensions supported by default (core) + RLGL.ExtSupported.vao = true; + RLGL.ExtSupported.instancing = true; + RLGL.ExtSupported.texNPOT = true; + RLGL.ExtSupported.texFloat32 = true; + RLGL.ExtSupported.texDepth = true; + RLGL.ExtSupported.maxDepthBits = 32; + RLGL.ExtSupported.texAnisoFilter = true; + RLGL.ExtSupported.texMirrorClamp = true; + #if !defined(__APPLE__) + // NOTE: With GLAD, we can check if an extension is supported using the GLAD_GL_xxx booleans + if (GLAD_GL_EXT_texture_compression_s3tc) RLGL.ExtSupported.texCompDXT = true; // Texture compression: DXT + if (GLAD_GL_ARB_ES3_compatibility) RLGL.ExtSupported.texCompETC2 = true; // Texture compression: ETC2/EAC + #endif +#endif // GRAPHICS_API_OPENGL_33 + +#if defined(GRAPHICS_API_OPENGL_ES2) + // Get supported extensions list + GLint numExt = 0; + const char **extList = RL_MALLOC(512*sizeof(const char *)); // Allocate 512 strings pointers (2 KB) + const char *extensions = (const char *)glGetString(GL_EXTENSIONS); // One big const string + + // NOTE: We have to duplicate string because glGetString() returns a const string + int len = strlen(extensions) + 1; + char *extensionsDup = (char *)RL_CALLOC(len, sizeof(char)); + strcpy(extensionsDup, extensions); + extList[numExt] = extensionsDup; + + for (int i = 0; i < len; i++) + { + if (extensionsDup[i] == ' ') + { + extensionsDup[i] = '\0'; + numExt++; + extList[numExt] = &extensionsDup[i + 1]; } } + + TRACELOG(LOG_INFO, "GL: Supported extensions count: %i", numExt); + +#if defined(SUPPORT_GL_DETAILS_INFO) + TRACELOG(LOG_INFO, "GL: OpenGL extensions:"); + for (int i = 0; i < numExt; i++) TRACELOG(LOG_INFO, " %s", extList[i]); #endif + + // Check required extensions + for (int i = 0; i < numExt; i++) + { + // Check VAO support + // NOTE: Only check on OpenGL ES, OpenGL 3.3 has VAO support as core feature + if (strcmp(extList[i], (const char *)"GL_OES_vertex_array_object") == 0) + { + // The extension is supported by our hardware and driver, try to get related functions pointers + // NOTE: emscripten does not support VAOs natively, it uses emulation and it reduces overall performance... + glGenVertexArrays = (PFNGLGENVERTEXARRAYSOESPROC)((rlglLoadProc)loader)("glGenVertexArraysOES"); + glBindVertexArray = (PFNGLBINDVERTEXARRAYOESPROC)((rlglLoadProc)loader)("glBindVertexArrayOES"); + glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSOESPROC)((rlglLoadProc)loader)("glDeleteVertexArraysOES"); + //glIsVertexArray = (PFNGLISVERTEXARRAYOESPROC)loader("glIsVertexArrayOES"); // NOTE: Fails in WebGL, omitted + + if ((glGenVertexArrays != NULL) && (glBindVertexArray != NULL) && (glDeleteVertexArrays != NULL)) RLGL.ExtSupported.vao = true; + } + + // Check instanced rendering support + if (strcmp(extList[i], (const char *)"GL_ANGLE_instanced_arrays") == 0) // Web ANGLE + { + glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawArraysInstancedANGLE"); + glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawElementsInstancedANGLE"); + glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISOREXTPROC)((rlglLoadProc)loader)("glVertexAttribDivisorANGLE"); + + if ((glDrawArraysInstanced != NULL) && (glDrawElementsInstanced != NULL) && (glVertexAttribDivisor != NULL)) RLGL.ExtSupported.instancing = true; + } + else + { + if ((strcmp(extList[i], (const char *)"GL_EXT_draw_instanced") == 0) && // Standard EXT + (strcmp(extList[i], (const char *)"GL_EXT_instanced_arrays") == 0)) + { + glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawArraysInstancedEXT"); + glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawElementsInstancedEXT"); + glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISOREXTPROC)((rlglLoadProc)loader)("glVertexAttribDivisorEXT"); + + if ((glDrawArraysInstanced != NULL) && (glDrawElementsInstanced != NULL) && (glVertexAttribDivisor != NULL)) RLGL.ExtSupported.instancing = true; + } + } + + // Check NPOT textures support + // NOTE: Only check on OpenGL ES, OpenGL 3.3 has NPOT textures full support as core feature + if (strcmp(extList[i], (const char *)"GL_OES_texture_npot") == 0) RLGL.ExtSupported.texNPOT = true; + + // Check texture float support + if (strcmp(extList[i], (const char *)"GL_OES_texture_float") == 0) RLGL.ExtSupported.texFloat32 = true; + + // Check depth texture support + if ((strcmp(extList[i], (const char *)"GL_OES_depth_texture") == 0) || + (strcmp(extList[i], (const char *)"GL_WEBGL_depth_texture") == 0)) RLGL.ExtSupported.texDepth = true; + + if (strcmp(extList[i], (const char *)"GL_OES_depth24") == 0) RLGL.ExtSupported.maxDepthBits = 24; + if (strcmp(extList[i], (const char *)"GL_OES_depth32") == 0) RLGL.ExtSupported.maxDepthBits = 32; + + // Check texture compression support: DXT + if ((strcmp(extList[i], (const char *)"GL_EXT_texture_compression_s3tc") == 0) || + (strcmp(extList[i], (const char *)"GL_WEBGL_compressed_texture_s3tc") == 0) || + (strcmp(extList[i], (const char *)"GL_WEBKIT_WEBGL_compressed_texture_s3tc") == 0)) RLGL.ExtSupported.texCompDXT = true; + + // Check texture compression support: ETC1 + if ((strcmp(extList[i], (const char *)"GL_OES_compressed_ETC1_RGB8_texture") == 0) || + (strcmp(extList[i], (const char *)"GL_WEBGL_compressed_texture_etc1") == 0)) RLGL.ExtSupported.texCompETC1 = true; + + // Check texture compression support: ETC2/EAC + if (strcmp(extList[i], (const char *)"GL_ARB_ES3_compatibility") == 0) RLGL.ExtSupported.texCompETC2 = true; + + // Check texture compression support: PVR + if (strcmp(extList[i], (const char *)"GL_IMG_texture_compression_pvrtc") == 0) RLGL.ExtSupported.texCompPVRT = true; + + // Check texture compression support: ASTC + if (strcmp(extList[i], (const char *)"GL_KHR_texture_compression_astc_hdr") == 0) RLGL.ExtSupported.texCompASTC = true; + + // Check anisotropic texture filter support + if (strcmp(extList[i], (const char *)"GL_EXT_texture_filter_anisotropic") == 0) RLGL.ExtSupported.texAnisoFilter = true; + + // Check clamp mirror wrap mode support + if (strcmp(extList[i], (const char *)"GL_EXT_texture_mirror_clamp") == 0) RLGL.ExtSupported.texMirrorClamp = true; + } + + // Free extensions pointers + RL_FREE(extList); + RL_FREE(extensionsDup); // Duplicated string must be deallocated +#endif // GRAPHICS_API_OPENGL_ES2 + + // Check OpenGL information and capabilities + //------------------------------------------------------------------------------ + // Show current OpenGL and GLSL version + TRACELOG(LOG_INFO, "GL: OpenGL device information:"); + TRACELOG(LOG_INFO, " > Vendor: %s", glGetString(GL_VENDOR)); + TRACELOG(LOG_INFO, " > Renderer: %s", glGetString(GL_RENDERER)); + TRACELOG(LOG_INFO, " > Version: %s", glGetString(GL_VERSION)); + TRACELOG(LOG_INFO, " > GLSL: %s", glGetString(GL_SHADING_LANGUAGE_VERSION)); + +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + // NOTE: Anisotropy levels capability is an extension + #ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT + #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF + #endif + glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &RLGL.ExtSupported.maxAnisotropyLevel); + +#if defined(SUPPORT_GL_DETAILS_INFO) + // Show some OpenGL GPU capabilities + TRACELOG(LOG_INFO, "GL: OpenGL capabilities:"); + GLint capability = 0; + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &capability); + TRACELOG(LOG_INFO, " GL_MAX_TEXTURE_SIZE: %i", capability); + glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &capability); + TRACELOG(LOG_INFO, " GL_MAX_CUBE_MAP_TEXTURE_SIZE: %i", capability); + glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &capability); + TRACELOG(LOG_INFO, " GL_MAX_TEXTURE_IMAGE_UNITS: %i", capability); + glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &capability); + TRACELOG(LOG_INFO, " GL_MAX_VERTEX_ATTRIBS: %i", capability); + #if !defined(GRAPHICS_API_OPENGL_ES2) + glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &capability); + TRACELOG(LOG_INFO, " GL_MAX_UNIFORM_BLOCK_SIZE: %i", capability); + glGetIntegerv(GL_MAX_DRAW_BUFFERS, &capability); + TRACELOG(LOG_INFO, " GL_MAX_DRAW_BUFFERS: %i", capability); + if (RLGL.ExtSupported.texAnisoFilter) TRACELOG(LOG_INFO, " GL_MAX_TEXTURE_MAX_ANISOTROPY: %.0f", RLGL.ExtSupported.maxAnisotropyLevel); + #endif + glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &capability); + TRACELOG(LOG_INFO, " GL_NUM_COMPRESSED_TEXTURE_FORMATS: %i", capability); + GLint format[32] = { 0 }; + glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, format); + for (int i = 0; i < capability; i++) TRACELOG(LOG_INFO, " %s", rlGetCompressedFormatName(format[i])); + + /* + // Following capabilities are only supported by OpenGL 4.3 or greater + glGetIntegerv(GL_MAX_VERTEX_ATTRIB_BINDINGS, &capability); + TRACELOG(LOG_INFO, " GL_MAX_VERTEX_ATTRIB_BINDINGS: %i", capability); + glGetIntegerv(GL_MAX_UNIFORM_LOCATIONS, &capability); + TRACELOG(LOG_INFO, " GL_MAX_UNIFORM_LOCATIONS: %i", capability); + */ +#else // SUPPORT_GL_DETAILS_INFO + + // Show some basic info about GL supported features + #if defined(GRAPHICS_API_OPENGL_ES2) + if (RLGL.ExtSupported.vao) TRACELOG(LOG_INFO, "GL: VAO extension detected, VAO functions loaded successfully"); + else TRACELOG(LOG_WARNING, "GL: VAO extension not found, VAO not supported"); + if (RLGL.ExtSupported.texNPOT) TRACELOG(LOG_INFO, "GL: NPOT textures extension detected, full NPOT textures supported"); + else TRACELOG(LOG_WARNING, "GL: NPOT textures extension not found, limited NPOT support (no-mipmaps, no-repeat)"); + #endif + if (RLGL.ExtSupported.texCompDXT) TRACELOG(LOG_INFO, "GL: DXT compressed textures supported"); + if (RLGL.ExtSupported.texCompETC1) TRACELOG(LOG_INFO, "GL: ETC1 compressed textures supported"); + if (RLGL.ExtSupported.texCompETC2) TRACELOG(LOG_INFO, "GL: ETC2/EAC compressed textures supported"); + if (RLGL.ExtSupported.texCompPVRT) TRACELOG(LOG_INFO, "GL: PVRT compressed textures supported"); + if (RLGL.ExtSupported.texCompASTC) TRACELOG(LOG_INFO, "GL: ASTC compressed textures supported"); +#endif // SUPPORT_GL_DETAILS_INFO + +#endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2 } -// Returns current OpenGL version +// Get current OpenGL version int rlGetVersion(void) { #if defined(GRAPHICS_API_OPENGL_11) return OPENGL_11; -#elif defined(GRAPHICS_API_OPENGL_21) +#endif +#if defined(GRAPHICS_API_OPENGL_21) #if defined(__APPLE__) return OPENGL_33; // NOTE: Force OpenGL 3.3 on OSX #else @@ -1901,62 +1906,454 @@ int rlGetVersion(void) #endif #elif defined(GRAPHICS_API_OPENGL_33) return OPENGL_33; -#elif defined(GRAPHICS_API_OPENGL_ES2) +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) return OPENGL_ES_20; #endif } +// Get default framebuffer width +int rlGetFramebufferWidth(void) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + return RLGL.State.framebufferWidth; +#else + return 0; +#endif +} + +// Get default framebuffer height +int rlGetFramebufferHeight(void) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + return RLGL.State.framebufferHeight; +#else + return 0; +#endif +} + +// Get default internal shader (simple texture + tint color) +Shader rlGetShaderDefault(void) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + return RLGL.State.defaultShader; +#else + Shader shader = { 0 }; + return shader; +#endif +} + +// Get default internal texture (white texture) +Texture2D rlGetTextureDefault(void) +{ + Texture2D texture = { 0 }; +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + texture.id = RLGL.State.defaultTextureId; + texture.width = 1; + texture.height = 1; + texture.mipmaps = 1; + texture.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; +#endif + return texture; +} + +// Render batch management +//------------------------------------------------------------------------------------------------ +// Load render batch +RenderBatch rlLoadRenderBatch(int numBuffers, int bufferElements) +{ + RenderBatch batch = { 0 }; + +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + // Initialize CPU (RAM) vertex buffers (position, texcoord, color data and indexes) + //-------------------------------------------------------------------------------------------- + batch.vertexBuffer = (VertexBuffer *)RL_MALLOC(numBuffers*sizeof(VertexBuffer)); + + for (int i = 0; i < numBuffers; i++) + { + batch.vertexBuffer[i].elementsCount = bufferElements; + + batch.vertexBuffer[i].vertices = (float *)RL_MALLOC(bufferElements*3*4*sizeof(float)); // 3 float by vertex, 4 vertex by quad + batch.vertexBuffer[i].texcoords = (float *)RL_MALLOC(bufferElements*2*4*sizeof(float)); // 2 float by texcoord, 4 texcoord by quad + batch.vertexBuffer[i].colors = (unsigned char *)RL_MALLOC(bufferElements*4*4*sizeof(unsigned char)); // 4 float by color, 4 colors by quad +#if defined(GRAPHICS_API_OPENGL_33) + batch.vertexBuffer[i].indices = (unsigned int *)RL_MALLOC(bufferElements*6*sizeof(unsigned int)); // 6 int by quad (indices) +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) + batch.vertexBuffer[i].indices = (unsigned short *)RL_MALLOC(bufferElements*6*sizeof(unsigned short)); // 6 int by quad (indices) +#endif + + for (int j = 0; j < (3*4*bufferElements); j++) batch.vertexBuffer[i].vertices[j] = 0.0f; + for (int j = 0; j < (2*4*bufferElements); j++) batch.vertexBuffer[i].texcoords[j] = 0.0f; + for (int j = 0; j < (4*4*bufferElements); j++) batch.vertexBuffer[i].colors[j] = 0; + + int k = 0; + + // Indices can be initialized right now + for (int j = 0; j < (6*bufferElements); j += 6) + { + batch.vertexBuffer[i].indices[j] = 4*k; + batch.vertexBuffer[i].indices[j + 1] = 4*k + 1; + batch.vertexBuffer[i].indices[j + 2] = 4*k + 2; + batch.vertexBuffer[i].indices[j + 3] = 4*k; + batch.vertexBuffer[i].indices[j + 4] = 4*k + 2; + batch.vertexBuffer[i].indices[j + 5] = 4*k + 3; + + k++; + } + + batch.vertexBuffer[i].vCounter = 0; + batch.vertexBuffer[i].tcCounter = 0; + batch.vertexBuffer[i].cCounter = 0; + } + + TRACELOG(LOG_INFO, "RLGL: Render batch vertex buffers loaded successfully in RAM (CPU)"); + //-------------------------------------------------------------------------------------------- + + // Upload to GPU (VRAM) vertex data and initialize VAOs/VBOs + //-------------------------------------------------------------------------------------------- + for (int i = 0; i < numBuffers; i++) + { + if (RLGL.ExtSupported.vao) + { + // Initialize Quads VAO + glGenVertexArrays(1, &batch.vertexBuffer[i].vaoId); + glBindVertexArray(batch.vertexBuffer[i].vaoId); + } + + // Quads - Vertex buffers binding and attributes enable + // Vertex position buffer (shader-location = 0) + glGenBuffers(1, &batch.vertexBuffer[i].vboId[0]); + glBindBuffer(GL_ARRAY_BUFFER, batch.vertexBuffer[i].vboId[0]); + glBufferData(GL_ARRAY_BUFFER, bufferElements*3*4*sizeof(float), batch.vertexBuffer[i].vertices, GL_DYNAMIC_DRAW); + glEnableVertexAttribArray(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_POSITION]); + glVertexAttribPointer(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_POSITION], 3, GL_FLOAT, 0, 0, 0); + + // Vertex texcoord buffer (shader-location = 1) + glGenBuffers(1, &batch.vertexBuffer[i].vboId[1]); + glBindBuffer(GL_ARRAY_BUFFER, batch.vertexBuffer[i].vboId[1]); + glBufferData(GL_ARRAY_BUFFER, bufferElements*2*4*sizeof(float), batch.vertexBuffer[i].texcoords, GL_DYNAMIC_DRAW); + glEnableVertexAttribArray(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_TEXCOORD01]); + glVertexAttribPointer(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_TEXCOORD01], 2, GL_FLOAT, 0, 0, 0); + + // Vertex color buffer (shader-location = 3) + glGenBuffers(1, &batch.vertexBuffer[i].vboId[2]); + glBindBuffer(GL_ARRAY_BUFFER, batch.vertexBuffer[i].vboId[2]); + glBufferData(GL_ARRAY_BUFFER, bufferElements*4*4*sizeof(unsigned char), batch.vertexBuffer[i].colors, GL_DYNAMIC_DRAW); + glEnableVertexAttribArray(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_COLOR]); + glVertexAttribPointer(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_COLOR], 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); + + // Fill index buffer + glGenBuffers(1, &batch.vertexBuffer[i].vboId[3]); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, batch.vertexBuffer[i].vboId[3]); +#if defined(GRAPHICS_API_OPENGL_33) + glBufferData(GL_ELEMENT_ARRAY_BUFFER, bufferElements*6*sizeof(int), batch.vertexBuffer[i].indices, GL_STATIC_DRAW); +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) + glBufferData(GL_ELEMENT_ARRAY_BUFFER, bufferElements*6*sizeof(short), batch.vertexBuffer[i].indices, GL_STATIC_DRAW); +#endif + } + + TRACELOG(LOG_INFO, "RLGL: Render batch vertex buffers loaded successfully in VRAM (GPU)"); + + // Unbind the current VAO + if (RLGL.ExtSupported.vao) glBindVertexArray(0); + //-------------------------------------------------------------------------------------------- + + // Init draw calls tracking system + //-------------------------------------------------------------------------------------------- + batch.draws = (DrawCall *)RL_MALLOC(DEFAULT_BATCH_DRAWCALLS*sizeof(DrawCall)); + + for (int i = 0; i < DEFAULT_BATCH_DRAWCALLS; i++) + { + batch.draws[i].mode = RL_QUADS; + batch.draws[i].vertexCount = 0; + batch.draws[i].vertexAlignment = 0; + //batch.draws[i].vaoId = 0; + //batch.draws[i].shaderId = 0; + batch.draws[i].textureId = RLGL.State.defaultTextureId; + //batch.draws[i].RLGL.State.projection = MatrixIdentity(); + //batch.draws[i].RLGL.State.modelview = MatrixIdentity(); + } + + batch.buffersCount = numBuffers; // Record buffer count + batch.drawsCounter = 1; // Reset draws counter + batch.currentDepth = -1.0f; // Reset depth value + //-------------------------------------------------------------------------------------------- +#endif + + return batch; +} + +// Unload default internal buffers vertex data from CPU and GPU +void rlUnloadRenderBatch(RenderBatch batch) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + // Unbind everything + if (RLGL.ExtSupported.vao) glBindVertexArray(0); + glDisableVertexAttribArray(0); + glDisableVertexAttribArray(1); + glDisableVertexAttribArray(2); + glDisableVertexAttribArray(3); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + + // Unload all vertex buffers data + for (int i = 0; i < batch.buffersCount; i++) + { + // Delete VBOs from GPU (VRAM) + glDeleteBuffers(1, &batch.vertexBuffer[i].vboId[0]); + glDeleteBuffers(1, &batch.vertexBuffer[i].vboId[1]); + glDeleteBuffers(1, &batch.vertexBuffer[i].vboId[2]); + glDeleteBuffers(1, &batch.vertexBuffer[i].vboId[3]); + + // Delete VAOs from GPU (VRAM) + if (RLGL.ExtSupported.vao) glDeleteVertexArrays(1, &batch.vertexBuffer[i].vaoId); + + // Free vertex arrays memory from CPU (RAM) + RL_FREE(batch.vertexBuffer[i].vertices); + RL_FREE(batch.vertexBuffer[i].texcoords); + RL_FREE(batch.vertexBuffer[i].colors); + RL_FREE(batch.vertexBuffer[i].indices); + } + + // Unload arrays + RL_FREE(batch.vertexBuffer); + RL_FREE(batch.draws); +#endif +} + +// Draw render batch +// NOTE: We require a pointer to reset batch and increase current buffer (multi-buffer) +void rlDrawRenderBatch(RenderBatch *batch) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + // Update batch vertex buffers + //------------------------------------------------------------------------------------------------------------ + // NOTE: If there is not vertex data, buffers doesn't need to be updated (vertexCount > 0) + // TODO: If no data changed on the CPU arrays --> No need to re-update GPU arrays (change flag required) + if (batch->vertexBuffer[batch->currentBuffer].vCounter > 0) + { + // Activate elements VAO + if (RLGL.ExtSupported.vao) glBindVertexArray(batch->vertexBuffer[batch->currentBuffer].vaoId); + + // Vertex positions buffer + glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[0]); + glBufferSubData(GL_ARRAY_BUFFER, 0, batch->vertexBuffer[batch->currentBuffer].vCounter*3*sizeof(float), batch->vertexBuffer[batch->currentBuffer].vertices); + //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*4*batch->vertexBuffer[batch->currentBuffer].elementsCount, batch->vertexBuffer[batch->currentBuffer].vertices, GL_DYNAMIC_DRAW); // Update all buffer + + // Texture coordinates buffer + glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[1]); + glBufferSubData(GL_ARRAY_BUFFER, 0, batch->vertexBuffer[batch->currentBuffer].vCounter*2*sizeof(float), batch->vertexBuffer[batch->currentBuffer].texcoords); + //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*4*batch->vertexBuffer[batch->currentBuffer].elementsCount, batch->vertexBuffer[batch->currentBuffer].texcoords, GL_DYNAMIC_DRAW); // Update all buffer + + // Colors buffer + glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[2]); + glBufferSubData(GL_ARRAY_BUFFER, 0, batch->vertexBuffer[batch->currentBuffer].vCounter*4*sizeof(unsigned char), batch->vertexBuffer[batch->currentBuffer].colors); + //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*4*4*batch->vertexBuffer[batch->currentBuffer].elementsCount, batch->vertexBuffer[batch->currentBuffer].colors, GL_DYNAMIC_DRAW); // Update all buffer + + // NOTE: glMapBuffer() causes sync issue. + // If GPU is working with this buffer, glMapBuffer() will wait(stall) until GPU to finish its job. + // To avoid waiting (idle), you can call first glBufferData() with NULL pointer before glMapBuffer(). + // If you do that, the previous data in PBO will be discarded and glMapBuffer() returns a new + // allocated pointer immediately even if GPU is still working with the previous data. + + // Another option: map the buffer object into client's memory + // Probably this code could be moved somewhere else... + // batch->vertexBuffer[batch->currentBuffer].vertices = (float *)glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE); + // if (batch->vertexBuffer[batch->currentBuffer].vertices) + // { + // Update vertex data + // } + // glUnmapBuffer(GL_ARRAY_BUFFER); + + // Unbind the current VAO + if (RLGL.ExtSupported.vao) glBindVertexArray(0); + } + //------------------------------------------------------------------------------------------------------------ + + // Draw batch vertex buffers (considering VR stereo if required) + //------------------------------------------------------------------------------------------------------------ + Matrix matProjection = RLGL.State.projection; + Matrix matModelView = RLGL.State.modelview; + + int eyesCount = 1; + if (RLGL.State.stereoRender) eyesCount = 2; + + for (int eye = 0; eye < eyesCount; eye++) + { + if (eyesCount == 2) + { + // Setup current eye viewport (half screen width) + rlViewport(eye*RLGL.State.framebufferWidth/2, 0, RLGL.State.framebufferWidth/2, RLGL.State.framebufferHeight); + + // Set current eye view offset to modelview matrix + rlSetMatrixModelview(MatrixMultiply(matModelView, RLGL.State.viewOffsetStereo[eye])); + // Set current eye projection matrix + rlSetMatrixProjection(RLGL.State.projectionStereo[eye]); + } + + // Draw buffers + if (batch->vertexBuffer[batch->currentBuffer].vCounter > 0) + { + // Set current shader and upload current MVP matrix + glUseProgram(RLGL.State.currentShader.id); + + // Create modelview-projection matrix and upload to shader + Matrix matMVP = MatrixMultiply(RLGL.State.modelview, RLGL.State.projection); + glUniformMatrix4fv(RLGL.State.currentShader.locs[SHADER_LOC_MATRIX_MVP], 1, false, MatrixToFloat(matMVP)); + + if (RLGL.ExtSupported.vao) glBindVertexArray(batch->vertexBuffer[batch->currentBuffer].vaoId); + else + { + // Bind vertex attrib: position (shader-location = 0) + glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[0]); + glVertexAttribPointer(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_POSITION], 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_POSITION]); + + // Bind vertex attrib: texcoord (shader-location = 1) + glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[1]); + glVertexAttribPointer(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_TEXCOORD01], 2, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_TEXCOORD01]); + + // Bind vertex attrib: color (shader-location = 3) + glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[2]); + glVertexAttribPointer(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_COLOR], 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); + glEnableVertexAttribArray(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_COLOR]); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[3]); + } + + // Setup some default shader values + glUniform4f(RLGL.State.currentShader.locs[SHADER_LOC_COLOR_DIFFUSE], 1.0f, 1.0f, 1.0f, 1.0f); + glUniform1i(RLGL.State.currentShader.locs[SHADER_LOC_MAP_DIFFUSE], 0); // Active default sampler2D: texture0 + + // Activate additional sampler textures + // Those additional textures will be common for all draw calls of the batch + for (int i = 0; i < MAX_BATCH_ACTIVE_TEXTURES; i++) + { + if (RLGL.State.activeTextureId[i] > 0) + { + glActiveTexture(GL_TEXTURE0 + 1 + i); + glBindTexture(GL_TEXTURE_2D, RLGL.State.activeTextureId[i]); + } + } + + // Activate default sampler2D texture0 (one texture is always active for default batch shader) + // NOTE: Batch system accumulates calls by texture0 changes, additional textures are enabled for all the draw calls + glActiveTexture(GL_TEXTURE0); + + for (int i = 0, vertexOffset = 0; i < batch->drawsCounter; i++) + { + // Bind current draw call texture, activated as GL_TEXTURE0 and binded to sampler2D texture0 by default + glBindTexture(GL_TEXTURE_2D, batch->draws[i].textureId); + + if ((batch->draws[i].mode == RL_LINES) || (batch->draws[i].mode == RL_TRIANGLES)) glDrawArrays(batch->draws[i].mode, vertexOffset, batch->draws[i].vertexCount); + else + { +#if defined(GRAPHICS_API_OPENGL_33) + // We need to define the number of indices to be processed: quadsCount*6 + // NOTE: The final parameter tells the GPU the offset in bytes from the + // start of the index buffer to the location of the first index to process + glDrawElements(GL_TRIANGLES, batch->draws[i].vertexCount/4*6, GL_UNSIGNED_INT, (GLvoid *)(vertexOffset/4*6*sizeof(GLuint))); +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) + glDrawElements(GL_TRIANGLES, batch->draws[i].vertexCount/4*6, GL_UNSIGNED_SHORT, (GLvoid *)(vertexOffset/4*6*sizeof(GLushort))); +#endif + } + + vertexOffset += (batch->draws[i].vertexCount + batch->draws[i].vertexAlignment); + } + + if (!RLGL.ExtSupported.vao) + { + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + } + + glBindTexture(GL_TEXTURE_2D, 0); // Unbind textures + } + + if (RLGL.ExtSupported.vao) glBindVertexArray(0); // Unbind VAO + + glUseProgram(0); // Unbind shader program + } + //------------------------------------------------------------------------------------------------------------ + + // Reset batch buffers + //------------------------------------------------------------------------------------------------------------ + // Reset vertex counters for next frame + batch->vertexBuffer[batch->currentBuffer].vCounter = 0; + batch->vertexBuffer[batch->currentBuffer].tcCounter = 0; + batch->vertexBuffer[batch->currentBuffer].cCounter = 0; + + // Reset depth for next draw + batch->currentDepth = -1.0f; + + // Restore projection/modelview matrices + RLGL.State.projection = matProjection; + RLGL.State.modelview = matModelView; + + // Reset RLGL.currentBatch->draws array + for (int i = 0; i < DEFAULT_BATCH_DRAWCALLS; i++) + { + batch->draws[i].mode = RL_QUADS; + batch->draws[i].vertexCount = 0; + batch->draws[i].textureId = RLGL.State.defaultTextureId; + } + + // Reset active texture units for next batch + for (int i = 0; i < MAX_BATCH_ACTIVE_TEXTURES; i++) RLGL.State.activeTextureId[i] = 0; + + // Reset draws counter to one draw for the batch + batch->drawsCounter = 1; + //------------------------------------------------------------------------------------------------------------ + + // Change to next buffer in the list (in case of multi-buffering) + batch->currentBuffer++; + if (batch->currentBuffer >= batch->buffersCount) batch->currentBuffer = 0; +#endif +} + +// Set the active render batch for rlgl +void rlSetRenderBatchActive(RenderBatch *batch) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + rlDrawRenderBatch(RLGL.currentBatch); + + if (batch != NULL) RLGL.currentBatch = batch; + else RLGL.currentBatch = &RLGL.defaultBatch; +#endif +} + +// Update and draw internal render batch +void rlDrawRenderBatchActive(void) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + rlDrawRenderBatch(RLGL.currentBatch); // NOTE: Stereo rendering is checked inside +#endif +} + // Check internal buffer overflow for a given number of vertex -bool rlCheckBufferLimit(int vCount) +// and force a RenderBatch draw call if required +bool rlCheckRenderBatchLimit(int vCount) { bool overflow = false; + #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if ((RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter + vCount) >= (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].elementsCount*4)) overflow = true; + if ((RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter + vCount) >= + (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].elementsCount*4)) + { + overflow = true; + rlDrawRenderBatch(RLGL.currentBatch); // NOTE: Stereo rendering is checked inside + } #endif + return overflow; } -// Set debug marker -void rlSetDebugMarker(const char *text) -{ -#if defined(GRAPHICS_API_OPENGL_33) - if (RLGL.ExtSupported.debugMarker) glInsertEventMarkerEXT(0, text); -#endif -} - -// Set blending mode factor and equation -void rlSetBlendMode(int glSrcFactor, int glDstFactor, int glEquation) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - RLGL.State.glBlendSrcFactor = glSrcFactor; - RLGL.State.glBlendDstFactor = glDstFactor; - RLGL.State.glBlendEquation = glEquation; -#endif -} - -// Load OpenGL extensions -// NOTE: External loader function could be passed as a pointer -void rlLoadExtensions(void *loader) -{ -#if defined(GRAPHICS_API_OPENGL_33) - // NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions (and lower versions) - #if !defined(__APPLE__) - if (!gladLoadGLLoader((GLADloadproc)loader)) TRACELOG(LOG_WARNING, "GLAD: Cannot load OpenGL extensions"); - else TRACELOG(LOG_INFO, "GLAD: OpenGL extensions loaded successfully"); - - #if defined(GRAPHICS_API_OPENGL_21) - if (GLAD_GL_VERSION_2_1) TRACELOG(LOG_INFO, "GL: OpenGL 2.1 profile supported"); - #elif defined(GRAPHICS_API_OPENGL_33) - if (GLAD_GL_VERSION_3_3) TRACELOG(LOG_INFO, "GL: OpenGL 3.3 Core profile supported"); - else TRACELOG(LOG_ERROR, "GL: OpenGL 3.3 Core profile not supported"); - #endif - #endif - - // With GLAD, we can check if an extension is supported using the GLAD_GL_xxx booleans - //if (GLAD_GL_ARB_vertex_array_object) // Use GL_ARB_vertex_array_object -#endif -} - +// Textures data management +//----------------------------------------------------------------------------------------- // Convert image data to OpenGL texture (returns OpenGL valid Id) unsigned int rlLoadTexture(void *data, int width, int height, int format, int mipmapCount) { @@ -1966,53 +2363,49 @@ unsigned int rlLoadTexture(void *data, int width, int height, int format, int mi // Check texture format support by OpenGL 1.1 (compressed textures not supported) #if defined(GRAPHICS_API_OPENGL_11) - if (format >= COMPRESSED_DXT1_RGB) + if (format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) { TRACELOG(LOG_WARNING, "GL: OpenGL 1.1 does not support GPU compressed texture formats"); return id; } #else - if ((!RLGL.ExtSupported.texCompDXT) && ((format == COMPRESSED_DXT1_RGB) || (format == COMPRESSED_DXT1_RGBA) || - (format == COMPRESSED_DXT3_RGBA) || (format == COMPRESSED_DXT5_RGBA))) + if ((!RLGL.ExtSupported.texCompDXT) && ((format == PIXELFORMAT_COMPRESSED_DXT1_RGB) || (format == PIXELFORMAT_COMPRESSED_DXT1_RGBA) || + (format == PIXELFORMAT_COMPRESSED_DXT3_RGBA) || (format == PIXELFORMAT_COMPRESSED_DXT5_RGBA))) { TRACELOG(LOG_WARNING, "GL: DXT compressed texture format not supported"); return id; } #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if ((!RLGL.ExtSupported.texCompETC1) && (format == COMPRESSED_ETC1_RGB)) + if ((!RLGL.ExtSupported.texCompETC1) && (format == PIXELFORMAT_COMPRESSED_ETC1_RGB)) { TRACELOG(LOG_WARNING, "GL: ETC1 compressed texture format not supported"); return id; } - if ((!RLGL.ExtSupported.texCompETC2) && ((format == COMPRESSED_ETC2_RGB) || (format == COMPRESSED_ETC2_EAC_RGBA))) + if ((!RLGL.ExtSupported.texCompETC2) && ((format == PIXELFORMAT_COMPRESSED_ETC2_RGB) || (format == PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA))) { TRACELOG(LOG_WARNING, "GL: ETC2 compressed texture format not supported"); return id; } - if ((!RLGL.ExtSupported.texCompPVRT) && ((format == COMPRESSED_PVRT_RGB) || (format == COMPRESSED_PVRT_RGBA))) + if ((!RLGL.ExtSupported.texCompPVRT) && ((format == PIXELFORMAT_COMPRESSED_PVRT_RGB) || (format == PIXELFORMAT_COMPRESSED_PVRT_RGBA))) { TRACELOG(LOG_WARNING, "GL: PVRT compressed texture format not supported"); return id; } - if ((!RLGL.ExtSupported.texCompASTC) && ((format == COMPRESSED_ASTC_4x4_RGBA) || (format == COMPRESSED_ASTC_8x8_RGBA))) + if ((!RLGL.ExtSupported.texCompASTC) && ((format == PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA) || (format == PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA))) { TRACELOG(LOG_WARNING, "GL: ASTC compressed texture format not supported"); return id; } #endif -#endif // GRAPHICS_API_OPENGL_11 +#endif // GRAPHICS_API_OPENGL_11 glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glGenTextures(1, &id); // Generate texture id -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - //glActiveTexture(GL_TEXTURE0); // If not defined, using GL_TEXTURE0 by default (shader texture) -#endif - glBindTexture(GL_TEXTURE_2D, id); int mipWidth = width; @@ -2022,7 +2415,7 @@ unsigned int rlLoadTexture(void *data, int width, int height, int format, int mi // Load the different mipmap levels for (int i = 0; i < mipmapCount; i++) { - unsigned int mipSize = GetPixelDataSize(mipWidth, mipHeight, format); + unsigned int mipSize = rlGetPixelDataSize(mipWidth, mipHeight, format); unsigned int glInternalFormat, glFormat, glType; rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType); @@ -2031,27 +2424,27 @@ unsigned int rlLoadTexture(void *data, int width, int height, int format, int mi if (glInternalFormat != -1) { - if (format < COMPRESSED_DXT1_RGB) glTexImage2D(GL_TEXTURE_2D, i, glInternalFormat, mipWidth, mipHeight, 0, glFormat, glType, (unsigned char *)data + mipOffset); - #if !defined(GRAPHICS_API_OPENGL_11) + if (format < PIXELFORMAT_COMPRESSED_DXT1_RGB) glTexImage2D(GL_TEXTURE_2D, i, glInternalFormat, mipWidth, mipHeight, 0, glFormat, glType, (unsigned char *)data + mipOffset); +#if !defined(GRAPHICS_API_OPENGL_11) else glCompressedTexImage2D(GL_TEXTURE_2D, i, glInternalFormat, mipWidth, mipHeight, 0, mipSize, (unsigned char *)data + mipOffset); - #endif +#endif - #if defined(GRAPHICS_API_OPENGL_33) - if (format == UNCOMPRESSED_GRAYSCALE) +#if defined(GRAPHICS_API_OPENGL_33) + if (format == PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) { GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_ONE }; glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask); } - else if (format == UNCOMPRESSED_GRAY_ALPHA) + else if (format == PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA) { - #if defined(GRAPHICS_API_OPENGL_21) +#if defined(GRAPHICS_API_OPENGL_21) GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_ALPHA }; - #elif defined(GRAPHICS_API_OPENGL_33) +#elif defined(GRAPHICS_API_OPENGL_33) GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_GREEN }; - #endif +#endif glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask); } - #endif +#endif } mipWidth /= 2; @@ -2103,7 +2496,7 @@ unsigned int rlLoadTexture(void *data, int width, int height, int format, int mi // Unbind current texture glBindTexture(GL_TEXTURE_2D, 0); - if (id > 0) TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Texture created successfully (%ix%i - %i mipmaps)", id, width, height, mipmapCount); + if (id > 0) TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Texture loaded successfully (%ix%i - %i mipmaps)", id, width, height, mipmapCount); else TRACELOG(LOG_WARNING, "TEXTURE: Failed to load texture"); return id; @@ -2169,7 +2562,7 @@ unsigned int rlLoadTextureCubemap(void *data, int size, int format) unsigned int id = 0; #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - unsigned int dataSize = GetPixelDataSize(size, size, format); + unsigned int dataSize = rlGetPixelDataSize(size, size, format); glGenTextures(1, &id); glBindTexture(GL_TEXTURE_CUBE_MAP, id); @@ -2184,32 +2577,32 @@ unsigned int rlLoadTextureCubemap(void *data, int size, int format) { if (data == NULL) { - if (format < COMPRESSED_DXT1_RGB) + if (format < PIXELFORMAT_COMPRESSED_DXT1_RGB) { - if (format == UNCOMPRESSED_R32G32B32) + if (format == PIXELFORMAT_UNCOMPRESSED_R32G32B32) { // Instead of using a sized internal texture format (GL_RGB16F, GL_RGB32F), we let the driver to choose the better format for us (GL_RGB) if (RLGL.ExtSupported.texFloat32) glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_RGB, size, size, 0, GL_RGB, GL_FLOAT, NULL); else TRACELOG(LOG_WARNING, "TEXTURES: Cubemap requested format not supported"); } - else if ((format == UNCOMPRESSED_R32) || (format == UNCOMPRESSED_R32G32B32A32)) TRACELOG(LOG_WARNING, "TEXTURES: Cubemap requested format not supported"); + else if ((format == PIXELFORMAT_UNCOMPRESSED_R32) || (format == PIXELFORMAT_UNCOMPRESSED_R32G32B32A32)) TRACELOG(LOG_WARNING, "TEXTURES: Cubemap requested format not supported"); else glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, size, size, 0, glFormat, glType, NULL); } else TRACELOG(LOG_WARNING, "TEXTURES: Empty cubemap creation does not support compressed format"); } else { - if (format < COMPRESSED_DXT1_RGB) glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, size, size, 0, glFormat, glType, (unsigned char *)data + i*dataSize); + if (format < PIXELFORMAT_COMPRESSED_DXT1_RGB) glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, size, size, 0, glFormat, glType, (unsigned char *)data + i*dataSize); else glCompressedTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, size, size, 0, dataSize, (unsigned char *)data + i*dataSize); } #if defined(GRAPHICS_API_OPENGL_33) - if (format == UNCOMPRESSED_GRAYSCALE) + if (format == PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) { GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_ONE }; glTexParameteriv(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask); } - else if (format == UNCOMPRESSED_GRAY_ALPHA) + else if (format == PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA) { #if defined(GRAPHICS_API_OPENGL_21) GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_ALPHA }; @@ -2234,7 +2627,7 @@ unsigned int rlLoadTextureCubemap(void *data, int size, int format) glBindTexture(GL_TEXTURE_CUBE_MAP, 0); #endif - if (id > 0) TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Cubemap texture created successfully (%ix%i)", id, size, size); + if (id > 0) TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Cubemap texture loaded successfully (%ix%i)", id, size, size); else TRACELOG(LOG_WARNING, "TEXTURE: Failed to load cubemap texture"); return id; @@ -2249,7 +2642,7 @@ void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int h unsigned int glInternalFormat, glFormat, glType; rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType); - if ((glInternalFormat != -1) && (format < COMPRESSED_DXT1_RGB)) + if ((glInternalFormat != -1) && (format < PIXELFORMAT_COMPRESSED_DXT1_RGB)) { glTexSubImage2D(GL_TEXTURE_2D, 0, offsetX, offsetY, width, height, glFormat, glType, (unsigned char *)data); } @@ -2267,43 +2660,43 @@ void rlGetGlTextureFormats(int format, unsigned int *glInternalFormat, unsigned { #if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_21) || defined(GRAPHICS_API_OPENGL_ES2) // NOTE: on OpenGL ES 2.0 (WebGL), internalFormat must match format and options allowed are: GL_LUMINANCE, GL_RGB, GL_RGBA - case UNCOMPRESSED_GRAYSCALE: *glInternalFormat = GL_LUMINANCE; *glFormat = GL_LUMINANCE; *glType = GL_UNSIGNED_BYTE; break; - case UNCOMPRESSED_GRAY_ALPHA: *glInternalFormat = GL_LUMINANCE_ALPHA; *glFormat = GL_LUMINANCE_ALPHA; *glType = GL_UNSIGNED_BYTE; break; - case UNCOMPRESSED_R5G6B5: *glInternalFormat = GL_RGB; *glFormat = GL_RGB; *glType = GL_UNSIGNED_SHORT_5_6_5; break; - case UNCOMPRESSED_R8G8B8: *glInternalFormat = GL_RGB; *glFormat = GL_RGB; *glType = GL_UNSIGNED_BYTE; break; - case UNCOMPRESSED_R5G5B5A1: *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_SHORT_5_5_5_1; break; - case UNCOMPRESSED_R4G4B4A4: *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_SHORT_4_4_4_4; break; - case UNCOMPRESSED_R8G8B8A8: *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_BYTE; break; + case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: *glInternalFormat = GL_LUMINANCE; *glFormat = GL_LUMINANCE; *glType = GL_UNSIGNED_BYTE; break; + case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: *glInternalFormat = GL_LUMINANCE_ALPHA; *glFormat = GL_LUMINANCE_ALPHA; *glType = GL_UNSIGNED_BYTE; break; + case PIXELFORMAT_UNCOMPRESSED_R5G6B5: *glInternalFormat = GL_RGB; *glFormat = GL_RGB; *glType = GL_UNSIGNED_SHORT_5_6_5; break; + case PIXELFORMAT_UNCOMPRESSED_R8G8B8: *glInternalFormat = GL_RGB; *glFormat = GL_RGB; *glType = GL_UNSIGNED_BYTE; break; + case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_SHORT_5_5_5_1; break; + case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_SHORT_4_4_4_4; break; + case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_BYTE; break; #if !defined(GRAPHICS_API_OPENGL_11) - case UNCOMPRESSED_R32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_LUMINANCE; *glFormat = GL_LUMINANCE; *glType = GL_FLOAT; break; // NOTE: Requires extension OES_texture_float - case UNCOMPRESSED_R32G32B32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_RGB; *glFormat = GL_RGB; *glType = GL_FLOAT; break; // NOTE: Requires extension OES_texture_float - case UNCOMPRESSED_R32G32B32A32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_FLOAT; break; // NOTE: Requires extension OES_texture_float + case PIXELFORMAT_UNCOMPRESSED_R32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_LUMINANCE; *glFormat = GL_LUMINANCE; *glType = GL_FLOAT; break; // NOTE: Requires extension OES_texture_float + case PIXELFORMAT_UNCOMPRESSED_R32G32B32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_RGB; *glFormat = GL_RGB; *glType = GL_FLOAT; break; // NOTE: Requires extension OES_texture_float + case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_FLOAT; break; // NOTE: Requires extension OES_texture_float #endif #elif defined(GRAPHICS_API_OPENGL_33) - case UNCOMPRESSED_GRAYSCALE: *glInternalFormat = GL_R8; *glFormat = GL_RED; *glType = GL_UNSIGNED_BYTE; break; - case UNCOMPRESSED_GRAY_ALPHA: *glInternalFormat = GL_RG8; *glFormat = GL_RG; *glType = GL_UNSIGNED_BYTE; break; - case UNCOMPRESSED_R5G6B5: *glInternalFormat = GL_RGB565; *glFormat = GL_RGB; *glType = GL_UNSIGNED_SHORT_5_6_5; break; - case UNCOMPRESSED_R8G8B8: *glInternalFormat = GL_RGB8; *glFormat = GL_RGB; *glType = GL_UNSIGNED_BYTE; break; - case UNCOMPRESSED_R5G5B5A1: *glInternalFormat = GL_RGB5_A1; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_SHORT_5_5_5_1; break; - case UNCOMPRESSED_R4G4B4A4: *glInternalFormat = GL_RGBA4; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_SHORT_4_4_4_4; break; - case UNCOMPRESSED_R8G8B8A8: *glInternalFormat = GL_RGBA8; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_BYTE; break; - case UNCOMPRESSED_R32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_R32F; *glFormat = GL_RED; *glType = GL_FLOAT; break; - case UNCOMPRESSED_R32G32B32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_RGB32F; *glFormat = GL_RGB; *glType = GL_FLOAT; break; - case UNCOMPRESSED_R32G32B32A32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_RGBA32F; *glFormat = GL_RGBA; *glType = GL_FLOAT; break; + case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: *glInternalFormat = GL_R8; *glFormat = GL_RED; *glType = GL_UNSIGNED_BYTE; break; + case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: *glInternalFormat = GL_RG8; *glFormat = GL_RG; *glType = GL_UNSIGNED_BYTE; break; + case PIXELFORMAT_UNCOMPRESSED_R5G6B5: *glInternalFormat = GL_RGB565; *glFormat = GL_RGB; *glType = GL_UNSIGNED_SHORT_5_6_5; break; + case PIXELFORMAT_UNCOMPRESSED_R8G8B8: *glInternalFormat = GL_RGB8; *glFormat = GL_RGB; *glType = GL_UNSIGNED_BYTE; break; + case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: *glInternalFormat = GL_RGB5_A1; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_SHORT_5_5_5_1; break; + case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: *glInternalFormat = GL_RGBA4; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_SHORT_4_4_4_4; break; + case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: *glInternalFormat = GL_RGBA8; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_BYTE; break; + case PIXELFORMAT_UNCOMPRESSED_R32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_R32F; *glFormat = GL_RED; *glType = GL_FLOAT; break; + case PIXELFORMAT_UNCOMPRESSED_R32G32B32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_RGB32F; *glFormat = GL_RGB; *glType = GL_FLOAT; break; + case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_RGBA32F; *glFormat = GL_RGBA; *glType = GL_FLOAT; break; + #endif + #if !defined(GRAPHICS_API_OPENGL_11) + case PIXELFORMAT_COMPRESSED_DXT1_RGB: if (RLGL.ExtSupported.texCompDXT) *glInternalFormat = GL_COMPRESSED_RGB_S3TC_DXT1_EXT; break; + case PIXELFORMAT_COMPRESSED_DXT1_RGBA: if (RLGL.ExtSupported.texCompDXT) *glInternalFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; break; + case PIXELFORMAT_COMPRESSED_DXT3_RGBA: if (RLGL.ExtSupported.texCompDXT) *glInternalFormat = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break; + case PIXELFORMAT_COMPRESSED_DXT5_RGBA: if (RLGL.ExtSupported.texCompDXT) *glInternalFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break; + case PIXELFORMAT_COMPRESSED_ETC1_RGB: if (RLGL.ExtSupported.texCompETC1) *glInternalFormat = GL_ETC1_RGB8_OES; break; // NOTE: Requires OpenGL ES 2.0 or OpenGL 4.3 + case PIXELFORMAT_COMPRESSED_ETC2_RGB: if (RLGL.ExtSupported.texCompETC2) *glInternalFormat = GL_COMPRESSED_RGB8_ETC2; break; // NOTE: Requires OpenGL ES 3.0 or OpenGL 4.3 + case PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA: if (RLGL.ExtSupported.texCompETC2) *glInternalFormat = GL_COMPRESSED_RGBA8_ETC2_EAC; break; // NOTE: Requires OpenGL ES 3.0 or OpenGL 4.3 + case PIXELFORMAT_COMPRESSED_PVRT_RGB: if (RLGL.ExtSupported.texCompPVRT) *glInternalFormat = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; break; // NOTE: Requires PowerVR GPU + case PIXELFORMAT_COMPRESSED_PVRT_RGBA: if (RLGL.ExtSupported.texCompPVRT) *glInternalFormat = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; break; // NOTE: Requires PowerVR GPU + case PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA: if (RLGL.ExtSupported.texCompASTC) *glInternalFormat = GL_COMPRESSED_RGBA_ASTC_4x4_KHR; break; // NOTE: Requires OpenGL ES 3.1 or OpenGL 4.3 + case PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA: if (RLGL.ExtSupported.texCompASTC) *glInternalFormat = GL_COMPRESSED_RGBA_ASTC_8x8_KHR; break; // NOTE: Requires OpenGL ES 3.1 or OpenGL 4.3 #endif - #if !defined(GRAPHICS_API_OPENGL_11) - case COMPRESSED_DXT1_RGB: if (RLGL.ExtSupported.texCompDXT) *glInternalFormat = GL_COMPRESSED_RGB_S3TC_DXT1_EXT; break; - case COMPRESSED_DXT1_RGBA: if (RLGL.ExtSupported.texCompDXT) *glInternalFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; break; - case COMPRESSED_DXT3_RGBA: if (RLGL.ExtSupported.texCompDXT) *glInternalFormat = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break; - case COMPRESSED_DXT5_RGBA: if (RLGL.ExtSupported.texCompDXT) *glInternalFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break; - case COMPRESSED_ETC1_RGB: if (RLGL.ExtSupported.texCompETC1) *glInternalFormat = GL_ETC1_RGB8_OES; break; // NOTE: Requires OpenGL ES 2.0 or OpenGL 4.3 - case COMPRESSED_ETC2_RGB: if (RLGL.ExtSupported.texCompETC2) *glInternalFormat = GL_COMPRESSED_RGB8_ETC2; break; // NOTE: Requires OpenGL ES 3.0 or OpenGL 4.3 - case COMPRESSED_ETC2_EAC_RGBA: if (RLGL.ExtSupported.texCompETC2) *glInternalFormat = GL_COMPRESSED_RGBA8_ETC2_EAC; break; // NOTE: Requires OpenGL ES 3.0 or OpenGL 4.3 - case COMPRESSED_PVRT_RGB: if (RLGL.ExtSupported.texCompPVRT) *glInternalFormat = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; break; // NOTE: Requires PowerVR GPU - case COMPRESSED_PVRT_RGBA: if (RLGL.ExtSupported.texCompPVRT) *glInternalFormat = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; break; // NOTE: Requires PowerVR GPU - case COMPRESSED_ASTC_4x4_RGBA: if (RLGL.ExtSupported.texCompASTC) *glInternalFormat = GL_COMPRESSED_RGBA_ASTC_4x4_KHR; break; // NOTE: Requires OpenGL ES 3.1 or OpenGL 4.3 - case COMPRESSED_ASTC_8x8_RGBA: if (RLGL.ExtSupported.texCompASTC) *glInternalFormat = GL_COMPRESSED_RGBA_ASTC_8x8_KHR; break; // NOTE: Requires OpenGL ES 3.1 or OpenGL 4.3 - #endif default: TRACELOG(LOG_WARNING, "TEXTURE: Current format not supported (%i)", format); break; } } @@ -2314,6 +2707,176 @@ void rlUnloadTexture(unsigned int id) glDeleteTextures(1, &id); } +// Generate mipmap data for selected texture +void rlGenerateMipmaps(Texture2D *texture) +{ + glBindTexture(GL_TEXTURE_2D, texture->id); + + // Check if texture is power-of-two (POT) + bool texIsPOT = false; + + if (((texture->width > 0) && ((texture->width & (texture->width - 1)) == 0)) && + ((texture->height > 0) && ((texture->height & (texture->height - 1)) == 0))) texIsPOT = true; + +#if defined(GRAPHICS_API_OPENGL_11) + if (texIsPOT) + { + // WARNING: Manual mipmap generation only works for RGBA 32bit textures! + if (texture->format == PIXELFORMAT_UNCOMPRESSED_R8G8B8A8) + { + // Retrieve texture data from VRAM + void *texData = rlReadTexturePixels(*texture); + + // NOTE: Texture data size is reallocated to fit mipmaps data + // NOTE: CPU mipmap generation only supports RGBA 32bit data + int mipmapCount = rlGenerateMipmapsData(texData, texture->width, texture->height); + + int size = texture->width*texture->height*4; + int offset = size; + + int mipWidth = texture->width/2; + int mipHeight = texture->height/2; + + // Load the mipmaps + for (int level = 1; level < mipmapCount; level++) + { + glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA8, mipWidth, mipHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, (unsigned char *)texData + offset); + + size = mipWidth*mipHeight*4; + offset += size; + + mipWidth /= 2; + mipHeight /= 2; + } + + texture->mipmaps = mipmapCount + 1; + RL_FREE(texData); // Once mipmaps have been generated and data has been uploaded to GPU VRAM, we can discard RAM data + + TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] Mipmaps generated manually on CPU side, total: %i", texture->id, texture->mipmaps); + } + else TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] Failed to generate mipmaps for provided texture format", texture->id); + } +#endif +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + if ((texIsPOT) || (RLGL.ExtSupported.texNPOT)) + { + //glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE); // Hint for mipmaps generation algorythm: GL_FASTEST, GL_NICEST, GL_DONT_CARE + glGenerateMipmap(GL_TEXTURE_2D); // Generate mipmaps automatically + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); // Activate Trilinear filtering for mipmaps + + #define MIN(a,b) (((a)<(b))?(a):(b)) + #define MAX(a,b) (((a)>(b))?(a):(b)) + + texture->mipmaps = 1 + (int)floor(log(MAX(texture->width, texture->height))/log(2)); + TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Mipmaps generated automatically, total: %i", texture->id, texture->mipmaps); + } +#endif + else TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] Failed to generate mipmaps", texture->id); + + glBindTexture(GL_TEXTURE_2D, 0); +} + + +// Read texture pixel data +void *rlReadTexturePixels(Texture2D texture) +{ + void *pixels = NULL; + +#if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) + glBindTexture(GL_TEXTURE_2D, texture.id); + + // NOTE: Using texture.id, we can retrieve some texture info (but not on OpenGL ES 2.0) + // Possible texture info: GL_TEXTURE_RED_SIZE, GL_TEXTURE_GREEN_SIZE, GL_TEXTURE_BLUE_SIZE, GL_TEXTURE_ALPHA_SIZE + //int width, height, format; + //glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width); + //glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height); + //glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &format); + + // NOTE: Each row written to or read from by OpenGL pixel operations like glGetTexImage are aligned to a 4 byte boundary by default, which may add some padding. + // Use glPixelStorei to modify padding with the GL_[UN]PACK_ALIGNMENT setting. + // GL_PACK_ALIGNMENT affects operations that read from OpenGL memory (glReadPixels, glGetTexImage, etc.) + // GL_UNPACK_ALIGNMENT affects operations that write to OpenGL memory (glTexImage, etc.) + glPixelStorei(GL_PACK_ALIGNMENT, 1); + + unsigned int glInternalFormat, glFormat, glType; + rlGetGlTextureFormats(texture.format, &glInternalFormat, &glFormat, &glType); + unsigned int size = rlGetPixelDataSize(texture.width, texture.height, texture.format); + + if ((glInternalFormat != -1) && (texture.format < PIXELFORMAT_COMPRESSED_DXT1_RGB)) + { + pixels = RL_MALLOC(size); + glGetTexImage(GL_TEXTURE_2D, 0, glFormat, glType, pixels); + } + else TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] Data retrieval not suported for pixel format (%i)", texture.id, texture.format); + + glBindTexture(GL_TEXTURE_2D, 0); +#endif + +#if defined(GRAPHICS_API_OPENGL_ES2) + // glGetTexImage() is not available on OpenGL ES 2.0 + // Texture width and height are required on OpenGL ES 2.0. There is no way to get it from texture id. + // Two possible Options: + // 1 - Bind texture to color fbo attachment and glReadPixels() + // 2 - Create an fbo, activate it, render quad with texture, glReadPixels() + // We are using Option 1, just need to care for texture format on retrieval + // NOTE: This behaviour could be conditioned by graphic driver... + unsigned int fboId = rlLoadFramebuffer(texture.width, texture.height); + + // TODO: Create depth texture/renderbuffer for fbo? + + glBindFramebuffer(GL_FRAMEBUFFER, fboId); + glBindTexture(GL_TEXTURE_2D, 0); + + // Attach our texture to FBO + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture.id, 0); + + // We read data as RGBA because FBO texture is configured as RGBA, despite binding another texture format + pixels = (unsigned char *)RL_MALLOC(rlGetPixelDataSize(texture.width, texture.height, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8)); + glReadPixels(0, 0, texture.width, texture.height, GL_RGBA, GL_UNSIGNED_BYTE, pixels); + + glBindFramebuffer(GL_FRAMEBUFFER, 0); + + // Clean up temporal fbo + rlUnloadFramebuffer(fboId); +#endif + + return pixels; +} + + +// Read screen pixel data (color buffer) +unsigned char *rlReadScreenPixels(int width, int height) +{ + unsigned char *screenData = (unsigned char *)RL_CALLOC(width*height*4, sizeof(unsigned char)); + + // NOTE 1: glReadPixels returns image flipped vertically -> (0,0) is the bottom left corner of the framebuffer + // NOTE 2: We are getting alpha channel! Be careful, it can be transparent if not cleared properly! + glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, screenData); + + // Flip image vertically! + unsigned char *imgData = (unsigned char *)RL_MALLOC(width*height*4*sizeof(unsigned char)); + + for (int y = height - 1; y >= 0; y--) + { + for (int x = 0; x < (width*4); x++) + { + imgData[((height - 1) - y)*width*4 + x] = screenData[(y*width*4) + x]; // Flip line + + // Set alpha component value to 255 (no trasparent image retrieval) + // NOTE: Alpha value has already been applied to RGB in framebuffer, we don't need it! + if (((x + 1)%4) == 0) imgData[((height - 1) - y)*width*4 + x] = 255; + } + } + + RL_FREE(screenData); + + return imgData; // NOTE: image data should be freed +} + +// Framebuffer management (fbo) +//----------------------------------------------------------------------------------------- // Load a framebuffer to be used for rendering // NOTE: No textures attached unsigned int rlLoadFramebuffer(int width, int height) @@ -2330,7 +2893,7 @@ unsigned int rlLoadFramebuffer(int width, int height) // Attach color buffer texture to an fbo (unloads previous attachment) // NOTE: Attach type: 0-Color, 1-Depth renderbuffer, 2-Depth texture -void rlFramebufferAttach(unsigned int fboId, unsigned int texId, int attachType, int texType) +void rlFramebufferAttach(unsigned int fboId, unsigned int texId, int attachType, int texType, int mipLevel) { #if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) && defined(SUPPORT_RENDER_TEXTURES_HINT) glBindFramebuffer(GL_FRAMEBUFFER, fboId); @@ -2346,20 +2909,20 @@ void rlFramebufferAttach(unsigned int fboId, unsigned int texId, int attachType, case RL_ATTACHMENT_COLOR_CHANNEL6: case RL_ATTACHMENT_COLOR_CHANNEL7: { - if (texType == RL_ATTACHMENT_TEXTURE2D) glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + attachType, GL_TEXTURE_2D, texId, 0); + if (texType == RL_ATTACHMENT_TEXTURE2D) glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + attachType, GL_TEXTURE_2D, texId, mipLevel); else if (texType == RL_ATTACHMENT_RENDERBUFFER) glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + attachType, GL_RENDERBUFFER, texId); - else if (texType >= RL_ATTACHMENT_CUBEMAP_POSITIVE_X) glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + attachType, GL_TEXTURE_CUBE_MAP_POSITIVE_X + texType, texId, 0); + else if (texType >= RL_ATTACHMENT_CUBEMAP_POSITIVE_X) glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + attachType, GL_TEXTURE_CUBE_MAP_POSITIVE_X + texType, texId, mipLevel); } break; case RL_ATTACHMENT_DEPTH: { - if (texType == RL_ATTACHMENT_TEXTURE2D) glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, texId, 0); + if (texType == RL_ATTACHMENT_TEXTURE2D) glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, texId, mipLevel); else if (texType == RL_ATTACHMENT_RENDERBUFFER) glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, texId); } break; case RL_ATTACHMENT_STENCIL: { - if (texType == RL_ATTACHMENT_TEXTURE2D) glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, texId, 0); + if (texType == RL_ATTACHMENT_TEXTURE2D) glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, texId, mipLevel); else if (texType == RL_ATTACHMENT_RENDERBUFFER) glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, texId); } break; @@ -2402,864 +2965,270 @@ bool rlFramebufferComplete(unsigned int id) return result; } -// Generate mipmap data for selected texture -void rlGenerateMipmaps(Texture2D *texture) +// Unload framebuffer from GPU memory +// NOTE: All attached textures/cubemaps/renderbuffers are also deleted +void rlUnloadFramebuffer(unsigned int id) { - glBindTexture(GL_TEXTURE_2D, texture->id); +#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) && defined(SUPPORT_RENDER_TEXTURES_HINT) - // Check if texture is power-of-two (POT) - bool texIsPOT = false; + // Query depth attachment to automatically delete texture/renderbuffer + int depthType = 0, depthId = 0; + glBindFramebuffer(GL_FRAMEBUFFER, id); // Bind framebuffer to query depth texture type + glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &depthType); + glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &depthId); - if (((texture->width > 0) && ((texture->width & (texture->width - 1)) == 0)) && - ((texture->height > 0) && ((texture->height & (texture->height - 1)) == 0))) texIsPOT = true; + unsigned int depthIdU = (unsigned int)depthId; + if (depthType == GL_RENDERBUFFER) glDeleteRenderbuffers(1, &depthIdU); + else if (depthType == GL_RENDERBUFFER) glDeleteTextures(1, &depthIdU); -#if defined(GRAPHICS_API_OPENGL_11) - if (texIsPOT) - { - // WARNING: Manual mipmap generation only works for RGBA 32bit textures! - if (texture->format == UNCOMPRESSED_R8G8B8A8) - { - // Retrieve texture data from VRAM - void *data = rlReadTexturePixels(*texture); + // NOTE: If a texture object is deleted while its image is attached to the *currently bound* framebuffer, + // the texture image is automatically detached from the currently bound framebuffer. - // NOTE: data size is reallocated to fit mipmaps data - // NOTE: CPU mipmap generation only supports RGBA 32bit data - int mipmapCount = GenerateMipmaps(data, texture->width, texture->height); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + glDeleteFramebuffers(1, &id); - int size = texture->width*texture->height*4; - int offset = size; - - int mipWidth = texture->width/2; - int mipHeight = texture->height/2; - - // Load the mipmaps - for (int level = 1; level < mipmapCount; level++) - { - glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA8, mipWidth, mipHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, (unsigned char *)data + offset); - - size = mipWidth*mipHeight*4; - offset += size; - - mipWidth /= 2; - mipHeight /= 2; - } - - texture->mipmaps = mipmapCount + 1; - RL_FREE(data); // Once mipmaps have been generated and data has been uploaded to GPU VRAM, we can discard RAM data - - TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] Mipmaps generated manually on CPU side, total: %i", texture->id, texture->mipmaps); - } - else TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] Failed to generate mipmaps for provided texture format", texture->id); - } -#elif defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if ((texIsPOT) || (RLGL.ExtSupported.texNPOT)) - { - //glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE); // Hint for mipmaps generation algorythm: GL_FASTEST, GL_NICEST, GL_DONT_CARE - glGenerateMipmap(GL_TEXTURE_2D); // Generate mipmaps automatically - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); // Activate Trilinear filtering for mipmaps - - #define MIN(a,b) (((a)<(b))?(a):(b)) - #define MAX(a,b) (((a)>(b))?(a):(b)) - - texture->mipmaps = 1 + (int)floor(log(MAX(texture->width, texture->height))/log(2)); - TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Mipmaps generated automatically, total: %i", texture->id, texture->mipmaps); - } -#endif - else TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] Failed to generate mipmaps", texture->id); - - glBindTexture(GL_TEXTURE_2D, 0); -} - -// Upload vertex data into a VAO (if supported) and VBO -void rlLoadMesh(Mesh *mesh, bool dynamic) -{ - if (mesh->vaoId > 0) - { - // Check if mesh has already been loaded in GPU - TRACELOG(LOG_WARNING, "VAO: [ID %i] Trying to re-load an already loaded mesh", mesh->vaoId); - return; - } - - mesh->vaoId = 0; // Vertex Array Object - mesh->vboId[0] = 0; // Vertex positions VBO - mesh->vboId[1] = 0; // Vertex texcoords VBO - mesh->vboId[2] = 0; // Vertex normals VBO - mesh->vboId[3] = 0; // Vertex colors VBO - mesh->vboId[4] = 0; // Vertex tangents VBO - mesh->vboId[5] = 0; // Vertex texcoords2 VBO - mesh->vboId[6] = 0; // Vertex indices VBO - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - int drawHint = GL_STATIC_DRAW; - if (dynamic) drawHint = GL_DYNAMIC_DRAW; - - if (RLGL.ExtSupported.vao) - { - // Initialize Quads VAO (Buffer A) - glGenVertexArrays(1, &mesh->vaoId); - glBindVertexArray(mesh->vaoId); - } - - // NOTE: Attributes must be uploaded considering default locations points - - // Enable vertex attributes: position (shader-location = 0) - glGenBuffers(1, &mesh->vboId[0]); - glBindBuffer(GL_ARRAY_BUFFER, mesh->vboId[0]); - glBufferData(GL_ARRAY_BUFFER, mesh->vertexCount*3*sizeof(float), mesh->vertices, drawHint); - glVertexAttribPointer(0, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(0); - - // Enable vertex attributes: texcoords (shader-location = 1) - glGenBuffers(1, &mesh->vboId[1]); - glBindBuffer(GL_ARRAY_BUFFER, mesh->vboId[1]); - glBufferData(GL_ARRAY_BUFFER, mesh->vertexCount*2*sizeof(float), mesh->texcoords, drawHint); - glVertexAttribPointer(1, 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(1); - - // Enable vertex attributes: normals (shader-location = 2) - if (mesh->normals != NULL) - { - glGenBuffers(1, &mesh->vboId[2]); - glBindBuffer(GL_ARRAY_BUFFER, mesh->vboId[2]); - glBufferData(GL_ARRAY_BUFFER, mesh->vertexCount*3*sizeof(float), mesh->normals, drawHint); - glVertexAttribPointer(2, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(2); - } - else - { - // Default color vertex attribute set to WHITE - glVertexAttrib3f(2, 1.0f, 1.0f, 1.0f); - glDisableVertexAttribArray(2); - } - - // Default color vertex attribute (shader-location = 3) - if (mesh->colors != NULL) - { - glGenBuffers(1, &mesh->vboId[3]); - glBindBuffer(GL_ARRAY_BUFFER, mesh->vboId[3]); - glBufferData(GL_ARRAY_BUFFER, mesh->vertexCount*4*sizeof(unsigned char), mesh->colors, drawHint); - glVertexAttribPointer(3, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - glEnableVertexAttribArray(3); - } - else - { - // Default color vertex attribute set to WHITE - glVertexAttrib4f(3, 1.0f, 1.0f, 1.0f, 1.0f); - glDisableVertexAttribArray(3); - } - - // Default tangent vertex attribute (shader-location = 4) - if (mesh->tangents != NULL) - { - glGenBuffers(1, &mesh->vboId[4]); - glBindBuffer(GL_ARRAY_BUFFER, mesh->vboId[4]); - glBufferData(GL_ARRAY_BUFFER, mesh->vertexCount*4*sizeof(float), mesh->tangents, drawHint); - glVertexAttribPointer(4, 4, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(4); - } - else - { - // Default tangents vertex attribute - glVertexAttrib4f(4, 0.0f, 0.0f, 0.0f, 0.0f); - glDisableVertexAttribArray(4); - } - - // Default texcoord2 vertex attribute (shader-location = 5) - if (mesh->texcoords2 != NULL) - { - glGenBuffers(1, &mesh->vboId[5]); - glBindBuffer(GL_ARRAY_BUFFER, mesh->vboId[5]); - glBufferData(GL_ARRAY_BUFFER, mesh->vertexCount*2*sizeof(float), mesh->texcoords2, drawHint); - glVertexAttribPointer(5, 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(5); - } - else - { - // Default texcoord2 vertex attribute - glVertexAttrib2f(5, 0.0f, 0.0f); - glDisableVertexAttribArray(5); - } - - if (mesh->indices != NULL) - { - glGenBuffers(1, &mesh->vboId[6]); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh->vboId[6]); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, mesh->triangleCount*3*sizeof(unsigned short), mesh->indices, drawHint); - } - - if (RLGL.ExtSupported.vao) - { - if (mesh->vaoId > 0) TRACELOG(LOG_INFO, "VAO: [ID %i] Mesh uploaded successfully to VRAM (GPU)", mesh->vaoId); - else TRACELOG(LOG_WARNING, "VAO: Failed to load mesh to VRAM (GPU)"); - } - else - { - TRACELOG(LOG_INFO, "VBO: Mesh uploaded successfully to VRAM (GPU)"); - } + TRACELOG(LOG_INFO, "FBO: [ID %i] Unloaded framebuffer from VRAM (GPU)", id); #endif } +// Vertex data management +//----------------------------------------------------------------------------------------- // Load a new attributes buffer -unsigned int rlLoadAttribBuffer(unsigned int vaoId, int shaderLoc, void *buffer, int size, bool dynamic) +unsigned int rlLoadVertexBuffer(void *buffer, int size, bool dynamic) { unsigned int id = 0; #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - int drawHint = GL_STATIC_DRAW; - if (dynamic) drawHint = GL_DYNAMIC_DRAW; - - if (RLGL.ExtSupported.vao) glBindVertexArray(vaoId); - glGenBuffers(1, &id); glBindBuffer(GL_ARRAY_BUFFER, id); - glBufferData(GL_ARRAY_BUFFER, size, buffer, drawHint); - glVertexAttribPointer(shaderLoc, 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(shaderLoc); - - if (RLGL.ExtSupported.vao) glBindVertexArray(0); + glBufferData(GL_ARRAY_BUFFER, size, buffer, dynamic? GL_DYNAMIC_DRAW : GL_STATIC_DRAW); #endif return id; } -// Update vertex or index data on GPU (upload new data to one buffer) -void rlUpdateMesh(Mesh mesh, int buffer, int count) +// Load a new attributes element buffer +unsigned int rlLoadVertexBufferElement(void *buffer, int size, bool dynamic) { - rlUpdateMeshAt(mesh, buffer, count, 0); + unsigned int id = 0; + +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glGenBuffers(1, &id); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, id); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, size, buffer, dynamic? GL_DYNAMIC_DRAW : GL_STATIC_DRAW); +#endif + + return id; } -// Update vertex or index data on GPU, at index -// WARNING: error checking is in place that will cause the data to not be -// updated if offset + size exceeds what the buffer can hold -void rlUpdateMeshAt(Mesh mesh, int buffer, int count, int index) +void rlEnableVertexBuffer(unsigned int id) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Activate mesh VAO - if (RLGL.ExtSupported.vao) glBindVertexArray(mesh.vaoId); + glBindBuffer(GL_ARRAY_BUFFER, id); +#endif +} - switch (buffer) +void rlDisableVertexBuffer(void) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glBindBuffer(GL_ARRAY_BUFFER, 0); +#endif +} + +void rlEnableVertexBufferElement(unsigned int id) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, id); +#endif +} + +void rlDisableVertexBufferElement(void) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); +#endif +} + +// Update GPU buffer with new data +// NOTE: dataSize and offset must be provided in bytes +void rlUpdateVertexBuffer(int bufferId, void *data, int dataSize, int offset) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glBindBuffer(GL_ARRAY_BUFFER, bufferId); + glBufferSubData(GL_ARRAY_BUFFER, offset, dataSize, data); +#endif +} + +bool rlEnableVertexArray(unsigned int vaoId) +{ + bool result = false; +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + if (RLGL.ExtSupported.vao) { - case 0: // Update vertices (vertex position) - { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[0]); - if (index == 0 && count >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, count*3*sizeof(float), mesh.vertices, GL_DYNAMIC_DRAW); - else if (index + count >= mesh.vertexCount) break; - else glBufferSubData(GL_ARRAY_BUFFER, index*3*sizeof(float), count*3*sizeof(float), mesh.vertices); + glBindVertexArray(vaoId); + result = true; + } +#endif + return result; +} - } break; - case 1: // Update texcoords (vertex texture coordinates) - { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[1]); - if (index == 0 && count >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, count*2*sizeof(float), mesh.texcoords, GL_DYNAMIC_DRAW); - else if (index + count >= mesh.vertexCount) break; - else glBufferSubData(GL_ARRAY_BUFFER, index*2*sizeof(float), count*2*sizeof(float), mesh.texcoords); +void rlDisableVertexArray(void) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + if (RLGL.ExtSupported.vao) glBindVertexArray(0); +#endif +} - } break; - case 2: // Update normals (vertex normals) - { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[2]); - if (index == 0 && count >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, count*3*sizeof(float), mesh.normals, GL_DYNAMIC_DRAW); - else if (index + count >= mesh.vertexCount) break; - else glBufferSubData(GL_ARRAY_BUFFER, index*3*sizeof(float), count*3*sizeof(float), mesh.normals); +void rlEnableVertexAttribute(unsigned int index) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glEnableVertexAttribArray(index); +#endif +} - } break; - case 3: // Update colors (vertex colors) - { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[3]); - if (index == 0 && count >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, count*4*sizeof(unsigned char), mesh.colors, GL_DYNAMIC_DRAW); - else if (index + count >= mesh.vertexCount) break; - else glBufferSubData(GL_ARRAY_BUFFER, index*4*sizeof(unsigned char), count*4*sizeof(unsigned char), mesh.colors); +void rlDisableVertexAttribute(unsigned int index) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glDisableVertexAttribArray(index); +#endif +} - } break; - case 4: // Update tangents (vertex tangents) - { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[4]); - if (index == 0 && count >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, count*4*sizeof(float), mesh.tangents, GL_DYNAMIC_DRAW); - else if (index + count >= mesh.vertexCount) break; - else glBufferSubData(GL_ARRAY_BUFFER, index*4*sizeof(float), count*4*sizeof(float), mesh.tangents); +void rlDrawVertexArray(int offset, int count) +{ + glDrawArrays(GL_TRIANGLES, offset, count); +} - } break; - case 5: // Update texcoords2 (vertex second texture coordinates) - { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[5]); - if (index == 0 && count >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, count*2*sizeof(float), mesh.texcoords2, GL_DYNAMIC_DRAW); - else if (index + count >= mesh.vertexCount) break; - else glBufferSubData(GL_ARRAY_BUFFER, index*2*sizeof(float), count*2*sizeof(float), mesh.texcoords2); +void rlDrawVertexArrayElements(int offset, int count, void *buffer) +{ + glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (unsigned short*)buffer + offset); +} - } break; - case 6: // Update indices (triangle index buffer) - { - // the * 3 is because each triangle has 3 indices - unsigned short *indices = mesh.indices; - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh.vboId[6]); +void rlDrawVertexArrayInstanced(int offset, int count, int instances) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glDrawArraysInstanced(GL_TRIANGLES, 0, count, instances); +#endif +} - if (index == 0 && count >= mesh.triangleCount) glBufferData(GL_ELEMENT_ARRAY_BUFFER, count*3*sizeof(*indices), indices, GL_DYNAMIC_DRAW); - else if (index + count >= mesh.triangleCount) break; - else glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, index*3*sizeof(*indices), count*3*sizeof(*indices), indices); +void rlDrawVertexArrayElementsInstanced(int offset, int count, void *buffer, int instances) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glDrawElementsInstanced(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (unsigned short*)buffer + offset, instances); +#endif +} - } break; +#if defined(GRAPHICS_API_OPENGL_11) +void rlEnableStatePointer(int vertexAttribType, void *buffer) +{ + if (buffer != NULL) glEnableClientState(vertexAttribType); + switch (vertexAttribType) + { + case GL_VERTEX_ARRAY: glVertexPointer(3, GL_FLOAT, 0, buffer); break; + case GL_TEXTURE_COORD_ARRAY: glTexCoordPointer(2, GL_FLOAT, 0, buffer); break; + case GL_NORMAL_ARRAY: if (buffer != NULL) glNormalPointer(GL_FLOAT, 0, buffer); break; + case GL_COLOR_ARRAY: if (buffer != NULL) glColorPointer(4, GL_UNSIGNED_BYTE, 0, buffer); break; + //case GL_INDEX_ARRAY: if (buffer != NULL) glIndexPointer(GL_SHORT, 0, buffer); break; // Indexed colors default: break; } - - // Unbind the current VAO - if (RLGL.ExtSupported.vao) glBindVertexArray(0); - - // Another option would be using buffer mapping... - //mesh.vertices = glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE); - // Now we can modify vertices - //glUnmapBuffer(GL_ARRAY_BUFFER); -#endif } -// Draw a 3d mesh with material and transform -void rlDrawMesh(Mesh mesh, Material material, Matrix transform) +void rlDisableStatePointer(int vertexAttribType) { -#if defined(GRAPHICS_API_OPENGL_11) - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, material.maps[MAP_DIFFUSE].texture.id); - - // NOTE: On OpenGL 1.1 we use Vertex Arrays to draw model - glEnableClientState(GL_VERTEX_ARRAY); // Enable vertex array - glEnableClientState(GL_TEXTURE_COORD_ARRAY); // Enable texture coords array - if (mesh.normals != NULL) glEnableClientState(GL_NORMAL_ARRAY); // Enable normals array - if (mesh.colors != NULL) glEnableClientState(GL_COLOR_ARRAY); // Enable colors array - - glVertexPointer(3, GL_FLOAT, 0, mesh.vertices); // Pointer to vertex coords array - glTexCoordPointer(2, GL_FLOAT, 0, mesh.texcoords); // Pointer to texture coords array - if (mesh.normals != NULL) glNormalPointer(GL_FLOAT, 0, mesh.normals); // Pointer to normals array - if (mesh.colors != NULL) glColorPointer(4, GL_UNSIGNED_BYTE, 0, mesh.colors); // Pointer to colors array - - rlPushMatrix(); - rlMultMatrixf(MatrixToFloat(transform)); - rlColor4ub(material.maps[MAP_DIFFUSE].color.r, material.maps[MAP_DIFFUSE].color.g, material.maps[MAP_DIFFUSE].color.b, material.maps[MAP_DIFFUSE].color.a); - - if (mesh.indices != NULL) glDrawElements(GL_TRIANGLES, mesh.triangleCount*3, GL_UNSIGNED_SHORT, mesh.indices); - else glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); - rlPopMatrix(); - - glDisableClientState(GL_VERTEX_ARRAY); // Disable vertex array - glDisableClientState(GL_TEXTURE_COORD_ARRAY); // Disable texture coords array - if (mesh.normals != NULL) glDisableClientState(GL_NORMAL_ARRAY); // Disable normals array - if (mesh.colors != NULL) glDisableClientState(GL_NORMAL_ARRAY); // Disable colors array - - glDisable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, 0); + glDisableClientState(vertexAttribType); +} #endif +unsigned int rlLoadVertexArray(void) +{ + unsigned int vaoId = 0; #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Bind shader program - glUseProgram(material.shader.id); - - // Matrices and other values required by shader - //----------------------------------------------------- - // Calculate and send to shader model matrix (used by PBR shader) - if (material.shader.locs[LOC_MATRIX_MODEL] != -1) SetShaderValueMatrix(material.shader, material.shader.locs[LOC_MATRIX_MODEL], transform); - - // Upload to shader material.colDiffuse - if (material.shader.locs[LOC_COLOR_DIFFUSE] != -1) - glUniform4f(material.shader.locs[LOC_COLOR_DIFFUSE], (float)material.maps[MAP_DIFFUSE].color.r/255.0f, - (float)material.maps[MAP_DIFFUSE].color.g/255.0f, - (float)material.maps[MAP_DIFFUSE].color.b/255.0f, - (float)material.maps[MAP_DIFFUSE].color.a/255.0f); - - // Upload to shader material.colSpecular (if available) - if (material.shader.locs[LOC_COLOR_SPECULAR] != -1) - glUniform4f(material.shader.locs[LOC_COLOR_SPECULAR], (float)material.maps[MAP_SPECULAR].color.r/255.0f, - (float)material.maps[MAP_SPECULAR].color.g/255.0f, - (float)material.maps[MAP_SPECULAR].color.b/255.0f, - (float)material.maps[MAP_SPECULAR].color.a/255.0f); - - if (material.shader.locs[LOC_MATRIX_VIEW] != -1) SetShaderValueMatrix(material.shader, material.shader.locs[LOC_MATRIX_VIEW], RLGL.State.modelview); - if (material.shader.locs[LOC_MATRIX_PROJECTION] != -1) SetShaderValueMatrix(material.shader, material.shader.locs[LOC_MATRIX_PROJECTION], RLGL.State.projection); - - // At this point the modelview matrix just contains the view matrix (camera) - // That's because BeginMode3D() sets it an no model-drawing function modifies it, all use rlPushMatrix() and rlPopMatrix() - Matrix matView = RLGL.State.modelview; // View matrix (camera) - Matrix matProjection = RLGL.State.projection; // Projection matrix (perspective) - - // TODO: Consider possible transform matrices in the RLGL.State.stack - // Is this the right order? or should we start with the first stored matrix instead of the last one? - //Matrix matStackTransform = MatrixIdentity(); - //for (int i = RLGL.State.stackCounter; i > 0; i--) matStackTransform = MatrixMultiply(RLGL.State.stack[i], matStackTransform); - - // Transform to camera-space coordinates - Matrix matModelView = MatrixMultiply(transform, MatrixMultiply(RLGL.State.transform, matView)); - //----------------------------------------------------- - - // Bind active texture maps (if available) - for (int i = 0; i < MAX_MATERIAL_MAPS; i++) + if (RLGL.ExtSupported.vao) { - if (material.maps[i].texture.id > 0) - { - glActiveTexture(GL_TEXTURE0 + i); - if ((i == MAP_IRRADIANCE) || (i == MAP_PREFILTER) || (i == MAP_CUBEMAP)) glBindTexture(GL_TEXTURE_CUBE_MAP, material.maps[i].texture.id); - else glBindTexture(GL_TEXTURE_2D, material.maps[i].texture.id); - - glUniform1i(material.shader.locs[LOC_MAP_DIFFUSE + i], i); - } + glGenVertexArrays(1, &vaoId); } - - // Bind vertex array objects (or VBOs) - if (RLGL.ExtSupported.vao) glBindVertexArray(mesh.vaoId); - else - { - // Bind mesh VBO data: vertex position (shader-location = 0) - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[0]); - glVertexAttribPointer(material.shader.locs[LOC_VERTEX_POSITION], 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(material.shader.locs[LOC_VERTEX_POSITION]); - - // Bind mesh VBO data: vertex texcoords (shader-location = 1) - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[1]); - glVertexAttribPointer(material.shader.locs[LOC_VERTEX_TEXCOORD01], 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(material.shader.locs[LOC_VERTEX_TEXCOORD01]); - - // Bind mesh VBO data: vertex normals (shader-location = 2, if available) - if (material.shader.locs[LOC_VERTEX_NORMAL] != -1) - { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[2]); - glVertexAttribPointer(material.shader.locs[LOC_VERTEX_NORMAL], 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(material.shader.locs[LOC_VERTEX_NORMAL]); - } - - // Bind mesh VBO data: vertex colors (shader-location = 3, if available) - if (material.shader.locs[LOC_VERTEX_COLOR] != -1) - { - if (mesh.vboId[3] != 0) - { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[3]); - glVertexAttribPointer(material.shader.locs[LOC_VERTEX_COLOR], 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - glEnableVertexAttribArray(material.shader.locs[LOC_VERTEX_COLOR]); - } - else - { - // Set default value for unused attribute - // NOTE: Required when using default shader and no VAO support - glVertexAttrib4f(material.shader.locs[LOC_VERTEX_COLOR], 1.0f, 1.0f, 1.0f, 1.0f); - glDisableVertexAttribArray(material.shader.locs[LOC_VERTEX_COLOR]); - } - } - - // Bind mesh VBO data: vertex tangents (shader-location = 4, if available) - if (material.shader.locs[LOC_VERTEX_TANGENT] != -1) - { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[4]); - glVertexAttribPointer(material.shader.locs[LOC_VERTEX_TANGENT], 4, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(material.shader.locs[LOC_VERTEX_TANGENT]); - } - - // Bind mesh VBO data: vertex texcoords2 (shader-location = 5, if available) - if (material.shader.locs[LOC_VERTEX_TEXCOORD02] != -1) - { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[5]); - glVertexAttribPointer(material.shader.locs[LOC_VERTEX_TEXCOORD02], 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(material.shader.locs[LOC_VERTEX_TEXCOORD02]); - } - - if (mesh.indices != NULL) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh.vboId[6]); - } - - int eyesCount = 1; -#if defined(SUPPORT_VR_SIMULATOR) - if (RLGL.Vr.stereoRender) eyesCount = 2; -#endif - - for (int eye = 0; eye < eyesCount; eye++) - { - if (eyesCount == 1) RLGL.State.modelview = matModelView; - #if defined(SUPPORT_VR_SIMULATOR) - else SetStereoView(eye, matProjection, matModelView); - #endif - - // Calculate model-view-projection matrix (MVP) - Matrix matMVP = MatrixMultiply(RLGL.State.modelview, RLGL.State.projection); // Transform to screen-space coordinates - - // Send combined model-view-projection matrix to shader - glUniformMatrix4fv(material.shader.locs[LOC_MATRIX_MVP], 1, false, MatrixToFloat(matMVP)); - - // Draw call! - if (mesh.indices != NULL) glDrawElements(GL_TRIANGLES, mesh.triangleCount*3, GL_UNSIGNED_SHORT, 0); // Indexed vertices draw - else glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); - } - - // Unbind all binded texture maps - for (int i = 0; i < MAX_MATERIAL_MAPS; i++) - { - glActiveTexture(GL_TEXTURE0 + i); // Set shader active texture - if ((i == MAP_IRRADIANCE) || (i == MAP_PREFILTER) || (i == MAP_CUBEMAP)) glBindTexture(GL_TEXTURE_CUBE_MAP, 0); - else glBindTexture(GL_TEXTURE_2D, 0); // Unbind current active texture - } - - // Unind vertex array objects (or VBOs) - if (RLGL.ExtSupported.vao) glBindVertexArray(0); - else - { - glBindBuffer(GL_ARRAY_BUFFER, 0); - if (mesh.indices != NULL) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - } - - // Unbind shader program - glUseProgram(0); - - // Restore RLGL.State.projection/RLGL.State.modelview matrices - // NOTE: In stereo rendering matrices are being modified to fit every eye - RLGL.State.projection = matProjection; - RLGL.State.modelview = matView; #endif + return vaoId; } -// Draw a 3d mesh with material and transform -void rlDrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int count) +void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, void *pointer) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glVertexAttribPointer(index, compSize, type, normalized, stride, pointer); +#endif +} + +void rlSetVertexAttributeDivisor(unsigned int index, int divisor) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glVertexAttribDivisor(index, divisor); +#endif +} + +void rlUnloadVertexArray(unsigned int vaoId) { -#if defined(GRAPHICS_API_OPENGL_33) - // Bind shader program - glUseProgram(material.shader.id); - - // Upload to shader material.colDiffuse - if (material.shader.locs[LOC_COLOR_DIFFUSE] != -1) - glUniform4f(material.shader.locs[LOC_COLOR_DIFFUSE], (float)material.maps[MAP_DIFFUSE].color.r/255.0f, - (float)material.maps[MAP_DIFFUSE].color.g/255.0f, - (float)material.maps[MAP_DIFFUSE].color.b/255.0f, - (float)material.maps[MAP_DIFFUSE].color.a/255.0f); - - // Upload to shader material.colSpecular (if available) - if (material.shader.locs[LOC_COLOR_SPECULAR] != -1) - glUniform4f(material.shader.locs[LOC_COLOR_SPECULAR], (float)material.maps[MAP_SPECULAR].color.r/255.0f, - (float)material.maps[MAP_SPECULAR].color.g/255.0f, - (float)material.maps[MAP_SPECULAR].color.b/255.0f, - (float)material.maps[MAP_SPECULAR].color.a/255.0f); - - // Bind active texture maps (if available) - for (int i = 0; i < MAX_MATERIAL_MAPS; i++) - { - if (material.maps[i].texture.id > 0) - { - glActiveTexture(GL_TEXTURE0 + i); - if ((i == MAP_IRRADIANCE) || (i == MAP_PREFILTER) || (i == MAP_CUBEMAP)) - glBindTexture(GL_TEXTURE_CUBE_MAP, material.maps[i].texture.id); - else glBindTexture(GL_TEXTURE_2D, material.maps[i].texture.id); - - glUniform1i(material.shader.locs[LOC_MAP_DIFFUSE + i], i); - } - } - - // Bind vertex array objects (or VBOs) - glBindVertexArray(mesh.vaoId); - - // At this point the modelview matrix just contains the view matrix (camera) - // For instanced shaders "mvp" is not premultiplied by any instance transform, only RLGL.State.transform - glUniformMatrix4fv(material.shader.locs[LOC_MATRIX_MVP], 1, false, - MatrixToFloat(MatrixMultiply(MatrixMultiply(RLGL.State.transform, RLGL.State.modelview), RLGL.State.projection))); - - float16* instances = RL_MALLOC(count*sizeof(float16)); - - for (int i = 0; i < count; i++) instances[i] = MatrixToFloatV(transforms[i]); - - // This could alternatively use a static VBO and either glMapBuffer or glBufferSubData. - // It isn't clear which would be reliably faster in all cases and on all platforms, and - // anecdotally glMapBuffer seems very slow (syncs) while glBufferSubData seems no faster - // since we're transferring all the transform matrices anyway. - unsigned int instancesB = 0; - glGenBuffers(1, &instancesB); - glBindBuffer(GL_ARRAY_BUFFER, instancesB); - glBufferData(GL_ARRAY_BUFFER, count*sizeof(float16), instances, GL_STATIC_DRAW); - - // Instances are put in LOC_MATRIX_MODEL attribute location with space for 4x Vector4, eg: - // layout (location = 12) in mat4 instance; - unsigned int instanceA = material.shader.locs[LOC_MATRIX_MODEL]; - - for (unsigned int i = 0; i < 4; i++) - { - glEnableVertexAttribArray(instanceA+i); - glVertexAttribPointer(instanceA + i, 4, GL_FLOAT, GL_FALSE, sizeof(Matrix), (void *)(i*sizeof(Vector4))); - glVertexAttribDivisor(instanceA + i, 1); - } - - glBindBuffer(GL_ARRAY_BUFFER, 0); - - // Draw call! - if (mesh.indices != NULL) glDrawElementsInstanced(GL_TRIANGLES, mesh.triangleCount*3, GL_UNSIGNED_SHORT, 0, count); - else glDrawArraysInstanced(GL_TRIANGLES, 0, mesh.vertexCount, count); - - glDeleteBuffers(1, &instancesB); - RL_FREE(instances); - - // Unbind all binded texture maps - for (int i = 0; i < MAX_MATERIAL_MAPS; i++) - { - glActiveTexture(GL_TEXTURE0 + i); // Set shader active texture - if ((i == MAP_IRRADIANCE) || (i == MAP_PREFILTER) || (i == MAP_CUBEMAP)) glBindTexture(GL_TEXTURE_CUBE_MAP, 0); - else glBindTexture(GL_TEXTURE_2D, 0); // Unbind current active texture - } - - // Unind vertex array objects (or VBOs) - glBindVertexArray(0); - - // Unbind shader program - glUseProgram(0); - -#else - TRACELOG(LOG_ERROR, "VAO: Instanced rendering requires GRAPHICS_API_OPENGL_33"); -#endif -} - -// Unload mesh data from CPU and GPU -void rlUnloadMesh(Mesh mesh) -{ - RL_FREE(mesh.vertices); - RL_FREE(mesh.texcoords); - RL_FREE(mesh.normals); - RL_FREE(mesh.colors); - RL_FREE(mesh.tangents); - RL_FREE(mesh.texcoords2); - RL_FREE(mesh.indices); - - RL_FREE(mesh.animVertices); - RL_FREE(mesh.animNormals); - RL_FREE(mesh.boneWeights); - RL_FREE(mesh.boneIds); - #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - for (int i = 0; i < 7; i++) glDeleteBuffers(1, &mesh.vboId[i]); // DEFAULT_MESH_VERTEX_BUFFERS (model.c) if (RLGL.ExtSupported.vao) { glBindVertexArray(0); - glDeleteVertexArrays(1, &mesh.vaoId); - TRACELOG(LOG_INFO, "VAO: [ID %i] Unloaded vertex data from VRAM (GPU)", mesh.vaoId); + glDeleteVertexArrays(1, &vaoId); + TRACELOG(LOG_INFO, "VAO: [ID %i] Unloaded vertex array data from VRAM (GPU)", vaoId); } - else TRACELOG(LOG_INFO, "VBO: Unloaded vertex data from VRAM (GPU)"); #endif } -// Read screen pixel data (color buffer) -unsigned char *rlReadScreenPixels(int width, int height) -{ - unsigned char *screenData = (unsigned char *)RL_CALLOC(width*height*4, sizeof(unsigned char)); - - // NOTE 1: glReadPixels returns image flipped vertically -> (0,0) is the bottom left corner of the framebuffer - // NOTE 2: We are getting alpha channel! Be careful, it can be transparent if not cleared properly! - glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, screenData); - - // Flip image vertically! - unsigned char *imgData = (unsigned char *)RL_MALLOC(width*height*4*sizeof(unsigned char)); - - for (int y = height - 1; y >= 0; y--) - { - for (int x = 0; x < (width*4); x++) - { - imgData[((height - 1) - y)*width*4 + x] = screenData[(y*width*4) + x]; // Flip line - - // Set alpha component value to 255 (no trasparent image retrieval) - // NOTE: Alpha value has already been applied to RGB in framebuffer, we don't need it! - if (((x + 1)%4) == 0) imgData[((height - 1) - y)*width*4 + x] = 255; - } - } - - RL_FREE(screenData); - - return imgData; // NOTE: image data should be freed -} - -// Read texture pixel data -void *rlReadTexturePixels(Texture2D texture) -{ - void *pixels = NULL; - -#if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) - glBindTexture(GL_TEXTURE_2D, texture.id); - - // NOTE: Using texture.id, we can retrieve some texture info (but not on OpenGL ES 2.0) - // Possible texture info: GL_TEXTURE_RED_SIZE, GL_TEXTURE_GREEN_SIZE, GL_TEXTURE_BLUE_SIZE, GL_TEXTURE_ALPHA_SIZE - //int width, height, format; - //glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width); - //glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height); - //glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &format); - - // NOTE: Each row written to or read from by OpenGL pixel operations like glGetTexImage are aligned to a 4 byte boundary by default, which may add some padding. - // Use glPixelStorei to modify padding with the GL_[UN]PACK_ALIGNMENT setting. - // GL_PACK_ALIGNMENT affects operations that read from OpenGL memory (glReadPixels, glGetTexImage, etc.) - // GL_UNPACK_ALIGNMENT affects operations that write to OpenGL memory (glTexImage, etc.) - glPixelStorei(GL_PACK_ALIGNMENT, 1); - - unsigned int glInternalFormat, glFormat, glType; - rlGetGlTextureFormats(texture.format, &glInternalFormat, &glFormat, &glType); - unsigned int size = GetPixelDataSize(texture.width, texture.height, texture.format); - - if ((glInternalFormat != -1) && (texture.format < COMPRESSED_DXT1_RGB)) - { - pixels = RL_MALLOC(size); - glGetTexImage(GL_TEXTURE_2D, 0, glFormat, glType, pixels); - } - else TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] Data retrieval not suported for pixel format (%i)", texture.id, texture.format); - - glBindTexture(GL_TEXTURE_2D, 0); -#endif - -#if defined(GRAPHICS_API_OPENGL_ES2) - // glGetTexImage() is not available on OpenGL ES 2.0 - // Texture2D width and height are required on OpenGL ES 2.0. There is no way to get it from texture id. - // Two possible Options: - // 1 - Bind texture to color fbo attachment and glReadPixels() - // 2 - Create an fbo, activate it, render quad with texture, glReadPixels() - // We are using Option 1, just need to care for texture format on retrieval - // NOTE: This behaviour could be conditioned by graphic driver... - unsigned int fboId = rlLoadFramebuffer(texture.width, texture.height); - - // TODO: Create depth texture/renderbuffer for fbo? - - glBindFramebuffer(GL_FRAMEBUFFER, fboId); - glBindTexture(GL_TEXTURE_2D, 0); - - // Attach our texture to FBO - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture.id, 0); - - // We read data as RGBA because FBO texture is configured as RGBA, despite binding another texture format - pixels = (unsigned char *)RL_MALLOC(GetPixelDataSize(texture.width, texture.height, UNCOMPRESSED_R8G8B8A8)); - glReadPixels(0, 0, texture.width, texture.height, GL_RGBA, GL_UNSIGNED_BYTE, pixels); - - glBindFramebuffer(GL_FRAMEBUFFER, 0); - - // Clean up temporal fbo - rlUnloadFramebuffer(fboId); -#endif - - return pixels; -} - -//---------------------------------------------------------------------------------- -// Module Functions Definition - Shaders Functions -// NOTE: Those functions are exposed directly to the user in raylib.h -//---------------------------------------------------------------------------------- - -// Get default internal texture (white texture) -Texture2D GetTextureDefault(void) -{ - Texture2D texture = { 0 }; -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - texture.id = RLGL.State.defaultTextureId; - texture.width = 1; - texture.height = 1; - texture.mipmaps = 1; - texture.format = UNCOMPRESSED_R8G8B8A8; -#endif - return texture; -} - -// Get texture to draw shapes (RAII) -Texture2D GetShapesTexture(void) -{ -#if defined(GRAPHICS_API_OPENGL_11) - Texture2D texture = { 0 }; - return texture; -#else - return RLGL.State.shapesTexture; -#endif -} - -// Get texture rectangle to draw shapes -Rectangle GetShapesTextureRec(void) -{ -#if defined(GRAPHICS_API_OPENGL_11) - Rectangle rec = { 0 }; - return rec; -#else - return RLGL.State.shapesTextureRec; -#endif -} - -// Define default texture used to draw shapes -void SetShapesTexture(Texture2D texture, Rectangle source) +void rlUnloadVertexBuffer(unsigned int vboId) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - RLGL.State.shapesTexture = texture; - RLGL.State.shapesTextureRec = source; + glDeleteBuffers(1, &vboId); + //TRACELOG(LOG_INFO, "VBO: Unloaded vertex data from VRAM (GPU)"); #endif } -// Get default shader -Shader GetShaderDefault(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - return RLGL.State.defaultShader; -#else - Shader shader = { 0 }; - return shader; -#endif -} - -// Load shader from files and bind default locations -// NOTE: If shader string is NULL, using default vertex/fragment shaders -Shader LoadShader(const char *vsFileName, const char *fsFileName) -{ - Shader shader = { 0 }; - - // NOTE: Shader.locs is allocated by LoadShaderCode() - - char *vShaderStr = NULL; - char *fShaderStr = NULL; - - if (vsFileName != NULL) vShaderStr = LoadFileText(vsFileName); - if (fsFileName != NULL) fShaderStr = LoadFileText(fsFileName); - - shader = LoadShaderCode(vShaderStr, fShaderStr); - - if (vShaderStr != NULL) RL_FREE(vShaderStr); - if (fShaderStr != NULL) RL_FREE(fShaderStr); - - return shader; -} - +// Shaders management +//----------------------------------------------------------------------------------------------- // Load shader from code strings // NOTE: If shader string is NULL, using default vertex/fragment shaders -Shader LoadShaderCode(const char *vsCode, const char *fsCode) +unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode) { - Shader shader = { 0 }; - shader.locs = (int *)RL_CALLOC(MAX_SHADER_LOCATIONS, sizeof(int)); - - // NOTE: All locations must be reseted to -1 (no location) - for (int i = 0; i < MAX_SHADER_LOCATIONS; i++) shader.locs[i] = -1; + unsigned int id = 0; #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) unsigned int vertexShaderId = RLGL.State.defaultVShaderId; unsigned int fragmentShaderId = RLGL.State.defaultFShaderId; - if (vsCode != NULL) vertexShaderId = CompileShader(vsCode, GL_VERTEX_SHADER); - if (fsCode != NULL) fragmentShaderId = CompileShader(fsCode, GL_FRAGMENT_SHADER); + if (vsCode != NULL) vertexShaderId = rlCompileShader(vsCode, GL_VERTEX_SHADER); + if (fsCode != NULL) fragmentShaderId = rlCompileShader(fsCode, GL_FRAGMENT_SHADER); - if ((vertexShaderId == RLGL.State.defaultVShaderId) && (fragmentShaderId == RLGL.State.defaultFShaderId)) shader = RLGL.State.defaultShader; + if ((vertexShaderId == RLGL.State.defaultVShaderId) && (fragmentShaderId == RLGL.State.defaultFShaderId)) id = RLGL.State.defaultShader.id; else { - shader.id = LoadShaderProgram(vertexShaderId, fragmentShaderId); + id = rlLoadShaderProgram(vertexShaderId, fragmentShaderId); if (vertexShaderId != RLGL.State.defaultVShaderId) { // Detach shader before deletion to make sure memory is freed - glDetachShader(shader.id, vertexShaderId); + glDetachShader(id, vertexShaderId); glDeleteShader(vertexShaderId); } if (fragmentShaderId != RLGL.State.defaultFShaderId) { // Detach shader before deletion to make sure memory is freed - glDetachShader(shader.id, fragmentShaderId); + glDetachShader(id, fragmentShaderId); glDeleteShader(fragmentShaderId); } - if (shader.id == 0) + if (id == 0) { TRACELOG(LOG_WARNING, "SHADER: Failed to load custom shader code"); - shader = RLGL.State.defaultShader; + id = RLGL.State.defaultShader.id; } - - // After shader loading, we TRY to set default location names - if (shader.id > 0) SetShaderDefaultLocations(&shader); } // Get available shader uniforms // NOTE: This information is useful for debug... int uniformCount = -1; - glGetProgramiv(shader.id, GL_ACTIVE_UNIFORMS, &uniformCount); + glGetProgramiv(id, GL_ACTIVE_UNIFORMS, &uniformCount); for (int i = 0; i < uniformCount; i++) { @@ -3269,819 +3238,71 @@ Shader LoadShaderCode(const char *vsCode, const char *fsCode) GLenum type = GL_ZERO; // Get the name of the uniforms - glGetActiveUniform(shader.id, i, sizeof(name) - 1, &namelen, &num, &type, name); + glGetActiveUniform(id, i, sizeof(name) - 1, &namelen, &num, &type, name); name[namelen] = 0; - TRACELOGD("SHADER: [ID %i] Active uniform (%s) set at location: %i", shader.id, name, glGetUniformLocation(shader.id, name)); + TRACELOGD("SHADER: [ID %i] Active uniform (%s) set at location: %i", id, name, glGetUniformLocation(id, name)); } #endif - return shader; + return id; } -// Unload shader from GPU memory (VRAM) -void UnloadShader(Shader shader) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (shader.id != RLGL.State.defaultShader.id) - { - glDeleteProgram(shader.id); - RL_FREE(shader.locs); - - TRACELOG(LOG_INFO, "SHADER: [ID %i] Unloaded shader program data from VRAM (GPU)", shader.id); - } -#endif -} - -// Begin custom shader mode -void BeginShaderMode(Shader shader) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (RLGL.State.currentShader.id != shader.id) - { - DrawRenderBatch(RLGL.currentBatch); - RLGL.State.currentShader = shader; - } -#endif -} - -// End custom shader mode (returns to default shader) -void EndShaderMode(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - BeginShaderMode(RLGL.State.defaultShader); -#endif -} - -// Get shader uniform location -int GetShaderLocation(Shader shader, const char *uniformName) -{ - int location = -1; -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - location = glGetUniformLocation(shader.id, uniformName); - - if (location == -1) TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to find shader uniform: %s", shader.id, uniformName); - else TRACELOG(LOG_INFO, "SHADER: [ID %i] Shader uniform (%s) set at location: %i", shader.id, uniformName, location); -#endif - return location; -} - -// Get shader attribute location -int GetShaderLocationAttrib(Shader shader, const char *attribName) -{ - int location = -1; -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - location = glGetAttribLocation(shader.id, attribName); - - if (location == -1) TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to find shader attribute: %s", shader.id, attribName); - else TRACELOG(LOG_INFO, "SHADER: [ID %i] Shader attribute (%s) set at location: %i", shader.id, attribName, location); -#endif - return location; -} - -// Set shader uniform value -void SetShaderValue(Shader shader, int uniformLoc, const void *value, int uniformType) -{ - SetShaderValueV(shader, uniformLoc, value, uniformType, 1); -} - -// Set shader uniform value vector -void SetShaderValueV(Shader shader, int uniformLoc, const void *value, int uniformType, int count) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glUseProgram(shader.id); - - switch (uniformType) - { - case UNIFORM_FLOAT: glUniform1fv(uniformLoc, count, (float *)value); break; - case UNIFORM_VEC2: glUniform2fv(uniformLoc, count, (float *)value); break; - case UNIFORM_VEC3: glUniform3fv(uniformLoc, count, (float *)value); break; - case UNIFORM_VEC4: glUniform4fv(uniformLoc, count, (float *)value); break; - case UNIFORM_INT: glUniform1iv(uniformLoc, count, (int *)value); break; - case UNIFORM_IVEC2: glUniform2iv(uniformLoc, count, (int *)value); break; - case UNIFORM_IVEC3: glUniform3iv(uniformLoc, count, (int *)value); break; - case UNIFORM_IVEC4: glUniform4iv(uniformLoc, count, (int *)value); break; - case UNIFORM_SAMPLER2D: glUniform1iv(uniformLoc, count, (int *)value); break; - default: TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to set uniform, data type not recognized", shader.id); - } - - //glUseProgram(0); // Avoid reseting current shader program, in case other uniforms are set -#endif -} - - -// Set shader uniform value (matrix 4x4) -void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glUseProgram(shader.id); - - glUniformMatrix4fv(uniformLoc, 1, false, MatrixToFloat(mat)); - - //glUseProgram(0); -#endif -} - -// Set shader uniform value for texture -void SetShaderValueTexture(Shader shader, int uniformLoc, Texture2D texture) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glUseProgram(shader.id); - - // Check if texture is already active - for (int i = 0; i < MAX_BATCH_ACTIVE_TEXTURES; i++) if (RLGL.State.activeTextureId[i] == texture.id) return; - - // Register a new active texture for the internal batch system - // NOTE: Default texture is always activated as GL_TEXTURE0 - for (int i = 0; i < MAX_BATCH_ACTIVE_TEXTURES; i++) - { - if (RLGL.State.activeTextureId[i] == 0) - { - glUniform1i(uniformLoc, 1 + i); // Activate new texture unit - RLGL.State.activeTextureId[i] = texture.id; // Save texture id for binding on drawing - break; - } - } - - //glUseProgram(0); -#endif -} - -// Set a custom projection matrix (replaces internal projection matrix) -void SetMatrixProjection(Matrix projection) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - RLGL.State.projection = projection; -#endif -} - -// Return internal projection matrix -Matrix GetMatrixProjection(void) { -#if defined(GRAPHICS_API_OPENGL_11) - float mat[16]; - glGetFloatv(GL_PROJECTION_MATRIX,mat); - Matrix m; - m.m0 = mat[0]; m.m1 = mat[1]; m.m2 = mat[2]; m.m3 = mat[3]; - m.m4 = mat[4]; m.m5 = mat[5]; m.m6 = mat[6]; m.m7 = mat[7]; - m.m8 = mat[8]; m.m9 = mat[9]; m.m10 = mat[10]; m.m11 = mat[11]; - m.m12 = mat[12]; m.m13 = mat[13]; m.m14 = mat[14]; m.m15 = mat[15]; - return m; -#else - return RLGL.State.projection; -#endif -# -} - -// Set a custom modelview matrix (replaces internal modelview matrix) -void SetMatrixModelview(Matrix view) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - RLGL.State.modelview = view; -#endif -} - -// Return internal modelview matrix -Matrix GetMatrixModelview(void) -{ - Matrix matrix = MatrixIdentity(); -#if defined(GRAPHICS_API_OPENGL_11) - float mat[16]; - glGetFloatv(GL_MODELVIEW_MATRIX, mat); - matrix.m0 = mat[0]; matrix.m1 = mat[1]; matrix.m2 = mat[2]; matrix.m3 = mat[3]; - matrix.m4 = mat[4]; matrix.m5 = mat[5]; matrix.m6 = mat[6]; matrix.m7 = mat[7]; - matrix.m8 = mat[8]; matrix.m9 = mat[9]; matrix.m10 = mat[10]; matrix.m11 = mat[11]; - matrix.m12 = mat[12]; matrix.m13 = mat[13]; matrix.m14 = mat[14]; matrix.m15 = mat[15]; -#else - matrix = RLGL.State.modelview; -#endif - return matrix; -} - -// Generate cubemap texture from HDR texture -TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int size, int format) -{ - TextureCubemap cubemap = { 0 }; -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - rlDisableBackfaceCulling(); // Disable backface culling to render inside the cube - - // STEP 1: Setup framebuffer - //------------------------------------------------------------------------------------------ - unsigned int rbo = rlLoadTextureDepth(size, size, true); - cubemap.id = rlLoadTextureCubemap(NULL, size, format); - - unsigned int fbo = rlLoadFramebuffer(size, size); - rlFramebufferAttach(fbo, rbo, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER); - rlFramebufferAttach(fbo, cubemap.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X); - - // Check if framebuffer is complete with attachments (valid) - if (rlFramebufferComplete(fbo)) TRACELOG(LOG_INFO, "FBO: [ID %i] Framebuffer object created successfully", fbo); - //------------------------------------------------------------------------------------------ - - // STEP 2: Draw to framebuffer - //------------------------------------------------------------------------------------------ - // NOTE: Shader is used to convert HDR equirectangular environment map to cubemap equivalent (6 faces) - - // Define projection matrix and send it to shader - Matrix fboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR); - SetShaderValueMatrix(shader, shader.locs[LOC_MATRIX_PROJECTION], fboProjection); - - // Define view matrix for every side of the cubemap - Matrix fboViews[6] = { - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ -1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 1.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 1.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, -1.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 1.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, -1.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }) - }; - - rlEnableShader(shader.id); -#if !defined(GENTEXTURECUBEMAP_USE_BATCH_SYSTEM) - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, panorama.id); -#endif - - rlViewport(0, 0, size, size); // Set viewport to current fbo dimensions - - for (int i = 0; i < 6; i++) - { - SetShaderValueMatrix(shader, shader.locs[LOC_MATRIX_VIEW], fboViews[i]); - rlFramebufferAttach(fbo, cubemap.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X + i); - - rlEnableFramebuffer(fbo); -#if defined(GENTEXTURECUBEMAP_USE_BATCH_SYSTEM) - rlEnableTexture(panorama.id); // WARNING: It must be called after enabling current framebuffer if using internal batch system! -#endif - rlClearScreenBuffers(); - GenDrawCube(); - -#if defined(GENTEXTURECUBEMAP_USE_BATCH_SYSTEM) - // Using internal batch system instead of raw OpenGL cube creating+drawing - // NOTE: DrawCubeV() is actually provided by models.c! -> GenTextureCubemap() should be moved to user code! - DrawCubeV(Vector3Zero(), Vector3One(), WHITE); - DrawRenderBatch(RLGL.currentBatch); -#endif - } - //------------------------------------------------------------------------------------------ - - // STEP 3: Unload framebuffer and reset state - //------------------------------------------------------------------------------------------ - rlDisableShader(); // Unbind shader - rlDisableTexture(); // Unbind texture - rlDisableFramebuffer(); // Unbind framebuffer - rlUnloadFramebuffer(fbo); // Unload framebuffer (and automatically attached depth texture/renderbuffer) - - // Reset viewport dimensions to default - rlViewport(0, 0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight); - //rlEnableBackfaceCulling(); - //------------------------------------------------------------------------------------------ - - cubemap.width = size; - cubemap.height = size; - cubemap.mipmaps = 1; - cubemap.format = UNCOMPRESSED_R32G32B32; -#endif - return cubemap; -} - -// Generate irradiance texture using cubemap data -TextureCubemap GenTextureIrradiance(Shader shader, TextureCubemap cubemap, int size) -{ - TextureCubemap irradiance = { 0 }; - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - rlDisableBackfaceCulling(); // Disable backface culling to render inside the cube - - // STEP 1: Setup framebuffer - //------------------------------------------------------------------------------------------ - unsigned int rbo = rlLoadTextureDepth(size, size, true); - irradiance.id = rlLoadTextureCubemap(NULL, size, UNCOMPRESSED_R32G32B32); - - unsigned int fbo = rlLoadFramebuffer(size, size); - rlFramebufferAttach(fbo, rbo, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER); - rlFramebufferAttach(fbo, cubemap.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X); - //------------------------------------------------------------------------------------------ - - // STEP 2: Draw to framebuffer - //------------------------------------------------------------------------------------------ - // NOTE: Shader is used to solve diffuse integral by convolution to create an irradiance cubemap - - // Define projection matrix and send it to shader - Matrix fboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR); - SetShaderValueMatrix(shader, shader.locs[LOC_MATRIX_PROJECTION], fboProjection); - - // Define view matrix for every side of the cubemap - Matrix fboViews[6] = { - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ -1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 1.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 1.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, -1.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 1.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, -1.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }) - }; - - rlEnableShader(shader.id); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_CUBE_MAP, cubemap.id); - - rlViewport(0, 0, size, size); // Set viewport to current fbo dimensions - - for (int i = 0; i < 6; i++) - { - SetShaderValueMatrix(shader, shader.locs[LOC_MATRIX_VIEW], fboViews[i]); - rlFramebufferAttach(fbo, irradiance.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X + i); - - rlEnableFramebuffer(fbo); - rlClearScreenBuffers(); - GenDrawCube(); - } - //------------------------------------------------------------------------------------------ - - // STEP 3: Unload framebuffer and reset state - //------------------------------------------------------------------------------------------ - rlDisableShader(); // Unbind shader - rlDisableTexture(); // Unbind texture - rlDisableFramebuffer(); // Unbind framebuffer - rlUnloadFramebuffer(fbo); // Unload framebuffer (and automatically attached depth texture/renderbuffer) - - // Reset viewport dimensions to default - rlViewport(0, 0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight); - //rlEnableBackfaceCulling(); - //------------------------------------------------------------------------------------------ - - irradiance.width = size; - irradiance.height = size; - irradiance.mipmaps = 1; - irradiance.format = UNCOMPRESSED_R32G32B32; -#endif - return irradiance; -} - -// Generate prefilter texture using cubemap data -TextureCubemap GenTexturePrefilter(Shader shader, TextureCubemap cubemap, int size) -{ - TextureCubemap prefilter = { 0 }; - -#if defined(GRAPHICS_API_OPENGL_33) // || defined(GRAPHICS_API_OPENGL_ES2) - rlDisableBackfaceCulling(); // Disable backface culling to render inside the cube - - // STEP 1: Setup framebuffer - //------------------------------------------------------------------------------------------ - unsigned int rbo = rlLoadTextureDepth(size, size, true); - prefilter.id = rlLoadTextureCubemap(NULL, size, UNCOMPRESSED_R32G32B32); - rlTextureParameters(prefilter.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_MIP_LINEAR); - - unsigned int fbo = rlLoadFramebuffer(size, size); - rlFramebufferAttach(fbo, rbo, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER); - rlFramebufferAttach(fbo, cubemap.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X); - //------------------------------------------------------------------------------------------ - - // Generate mipmaps for the prefiltered HDR texture - glGenerateMipmap(GL_TEXTURE_CUBE_MAP); - //rlGenerateMipmaps(Texture2D *texture); // Only GL_TEXTURE_2D - - // STEP 2: Draw to framebuffer - //------------------------------------------------------------------------------------------ - // NOTE: Shader is used to prefilter HDR and store data into mipmap levels - - // Define projection matrix and send it to shader - Matrix fboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR); - SetShaderValueMatrix(shader, shader.locs[LOC_MATRIX_PROJECTION], fboProjection); - - // Define view matrix for every side of the cubemap - Matrix fboViews[6] = { - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ -1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 1.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 1.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, -1.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 1.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), - MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, -1.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }) - }; - - rlEnableShader(shader.id); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_CUBE_MAP, cubemap.id); - - // TODO: Locations should be taken out of this function... too shader dependant... - int roughnessLoc = GetShaderLocation(shader, "roughness"); - - rlEnableFramebuffer(fbo); - - #define MAX_MIPMAP_LEVELS 5 // Max number of prefilter texture mipmaps - - for (int mip = 0; mip < MAX_MIPMAP_LEVELS; mip++) - { - // Resize framebuffer according to mip-level size. - unsigned int mipWidth = size*(int)powf(0.5f, (float)mip); - unsigned int mipHeight = size*(int)powf(0.5f, (float)mip); - - rlViewport(0, 0, mipWidth, mipHeight); - - glBindRenderbuffer(GL_RENDERBUFFER, rbo); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, mipWidth, mipHeight); - - float roughness = (float)mip/(float)(MAX_MIPMAP_LEVELS - 1); - glUniform1f(roughnessLoc, roughness); - - for (int i = 0; i < 6; i++) - { - SetShaderValueMatrix(shader, shader.locs[LOC_MATRIX_VIEW], fboViews[i]); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, prefilter.id, mip); - //rlFramebufferAttach(fbo, irradiance.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X + i); // TODO: Support mip levels? - - rlEnableFramebuffer(fbo); - rlClearScreenBuffers(); - GenDrawCube(); - } - } - //------------------------------------------------------------------------------------------ - - // STEP 3: Unload framebuffer and reset state - //------------------------------------------------------------------------------------------ - rlDisableShader(); // Unbind shader - rlDisableTexture(); // Unbind texture - rlDisableFramebuffer(); // Unbind framebuffer - rlUnloadFramebuffer(fbo); // Unload framebuffer (and automatically attached depth texture/renderbuffer) - - // Reset viewport dimensions to default - rlViewport(0, 0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight); - //rlEnableBackfaceCulling(); - //------------------------------------------------------------------------------------------ - - prefilter.width = size; - prefilter.height = size; - //prefilter.mipmaps = 1 + (int)floor(log(size)/log(2)); // MAX_MIPMAP_LEVELS - //prefilter.format = UNCOMPRESSED_R32G32B32; -#endif - return prefilter; -} - -// Generate BRDF texture using cubemap data -// TODO: Review implementation: https://github.com/HectorMF/BRDFGenerator -Texture2D GenTextureBRDF(Shader shader, int size) -{ - Texture2D brdf = { 0 }; -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // STEP 1: Setup framebuffer - //------------------------------------------------------------------------------------------ - unsigned int rbo = rlLoadTextureDepth(size, size, true); - brdf.id = rlLoadTexture(NULL, size, size, UNCOMPRESSED_R32G32B32, 1); - - unsigned int fbo = rlLoadFramebuffer(size, size); - rlFramebufferAttach(fbo, rbo, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER); - rlFramebufferAttach(fbo, brdf.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_TEXTURE2D); - //------------------------------------------------------------------------------------------ - - // STEP 2: Draw to framebuffer - //------------------------------------------------------------------------------------------ - // NOTE: Render BRDF LUT into a quad using FBO - - rlEnableShader(shader.id); - - rlViewport(0, 0, size, size); - - rlEnableFramebuffer(fbo); - rlClearScreenBuffers(); - GenDrawQuad(); - //------------------------------------------------------------------------------------------ - - // STEP 3: Unload framebuffer and reset state - //------------------------------------------------------------------------------------------ - rlDisableShader(); // Unbind shader - rlDisableTexture(); // Unbind texture - rlDisableFramebuffer(); // Unbind framebuffer - rlUnloadFramebuffer(fbo); // Unload framebuffer (and automatically attached depth texture/renderbuffer) - - // Reset viewport dimensions to default - rlViewport(0, 0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight); - //------------------------------------------------------------------------------------------ - - brdf.width = size; - brdf.height = size; - brdf.mipmaps = 1; - brdf.format = UNCOMPRESSED_R32G32B32; -#endif - return brdf; -} - -// Begin blending mode (alpha, additive, multiplied) -// NOTE: Only 3 blending modes supported, default blend mode is alpha -void BeginBlendMode(int mode) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (RLGL.State.currentBlendMode != mode) - { - DrawRenderBatch(RLGL.currentBatch); - - switch (mode) - { - case BLEND_ALPHA: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendEquation(GL_FUNC_ADD); break; - case BLEND_ADDITIVE: glBlendFunc(GL_SRC_ALPHA, GL_ONE); glBlendEquation(GL_FUNC_ADD); break; - case BLEND_MULTIPLIED: glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA); glBlendEquation(GL_FUNC_ADD); break; - case BLEND_ADD_COLORS: glBlendFunc(GL_ONE, GL_ONE); glBlendEquation(GL_FUNC_ADD); break; - case BLEND_SUBTRACT_COLORS: glBlendFunc(GL_ONE, GL_ONE); glBlendEquation(GL_FUNC_SUBTRACT); break; - case BLEND_CUSTOM: glBlendFunc(RLGL.State.glBlendSrcFactor, RLGL.State.glBlendDstFactor); glBlendEquation(RLGL.State.glBlendEquation); break; - default: break; - } - - RLGL.State.currentBlendMode = mode; - } -#endif -} - -// End blending mode (reset to default: alpha blending) -void EndBlendMode(void) -{ - BeginBlendMode(BLEND_ALPHA); -} - -#if defined(SUPPORT_VR_SIMULATOR) -// Init VR simulator for selected device parameters -// NOTE: It modifies the global variable: RLGL.Vr.stereoFboId -void InitVrSimulator(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Initialize framebuffer and textures for stereo rendering - // NOTE: Screen size should match HMD aspect ratio - RLGL.Vr.stereoFboId = rlLoadFramebuffer(RLGL.State.framebufferWidth, RLGL.State.framebufferHeight); - - // Load color/depth textures to attach to framebuffer - RLGL.Vr.stereoTexId = rlLoadTexture(NULL, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight, UNCOMPRESSED_R8G8B8A8, 1); - unsigned int depthId = rlLoadTextureDepth(RLGL.State.framebufferWidth, RLGL.State.framebufferHeight, true); - - // Attach color texture and depth renderbuffer/texture to FBO - rlFramebufferAttach(RLGL.Vr.stereoFboId, RLGL.Vr.stereoTexId, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_TEXTURE2D); - rlFramebufferAttach(RLGL.Vr.stereoFboId, depthId, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER); - - RLGL.Vr.simulatorReady = true; -#else - TRACELOG(LOG_WARNING, "RLGL: VR Simulator not supported on OpenGL 1.1"); -#endif -} - -// Update VR tracking (position and orientation) and camera -// NOTE: Camera (position, target, up) gets update with head tracking information -void UpdateVrTracking(Camera *camera) -{ - // TODO: Simulate 1st person camera system -} - -// Close VR simulator for current device -void CloseVrSimulator(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (RLGL.Vr.simulatorReady) - { - rlUnloadTexture(RLGL.Vr.stereoTexId); // Unload color texture - rlUnloadFramebuffer(RLGL.Vr.stereoFboId); // Unload stereo framebuffer and depth texture/renderbuffer - } -#endif -} - -// Set stereo rendering configuration parameters -void SetVrConfiguration(VrDeviceInfo hmd, Shader distortion) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Reset RLGL.Vr.config for a new values assignment - memset(&RLGL.Vr.config, 0, sizeof(RLGL.Vr.config)); - - // Assign distortion shader - RLGL.Vr.config.distortionShader = distortion; - - // Compute aspect ratio - float aspect = ((float)hmd.hResolution*0.5f)/(float)hmd.vResolution; - - // Compute lens parameters - float lensShift = (hmd.hScreenSize*0.25f - hmd.lensSeparationDistance*0.5f)/hmd.hScreenSize; - float leftLensCenter[2] = { 0.25f + lensShift, 0.5f }; - float rightLensCenter[2] = { 0.75f - lensShift, 0.5f }; - float leftScreenCenter[2] = { 0.25f, 0.5f }; - float rightScreenCenter[2] = { 0.75f, 0.5f }; - - // Compute distortion scale parameters - // NOTE: To get lens max radius, lensShift must be normalized to [-1..1] - float lensRadius = fabsf(-1.0f - 4.0f*lensShift); - float lensRadiusSq = lensRadius*lensRadius; - float distortionScale = hmd.lensDistortionValues[0] + - hmd.lensDistortionValues[1]*lensRadiusSq + - hmd.lensDistortionValues[2]*lensRadiusSq*lensRadiusSq + - hmd.lensDistortionValues[3]*lensRadiusSq*lensRadiusSq*lensRadiusSq; - - TRACELOGD("RLGL: VR device configuration:"); - TRACELOGD(" > Distortion Scale: %f", distortionScale); - - float normScreenWidth = 0.5f; - float normScreenHeight = 1.0f; - float scaleIn[2] = { 2.0f/normScreenWidth, 2.0f/normScreenHeight/aspect }; - float scale[2] = { normScreenWidth*0.5f/distortionScale, normScreenHeight*0.5f*aspect/distortionScale }; - - TRACELOGD(" > Distortion Shader: LeftLensCenter = { %f, %f }", leftLensCenter[0], leftLensCenter[1]); - TRACELOGD(" > Distortion Shader: RightLensCenter = { %f, %f }", rightLensCenter[0], rightLensCenter[1]); - TRACELOGD(" > Distortion Shader: Scale = { %f, %f }", scale[0], scale[1]); - TRACELOGD(" > Distortion Shader: ScaleIn = { %f, %f }", scaleIn[0], scaleIn[1]); - - // Fovy is normally computed with: 2*atan2f(hmd.vScreenSize, 2*hmd.eyeToScreenDistance) - // ...but with lens distortion it is increased (see Oculus SDK Documentation) - //float fovy = 2.0f*atan2f(hmd.vScreenSize*0.5f*distortionScale, hmd.eyeToScreenDistance); // Really need distortionScale? - float fovy = 2.0f*(float)atan2f(hmd.vScreenSize*0.5f, hmd.eyeToScreenDistance); - - // Compute camera projection matrices - float projOffset = 4.0f*lensShift; // Scaled to projection space coordinates [-1..1] - Matrix proj = MatrixPerspective(fovy, aspect, RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR); - RLGL.Vr.config.eyesProjection[0] = MatrixMultiply(proj, MatrixTranslate(projOffset, 0.0f, 0.0f)); - RLGL.Vr.config.eyesProjection[1] = MatrixMultiply(proj, MatrixTranslate(-projOffset, 0.0f, 0.0f)); - - // Compute camera transformation matrices - // NOTE: Camera movement might seem more natural if we model the head. - // Our axis of rotation is the base of our head, so we might want to add - // some y (base of head to eye level) and -z (center of head to eye protrusion) to the camera positions. - RLGL.Vr.config.eyesViewOffset[0] = MatrixTranslate(-hmd.interpupillaryDistance*0.5f, 0.075f, 0.045f); - RLGL.Vr.config.eyesViewOffset[1] = MatrixTranslate(hmd.interpupillaryDistance*0.5f, 0.075f, 0.045f); - - // Compute eyes Viewports - RLGL.Vr.config.eyeViewportRight[2] = hmd.hResolution/2; - RLGL.Vr.config.eyeViewportRight[3] = hmd.vResolution; - - RLGL.Vr.config.eyeViewportLeft[0] = hmd.hResolution/2; - RLGL.Vr.config.eyeViewportLeft[1] = 0; - RLGL.Vr.config.eyeViewportLeft[2] = hmd.hResolution/2; - RLGL.Vr.config.eyeViewportLeft[3] = hmd.vResolution; - - if (RLGL.Vr.config.distortionShader.id > 0) - { - // Update distortion shader with lens and distortion-scale parameters - SetShaderValue(RLGL.Vr.config.distortionShader, GetShaderLocation(RLGL.Vr.config.distortionShader, "leftLensCenter"), leftLensCenter, UNIFORM_VEC2); - SetShaderValue(RLGL.Vr.config.distortionShader, GetShaderLocation(RLGL.Vr.config.distortionShader, "rightLensCenter"), rightLensCenter, UNIFORM_VEC2); - SetShaderValue(RLGL.Vr.config.distortionShader, GetShaderLocation(RLGL.Vr.config.distortionShader, "leftScreenCenter"), leftScreenCenter, UNIFORM_VEC2); - SetShaderValue(RLGL.Vr.config.distortionShader, GetShaderLocation(RLGL.Vr.config.distortionShader, "rightScreenCenter"), rightScreenCenter, UNIFORM_VEC2); - - SetShaderValue(RLGL.Vr.config.distortionShader, GetShaderLocation(RLGL.Vr.config.distortionShader, "scale"), scale, UNIFORM_VEC2); - SetShaderValue(RLGL.Vr.config.distortionShader, GetShaderLocation(RLGL.Vr.config.distortionShader, "scaleIn"), scaleIn, UNIFORM_VEC2); - SetShaderValue(RLGL.Vr.config.distortionShader, GetShaderLocation(RLGL.Vr.config.distortionShader, "hmdWarpParam"), hmd.lensDistortionValues, UNIFORM_VEC4); - SetShaderValue(RLGL.Vr.config.distortionShader, GetShaderLocation(RLGL.Vr.config.distortionShader, "chromaAbParam"), hmd.chromaAbCorrection, UNIFORM_VEC4); - } -#endif -} - -// Detect if VR simulator is running -bool IsVrSimulatorReady(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - return RLGL.Vr.simulatorReady; -#else - return false; -#endif -} - -// Enable/Disable VR experience (device or simulator) -void ToggleVrMode(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - RLGL.Vr.simulatorReady = !RLGL.Vr.simulatorReady; - - if (!RLGL.Vr.simulatorReady) - { - RLGL.Vr.stereoRender = false; - - // Reset viewport and default projection-modelview matrices - rlViewport(0, 0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight); - RLGL.State.projection = MatrixOrtho(0.0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight, 0.0, 0.0, 1.0); - RLGL.State.modelview = MatrixIdentity(); - } - else RLGL.Vr.stereoRender = true; -#endif -} - -// Begin VR drawing configuration -void BeginVrDrawing(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (RLGL.Vr.simulatorReady) - { - rlEnableFramebuffer(RLGL.Vr.stereoFboId); // Setup framebuffer for stereo rendering - //glEnable(GL_FRAMEBUFFER_SRGB); // Enable SRGB framebuffer (only if required) - - //rlViewport(0, 0, buffer.width, buffer.height); // Useful if rendering to separate framebuffers (every eye) - rlClearScreenBuffers(); // Clear current framebuffer - - RLGL.Vr.stereoRender = true; - } -#endif -} - -// End VR drawing process (and desktop mirror) -void EndVrDrawing(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (RLGL.Vr.simulatorReady) - { - RLGL.Vr.stereoRender = false; // Disable stereo render - - rlDisableFramebuffer(); // Unbind current framebuffer - - rlClearScreenBuffers(); // Clear current framebuffer - - // Set viewport to default framebuffer size (screen size) - rlViewport(0, 0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight); - - // Let rlgl reconfigure internal matrices - rlMatrixMode(RL_PROJECTION); // Enable internal projection matrix - rlLoadIdentity(); // Reset internal projection matrix - rlOrtho(0.0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight, 0.0, 0.0, 1.0); // Recalculate internal RLGL.State.projection matrix - rlMatrixMode(RL_MODELVIEW); // Enable internal modelview matrix - rlLoadIdentity(); // Reset internal modelview matrix - - // Draw stereo framebuffer texture using distortion shader if available - if (RLGL.Vr.config.distortionShader.id > 0) RLGL.State.currentShader = RLGL.Vr.config.distortionShader; - else RLGL.State.currentShader = GetShaderDefault(); - - rlEnableTexture(RLGL.Vr.stereoTexId); - - rlPushMatrix(); - rlBegin(RL_QUADS); - rlColor4ub(255, 255, 255, 255); - rlNormal3f(0.0f, 0.0f, 1.0f); - - // Bottom-left corner for texture and quad - rlTexCoord2f(0.0f, 1.0f); - rlVertex2f(0.0f, 0.0f); - - // Bottom-right corner for texture and quad - rlTexCoord2f(0.0f, 0.0f); - rlVertex2f(0.0f, (float)RLGL.State.framebufferHeight); - - // Top-right corner for texture and quad - rlTexCoord2f(1.0f, 0.0f); - rlVertex2f((float)RLGL.State.framebufferWidth, (float)RLGL.State.framebufferHeight); - - // Top-left corner for texture and quad - rlTexCoord2f(1.0f, 1.0f); - rlVertex2f((float)RLGL.State.framebufferWidth, 0.0f); - rlEnd(); - rlPopMatrix(); - - rlDisableTexture(); - - // Update and draw render texture fbo with distortion to backbuffer - DrawRenderBatch(RLGL.currentBatch); - - // Restore RLGL.State.defaultShader - RLGL.State.currentShader = RLGL.State.defaultShader; - - // Reset viewport and default projection-modelview matrices - rlViewport(0, 0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight); - RLGL.State.projection = MatrixOrtho(0.0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight, 0.0, 0.0, 1.0); - RLGL.State.modelview = MatrixIdentity(); - - rlDisableDepthTest(); - } -#endif -} -#endif // SUPPORT_VR_SIMULATOR - -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) // Compile custom shader and return shader id -static unsigned int CompileShader(const char *shaderStr, int type) +unsigned int rlCompileShader(const char *shaderCode, int type) { - unsigned int shader = glCreateShader(type); - glShaderSource(shader, 1, &shaderStr, NULL); + unsigned int shader = 0; + +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + shader = glCreateShader(type); + glShaderSource(shader, 1, &shaderCode, NULL); GLint success = 0; glCompileShader(shader); glGetShaderiv(shader, GL_COMPILE_STATUS, &success); - if (success != GL_TRUE) + if (success == GL_FALSE) { - TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to compile shader code", shader); + switch (type) + { + case GL_VERTEX_SHADER: TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to compile vertex shader code", shader); break; + case GL_FRAGMENT_SHADER: TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to compile fragment shader code", shader); break; + //case GL_GEOMETRY_SHADER: + //case GL_COMPUTE_SHADER: + default: break; + } + int maxLength = 0; - int length; glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &maxLength); -#if defined(_MSC_VER) - char *log = RL_MALLOC(maxLength); -#else - char log[maxLength]; -#endif - glGetShaderInfoLog(shader, maxLength, &length, log); - - TRACELOG(LOG_WARNING, "SHADER: [ID %i] Compile error: %s", shader, log); - -#if defined(_MSC_VER) - RL_FREE(log); -#endif + if (maxLength > 0) + { + int length = 0; + char *log = RL_CALLOC(maxLength, sizeof(char)); + glGetShaderInfoLog(shader, maxLength, &length, log); + TRACELOG(LOG_WARNING, "SHADER: [ID %i] Compile error: %s", shader, log); + RL_FREE(log); + } } - else TRACELOG(LOG_INFO, "SHADER: [ID %i] Compiled successfully", shader); + else + { + switch (type) + { + case GL_VERTEX_SHADER: TRACELOG(LOG_INFO, "SHADER: [ID %i] Vertex shader compiled successfully", shader); break; + case GL_FRAGMENT_SHADER: TRACELOG(LOG_INFO, "SHADER: [ID %i] Fragment shader compiled successfully", shader); break; + //case GL_GEOMETRY_SHADER: + //case GL_COMPUTE_SHADER: + default: break; + } + } +#endif return shader; } // Load custom shader strings and return program id -static unsigned int LoadShaderProgram(unsigned int vShaderId, unsigned int fShaderId) +unsigned int rlLoadShaderProgram(unsigned int vShaderId, unsigned int fShaderId) { unsigned int program = 0; @@ -4113,535 +3334,270 @@ static unsigned int LoadShaderProgram(unsigned int vShaderId, unsigned int fShad TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to link shader program", program); int maxLength = 0; - int length; - glGetProgramiv(program, GL_INFO_LOG_LENGTH, &maxLength); -#if defined(_MSC_VER) - char *log = RL_MALLOC(maxLength); -#else - char log[maxLength]; -#endif - glGetProgramInfoLog(program, maxLength, &length, log); + if (maxLength > 0) + { + int length = 0; + char *log = RL_CALLOC(maxLength, sizeof(char)); + glGetProgramInfoLog(program, maxLength, &length, log); + TRACELOG(LOG_WARNING, "SHADER: [ID %i] Link error: %s", program, log); + RL_FREE(log); + } - TRACELOG(LOG_WARNING, "SHADER: [ID %i] Link error: %s", program, log); - -#if defined(_MSC_VER) - RL_FREE(log); -#endif glDeleteProgram(program); program = 0; } - else TRACELOG(LOG_INFO, "SHADER: [ID %i] Program loaded successfully", program); + else TRACELOG(LOG_INFO, "SHADER: [ID %i] Program shader loaded successfully", program); #endif return program; } - -// Load default shader (just vertex positioning and texture coloring) -// NOTE: This shader program is used for internal buffers -static Shader LoadShaderDefault(void) +// Unload shader program +void rlUnloadShaderProgram(unsigned int id) { - Shader shader = { 0 }; - shader.locs = (int *)RL_CALLOC(MAX_SHADER_LOCATIONS, sizeof(int)); +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glDeleteProgram(id); - // NOTE: All locations must be reseted to -1 (no location) - for (int i = 0; i < MAX_SHADER_LOCATIONS; i++) shader.locs[i] = -1; - - // Vertex shader directly defined, no external file required - const char *defaultVShaderStr = -#if defined(GRAPHICS_API_OPENGL_21) - "#version 120 \n" -#elif defined(GRAPHICS_API_OPENGL_ES2) - "#version 100 \n" + TRACELOG(LOG_INFO, "SHADER: [ID %i] Unloaded shader program data from VRAM (GPU)", id); #endif -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) - "attribute vec3 vertexPosition; \n" - "attribute vec2 vertexTexCoord; \n" - "attribute vec4 vertexColor; \n" - "varying vec2 fragTexCoord; \n" - "varying vec4 fragColor; \n" -#elif defined(GRAPHICS_API_OPENGL_33) - "#version 330 \n" - "in vec3 vertexPosition; \n" - "in vec2 vertexTexCoord; \n" - "in vec4 vertexColor; \n" - "out vec2 fragTexCoord; \n" - "out vec4 fragColor; \n" -#endif - "uniform mat4 mvp; \n" - "void main() \n" - "{ \n" - " fragTexCoord = vertexTexCoord; \n" - " fragColor = vertexColor; \n" - " gl_Position = mvp*vec4(vertexPosition, 1.0); \n" - "} \n"; +} - // Fragment shader directly defined, no external file required - const char *defaultFShaderStr = -#if defined(GRAPHICS_API_OPENGL_21) - "#version 120 \n" -#elif defined(GRAPHICS_API_OPENGL_ES2) - "#version 100 \n" - "precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) -#endif -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) - "varying vec2 fragTexCoord; \n" - "varying vec4 fragColor; \n" -#elif defined(GRAPHICS_API_OPENGL_33) - "#version 330 \n" - "in vec2 fragTexCoord; \n" - "in vec4 fragColor; \n" - "out vec4 finalColor; \n" -#endif - "uniform sampler2D texture0; \n" - "uniform vec4 colDiffuse; \n" - "void main() \n" - "{ \n" -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) - " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" // NOTE: texture2D() is deprecated on OpenGL 3.3 and ES 3.0 - " gl_FragColor = texelColor*colDiffuse*fragColor; \n" -#elif defined(GRAPHICS_API_OPENGL_33) - " vec4 texelColor = texture(texture0, fragTexCoord); \n" - " finalColor = texelColor*colDiffuse*fragColor; \n" -#endif - "} \n"; +// Get shader location uniform +int rlGetLocationUniform(unsigned int shaderId, const char *uniformName) +{ + int location = -1; +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + location = glGetUniformLocation(shaderId, uniformName); - // NOTE: Compiled vertex/fragment shaders are kept for re-use - RLGL.State.defaultVShaderId = CompileShader(defaultVShaderStr, GL_VERTEX_SHADER); // Compile default vertex shader - RLGL.State.defaultFShaderId = CompileShader(defaultFShaderStr, GL_FRAGMENT_SHADER); // Compile default fragment shader + if (location == -1) TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to find shader uniform: %s", shaderId, uniformName); + else TRACELOG(LOG_INFO, "SHADER: [ID %i] Shader uniform (%s) set at location: %i", shaderId, uniformName, location); +#endif + return location; +} - shader.id = LoadShaderProgram(RLGL.State.defaultVShaderId, RLGL.State.defaultFShaderId); +// Get shader location attribute +int rlGetLocationAttrib(unsigned int shaderId, const char *attribName) +{ + int location = -1; +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + location = glGetAttribLocation(shaderId, attribName); - if (shader.id > 0) + if (location == -1) TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to find shader attribute: %s", shaderId, attribName); + else TRACELOG(LOG_INFO, "SHADER: [ID %i] Shader attribute (%s) set at location: %i", shaderId, attribName, location); +#endif + return location; +} + +// Set shader value uniform +void rlSetUniform(int locIndex, const void *value, int uniformType, int count) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + switch (uniformType) { - TRACELOG(LOG_INFO, "SHADER: [ID %i] Default shader loaded successfully", shader.id); - - // Set default shader locations: attributes locations - shader.locs[LOC_VERTEX_POSITION] = glGetAttribLocation(shader.id, "vertexPosition"); - shader.locs[LOC_VERTEX_TEXCOORD01] = glGetAttribLocation(shader.id, "vertexTexCoord"); - shader.locs[LOC_VERTEX_COLOR] = glGetAttribLocation(shader.id, "vertexColor"); - - // Set default shader locations: uniform locations - shader.locs[LOC_MATRIX_MVP] = glGetUniformLocation(shader.id, "mvp"); - shader.locs[LOC_COLOR_DIFFUSE] = glGetUniformLocation(shader.id, "colDiffuse"); - shader.locs[LOC_MAP_DIFFUSE] = glGetUniformLocation(shader.id, "texture0"); - - // NOTE: We could also use below function but in case DEFAULT_ATTRIB_* points are - // changed for external custom shaders, we just use direct bindings above - //SetShaderDefaultLocations(&shader); + case SHADER_UNIFORM_FLOAT: glUniform1fv(locIndex, count, (float *)value); break; + case SHADER_UNIFORM_VEC2: glUniform2fv(locIndex, count, (float *)value); break; + case SHADER_UNIFORM_VEC3: glUniform3fv(locIndex, count, (float *)value); break; + case SHADER_UNIFORM_VEC4: glUniform4fv(locIndex, count, (float *)value); break; + case SHADER_UNIFORM_INT: glUniform1iv(locIndex, count, (int *)value); break; + case SHADER_UNIFORM_IVEC2: glUniform2iv(locIndex, count, (int *)value); break; + case SHADER_UNIFORM_IVEC3: glUniform3iv(locIndex, count, (int *)value); break; + case SHADER_UNIFORM_IVEC4: glUniform4iv(locIndex, count, (int *)value); break; + case SHADER_UNIFORM_SAMPLER2D: glUniform1iv(locIndex, count, (int *)value); break; + default: TRACELOG(LOG_WARNING, "SHADER: Failed to set uniform value, data type not recognized"); } - else TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to load default shader", shader.id); - - return shader; -} - -// Get location handlers to for shader attributes and uniforms -// NOTE: If any location is not found, loc point becomes -1 -static void SetShaderDefaultLocations(Shader *shader) -{ - // NOTE: Default shader attrib locations have been fixed before linking: - // vertex position location = 0 - // vertex texcoord location = 1 - // vertex normal location = 2 - // vertex color location = 3 - // vertex tangent location = 4 - // vertex texcoord2 location = 5 - - // Get handles to GLSL input attibute locations - shader->locs[LOC_VERTEX_POSITION] = glGetAttribLocation(shader->id, DEFAULT_SHADER_ATTRIB_NAME_POSITION); - shader->locs[LOC_VERTEX_TEXCOORD01] = glGetAttribLocation(shader->id, DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD); - shader->locs[LOC_VERTEX_TEXCOORD02] = glGetAttribLocation(shader->id, DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2); - shader->locs[LOC_VERTEX_NORMAL] = glGetAttribLocation(shader->id, DEFAULT_SHADER_ATTRIB_NAME_NORMAL); - shader->locs[LOC_VERTEX_TANGENT] = glGetAttribLocation(shader->id, DEFAULT_SHADER_ATTRIB_NAME_TANGENT); - shader->locs[LOC_VERTEX_COLOR] = glGetAttribLocation(shader->id, DEFAULT_SHADER_ATTRIB_NAME_COLOR); - - // Get handles to GLSL uniform locations (vertex shader) - shader->locs[LOC_MATRIX_MVP] = glGetUniformLocation(shader->id, "mvp"); - shader->locs[LOC_MATRIX_PROJECTION] = glGetUniformLocation(shader->id, "projection"); - shader->locs[LOC_MATRIX_VIEW] = glGetUniformLocation(shader->id, "view"); - - // Get handles to GLSL uniform locations (fragment shader) - shader->locs[LOC_COLOR_DIFFUSE] = glGetUniformLocation(shader->id, "colDiffuse"); - shader->locs[LOC_MAP_DIFFUSE] = glGetUniformLocation(shader->id, "texture0"); - shader->locs[LOC_MAP_SPECULAR] = glGetUniformLocation(shader->id, "texture1"); - shader->locs[LOC_MAP_NORMAL] = glGetUniformLocation(shader->id, "texture2"); -} - -// Unload default shader -static void UnloadShaderDefault(void) -{ - glUseProgram(0); - - glDetachShader(RLGL.State.defaultShader.id, RLGL.State.defaultVShaderId); - glDetachShader(RLGL.State.defaultShader.id, RLGL.State.defaultFShaderId); - glDeleteShader(RLGL.State.defaultVShaderId); - glDeleteShader(RLGL.State.defaultFShaderId); - - glDeleteProgram(RLGL.State.defaultShader.id); - - RL_FREE(RLGL.State.defaultShader.locs); -} - -// Load render batch -static RenderBatch LoadRenderBatch(int numBuffers, int bufferElements) -{ - RenderBatch batch = { 0 }; - - // Initialize CPU (RAM) vertex buffers (position, texcoord, color data and indexes) - //-------------------------------------------------------------------------------------------- - batch.vertexBuffer = (VertexBuffer *)RL_MALLOC(sizeof(VertexBuffer)*numBuffers); - - for (int i = 0; i < numBuffers; i++) - { - batch.vertexBuffer[i].elementsCount = bufferElements; - - batch.vertexBuffer[i].vertices = (float *)RL_MALLOC(bufferElements*3*4*sizeof(float)); // 3 float by vertex, 4 vertex by quad - batch.vertexBuffer[i].texcoords = (float *)RL_MALLOC(bufferElements*2*4*sizeof(float)); // 2 float by texcoord, 4 texcoord by quad - batch.vertexBuffer[i].colors = (unsigned char *)RL_MALLOC(bufferElements*4*4*sizeof(unsigned char)); // 4 float by color, 4 colors by quad -#if defined(GRAPHICS_API_OPENGL_33) - batch.vertexBuffer[i].indices = (unsigned int *)RL_MALLOC(bufferElements*6*sizeof(unsigned int)); // 6 int by quad (indices) -#elif defined(GRAPHICS_API_OPENGL_ES2) - batch.vertexBuffer[i].indices = (unsigned short *)RL_MALLOC(bufferElements*6*sizeof(unsigned short)); // 6 int by quad (indices) #endif +} - for (int j = 0; j < (3*4*bufferElements); j++) batch.vertexBuffer[i].vertices[j] = 0.0f; - for (int j = 0; j < (2*4*bufferElements); j++) batch.vertexBuffer[i].texcoords[j] = 0.0f; - for (int j = 0; j < (4*4*bufferElements); j++) batch.vertexBuffer[i].colors[j] = 0; +// Set shader value attribute +void rlSetVertexAttributeDefault(int locIndex, const void *value, int attribType, int count) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + switch (attribType) + { + case SHADER_ATTRIB_FLOAT: if (count == 1) glVertexAttrib1fv(locIndex, (float *)value); break; + case SHADER_ATTRIB_VEC2: if (count == 2) glVertexAttrib2fv(locIndex, (float *)value); break; + case SHADER_ATTRIB_VEC3: if (count == 3) glVertexAttrib3fv(locIndex, (float *)value); break; + case SHADER_ATTRIB_VEC4: if (count == 4) glVertexAttrib4fv(locIndex, (float *)value); break; + default: TRACELOG(LOG_WARNING, "SHADER: Failed to set attrib default value, data type not recognized"); + } +#endif +} - int k = 0; +// Set shader value uniform matrix +void rlSetUniformMatrix(int locIndex, Matrix mat) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glUniformMatrix4fv(locIndex, 1, false, MatrixToFloat(mat)); +#endif +} - // Indices can be initialized right now - for (int j = 0; j < (6*bufferElements); j += 6) +// Set shader value uniform sampler +void rlSetUniformSampler(int locIndex, unsigned int textureId) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + // Check if texture is already active + for (int i = 0; i < MAX_BATCH_ACTIVE_TEXTURES; i++) if (RLGL.State.activeTextureId[i] == textureId) return; + + // Register a new active texture for the internal batch system + // NOTE: Default texture is always activated as GL_TEXTURE0 + for (int i = 0; i < MAX_BATCH_ACTIVE_TEXTURES; i++) + { + if (RLGL.State.activeTextureId[i] == 0) { - batch.vertexBuffer[i].indices[j] = 4*k; - batch.vertexBuffer[i].indices[j + 1] = 4*k + 1; - batch.vertexBuffer[i].indices[j + 2] = 4*k + 2; - batch.vertexBuffer[i].indices[j + 3] = 4*k; - batch.vertexBuffer[i].indices[j + 4] = 4*k + 2; - batch.vertexBuffer[i].indices[j + 5] = 4*k + 3; - - k++; + glUniform1i(locIndex, 1 + i); // Activate new texture unit + RLGL.State.activeTextureId[i] = textureId; // Save texture id for binding on drawing + break; } - - batch.vertexBuffer[i].vCounter = 0; - batch.vertexBuffer[i].tcCounter = 0; - batch.vertexBuffer[i].cCounter = 0; } - - TRACELOG(LOG_INFO, "RLGL: Internal vertex buffers initialized successfully in RAM (CPU)"); - //-------------------------------------------------------------------------------------------- - - // Upload to GPU (VRAM) vertex data and initialize VAOs/VBOs - //-------------------------------------------------------------------------------------------- - for (int i = 0; i < numBuffers; i++) - { - if (RLGL.ExtSupported.vao) - { - // Initialize Quads VAO - glGenVertexArrays(1, &batch.vertexBuffer[i].vaoId); - glBindVertexArray(batch.vertexBuffer[i].vaoId); - } - - // Quads - Vertex buffers binding and attributes enable - // Vertex position buffer (shader-location = 0) - glGenBuffers(1, &batch.vertexBuffer[i].vboId[0]); - glBindBuffer(GL_ARRAY_BUFFER, batch.vertexBuffer[i].vboId[0]); - glBufferData(GL_ARRAY_BUFFER, bufferElements*3*4*sizeof(float), batch.vertexBuffer[i].vertices, GL_DYNAMIC_DRAW); - glEnableVertexAttribArray(RLGL.State.currentShader.locs[LOC_VERTEX_POSITION]); - glVertexAttribPointer(RLGL.State.currentShader.locs[LOC_VERTEX_POSITION], 3, GL_FLOAT, 0, 0, 0); - - // Vertex texcoord buffer (shader-location = 1) - glGenBuffers(1, &batch.vertexBuffer[i].vboId[1]); - glBindBuffer(GL_ARRAY_BUFFER, batch.vertexBuffer[i].vboId[1]); - glBufferData(GL_ARRAY_BUFFER, bufferElements*2*4*sizeof(float), batch.vertexBuffer[i].texcoords, GL_DYNAMIC_DRAW); - glEnableVertexAttribArray(RLGL.State.currentShader.locs[LOC_VERTEX_TEXCOORD01]); - glVertexAttribPointer(RLGL.State.currentShader.locs[LOC_VERTEX_TEXCOORD01], 2, GL_FLOAT, 0, 0, 0); - - // Vertex color buffer (shader-location = 3) - glGenBuffers(1, &batch.vertexBuffer[i].vboId[2]); - glBindBuffer(GL_ARRAY_BUFFER, batch.vertexBuffer[i].vboId[2]); - glBufferData(GL_ARRAY_BUFFER, bufferElements*4*4*sizeof(unsigned char), batch.vertexBuffer[i].colors, GL_DYNAMIC_DRAW); - glEnableVertexAttribArray(RLGL.State.currentShader.locs[LOC_VERTEX_COLOR]); - glVertexAttribPointer(RLGL.State.currentShader.locs[LOC_VERTEX_COLOR], 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - - // Fill index buffer - glGenBuffers(1, &batch.vertexBuffer[i].vboId[3]); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, batch.vertexBuffer[i].vboId[3]); -#if defined(GRAPHICS_API_OPENGL_33) - glBufferData(GL_ELEMENT_ARRAY_BUFFER, bufferElements*6*sizeof(int), batch.vertexBuffer[i].indices, GL_STATIC_DRAW); -#elif defined(GRAPHICS_API_OPENGL_ES2) - glBufferData(GL_ELEMENT_ARRAY_BUFFER, bufferElements*6*sizeof(short), batch.vertexBuffer[i].indices, GL_STATIC_DRAW); #endif - } - - TRACELOG(LOG_INFO, "RLGL: Render batch vertex buffers loaded successfully"); - - // Unbind the current VAO - if (RLGL.ExtSupported.vao) glBindVertexArray(0); - //-------------------------------------------------------------------------------------------- - - // Init draw calls tracking system - //-------------------------------------------------------------------------------------------- - batch.draws = (DrawCall *)RL_MALLOC(DEFAULT_BATCH_DRAWCALLS*sizeof(DrawCall)); - - for (int i = 0; i < DEFAULT_BATCH_DRAWCALLS; i++) - { - batch.draws[i].mode = RL_QUADS; - batch.draws[i].vertexCount = 0; - batch.draws[i].vertexAlignment = 0; - //batch.draws[i].vaoId = 0; - //batch.draws[i].shaderId = 0; - batch.draws[i].textureId = RLGL.State.defaultTextureId; - //batch.draws[i].RLGL.State.projection = MatrixIdentity(); - //batch.draws[i].RLGL.State.modelview = MatrixIdentity(); - } - - batch.buffersCount = numBuffers; // Record buffer count - batch.drawsCounter = 1; // Reset draws counter - batch.currentDepth = -1.0f; // Reset depth value - //-------------------------------------------------------------------------------------------- - - return batch; } -// Draw render batch -// NOTE: We require a pointer to reset batch and increase current buffer (multi-buffer) -static void DrawRenderBatch(RenderBatch *batch) +// Set shader currently active +void rlSetShader(Shader shader) { - // Update batch vertex buffers - //------------------------------------------------------------------------------------------------------------ - // NOTE: If there is not vertex data, buffers doesn't need to be updated (vertexCount > 0) - // TODO: If no data changed on the CPU arrays --> No need to re-update GPU arrays (change flag required) - if (batch->vertexBuffer[batch->currentBuffer].vCounter > 0) +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + if (RLGL.State.currentShader.id != shader.id) { - // Activate elements VAO - if (RLGL.ExtSupported.vao) glBindVertexArray(batch->vertexBuffer[batch->currentBuffer].vaoId); - - // Vertex positions buffer - glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[0]); - glBufferSubData(GL_ARRAY_BUFFER, 0, batch->vertexBuffer[batch->currentBuffer].vCounter*3*sizeof(float), batch->vertexBuffer[batch->currentBuffer].vertices); - //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*4*batch->vertexBuffer[batch->currentBuffer].elementsCount, batch->vertexBuffer[batch->currentBuffer].vertices, GL_DYNAMIC_DRAW); // Update all buffer - - // Texture coordinates buffer - glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[1]); - glBufferSubData(GL_ARRAY_BUFFER, 0, batch->vertexBuffer[batch->currentBuffer].vCounter*2*sizeof(float), batch->vertexBuffer[batch->currentBuffer].texcoords); - //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*4*batch->vertexBuffer[batch->currentBuffer].elementsCount, batch->vertexBuffer[batch->currentBuffer].texcoords, GL_DYNAMIC_DRAW); // Update all buffer - - // Colors buffer - glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[2]); - glBufferSubData(GL_ARRAY_BUFFER, 0, batch->vertexBuffer[batch->currentBuffer].vCounter*4*sizeof(unsigned char), batch->vertexBuffer[batch->currentBuffer].colors); - //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*4*4*batch->vertexBuffer[batch->currentBuffer].elementsCount, batch->vertexBuffer[batch->currentBuffer].colors, GL_DYNAMIC_DRAW); // Update all buffer - - // NOTE: glMapBuffer() causes sync issue. - // If GPU is working with this buffer, glMapBuffer() will wait(stall) until GPU to finish its job. - // To avoid waiting (idle), you can call first glBufferData() with NULL pointer before glMapBuffer(). - // If you do that, the previous data in PBO will be discarded and glMapBuffer() returns a new - // allocated pointer immediately even if GPU is still working with the previous data. - - // Another option: map the buffer object into client's memory - // Probably this code could be moved somewhere else... - // batch->vertexBuffer[batch->currentBuffer].vertices = (float *)glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE); - // if (batch->vertexBuffer[batch->currentBuffer].vertices) - // { - // Update vertex data - // } - // glUnmapBuffer(GL_ARRAY_BUFFER); - - // Unbind the current VAO - if (RLGL.ExtSupported.vao) glBindVertexArray(0); + rlDrawRenderBatch(RLGL.currentBatch); + RLGL.State.currentShader = shader; } - //------------------------------------------------------------------------------------------------------------ - - // Draw batch vertex buffers (considering VR stereo if required) - //------------------------------------------------------------------------------------------------------------ - Matrix matProjection = RLGL.State.projection; - Matrix matModelView = RLGL.State.modelview; - - int eyesCount = 1; -#if defined(SUPPORT_VR_SIMULATOR) - if (RLGL.Vr.stereoRender) eyesCount = 2; #endif +} - for (int eye = 0; eye < eyesCount; eye++) - { -#if defined(SUPPORT_VR_SIMULATOR) - if (eyesCount == 2) SetStereoView(eye, matProjection, matModelView); +// Matrix state management +//----------------------------------------------------------------------------------------- +// Get internal modelview matrix +Matrix rlGetMatrixModelview(void) +{ + Matrix matrix = MatrixIdentity(); +#if defined(GRAPHICS_API_OPENGL_11) + float mat[16]; + glGetFloatv(GL_MODELVIEW_MATRIX, mat); + matrix.m0 = mat[0]; + matrix.m1 = mat[1]; + matrix.m2 = mat[2]; + matrix.m3 = mat[3]; + matrix.m4 = mat[4]; + matrix.m5 = mat[5]; + matrix.m6 = mat[6]; + matrix.m7 = mat[7]; + matrix.m8 = mat[8]; + matrix.m9 = mat[9]; + matrix.m10 = mat[10]; + matrix.m11 = mat[11]; + matrix.m12 = mat[12]; + matrix.m13 = mat[13]; + matrix.m14 = mat[14]; + matrix.m15 = mat[15]; +#else + matrix = RLGL.State.modelview; #endif - // Draw buffers - if (batch->vertexBuffer[batch->currentBuffer].vCounter > 0) - { - // Set current shader and upload current MVP matrix - glUseProgram(RLGL.State.currentShader.id); + return matrix; +} - // Create modelview-projection matrix and upload to shader - Matrix matMVP = MatrixMultiply(RLGL.State.modelview, RLGL.State.projection); - glUniformMatrix4fv(RLGL.State.currentShader.locs[LOC_MATRIX_MVP], 1, false, MatrixToFloat(matMVP)); - - if (RLGL.ExtSupported.vao) glBindVertexArray(batch->vertexBuffer[batch->currentBuffer].vaoId); - else - { - // Bind vertex attrib: position (shader-location = 0) - glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[0]); - glVertexAttribPointer(RLGL.State.currentShader.locs[LOC_VERTEX_POSITION], 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(RLGL.State.currentShader.locs[LOC_VERTEX_POSITION]); - - // Bind vertex attrib: texcoord (shader-location = 1) - glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[1]); - glVertexAttribPointer(RLGL.State.currentShader.locs[LOC_VERTEX_TEXCOORD01], 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(RLGL.State.currentShader.locs[LOC_VERTEX_TEXCOORD01]); - - // Bind vertex attrib: color (shader-location = 3) - glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[2]); - glVertexAttribPointer(RLGL.State.currentShader.locs[LOC_VERTEX_COLOR], 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - glEnableVertexAttribArray(RLGL.State.currentShader.locs[LOC_VERTEX_COLOR]); - - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[3]); - } - - // Setup some default shader values - glUniform4f(RLGL.State.currentShader.locs[LOC_COLOR_DIFFUSE], 1.0f, 1.0f, 1.0f, 1.0f); - glUniform1i(RLGL.State.currentShader.locs[LOC_MAP_DIFFUSE], 0); // Active default sampler2D: texture0 - - // Activate additional sampler textures - // Those additional textures will be common for all draw calls of the batch - for (int i = 0; i < MAX_BATCH_ACTIVE_TEXTURES; i++) - { - if (RLGL.State.activeTextureId[i] > 0) - { - glActiveTexture(GL_TEXTURE0 + 1 + i); - glBindTexture(GL_TEXTURE_2D, RLGL.State.activeTextureId[i]); - } - } - - // Activate default sampler2D texture0 (one texture is always active for default batch shader) - // NOTE: Batch system accumulates calls by texture0 changes, additional textures are enabled for all the draw calls - glActiveTexture(GL_TEXTURE0); - - for (int i = 0, vertexOffset = 0; i < batch->drawsCounter; i++) - { - // Bind current draw call texture, activated as GL_TEXTURE0 and binded to sampler2D texture0 by default - glBindTexture(GL_TEXTURE_2D, batch->draws[i].textureId); - - if ((batch->draws[i].mode == RL_LINES) || (batch->draws[i].mode == RL_TRIANGLES)) glDrawArrays(batch->draws[i].mode, vertexOffset, batch->draws[i].vertexCount); - else - { -#if defined(GRAPHICS_API_OPENGL_33) - // We need to define the number of indices to be processed: quadsCount*6 - // NOTE: The final parameter tells the GPU the offset in bytes from the - // start of the index buffer to the location of the first index to process - glDrawElements(GL_TRIANGLES, batch->draws[i].vertexCount/4*6, GL_UNSIGNED_INT, (GLvoid *)(vertexOffset/4*6*sizeof(GLuint))); -#elif defined(GRAPHICS_API_OPENGL_ES2) - glDrawElements(GL_TRIANGLES, batch->draws[i].vertexCount/4*6, GL_UNSIGNED_SHORT, (GLvoid *)(vertexOffset/4*6*sizeof(GLushort))); +// Get internal projection matrix +Matrix rlGetMatrixProjection(void) +{ +#if defined(GRAPHICS_API_OPENGL_11) + float mat[16]; + glGetFloatv(GL_PROJECTION_MATRIX,mat); + Matrix m; + m.m0 = mat[0]; + m.m1 = mat[1]; + m.m2 = mat[2]; + m.m3 = mat[3]; + m.m4 = mat[4]; + m.m5 = mat[5]; + m.m6 = mat[6]; + m.m7 = mat[7]; + m.m8 = mat[8]; + m.m9 = mat[9]; + m.m10 = mat[10]; + m.m11 = mat[11]; + m.m12 = mat[12]; + m.m13 = mat[13]; + m.m14 = mat[14]; + m.m15 = mat[15]; + return m; +#else + return RLGL.State.projection; #endif - } - - vertexOffset += (batch->draws[i].vertexCount + batch->draws[i].vertexAlignment); - } - - if (!RLGL.ExtSupported.vao) - { - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - } - - glBindTexture(GL_TEXTURE_2D, 0); // Unbind textures - } - - if (RLGL.ExtSupported.vao) glBindVertexArray(0); // Unbind VAO - - glUseProgram(0); // Unbind shader program - } - //------------------------------------------------------------------------------------------------------------ - - // Reset batch buffers - //------------------------------------------------------------------------------------------------------------ - // Reset vertex counters for next frame - batch->vertexBuffer[batch->currentBuffer].vCounter = 0; - batch->vertexBuffer[batch->currentBuffer].tcCounter = 0; - batch->vertexBuffer[batch->currentBuffer].cCounter = 0; - - // Reset depth for next draw - batch->currentDepth = -1.0f; - - // Restore projection/modelview matrices - RLGL.State.projection = matProjection; - RLGL.State.modelview = matModelView; - - // Reset RLGL.currentBatch->draws array - for (int i = 0; i < DEFAULT_BATCH_DRAWCALLS; i++) - { - batch->draws[i].mode = RL_QUADS; - batch->draws[i].vertexCount = 0; - batch->draws[i].textureId = RLGL.State.defaultTextureId; - } - - // Reset active texture units for next batch - for (int i = 0; i < MAX_BATCH_ACTIVE_TEXTURES; i++) RLGL.State.activeTextureId[i] = 0; - - // Reset draws counter to one draw for the batch - batch->drawsCounter = 1; - //------------------------------------------------------------------------------------------------------------ - - // Change to next buffer in the list (in case of multi-buffering) - batch->currentBuffer++; - if (batch->currentBuffer >= batch->buffersCount) batch->currentBuffer = 0; } -// Unload default internal buffers vertex data from CPU and GPU -static void UnloadRenderBatch(RenderBatch batch) +// Get internal accumulated transform matrix +Matrix rlGetMatrixTransform(void) { - // Unbind everything - if (RLGL.ExtSupported.vao) glBindVertexArray(0); - glDisableVertexAttribArray(0); - glDisableVertexAttribArray(1); - glDisableVertexAttribArray(2); - glDisableVertexAttribArray(3); - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - - // Unload all vertex buffers data - for (int i = 0; i < batch.buffersCount; i++) - { - // Delete VBOs from GPU (VRAM) - glDeleteBuffers(1, &batch.vertexBuffer[i].vboId[0]); - glDeleteBuffers(1, &batch.vertexBuffer[i].vboId[1]); - glDeleteBuffers(1, &batch.vertexBuffer[i].vboId[2]); - glDeleteBuffers(1, &batch.vertexBuffer[i].vboId[3]); - - // Delete VAOs from GPU (VRAM) - if (RLGL.ExtSupported.vao) glDeleteVertexArrays(1, &batch.vertexBuffer[i].vaoId); - - // Free vertex arrays memory from CPU (RAM) - RL_FREE(batch.vertexBuffer[i].vertices); - RL_FREE(batch.vertexBuffer[i].texcoords); - RL_FREE(batch.vertexBuffer[i].colors); - RL_FREE(batch.vertexBuffer[i].indices); - } - - // Unload arrays - RL_FREE(batch.vertexBuffer); - RL_FREE(batch.draws); + Matrix mat = MatrixIdentity(); +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + // TODO: Consider possible transform matrices in the RLGL.State.stack + // Is this the right order? or should we start with the first stored matrix instead of the last one? + //Matrix matStackTransform = MatrixIdentity(); + //for (int i = RLGL.State.stackCounter; i > 0; i--) matStackTransform = MatrixMultiply(RLGL.State.stack[i], matStackTransform); + mat = RLGL.State.transform; +#endif + return mat; } -// Set the active render batch for rlgl -static void SetRenderBatchActive(RenderBatch *batch) +// Get internal projection matrix for stereo render (selected eye) +RLAPI Matrix rlGetMatrixProjectionStereo(int eye) { - DrawRenderBatch(RLGL.currentBatch); - RLGL.currentBatch = batch; + Matrix mat = MatrixIdentity(); +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + mat = RLGL.State.projectionStereo[eye]; +#endif + return mat; } -// Set default render batch for rlgl -static void SetRenderBatchDefault(void) +// Get internal view offset matrix for stereo render (selected eye) +RLAPI Matrix rlGetMatrixViewOffsetStereo(int eye) { - DrawRenderBatch(RLGL.currentBatch); - RLGL.currentBatch = &RLGL.defaultBatch; + Matrix mat = MatrixIdentity(); +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + mat = RLGL.State.viewOffsetStereo[eye]; +#endif + return mat; } -// Renders a 1x1 XY quad in NDC -static void GenDrawQuad(void) +// Set a custom modelview matrix (replaces internal modelview matrix) +void rlSetMatrixModelview(Matrix view) { +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + RLGL.State.modelview = view; +#endif +} + +// Set a custom projection matrix (replaces internal projection matrix) +void rlSetMatrixProjection(Matrix projection) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + RLGL.State.projection = projection; +#endif +} + +// Set eyes projection matrices for stereo rendering +void rlSetMatrixProjectionStereo(Matrix right, Matrix left) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + RLGL.State.projectionStereo[0] = right; + RLGL.State.projectionStereo[1] = left; +#endif +} + +// Set eyes view offsets matrices for stereo rendering +void rlSetMatrixViewOffsetStereo(Matrix right, Matrix left) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + RLGL.State.viewOffsetStereo[0] = right; + RLGL.State.viewOffsetStereo[1] = left; +#endif +} + +// Load and draw a 1x1 XY quad in NDC +void rlLoadDrawQuad(void) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) unsigned int quadVAO = 0; unsigned int quadVBO = 0; @@ -4676,11 +3632,13 @@ static void GenDrawQuad(void) // Delete buffers (VBO and VAO) glDeleteBuffers(1, &quadVBO); glDeleteVertexArrays(1, &quadVAO); +#endif } -// Renders a 1x1 3D cube in NDC -static void GenDrawCube(void) +// Load and draw a 1x1 3D cube in NDC +void rlLoadDrawCube(void) { +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) unsigned int cubeVAO = 0; unsigned int cubeVBO = 0; @@ -4752,35 +3710,224 @@ static void GenDrawCube(void) // Delete VBO and VAO glDeleteBuffers(1, &cubeVBO); glDeleteVertexArrays(1, &cubeVAO); +#endif } -#if defined(SUPPORT_VR_SIMULATOR) -// Set internal projection and modelview matrix depending on eyes tracking data -static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView) +//---------------------------------------------------------------------------------- +// Module specific Functions Definition +//---------------------------------------------------------------------------------- +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) +// Load default shader (just vertex positioning and texture coloring) +// NOTE: This shader program is used for internal buffers +// NOTE: It uses global variable: RLGL.State.defaultShader +static void rlLoadShaderDefault(void) { - Matrix eyeProjection = matProjection; - Matrix eyeModelView = matModelView; + RLGL.State.defaultShader.locs = (int *)RL_CALLOC(MAX_SHADER_LOCATIONS, sizeof(int)); - // Setup viewport and projection/modelview matrices using tracking data - rlViewport(eye*RLGL.State.framebufferWidth/2, 0, RLGL.State.framebufferWidth/2, RLGL.State.framebufferHeight); + // NOTE: All locations must be reseted to -1 (no location) + for (int i = 0; i < MAX_SHADER_LOCATIONS; i++) RLGL.State.defaultShader.locs[i] = -1; - // Apply view offset to modelview matrix - eyeModelView = MatrixMultiply(matModelView, RLGL.Vr.config.eyesViewOffset[eye]); + // Vertex shader directly defined, no external file required + const char *vShaderDefault = +#if defined(GRAPHICS_API_OPENGL_21) + "#version 120 \n" + "attribute vec3 vertexPosition; \n" + "attribute vec2 vertexTexCoord; \n" + "attribute vec4 vertexColor; \n" + "varying vec2 fragTexCoord; \n" + "varying vec4 fragColor; \n" +#elif defined(GRAPHICS_API_OPENGL_33) + "#version 330 \n" + "in vec3 vertexPosition; \n" + "in vec2 vertexTexCoord; \n" + "in vec4 vertexColor; \n" + "out vec2 fragTexCoord; \n" + "out vec4 fragColor; \n" +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) + "#version 100 \n" + "attribute vec3 vertexPosition; \n" + "attribute vec2 vertexTexCoord; \n" + "attribute vec4 vertexColor; \n" + "varying vec2 fragTexCoord; \n" + "varying vec4 fragColor; \n" +#endif + "uniform mat4 mvp; \n" + "void main() \n" + "{ \n" + " fragTexCoord = vertexTexCoord; \n" + " fragColor = vertexColor; \n" + " gl_Position = mvp*vec4(vertexPosition, 1.0); \n" + "} \n"; - // Set current eye projection matrix - eyeProjection = RLGL.Vr.config.eyesProjection[eye]; + // Fragment shader directly defined, no external file required + const char *fShaderDefault = +#if defined(GRAPHICS_API_OPENGL_21) + "#version 120 \n" + "varying vec2 fragTexCoord; \n" + "varying vec4 fragColor; \n" + "uniform sampler2D texture0; \n" + "uniform vec4 colDiffuse; \n" + "void main() \n" + "{ \n" + " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" + " gl_FragColor = texelColor*colDiffuse*fragColor; \n" + "} \n"; +#elif defined(GRAPHICS_API_OPENGL_33) + "#version 330 \n" + "in vec2 fragTexCoord; \n" + "in vec4 fragColor; \n" + "out vec4 finalColor; \n" + "uniform sampler2D texture0; \n" + "uniform vec4 colDiffuse; \n" + "void main() \n" + "{ \n" + " vec4 texelColor = texture(texture0, fragTexCoord); \n" + " finalColor = texelColor*colDiffuse*fragColor; \n" + "} \n"; +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) + "#version 100 \n" + "precision mediump float; \n" // Precision required for OpenGL ES2 (WebGL) + "varying vec2 fragTexCoord; \n" + "varying vec4 fragColor; \n" + "uniform sampler2D texture0; \n" + "uniform vec4 colDiffuse; \n" + "void main() \n" + "{ \n" + " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" + " gl_FragColor = texelColor*colDiffuse*fragColor; \n" + "} \n"; +#endif - SetMatrixModelview(eyeModelView); - SetMatrixProjection(eyeProjection); + // NOTE: Compiled vertex/fragment shaders are kept for re-use + RLGL.State.defaultVShaderId = rlCompileShader(vShaderDefault, GL_VERTEX_SHADER); // Compile default vertex shader + RLGL.State.defaultFShaderId = rlCompileShader(fShaderDefault, GL_FRAGMENT_SHADER); // Compile default fragment shader + + RLGL.State.defaultShader.id = rlLoadShaderProgram(RLGL.State.defaultVShaderId, RLGL.State.defaultFShaderId); + + if (RLGL.State.defaultShader.id > 0) + { + TRACELOG(LOG_INFO, "SHADER: [ID %i] Default shader loaded successfully", RLGL.State.defaultShader.id); + + // Set default shader locations: attributes locations + RLGL.State.defaultShader.locs[SHADER_LOC_VERTEX_POSITION] = glGetAttribLocation(RLGL.State.defaultShader.id, "vertexPosition"); + RLGL.State.defaultShader.locs[SHADER_LOC_VERTEX_TEXCOORD01] = glGetAttribLocation(RLGL.State.defaultShader.id, "vertexTexCoord"); + RLGL.State.defaultShader.locs[SHADER_LOC_VERTEX_COLOR] = glGetAttribLocation(RLGL.State.defaultShader.id, "vertexColor"); + + // Set default shader locations: uniform locations + RLGL.State.defaultShader.locs[SHADER_LOC_MATRIX_MVP] = glGetUniformLocation(RLGL.State.defaultShader.id, "mvp"); + RLGL.State.defaultShader.locs[SHADER_LOC_COLOR_DIFFUSE] = glGetUniformLocation(RLGL.State.defaultShader.id, "colDiffuse"); + RLGL.State.defaultShader.locs[SHADER_LOC_MAP_DIFFUSE] = glGetUniformLocation(RLGL.State.defaultShader.id, "texture0"); + } + else TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to load default shader", RLGL.State.defaultShader.id); } -#endif // SUPPORT_VR_SIMULATOR + +// Unload default shader +// NOTE: It uses global variable: RLGL.State.defaultShader +static void rlUnloadShaderDefault(void) +{ + glUseProgram(0); + + glDetachShader(RLGL.State.defaultShader.id, RLGL.State.defaultVShaderId); + glDetachShader(RLGL.State.defaultShader.id, RLGL.State.defaultFShaderId); + glDeleteShader(RLGL.State.defaultVShaderId); + glDeleteShader(RLGL.State.defaultFShaderId); + + glDeleteProgram(RLGL.State.defaultShader.id); + + RL_FREE(RLGL.State.defaultShader.locs); + + TRACELOG(LOG_INFO, "SHADER: [ID %i] Default shader unloaded successfully", RLGL.State.defaultShader.id); +} + +#if defined(SUPPORT_GL_DETAILS_INFO) +// Get compressed format official GL identifier name +static char *rlGetCompressedFormatName(int format) +{ + static char compName[64] = { 0 }; + memset(compName, 0, 64); + + switch (format) + { + // GL_EXT_texture_compression_s3tc + case 0x83F0: strcpy(compName, "GL_COMPRESSED_RGB_S3TC_DXT1_EXT"); break; + case 0x83F1: strcpy(compName, "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT"); break; + case 0x83F2: strcpy(compName, "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT"); break; + case 0x83F3: strcpy(compName, "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT"); break; + // GL_3DFX_texture_compression_FXT1 + case 0x86B0: strcpy(compName, "GL_COMPRESSED_RGB_FXT1_3DFX"); break; + case 0x86B1: strcpy(compName, "GL_COMPRESSED_RGBA_FXT1_3DFX"); break; + // GL_IMG_texture_compression_pvrtc + case 0x8C00: strcpy(compName, "GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG"); break; + case 0x8C01: strcpy(compName, "GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG"); break; + case 0x8C02: strcpy(compName, "GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"); break; + case 0x8C03: strcpy(compName, "GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG"); break; + // GL_OES_compressed_ETC1_RGB8_texture + case 0x8D64: strcpy(compName, "GL_ETC1_RGB8_OES"); break; + // GL_ARB_texture_compression_rgtc + case 0x8DBB: strcpy(compName, "GL_COMPRESSED_RED_RGTC1"); break; + case 0x8DBC: strcpy(compName, "GL_COMPRESSED_SIGNED_RED_RGTC1"); break; + case 0x8DBD: strcpy(compName, "GL_COMPRESSED_RG_RGTC2"); break; + case 0x8DBE: strcpy(compName, "GL_COMPRESSED_SIGNED_RG_RGTC2"); break; + // GL_ARB_texture_compression_bptc + case 0x8E8C: strcpy(compName, "GL_COMPRESSED_RGBA_BPTC_UNORM_ARB"); break; + case 0x8E8D: strcpy(compName, "GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB"); break; + case 0x8E8E: strcpy(compName, "GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB"); break; + case 0x8E8F: strcpy(compName, "GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB"); break; + // GL_ARB_ES3_compatibility + case 0x9274: strcpy(compName, "GL_COMPRESSED_RGB8_ETC2"); break; + case 0x9275: strcpy(compName, "GL_COMPRESSED_SRGB8_ETC2"); break; + case 0x9276: strcpy(compName, "GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2"); break; + case 0x9277: strcpy(compName, "GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2"); break; + case 0x9278: strcpy(compName, "GL_COMPRESSED_RGBA8_ETC2_EAC"); break; + case 0x9279: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"); break; + case 0x9270: strcpy(compName, "GL_COMPRESSED_R11_EAC"); break; + case 0x9271: strcpy(compName, "GL_COMPRESSED_SIGNED_R11_EAC"); break; + case 0x9272: strcpy(compName, "GL_COMPRESSED_RG11_EAC"); break; + case 0x9273: strcpy(compName, "GL_COMPRESSED_SIGNED_RG11_EAC"); break; + // GL_KHR_texture_compression_astc_hdr + case 0x93B0: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_4x4_KHR"); break; + case 0x93B1: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_5x4_KHR"); break; + case 0x93B2: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_5x5_KHR"); break; + case 0x93B3: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_6x5_KHR"); break; + case 0x93B4: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_6x6_KHR"); break; + case 0x93B5: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_8x5_KHR"); break; + case 0x93B6: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_8x6_KHR"); break; + case 0x93B7: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_8x8_KHR"); break; + case 0x93B8: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_10x5_KHR"); break; + case 0x93B9: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_10x6_KHR"); break; + case 0x93BA: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_10x8_KHR"); break; + case 0x93BB: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_10x10_KHR"); break; + case 0x93BC: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_12x10_KHR"); break; + case 0x93BD: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_12x12_KHR"); break; + case 0x93D0: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR"); break; + case 0x93D1: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR"); break; + case 0x93D2: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR"); break; + case 0x93D3: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR"); break; + case 0x93D4: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR"); break; + case 0x93D5: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR"); break; + case 0x93D6: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR"); break; + case 0x93D7: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR"); break; + case 0x93D8: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR"); break; + case 0x93D9: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR"); break; + case 0x93DA: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR"); break; + case 0x93DB: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR"); break; + case 0x93DC: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR"); break; + case 0x93DD: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR"); break; + default: strcpy(compName, "GL_COMPRESSED_UNKNOWN"); break; + } + + return compName; +} +#endif // SUPPORT_GL_DETAILS_INFO #endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2 #if defined(GRAPHICS_API_OPENGL_11) // Mipmaps data is generated after image data // NOTE: Only works with RGBA (4 bytes) data! -static int GenerateMipmaps(unsigned char *data, int baseWidth, int baseHeight) +static int rlGenerateMipmapsData(unsigned char *data, int baseWidth, int baseHeight) { int mipmapCount = 1; // Required mipmap levels count (including base level) int width = baseWidth; @@ -4806,7 +3953,7 @@ static int GenerateMipmaps(unsigned char *data, int baseWidth, int baseHeight) unsigned char *temp = RL_REALLOC(data, size); if (temp != NULL) data = temp; - else TRACELOG(LOG_WARNING, "TEXTURE: Failed to allocate required mipmaps memory"); + else TRACELOG(LOG_WARNING, "TEXTURE: Failed to re-allocate required mipmaps memory"); width = baseWidth; height = baseHeight; @@ -4832,7 +3979,7 @@ static int GenerateMipmaps(unsigned char *data, int baseWidth, int baseHeight) for (int mip = 1; mip < mipmapCount; mip++) { - mipmap = GenNextMipmap(image, width, height); + mipmap = rlGenNextMipmapData(image, width, height); offset += (width*height*4); // Size of last mipmap j = 0; @@ -4863,7 +4010,7 @@ static int GenerateMipmaps(unsigned char *data, int baseWidth, int baseHeight) } // Manual mipmap generation (basic scaling algorithm) -static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight) +static Color *rlGenNextMipmapData(Color *srcData, int srcWidth, int srcHeight) { int x2, y2; Color prow, pcol; @@ -4903,83 +4050,38 @@ static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight) return mipmap; } -#endif - -#if defined(RLGL_STANDALONE) -// Load text data from file, returns a '\0' terminated string -// NOTE: text chars array should be freed manually -char *LoadFileText(const char *fileName) -{ - char *text = NULL; - - if (fileName != NULL) - { - FILE *textFile = fopen(fileName, "rt"); - - if (textFile != NULL) - { - // WARNING: When reading a file as 'text' file, - // text mode causes carriage return-linefeed translation... - // ...but using fseek() should return correct byte-offset - fseek(textFile, 0, SEEK_END); - int size = ftell(textFile); - fseek(textFile, 0, SEEK_SET); - - if (size > 0) - { - text = (char *)RL_MALLOC((size + 1)*sizeof(char)); - int count = fread(text, sizeof(char), size, textFile); - - // WARNING: \r\n is converted to \n on reading, so, - // read bytes count gets reduced by the number of lines - if (count < size) text = RL_REALLOC(text, count + 1); - - // Zero-terminate the string - text[count] = '\0'; - - TRACELOG(LOG_INFO, "FILEIO: [%s] Text file loaded successfully", fileName); - } - else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to read text file", fileName); - - fclose(textFile); - } - else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to open text file", fileName); - } - else TRACELOG(LOG_WARNING, "FILEIO: File name provided is not valid"); - - return text; -} +#endif // GRAPHICS_API_OPENGL_11 // Get pixel data size in bytes (image or texture) // NOTE: Size depends on pixel format -int GetPixelDataSize(int width, int height, int format) +static int rlGetPixelDataSize(int width, int height, int format) { int dataSize = 0; // Size in bytes int bpp = 0; // Bits per pixel switch (format) { - case UNCOMPRESSED_GRAYSCALE: bpp = 8; break; - case UNCOMPRESSED_GRAY_ALPHA: - case UNCOMPRESSED_R5G6B5: - case UNCOMPRESSED_R5G5B5A1: - case UNCOMPRESSED_R4G4B4A4: bpp = 16; break; - case UNCOMPRESSED_R8G8B8A8: bpp = 32; break; - case UNCOMPRESSED_R8G8B8: bpp = 24; break; - case UNCOMPRESSED_R32: bpp = 32; break; - case UNCOMPRESSED_R32G32B32: bpp = 32*3; break; - case UNCOMPRESSED_R32G32B32A32: bpp = 32*4; break; - case COMPRESSED_DXT1_RGB: - case COMPRESSED_DXT1_RGBA: - case COMPRESSED_ETC1_RGB: - case COMPRESSED_ETC2_RGB: - case COMPRESSED_PVRT_RGB: - case COMPRESSED_PVRT_RGBA: bpp = 4; break; - case COMPRESSED_DXT3_RGBA: - case COMPRESSED_DXT5_RGBA: - case COMPRESSED_ETC2_EAC_RGBA: - case COMPRESSED_ASTC_4x4_RGBA: bpp = 8; break; - case COMPRESSED_ASTC_8x8_RGBA: bpp = 2; break; + case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: bpp = 8; break; + case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: + case PIXELFORMAT_UNCOMPRESSED_R5G6B5: + case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: + case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: bpp = 16; break; + case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: bpp = 32; break; + case PIXELFORMAT_UNCOMPRESSED_R8G8B8: bpp = 24; break; + case PIXELFORMAT_UNCOMPRESSED_R32: bpp = 32; break; + case PIXELFORMAT_UNCOMPRESSED_R32G32B32: bpp = 32*3; break; + case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: bpp = 32*4; break; + case PIXELFORMAT_COMPRESSED_DXT1_RGB: + case PIXELFORMAT_COMPRESSED_DXT1_RGBA: + case PIXELFORMAT_COMPRESSED_ETC1_RGB: + case PIXELFORMAT_COMPRESSED_ETC2_RGB: + case PIXELFORMAT_COMPRESSED_PVRT_RGB: + case PIXELFORMAT_COMPRESSED_PVRT_RGBA: bpp = 4; break; + case PIXELFORMAT_COMPRESSED_DXT3_RGBA: + case PIXELFORMAT_COMPRESSED_DXT5_RGBA: + case PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA: + case PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA: bpp = 8; break; + case PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA: bpp = 2; break; default: break; } @@ -4989,12 +4091,10 @@ int GetPixelDataSize(int width, int height, int format) // if texture is smaller, minimum dataSize is 8 or 16 if ((width < 4) && (height < 4)) { - if ((format >= COMPRESSED_DXT1_RGB) && (format < COMPRESSED_DXT3_RGBA)) dataSize = 8; - else if ((format >= COMPRESSED_DXT3_RGBA) && (format < COMPRESSED_ASTC_8x8_RGBA)) dataSize = 16; + if ((format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) && (format < PIXELFORMAT_COMPRESSED_DXT3_RGBA)) dataSize = 8; + else if ((format >= PIXELFORMAT_COMPRESSED_DXT3_RGBA) && (format < PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA)) dataSize = 16; } return dataSize; } -#endif // RLGL_STANDALONE - #endif // RLGL_IMPLEMENTATION diff --git a/src/shapes.c b/src/shapes.c index fc4bddc02..5acd9810d 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -4,10 +4,6 @@ * * CONFIGURATION: * -* #define SUPPORT_FONT_TEXTURE -* Draw rectangle shapes using font texture white character instead of default white texture -* Allows drawing rectangles and text with a single draw call, very useful for GUI systems! -* * #define SUPPORT_QUADS_DRAW_MODE * Use QUADS instead of TRIANGLES for drawing when possible. * Some lines-based shapes could still use lines @@ -62,7 +58,8 @@ //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -// ... +Texture2D texShapes = { 1, 1, 1, 1, 7 }; // Texture used on shapes drawing (usually a white pixel) +Rectangle texShapesRec = { 0, 0, 1, 1 }; // Texture source rectangle used on shapes drawing //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -73,6 +70,15 @@ static float EaseCubicInOut(float t, float b, float c, float d); // Cubic eas // Module Functions Definition //---------------------------------------------------------------------------------- +// Set texture and rectangle to be used on shapes drawing +// NOTE: It can be useful when using basic shapes and one single font, +// defining a font char white rectangle would allow drawing everything in a single draw call +void SetShapesTexture(Texture2D texture, Rectangle source) +{ + texShapes = texture; + texShapesRec = source; +} + // Draw a pixel void DrawPixel(int posX, int posY, Color color) { @@ -116,45 +122,22 @@ void DrawLineV(Vector2 startPos, Vector2 endPos, Color color) // Draw a line defining thickness void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color) { - if (startPos.x > endPos.x) + Vector2 delta = { endPos.x - startPos.x, endPos.y - startPos.y }; + float length = sqrtf(delta.x*delta.x + delta.y*delta.y); + + if ((length > 0) && (thick > 0)) { - Vector2 tempPos = startPos; - startPos = endPos; - endPos = tempPos; + float scale = thick/(2*length); + Vector2 radius = { -scale*delta.y, scale*delta.x }; + Vector2 strip[4] = { + { startPos.x - radius.x, startPos.y - radius.y }, + { startPos.x + radius.x, startPos.y + radius.y }, + { endPos.x - radius.x, endPos.y - radius.y }, + { endPos.x + radius.x, endPos.y + radius.y } + }; + + DrawTriangleStrip(strip, 4, color); } - - float dx = endPos.x - startPos.x; - float dy = endPos.y - startPos.y; - - float d = sqrtf(dx*dx + dy*dy); - float angle = asinf(dy/d); - - rlEnableTexture(GetShapesTexture().id); - - rlPushMatrix(); - rlTranslatef((float)startPos.x, (float)startPos.y, 0.0f); - rlRotatef(RAD2DEG*angle, 0.0f, 0.0f, 1.0f); - rlTranslatef(0, (thick > 1.0f)? -thick/2.0f : -1.0f, 0.0f); - - rlBegin(RL_QUADS); - rlColor4ub(color.r, color.g, color.b, color.a); - rlNormal3f(0.0f, 0.0f, 1.0f); - - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); - rlVertex2f(0.0f, 0.0f); - - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); - rlVertex2f(0.0f, thick); - - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); - rlVertex2f(d, thick); - - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); - rlVertex2f(d, 0.0f); - rlEnd(); - rlPopMatrix(); - - rlDisableTexture(); } // Draw line using cubic-bezier curves in-out @@ -165,7 +148,7 @@ void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color) #endif Vector2 previous = startPos; - Vector2 current; + Vector2 current = { 0 }; for (int i = 1; i <= BEZIER_LINE_DIVISIONS; i++) { @@ -184,24 +167,24 @@ void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color) void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color) { const float step = 1.0f/BEZIER_LINE_DIVISIONS; - + Vector2 previous = startPos; Vector2 current = { 0 }; float t = 0.0f; - + for (int i = 0; i <= BEZIER_LINE_DIVISIONS; i++) { t = step*i; float a = powf(1 - t, 2); float b = 2*(1 - t)*t; float c = powf(t, 2); - + // NOTE: The easing functions aren't suitable here because they don't take a control point current.y = a*startPos.y + b*controlPos.y + c*endPos.y; current.x = a*startPos.x + b*controlPos.x + c*endPos.x; - - DrawLineEx(previous,current,thick,color); - + + DrawLineEx(previous, current, thick, color); + previous = current; } } @@ -211,7 +194,7 @@ void DrawLineStrip(Vector2 *points, int pointsCount, Color color) { if (pointsCount >= 2) { - if (rlCheckBufferLimit(pointsCount)) rlglDraw(); + rlCheckRenderBatchLimit(pointsCount); rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); @@ -232,7 +215,7 @@ void DrawCircle(int centerX, int centerY, float radius, Color color) } // Draw a piece of a circle -void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color) +void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color) { if (radius <= 0.0f) radius = 0.1f; // Avoid div by zero @@ -240,27 +223,29 @@ void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle if (endAngle < startAngle) { // Swap values - int tmp = startAngle; + float tmp = startAngle; startAngle = endAngle; endAngle = tmp; } - if (segments < 4) + int minSegments = (int)ceilf((endAngle - startAngle)/90); + + if (segments < minSegments) { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360); - if (segments <= 0) segments = 4; + if (segments <= 0) segments = minSegments; } - float stepLength = (float)(endAngle - startAngle)/(float)segments; - float angle = (float)startAngle; + float stepLength = (endAngle - startAngle)/(float)segments; + float angle = startAngle; #if defined(SUPPORT_QUADS_DRAW_MODE) - if (rlCheckBufferLimit(4*segments/2)) rlglDraw(); + rlCheckRenderBatchLimit(4*segments/2); - rlEnableTexture(GetShapesTexture().id); + rlSetTexture(texShapes.id); rlBegin(RL_QUADS); // NOTE: Every QUAD actually represents two segments @@ -268,16 +253,16 @@ void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle { rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(center.x, center.y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength*2))*radius, center.y + cosf(DEG2RAD*(angle + stepLength*2))*radius); angle += (stepLength*2); @@ -288,23 +273,23 @@ void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle { rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(center.x, center.y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(center.x, center.y); } rlEnd(); - rlDisableTexture(); + rlSetTexture(0); #else - if (rlCheckBufferLimit(3*segments)) rlglDraw(); + rlCheckRenderBatchLimit(3*segments); rlBegin(RL_TRIANGLES); for (int i = 0; i < segments; i++) @@ -321,7 +306,7 @@ void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle #endif } -void DrawCircleSectorLines(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color) +void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color) { if (radius <= 0.0f) radius = 0.1f; // Avoid div by zero issue @@ -329,29 +314,31 @@ void DrawCircleSectorLines(Vector2 center, float radius, int startAngle, int end if (endAngle < startAngle) { // Swap values - int tmp = startAngle; + float tmp = startAngle; startAngle = endAngle; endAngle = tmp; } - if (segments < 4) + int minSegments = (int)ceilf((endAngle - startAngle)/90); + + if (segments < minSegments) { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1); segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360); - if (segments <= 0) segments = 4; + if (segments <= 0) segments = minSegments; } - float stepLength = (float)(endAngle - startAngle)/(float)segments; - float angle = (float)startAngle; + float stepLength = (endAngle - startAngle)/(float)segments; + float angle = startAngle; // Hide the cap lines when the circle is full bool showCapLines = true; int limit = 2*(segments + 2); - if ((endAngle - startAngle)%360 == 0) { limit = 2*segments; showCapLines = false; } + if ((int)(endAngle - startAngle)%360 == 0) { limit = 2*segments; showCapLines = false; } - if (rlCheckBufferLimit(limit)) rlglDraw(); + rlCheckRenderBatchLimit(limit); rlBegin(RL_LINES); if (showCapLines) @@ -384,7 +371,7 @@ void DrawCircleSectorLines(Vector2 center, float radius, int startAngle, int end // NOTE: Gradient goes from center (color1) to border (color2) void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2) { - if (rlCheckBufferLimit(3*36)) rlglDraw(); + rlCheckRenderBatchLimit(3*36); rlBegin(RL_TRIANGLES); for (int i = 0; i < 360; i += 10) @@ -400,7 +387,7 @@ void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Co } // Draw a color-filled circle (Vector version) -// NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues (view rlglDraw) +// NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues void DrawCircleV(Vector2 center, float radius, Color color) { DrawCircleSector(center, radius, 0, 360, 36, color); @@ -409,7 +396,7 @@ void DrawCircleV(Vector2 center, float radius, Color color) // Draw circle outline void DrawCircleLines(int centerX, int centerY, float radius, Color color) { - if (rlCheckBufferLimit(2*36)) rlglDraw(); + rlCheckRenderBatchLimit(2*36); rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); @@ -426,7 +413,7 @@ void DrawCircleLines(int centerX, int centerY, float radius, Color color) // Draw ellipse void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color) { - if (rlCheckBufferLimit(3*36)) rlglDraw(); + rlCheckRenderBatchLimit(3*36); rlBegin(RL_TRIANGLES); for (int i = 0; i < 360; i += 10) @@ -442,7 +429,7 @@ void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color c // Draw ellipse outline void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color) { - if (rlCheckBufferLimit(2*36)) rlglDraw(); + rlCheckRenderBatchLimit(2*36); rlBegin(RL_LINES); for (int i = 0; i < 360; i += 10) @@ -454,7 +441,7 @@ void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Co rlEnd(); } -void DrawRing(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color) +void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color) { if (startAngle == endAngle) return; @@ -472,18 +459,20 @@ void DrawRing(Vector2 center, float innerRadius, float outerRadius, int startAng if (endAngle < startAngle) { // Swap values - int tmp = startAngle; + float tmp = startAngle; startAngle = endAngle; endAngle = tmp; } - if (segments < 4) + int minSegments = (int)ceilf((endAngle - startAngle)/90); + + if (segments < minSegments) { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1); segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360); - if (segments <= 0) segments = 4; + if (segments <= 0) segments = minSegments; } // Not a ring @@ -493,38 +482,38 @@ void DrawRing(Vector2 center, float innerRadius, float outerRadius, int startAng return; } - float stepLength = (float)(endAngle - startAngle)/(float)segments; - float angle = (float)startAngle; + float stepLength = (endAngle - startAngle)/(float)segments; + float angle = startAngle; #if defined(SUPPORT_QUADS_DRAW_MODE) - if (rlCheckBufferLimit(4*segments)) rlglDraw(); + rlCheckRenderBatchLimit(4*segments); - rlEnableTexture(GetShapesTexture().id); + rlSetTexture(texShapes.id); rlBegin(RL_QUADS); for (int i = 0; i < segments; i++) { rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*outerRadius); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius); angle += stepLength; } rlEnd(); - rlDisableTexture(); + rlSetTexture(0); #else - if (rlCheckBufferLimit(6*segments)) rlglDraw(); + rlCheckRenderBatchLimit(6*segments); rlBegin(RL_TRIANGLES); for (int i = 0; i < segments; i++) @@ -545,7 +534,7 @@ void DrawRing(Vector2 center, float innerRadius, float outerRadius, int startAng #endif } -void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color) +void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color) { if (startAngle == endAngle) return; @@ -563,18 +552,20 @@ void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, int sta if (endAngle < startAngle) { // Swap values - int tmp = startAngle; + float tmp = startAngle; startAngle = endAngle; endAngle = tmp; } - if (segments < 4) + int minSegments = (int)ceilf((endAngle - startAngle)/90); + + if (segments < minSegments) { // Calculate the maximum angle between segments based on the error rate (usually 0.5f) float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1); segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360); - if (segments <= 0) segments = 4; + if (segments <= 0) segments = minSegments; } if (innerRadius <= 0.0f) @@ -583,14 +574,14 @@ void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, int sta return; } - float stepLength = (float)(endAngle - startAngle)/(float)segments; - float angle = (float)startAngle; + float stepLength = (endAngle - startAngle)/(float)segments; + float angle = startAngle; bool showCapLines = true; int limit = 4*(segments + 1); - if ((endAngle - startAngle)%360 == 0) { limit = 4*segments; showCapLines = false; } + if ((int)(endAngle - startAngle)%360 == 0) { limit = 4*segments; showCapLines = false; } - if (rlCheckBufferLimit(limit)) rlglDraw(); + rlCheckRenderBatchLimit(limit); rlBegin(RL_LINES); if (showCapLines) @@ -629,7 +620,7 @@ void DrawRectangle(int posX, int posY, int width, int height, Color color) } // Draw a color-filled rectangle (Vector version) -// NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues (view rlglDraw) +// NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues void DrawRectangleV(Vector2 position, Vector2 size, Color color) { DrawRectanglePro((Rectangle){ position.x, position.y, size.x, size.y }, (Vector2){ 0.0f, 0.0f }, 0.0f, color); @@ -644,34 +635,65 @@ void DrawRectangleRec(Rectangle rec, Color color) // Draw a color-filled rectangle with pro parameters void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color) { - if (rlCheckBufferLimit(4)) rlglDraw(); + rlCheckRenderBatchLimit(4); - rlEnableTexture(GetShapesTexture().id); + Vector2 topLeft = { 0 }; + Vector2 topRight = { 0 }; + Vector2 bottomLeft = { 0 }; + Vector2 bottomRight = { 0 }; - rlPushMatrix(); - rlTranslatef(rec.x, rec.y, 0.0f); - rlRotatef(rotation, 0.0f, 0.0f, 1.0f); - rlTranslatef(-origin.x, -origin.y, 0.0f); + // Only calculate rotation if needed + if (rotation == 0.0f) + { + float x = rec.x - origin.x; + float y = rec.y - origin.y; + topLeft = (Vector2){ x, y }; + topRight = (Vector2){ x + rec.width, y }; + bottomLeft = (Vector2){ x, y + rec.height }; + bottomRight = (Vector2){ x + rec.width, y + rec.height }; + } + else + { + float sinRotation = sinf(rotation*DEG2RAD); + float cosRotation = cosf(rotation*DEG2RAD); + float x = rec.x; + float y = rec.y; + float dx = -origin.x; + float dy = -origin.y; - rlBegin(RL_QUADS); - rlNormal3f(0.0f, 0.0f, 1.0f); - rlColor4ub(color.r, color.g, color.b, color.a); + topLeft.x = x + dx*cosRotation - dy*sinRotation; + topLeft.y = y + dx*sinRotation + dy*cosRotation; - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); - rlVertex2f(0.0f, 0.0f); + topRight.x = x + (dx + rec.width)*cosRotation - dy*sinRotation; + topRight.y = y + (dx + rec.width)*sinRotation + dy*cosRotation; - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); - rlVertex2f(0.0f, rec.height); + bottomLeft.x = x + dx*cosRotation - (dy + rec.height)*sinRotation; + bottomLeft.y = y + dx*sinRotation + (dy + rec.height)*cosRotation; - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); - rlVertex2f(rec.width, rec.height); + bottomRight.x = x + (dx + rec.width)*cosRotation - (dy + rec.height)*sinRotation; + bottomRight.y = y + (dx + rec.width)*sinRotation + (dy + rec.height)*cosRotation; + } - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); - rlVertex2f(rec.width, 0.0f); - rlEnd(); - rlPopMatrix(); + rlSetTexture(texShapes.id); + rlBegin(RL_QUADS); - rlDisableTexture(); + rlNormal3f(0.0f, 0.0f, 1.0f); + rlColor4ub(color.r, color.g, color.b, color.a); + + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); + rlVertex2f(topLeft.x, topLeft.y); + + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); + rlVertex2f(bottomLeft.x, bottomLeft.y); + + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); + rlVertex2f(bottomRight.x, bottomRight.y); + + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); + rlVertex2f(topRight.x, topRight.y); + + rlEnd(); + rlSetTexture(0); } // Draw a vertical-gradient-filled rectangle @@ -692,7 +714,7 @@ void DrawRectangleGradientH(int posX, int posY, int width, int height, Color col // NOTE: Colors refer to corners, starting at top-lef corner and counter-clockwise void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4) { - rlEnableTexture(GetShapesTexture().id); + rlSetTexture(texShapes.id); rlPushMatrix(); rlBegin(RL_QUADS); @@ -700,28 +722,28 @@ void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, // NOTE: Default raylib font character 95 is a white square rlColor4ub(col1.r, col1.g, col1.b, col1.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(rec.x, rec.y); rlColor4ub(col2.r, col2.g, col2.b, col2.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(rec.x, rec.y + rec.height); rlColor4ub(col3.r, col3.g, col3.b, col3.a); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(rec.x + rec.width, rec.y + rec.height); rlColor4ub(col4.r, col4.g, col4.b, col4.a); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(rec.x + rec.width, rec.y); rlEnd(); rlPopMatrix(); - rlDisableTexture(); + rlSetTexture(0); } // Draw rectangle outline -// NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues (view rlglDraw) +// NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues void DrawRectangleLines(int posX, int posY, int width, int height, Color color) { #if defined(SUPPORT_QUADS_DRAW_MODE) @@ -748,18 +770,34 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color) } // Draw rectangle outline with extended parameters -void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color) +void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color) { - if (lineThick > rec.width || lineThick > rec.height) + if ((lineThick > rec.width) || (lineThick > rec.height)) { - if (rec.width > rec.height) lineThick = (int)rec.height/2; - else if (rec.width < rec.height) lineThick = (int)rec.width/2; + if (rec.width > rec.height) lineThick = rec.height/2; + else if (rec.width < rec.height) lineThick = rec.width/2; } - DrawRectangle( (int)rec.x, (int)rec.y, (int)rec.width, lineThick, color); - DrawRectangle( (int)(rec.x - lineThick + rec.width), (int)(rec.y + lineThick), lineThick, (int)(rec.height - lineThick*2.0f), color); - DrawRectangle( (int)rec.x, (int)(rec.y + rec.height - lineThick), (int)rec.width, lineThick, color); - DrawRectangle( (int)rec.x, (int)(rec.y + lineThick), lineThick, (int)(rec.height - lineThick*2), color); + // When rec = { x, y, 8.0f, 6.0f } and lineThick = 2, the following + // four rectangles are drawn ([T]op, [B]ottom, [L]eft, [R]ight): + // + // TTTTTTTT + // TTTTTTTT + // LL RR + // LL RR + // BBBBBBBB + // BBBBBBBB + // + + Rectangle top = { rec.x, rec.y, rec.width, lineThick }; + Rectangle bottom = { rec.x, rec.y - lineThick + rec.height, rec.width, lineThick }; + Rectangle left = { rec.x, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f }; + Rectangle right = { rec.x - lineThick + rec.width, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f }; + + DrawRectangleRec(top, color); + DrawRectangleRec(bottom, color); + DrawRectangleRec(left, color); + DrawRectangleRec(right, color); } // Draw rectangle with rounded edges @@ -789,27 +827,28 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co float stepLength = 90.0f/(float)segments; - /* Quick sketch to make sense of all of this (there are 9 parts to draw, also mark the 12 points we'll use below) - * Not my best attempt at ASCII art, just preted it's rounded rectangle :) - * P0 P1 - * ____________________ - * /| |\ - * /1| 2 |3\ - *P7 /__|____________________|__\ P2 - * | |P8 P9| | - * | 8 | 9 | 4 | - * | __|____________________|__ | - *P6 \ |P11 P10| / P3 - * \7| 6 |5/ - * \|____________________|/ - * P5 P4 - */ + /* + Quick sketch to make sense of all of this, + there are 9 parts to draw, also mark the 12 points we'll use - const Vector2 point[12] = { // coordinates of the 12 points that define the rounded rect (the idea here is to make things easier) - {(float)rec.x + radius, rec.y}, {(float)(rec.x + rec.width) - radius, rec.y}, { rec.x + rec.width, (float)rec.y + radius }, // PO, P1, P2 - {rec.x + rec.width, (float)(rec.y + rec.height) - radius}, {(float)(rec.x + rec.width) - radius, rec.y + rec.height}, // P3, P4 - {(float)rec.x + radius, rec.y + rec.height}, { rec.x, (float)(rec.y + rec.height) - radius}, {rec.x, (float)rec.y + radius}, // P5, P6, P7 - {(float)rec.x + radius, (float)rec.y + radius}, {(float)(rec.x + rec.width) - radius, (float)rec.y + radius}, // P8, P9 + P0____________________P1 + /| |\ + /1| 2 |3\ + P7 /__|____________________|__\ P2 + | |P8 P9| | + | 8 | 9 | 4 | + | __|____________________|__ | + P6 \ |P11 P10| / P3 + \7| 6 |5/ + \|____________________|/ + P5 P4 + */ + // Coordinates of the 12 points that define the rounded rect + const Vector2 point[12] = { + {(float)rec.x + radius, rec.y}, {(float)(rec.x + rec.width) - radius, rec.y}, { rec.x + rec.width, (float)rec.y + radius }, // PO, P1, P2 + {rec.x + rec.width, (float)(rec.y + rec.height) - radius}, {(float)(rec.x + rec.width) - radius, rec.y + rec.height}, // P3, P4 + {(float)rec.x + radius, rec.y + rec.height}, { rec.x, (float)(rec.y + rec.height) - radius}, {rec.x, (float)rec.y + radius}, // P5, P6, P7 + {(float)rec.x + radius, (float)rec.y + radius}, {(float)(rec.x + rec.width) - radius, (float)rec.y + radius}, // P8, P9 {(float)(rec.x + rec.width) - radius, (float)(rec.y + rec.height) - radius}, {(float)rec.x + radius, (float)(rec.y + rec.height) - radius} // P10, P11 }; @@ -817,9 +856,9 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co const float angles[4] = { 180.0f, 90.0f, 0.0f, 270.0f }; #if defined(SUPPORT_QUADS_DRAW_MODE) - if (rlCheckBufferLimit(16*segments/2 + 5*4)) rlglDraw(); + rlCheckRenderBatchLimit(16*segments/2 + 5*4); - rlEnableTexture(GetShapesTexture().id); + rlSetTexture(texShapes.id); rlBegin(RL_QUADS); // Draw all of the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner @@ -827,96 +866,99 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co { float angle = angles[k]; const Vector2 center = centers[k]; + // NOTE: Every QUAD actually represents two segments for (int i = 0; i < segments/2; i++) { rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(center.x, center.y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength*2))*radius, center.y + cosf(DEG2RAD*(angle + stepLength*2))*radius); angle += (stepLength*2); } + // NOTE: In case number of segments is odd, we add one last piece to the cake if (segments%2) { rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(center.x, center.y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(center.x, center.y); } } // [2] Upper Rectangle rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[0].x, point[0].y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[8].x, point[8].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[9].x, point[9].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[1].x, point[1].y); // [4] Right Rectangle rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[2].x, point[2].y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[9].x, point[9].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[10].x, point[10].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[3].x, point[3].y); // [6] Bottom Rectangle rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[11].x, point[11].y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[5].x, point[5].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[4].x, point[4].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[10].x, point[10].y); // [8] Left Rectangle rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[7].x, point[7].y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[6].x, point[6].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[11].x, point[11].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[8].x, point[8].y); // [9] Middle Rectangle rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[8].x, point[8].y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[11].x, point[11].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[10].x, point[10].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[9].x, point[9].y); rlEnd(); - rlDisableTexture(); + rlSetTexture(0); #else - if (rlCheckBufferLimit(12*segments + 5*6)) rlglDraw(); // 4 corners with 3 vertices per segment + 5 rectangles with 6 vertices each + rlCheckRenderBatchLimit(12*segments + 5*6); // 4 corners with 3 vertices per segment + 5 rectangles with 6 vertices each rlBegin(RL_TRIANGLES); + // Draw all of the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop { @@ -981,7 +1023,7 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co } // Draw rectangle with rounded edges outline -void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int lineThick, Color color) +void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color) { if (lineThick < 0) lineThick = 0; @@ -1008,24 +1050,24 @@ void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int } float stepLength = 90.0f/(float)segments; - const float outerRadius = radius + (float)lineThick, innerRadius = radius; + const float outerRadius = radius + lineThick, innerRadius = radius; - /* Quick sketch to make sense of all of this (mark the 16 + 4(corner centers P16-19) points we'll use below) - * Not my best attempt at ASCII art, just preted it's rounded rectangle :) - * P0 P1 - * ==================== - * // P8 P9 \\ - * // \\ - *P7 // P15 P10 \\ P2 - * || *P16 P17* || - * || || - * || P14 P11 || - *P6 \\ *P19 P18* // P3 - * \\ // - * \\ P13 P12 // - * ==================== - * P5 P4 - */ + /* + Quick sketch to make sense of all of this, + marks the 16 + 4(corner centers P16-19) points we'll use + + P0 ================== P1 + // P8 P9 \\ + // \\ + P7 // P15 P10 \\ P2 + || *P16 P17* || + || || + || P14 P11 || + P6 \\ *P19 P18* // P3 + \\ // + \\ P13 P12 // + P5 ================== P4 + */ const Vector2 point[16] = { {(float)rec.x + innerRadius, rec.y - lineThick}, {(float)(rec.x + rec.width) - innerRadius, rec.y - lineThick}, { rec.x + rec.width + lineThick, (float)rec.y + innerRadius }, // PO, P1, P2 {rec.x + rec.width + lineThick, (float)(rec.y + rec.height) - innerRadius}, {(float)(rec.x + rec.width) - innerRadius, rec.y + rec.height + lineThick}, // P3, P4 @@ -1046,11 +1088,12 @@ void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int if (lineThick > 1) { #if defined(SUPPORT_QUADS_DRAW_MODE) - if (rlCheckBufferLimit(4*4*segments + 4*4)) rlglDraw(); // 4 corners with 4 vertices for each segment + 4 rectangles with 4 vertices each + rlCheckRenderBatchLimit(4*4*segments + 4*4); // 4 corners with 4 vertices for each segment + 4 rectangles with 4 vertices each - rlEnableTexture(GetShapesTexture().id); + rlSetTexture(texShapes.id); rlBegin(RL_QUADS); + // Draw all of the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop { @@ -1059,13 +1102,13 @@ void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int for (int i = 0; i < segments; i++) { rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*outerRadius); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius); angle += stepLength; @@ -1074,52 +1117,52 @@ void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int // Upper rectangle rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[0].x, point[0].y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[8].x, point[8].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[9].x, point[9].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[1].x, point[1].y); // Right rectangle rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[2].x, point[2].y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[10].x, point[10].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[11].x, point[11].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[3].x, point[3].y); // Lower rectangle rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[13].x, point[13].y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[5].x, point[5].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[4].x, point[4].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[12].x, point[12].y); // Left rectangle rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[15].x, point[15].y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[7].x, point[7].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(point[6].x, point[6].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(point[14].x, point[14].y); rlEnd(); - rlDisableTexture(); + rlSetTexture(0); #else - if (rlCheckBufferLimit(4*6*segments + 4*6)) rlglDraw(); // 4 corners with 6(2*3) vertices for each segment + 4 rectangles with 6 vertices each + rlCheckRenderBatchLimit(4*6*segments + 4*6); // 4 corners with 6(2*3) vertices for each segment + 4 rectangles with 6 vertices each rlBegin(RL_TRIANGLES); @@ -1186,7 +1229,7 @@ void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int else { // Use LINES to draw the outline - if (rlCheckBufferLimit(8*segments + 4*2)) rlglDraw(); // 4 corners with 2 vertices for each segment + 4 rectangles with 2 vertices each + rlCheckRenderBatchLimit(8*segments + 4*2); // 4 corners with 2 vertices for each segment + 4 rectangles with 2 vertices each rlBegin(RL_LINES); @@ -1221,28 +1264,28 @@ void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int // NOTE: Vertex must be provided in counter-clockwise order void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color) { - if (rlCheckBufferLimit(4)) rlglDraw(); + rlCheckRenderBatchLimit(4); #if defined(SUPPORT_QUADS_DRAW_MODE) - rlEnableTexture(GetShapesTexture().id); + rlSetTexture(texShapes.id); rlBegin(RL_QUADS); rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(v1.x, v1.y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(v2.x, v2.y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(v2.x, v2.y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(v3.x, v3.y); rlEnd(); - rlDisableTexture(); + rlSetTexture(0); #else rlBegin(RL_TRIANGLES); rlColor4ub(color.r, color.g, color.b, color.a); @@ -1257,7 +1300,7 @@ void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color) // NOTE: Vertex must be provided in counter-clockwise order void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color) { - if (rlCheckBufferLimit(6)) rlglDraw(); + rlCheckRenderBatchLimit(6); rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); @@ -1279,28 +1322,28 @@ void DrawTriangleFan(Vector2 *points, int pointsCount, Color color) { if (pointsCount >= 3) { - if (rlCheckBufferLimit((pointsCount - 2)*4)) rlglDraw(); + rlCheckRenderBatchLimit((pointsCount - 2)*4); - rlEnableTexture(GetShapesTexture().id); + rlSetTexture(texShapes.id); rlBegin(RL_QUADS); rlColor4ub(color.r, color.g, color.b, color.a); for (int i = 1; i < pointsCount - 1; i++) { - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(points[0].x, points[0].y); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(points[i].x, points[i].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(points[i + 1].x, points[i + 1].y); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(points[i + 1].x, points[i + 1].y); } rlEnd(); - rlDisableTexture(); + rlSetTexture(0); } } @@ -1310,7 +1353,7 @@ void DrawTriangleStrip(Vector2 *points, int pointsCount, Color color) { if (pointsCount >= 3) { - if (rlCheckBufferLimit(3*(pointsCount - 2))) rlglDraw(); + rlCheckRenderBatchLimit(3*(pointsCount - 2)); rlBegin(RL_TRIANGLES); rlColor4ub(color.r, color.g, color.b, color.a); @@ -1340,35 +1383,39 @@ void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color col if (sides < 3) sides = 3; float centralAngle = 0.0f; - if (rlCheckBufferLimit(4*(360/sides))) rlglDraw(); +#if defined(SUPPORT_QUADS_DRAW_MODE) + rlCheckRenderBatchLimit(4*sides); // Each side is a quad +#else + rlCheckRenderBatchLimit(3*sides); +#endif rlPushMatrix(); rlTranslatef(center.x, center.y, 0.0f); rlRotatef(rotation, 0.0f, 0.0f, 1.0f); #if defined(SUPPORT_QUADS_DRAW_MODE) - rlEnableTexture(GetShapesTexture().id); + rlSetTexture(texShapes.id); rlBegin(RL_QUADS); for (int i = 0; i < sides; i++) { rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(0, 0); - rlTexCoord2f(GetShapesTextureRec().x/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius); - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, (GetShapesTextureRec().y + GetShapesTextureRec().height)/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius); centralAngle += 360.0f/(float)sides; - rlTexCoord2f((GetShapesTextureRec().x + GetShapesTextureRec().width)/GetShapesTexture().width, GetShapesTextureRec().y/GetShapesTexture().height); + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius); } rlEnd(); - rlDisableTexture(); + rlSetTexture(0); #else rlBegin(RL_TRIANGLES); for (int i = 0; i < sides; i++) @@ -1392,7 +1439,7 @@ void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Colo if (sides < 3) sides = 3; float centralAngle = 0.0f; - if (rlCheckBufferLimit(3*(360/sides))) rlglDraw(); + rlCheckRenderBatchLimit(2*sides); rlPushMatrix(); rlTranslatef(center.x, center.y, 0.0f); @@ -1411,6 +1458,68 @@ void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Colo rlPopMatrix(); } +void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color) +{ + if (sides < 3) sides = 3; + float centralAngle = 0.0f; + float exteriorAngle = 360.0f/(float)sides; + float innerRadius = radius - (lineThick*cosf(DEG2RAD*exteriorAngle/2.0f)); + +#if defined(SUPPORT_QUADS_DRAW_MODE) + rlCheckRenderBatchLimit(4*sides); +#else + rlCheckRenderBatchLimit(6*sides); +#endif + + rlPushMatrix(); + rlTranslatef(center.x, center.y, 0.0f); + rlRotatef(rotation, 0.0f, 0.0f, 1.0f); + +#if defined(SUPPORT_QUADS_DRAW_MODE) + rlSetTexture(texShapes.id); + + rlBegin(RL_QUADS); + for (int i = 0; i < sides; i++) + { + rlColor4ub(color.r, color.g, color.b, color.a); + + rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); + rlVertex2f(sinf(DEG2RAD*centralAngle)*innerRadius, cosf(DEG2RAD*centralAngle)*innerRadius); + + rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); + rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius); + + centralAngle += exteriorAngle; + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); + rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius); + + rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); + rlVertex2f(sinf(DEG2RAD*centralAngle)*innerRadius, cosf(DEG2RAD*centralAngle)*innerRadius); + } + rlEnd(); + rlSetTexture(0); +#else + rlBegin(RL_TRIANGLES); + for (int i = 0; i < sides; i++) + { + rlColor4ub(color.r, color.g, color.b, color.a); + float nextAngle = centralAngle + exteriorAngle; + + rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius); + rlVertex2f(sinf(DEG2RAD*centralAngle)*innerRadius, cosf(DEG2RAD*centralAngle)*innerRadius); + rlVertex2f(sinf(DEG2RAD*nextAngle)*radius, cosf(DEG2RAD*nextAngle)*radius); + + rlVertex2f(sinf(DEG2RAD*centralAngle)*innerRadius, cosf(DEG2RAD*centralAngle)*innerRadius); + rlVertex2f(sinf(DEG2RAD*nextAngle)*radius, cosf(DEG2RAD*nextAngle)*radius); + rlVertex2f(sinf(DEG2RAD*nextAngle)*innerRadius, cosf(DEG2RAD*nextAngle)*innerRadius); + + centralAngle = nextAngle; + } + rlEnd(); +#endif + rlPopMatrix(); +} + //---------------------------------------------------------------------------------- // Module Functions Definition - Collision Detection functions //---------------------------------------------------------------------------------- @@ -1444,7 +1553,7 @@ bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 float gamma = 1.0f - alpha - beta; - if ((alpha > 0) && (beta > 0) & (gamma > 0)) collision = true; + if ((alpha > 0) && (beta > 0) && (gamma > 0)) collision = true; return collision; } @@ -1504,7 +1613,7 @@ bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, if (div == 0.0f) return false; // WARNING: This check could not work due to float precision rounding issues... - const float xi = ((startPos2.x - startPos2.x)*(startPos1.x*endPos1.y - startPos1.y*endPos1.x) - (startPos1.x - endPos1.x)*(startPos2.x*endPos2.y - startPos2.y*endPos2.x))/div; + const float xi = ((startPos2.x - endPos2.x)*(startPos1.x*endPos1.y - startPos1.y*endPos1.x) - (startPos1.x - endPos1.x)*(startPos2.x*endPos2.y - startPos2.y*endPos2.x))/div; const float yi = ((startPos2.y - endPos2.y)*(startPos1.x*endPos1.y - startPos1.y*endPos1.x) - (startPos1.y - endPos1.y)*(startPos2.x*endPos2.y - startPos2.y*endPos2.x))/div; if (xi < fminf(startPos1.x, endPos1.x) || xi > fmaxf(startPos1.x, endPos1.x)) return false; @@ -1521,6 +1630,25 @@ bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, return true; } +// Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] +bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold) +{ + bool collision = false; + float dxc = point.x - p1.x; + float dyc = point.y - p1.y; + float dxl = p2.x - p1.x; + float dyl = p2.y - p1.y; + float cross = dxc*dyl - dyc*dxl; + + if (fabsf(cross) < (threshold*fmaxf(fabsf(dxl), fabsf(dyl)))) + { + if (fabsf(dxl) >= fabsf(dyl)) collision = (dxl > 0)? ((p1.x <= point.x) && (point.x <= p2.x)) : ((p2.x <= point.x) && (point.x <= p1.x)); + else collision = (dyl > 0)? ((p1.y <= point.y) && (point.y <= p2.y)) : ((p2.y <= point.y) && (point.y <= p1.y)); + } + + return collision; +} + // Get collision rectangle for two rectangles collision Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) { diff --git a/src/shell.html b/src/shell.html index 507b35acf..aa0210c32 100644 --- a/src/shell.html +++ b/src/shell.html @@ -76,7 +76,7 @@ jwE50AGjLCVuS8Yt4H7OgZLKK5EKOsLviEWJSL/+0uMi7gLUSBseYwqEbXvSHCec1CJvZPyHCmYQffaB canvas.emscripten { border: 0px none; background: black; - width: 100% + width: 100%; } .spinner { diff --git a/src/text.c b/src/text.c index 5c10dd439..9a42796e4 100644 --- a/src/text.c +++ b/src/text.c @@ -196,7 +196,7 @@ extern void LoadFontDefault(void) .data = calloc(128*128, 2), // 2 bytes per pixel (gray + alpha) .width = 128, .height = 128, - .format = UNCOMPRESSED_GRAY_ALPHA, + .format = PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, .mipmaps = 1 }; @@ -328,7 +328,7 @@ Font LoadFont(const char *fileName) TRACELOG(LOG_WARNING, "FONT: [%s] Failed to load font texture -> Using default font", fileName); font = GetFontDefault(); } - else SetTextureFilter(font.texture, FILTER_POINT); // By default we set point filter (best performance) + else SetTextureFilter(font.texture, TEXTURE_FILTER_POINT); // By default we set point filter (best performance) return font; } @@ -432,7 +432,7 @@ Font LoadFontFromImage(Image image, Color key, int firstChar) } // NOTE: We need to remove key color borders from image to avoid weird - // artifacts on texture scaling when using FILTER_BILINEAR or FILTER_TRILINEAR + // artifacts on texture scaling when using TEXTURE_FILTER_BILINEAR or TEXTURE_FILTER_TRILINEAR for (int i = 0; i < image.height*image.width; i++) if (COLOR_EQUAL(pixels[i], key)) pixels[i] = BLANK; // Create a new image with the processed color data (key color replaced by BLANK) @@ -440,7 +440,7 @@ Font LoadFontFromImage(Image image, Color key, int firstChar) .data = pixels, .width = image.width, .height = image.height, - .format = UNCOMPRESSED_R8G8B8A8, + .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, .mipmaps = 1 }; @@ -479,7 +479,7 @@ Font LoadFontFromImage(Image image, Color key, int firstChar) return font; } -// Load font from memory buffer, fileType refers to extension: i.e. "ttf" +// Load font from memory buffer, fileType refers to extension: i.e. ".ttf" Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount) { Font font = { 0 }; @@ -488,8 +488,8 @@ Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int strcpy(fileExtLower, TextToLower(fileType)); #if defined(SUPPORT_FILEFORMAT_TTF) - if (TextIsEqual(fileExtLower, "ttf") || - TextIsEqual(fileExtLower, "otf")) + if (TextIsEqual(fileExtLower, ".ttf") || + TextIsEqual(fileExtLower, ".otf")) { font.baseSize = fontSize; font.charsCount = (charsCount > 0)? charsCount : 95; @@ -598,7 +598,7 @@ CharInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize chars[i].image.width = chw; chars[i].image.height = chh; chars[i].image.mipmaps = 1; - chars[i].image.format = UNCOMPRESSED_GRAYSCALE; + chars[i].image.format = PIXELFORMAT_UNCOMPRESSED_GRAYSCALE; chars[i].offsetY += (int)((float)ascent*scaleFactor); @@ -609,7 +609,7 @@ CharInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize .data = calloc(chars[i].advanceX*fontSize, 2), .width = chars[i].advanceX, .height = fontSize, - .format = UNCOMPRESSED_GRAYSCALE, + .format = PIXELFORMAT_UNCOMPRESSED_GRAYSCALE, .mipmaps = 1 }; @@ -679,7 +679,7 @@ Image GenImageFontAtlas(const CharInfo *chars, Rectangle **charRecs, int charsCo atlas.width = imageSize; // Atlas bitmap width atlas.height = imageSize; // Atlas bitmap height atlas.data = (unsigned char *)RL_CALLOC(1, atlas.width*atlas.height); // Create a bitmap to store characters (8 bpp) - atlas.format = UNCOMPRESSED_GRAYSCALE; + atlas.format = PIXELFORMAT_UNCOMPRESSED_GRAYSCALE; atlas.mipmaps = 1; // DEBUG: We can see padding in the generated image setting a gray background... @@ -783,7 +783,7 @@ Image GenImageFontAtlas(const CharInfo *chars, Rectangle **charRecs, int charsCo RL_FREE(atlas.data); atlas.data = dataGrayAlpha; - atlas.format = UNCOMPRESSED_GRAY_ALPHA; + atlas.format = PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA; *charRecs = recs; @@ -813,11 +813,17 @@ void UnloadFont(Font font) } } -// Shows current FPS on top-left corner +// Draw current FPS // NOTE: Uses default font void DrawFPS(int posX, int posY) { - DrawText(TextFormat("%2i FPS", GetFPS()), posX, posY, 20, LIME); + Color color = LIME; // good fps + int fps = GetFPS(); + + if (fps < 30 && fps >= 15) color = ORANGE; // warning FPS + else if (fps < 15) color = RED; // bad FPS + + DrawText(TextFormat("%2i FPS", GetFPS()), posX, posY, 20, color); } // Draw text (using default font) @@ -842,12 +848,14 @@ void DrawText(const char *text, int posX, int posY, int fontSize, Color color) // NOTE: chars spacing is NOT proportional to fontSize void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint) { - int length = TextLength(text); // Total length in bytes of the text, scanned by codepoints in loop + if (font.texture.id == 0) font = GetFontDefault(); // Security check in case of not valid font + + int length = TextLength(text); // Total length in bytes of the text, scanned by codepoints in loop int textOffsetY = 0; // Offset between lines (on line break '\n') float textOffsetX = 0.0f; // Offset X to next character to draw - float scaleFactor = fontSize/font.baseSize; // Character quad scaling factor + float scaleFactor = fontSize/font.baseSize; // Character quad scaling factor for (int i = 0; i < length;) { @@ -1115,7 +1123,7 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing return vec; } -// Returns index position for a unicode character on spritefont +// Get index position for a unicode character on spritefont int GetGlyphIndex(Font font, int codepoint) { #ifndef GLYPH_NOTFOUND_CHAR_FALLBACK @@ -1168,14 +1176,14 @@ const char *TextFormat(const char *text, ...) // We create an array of buffers so strings don't expire until MAX_TEXTFORMAT_BUFFERS invocations static char buffers[MAX_TEXTFORMAT_BUFFERS][MAX_TEXT_BUFFER_LENGTH] = { 0 }; - static int index = 0; + static int index = 0; char *currentBuffer = buffers[index]; memset(currentBuffer, 0, MAX_TEXT_BUFFER_LENGTH); // Clear buffer before using va_list args; va_start(args, text); - vsprintf(currentBuffer, text, args); + vsnprintf(currentBuffer, MAX_TEXT_BUFFER_LENGTH, text, args); va_end(args); index += 1; // Move to next buffer for next function call @@ -1264,7 +1272,7 @@ const char *TextSubtext(const char *text, int position, int length) // Replace text string // REQUIRES: strstr(), strncpy(), strcpy() -// WARNING: Internally allocated memory must be freed by the user (if return != NULL) +// WARNING: Returned buffer must be freed by the user (if return != NULL) char *TextReplace(char *text, const char *replace, const char *by) { // Sanity checks and initialization @@ -1289,14 +1297,14 @@ char *TextReplace(char *text, const char *replace, const char *by) for (count = 0; (temp = strstr(insertPoint, replace)); count++) insertPoint = temp + replaceLen; // Allocate returning string and point temp to it - temp = result = RL_MALLOC(TextLength(text) + (byLen - replaceLen)*count + 1); + temp = result = (char *)RL_MALLOC(TextLength(text) + (byLen - replaceLen)*count + 1); if (!result) return NULL; // Memory could not be allocated // First time through the loop, all the variable are set correctly from here on, - // temp points to the end of the result string - // insertPoint points to the next occurrence of replace in text - // text points to the remainder of text after "end of replace" + // - 'temp' points to the end of the result string + // - 'insertPoint' points to the next occurrence of replace in text + // - 'text' points to the remainder of text after "end of replace" while (count--) { insertPoint = strstr(text, replace); @@ -1317,7 +1325,7 @@ char *TextReplace(char *text, const char *replace, const char *by) char *TextInsert(const char *text, const char *insert, int position) { int textLen = TextLength(text); - int insertLen = TextLength(insert); + int insertLen = TextLength(insert); char *result = (char *)RL_MALLOC(textLen + insertLen + 1); @@ -1365,6 +1373,7 @@ const char *TextJoin(const char **textList, int count, const char *delimiter) } // Split string into multiple strings +// REQUIRES: memset() const char **TextSplit(const char *text, char delimiter, int *count) { // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter) @@ -1426,6 +1435,7 @@ int TextFindIndex(const char *text, const char *find) } // Get upper case version of provided string +// REQUIRES: toupper() const char *TextToUpper(const char *text) { static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; @@ -1447,6 +1457,7 @@ const char *TextToUpper(const char *text) } // Get lower case version of provided string +// REQUIRES: tolower() const char *TextToLower(const char *text) { static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; @@ -1465,6 +1476,7 @@ const char *TextToLower(const char *text) } // Get Pascal case notation version of provided string +// REQUIRES: toupper() const char *TextToPascal(const char *text) { static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; @@ -1488,7 +1500,9 @@ const char *TextToPascal(const char *text) return buffer; } -// Encode text codepoint into utf8 text (memory must be freed!) +// Encode text codepoint into utf8 text +// REQUIRES: memcpy() +// WARNING: Allocated memory should be manually freed char *TextToUtf8(int *codepoints, int length) { // We allocate enough memory fo fit all possible codepoints @@ -1551,6 +1565,7 @@ RLAPI const char *CodepointToUtf8(int codepoint, int *byteLength) } // Get all codepoints in a string, codepoints count returned by parameters +// REQUIRES: memset() int *GetCodepoints(const char *text, int *count) { static int codepoints[MAX_TEXT_UNICODE_CHARS] = { 0 }; @@ -1571,7 +1586,7 @@ int *GetCodepoints(const char *text, int *count) return codepoints; } -// Returns total number of characters(codepoints) in a UTF8 encoded text, until '\0' is found +// Get total number of characters(codepoints) in a UTF8 encoded text, until '\0' is found // NOTE: If an invalid UTF8 sequence is encountered a '?'(0x3f) codepoint is counted instead int GetCodepointsCount(const char *text) { @@ -1593,12 +1608,12 @@ int GetCodepointsCount(const char *text) } #endif // SUPPORT_TEXT_MANIPULATION -// Returns next codepoint in a UTF8 encoded text, scanning until '\0' is found +// Get next codepoint in a UTF8 encoded text, scanning until '\0' is found // When a invalid UTF8 byte is encountered we exit as soon as possible and a '?'(0x3f) codepoint is returned // Total number of bytes processed are returned as a parameter // NOTE: the standard says U+FFFD should be returned in case of errors // but that character is not supported by the default font in raylib -// TODO: optimize this code for speed!! +// TODO: Optimize this code for speed!! int GetNextCodepoint(const char *text, int *bytesProcessed) { /* @@ -1711,6 +1726,7 @@ int GetNextCodepoint(const char *text, int *bytesProcessed) #if defined(SUPPORT_FILEFORMAT_FNT) // Read a line from memory +// REQUIRES: memcpy() // NOTE: Returns the number of bytes read static int GetLine(const char *origin, char *buffer, int maxLength) { @@ -1794,14 +1810,14 @@ static Font LoadBMFont(const char *fileName) Image imFont = LoadImage(imPath); - if (imFont.format == UNCOMPRESSED_GRAYSCALE) + if (imFont.format == PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) { // Convert image to GRAYSCALE + ALPHA, using the mask as the alpha channel Image imFontAlpha = { .data = calloc(imFont.width*imFont.height, 2), .width = imFont.width, .height = imFont.height, - .format = UNCOMPRESSED_GRAY_ALPHA, + .format = PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, .mipmaps = 1 }; @@ -1849,7 +1865,7 @@ static Font LoadBMFont(const char *fileName) } UnloadImage(imFont); - RL_FREE(fileText); + UnloadFileText(fileText); if (font.texture.id == 0) { diff --git a/src/textures.c b/src/textures.c index 32d995244..af0985969 100644 --- a/src/textures.c +++ b/src/textures.c @@ -65,9 +65,9 @@ #endif #include // Required for: malloc(), free() -#include // Required for: FILE, fopen(), fclose(), fread() #include // Required for: strlen() [Used in ImageTextEx()] #include // Required for: fabsf() +#include // Required for: sprintf() [Used in ExportImageAsCode()] #include "utils.h" // Required for: fopen() Android mapping @@ -123,7 +123,7 @@ // NOTE: Used to read image data (multiple formats support) #endif -#if (defined(SUPPORT_IMAGE_EXPORT) || defined(SUPPORT_COMPRESSION_API)) +#if defined(SUPPORT_IMAGE_EXPORT) #define STBIW_MALLOC RL_MALLOC #define STBIW_FREE RL_FREE #define STBIW_REALLOC RL_REALLOC @@ -148,8 +148,8 @@ //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#ifndef UNCOMPRESSED_R5G5B5A1_ALPHA_THRESHOLD - #define UNCOMPRESSED_R5G5B5A1_ALPHA_THRESHOLD 50 // Threshold over 255 to set alpha as 0 +#ifndef PIXELFORMAT_UNCOMPRESSED_R5G5B5A1_ALPHA_THRESHOLD + #define PIXELFORMAT_UNCOMPRESSED_R5G5B5A1_ALPHA_THRESHOLD 50 // Threshold over 255 to set alpha as 0 #endif //---------------------------------------------------------------------------------- @@ -277,7 +277,7 @@ Image LoadImageAnim(const char *fileName, int *frames) image.data = stbi_load_gif_from_memory(fileData, dataSize, delays, &image.width, &image.height, &framesCount, &comp, 4); image.mipmaps = 1; - image.format = UNCOMPRESSED_R8G8B8A8; + image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; RL_FREE(fileData); RL_FREE(delays); // NOTE: Frames delays are discarded @@ -294,7 +294,7 @@ Image LoadImageAnim(const char *fileName, int *frames) return image; } -// Load image from memory buffer, fileType refers to extension: i.e. "png" +// Load image from memory buffer, fileType refers to extension: i.e. ".png" Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize) { Image image = { 0 }; @@ -303,28 +303,28 @@ Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, i strcpy(fileExtLower, TextToLower(fileType)); #if defined(SUPPORT_FILEFORMAT_PNG) - if ((TextIsEqual(fileExtLower, "png")) + if ((TextIsEqual(fileExtLower, ".png")) #else if ((false) #endif #if defined(SUPPORT_FILEFORMAT_BMP) - || (TextIsEqual(fileExtLower, "bmp")) + || (TextIsEqual(fileExtLower, ".bmp")) #endif #if defined(SUPPORT_FILEFORMAT_TGA) - || (TextIsEqual(fileExtLower, "tga")) + || (TextIsEqual(fileExtLower, ".tga")) #endif #if defined(SUPPORT_FILEFORMAT_JPG) - || (TextIsEqual(fileExtLower, "jpg") || - TextIsEqual(fileExtLower, "jpeg")) + || (TextIsEqual(fileExtLower, ".jpg") || + TextIsEqual(fileExtLower, ".jpeg")) #endif #if defined(SUPPORT_FILEFORMAT_GIF) - || (TextIsEqual(fileExtLower, "gif")) + || (TextIsEqual(fileExtLower, ".gif")) #endif #if defined(SUPPORT_FILEFORMAT_PIC) - || (TextIsEqual(fileExtLower, "pic")) + || (TextIsEqual(fileExtLower, ".pic")) #endif #if defined(SUPPORT_FILEFORMAT_PSD) - || (TextIsEqual(fileExtLower, "psd")) + || (TextIsEqual(fileExtLower, ".psd")) #endif ) { @@ -338,15 +338,15 @@ Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, i image.mipmaps = 1; - if (comp == 1) image.format = UNCOMPRESSED_GRAYSCALE; - else if (comp == 2) image.format = UNCOMPRESSED_GRAY_ALPHA; - else if (comp == 3) image.format = UNCOMPRESSED_R8G8B8; - else if (comp == 4) image.format = UNCOMPRESSED_R8G8B8A8; + if (comp == 1) image.format = PIXELFORMAT_UNCOMPRESSED_GRAYSCALE; + else if (comp == 2) image.format = PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA; + else if (comp == 3) image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8; + else if (comp == 4) image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; } #endif } #if defined(SUPPORT_FILEFORMAT_HDR) - else if (TextIsEqual(fileExtLower, "hdr")) + else if (TextIsEqual(fileExtLower, ".hdr")) { #if defined(STBI_REQUIRED) if (fileData != NULL) @@ -356,9 +356,9 @@ Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, i image.mipmaps = 1; - if (comp == 1) image.format = UNCOMPRESSED_R32; - else if (comp == 3) image.format = UNCOMPRESSED_R32G32B32; - else if (comp == 4) image.format = UNCOMPRESSED_R32G32B32A32; + if (comp == 1) image.format = PIXELFORMAT_UNCOMPRESSED_R32; + else if (comp == 3) image.format = PIXELFORMAT_UNCOMPRESSED_R32G32B32; + else if (comp == 4) image.format = PIXELFORMAT_UNCOMPRESSED_R32G32B32A32; else { TRACELOG(LOG_WARNING, "IMAGE: HDR file format not supported"); @@ -369,19 +369,19 @@ Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, i } #endif #if defined(SUPPORT_FILEFORMAT_DDS) - else if (TextIsEqual(fileExtLower, "dds")) image = LoadDDS(fileData, dataSize); + else if (TextIsEqual(fileExtLower, ".dds")) image = LoadDDS(fileData, dataSize); #endif #if defined(SUPPORT_FILEFORMAT_PKM) - else if (TextIsEqual(fileExtLower, "pkm")) image = LoadPKM(fileData, dataSize); + else if (TextIsEqual(fileExtLower, ".pkm")) image = LoadPKM(fileData, dataSize); #endif #if defined(SUPPORT_FILEFORMAT_KTX) - else if (TextIsEqual(fileExtLower, "ktx")) image = LoadKTX(fileData, dataSize); + else if (TextIsEqual(fileExtLower, ".ktx")) image = LoadKTX(fileData, dataSize); #endif #if defined(SUPPORT_FILEFORMAT_PVR) - else if (TextIsEqual(fileExtLower, "pvr")) image = LoadPVR(fileData, dataSize); + else if (TextIsEqual(fileExtLower, ".pvr")) image = LoadPVR(fileData, dataSize); #endif #if defined(SUPPORT_FILEFORMAT_ASTC) - else if (TextIsEqual(fileExtLower, "astc")) image = LoadASTC(fileData, dataSize); + else if (TextIsEqual(fileExtLower, ".astc")) image = LoadASTC(fileData, dataSize); #endif else TRACELOG(LOG_WARNING, "IMAGE: File format not supported"); @@ -405,10 +405,10 @@ bool ExportImage(Image image, const char *fileName) bool allocatedData = false; unsigned char *imgData = (unsigned char *)image.data; - if (image.format == UNCOMPRESSED_GRAYSCALE) channels = 1; - else if (image.format == UNCOMPRESSED_GRAY_ALPHA) channels = 2; - else if (image.format == UNCOMPRESSED_R8G8B8) channels = 3; - else if (image.format == UNCOMPRESSED_R8G8B8A8) channels = 4; + if (image.format == PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) channels = 1; + else if (image.format == PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA) channels = 2; + else if (image.format == PIXELFORMAT_UNCOMPRESSED_R8G8B8) channels = 3; + else if (image.format == PIXELFORMAT_UNCOMPRESSED_R8G8B8A8) channels = 4; else { // NOTE: Getting Color array as RGBA unsigned char values @@ -417,9 +417,15 @@ bool ExportImage(Image image, const char *fileName) } #if defined(SUPPORT_FILEFORMAT_PNG) - if (IsFileExtension(fileName, ".png")) success = stbi_write_png(fileName, image.width, image.height, channels, imgData, image.width*channels); + if (IsFileExtension(fileName, ".png")) + { + int dataSize = 0; + unsigned char *fileData = stbi_write_png_to_mem((const unsigned char *)imgData, image.width*channels, image.width, image.height, channels, &dataSize); + success = SaveFileData(fileName, fileData, dataSize); + RL_FREE(fileData); + } #else - if (false) {} + if (false) { } #endif #if defined(SUPPORT_FILEFORMAT_BMP) else if (IsFileExtension(fileName, ".bmp")) success = stbi_write_bmp(fileName, image.width, image.height, channels, imgData); @@ -454,6 +460,8 @@ bool ExportImageAsCode(Image image, const char *fileName) { bool success = false; +#if defined(SUPPORT_IMAGE_EXPORT) + #ifndef TEXT_BYTES_PER_LINE #define TEXT_BYTES_PER_LINE 20 #endif @@ -495,6 +503,11 @@ bool ExportImageAsCode(Image image, const char *fileName) success = SaveFileText(fileName, txtData); RL_FREE(txtData); + +#endif // SUPPORT_IMAGE_EXPORT + + if (success != 0) TRACELOG(LOG_INFO, "FILEIO: [%s] Image exported successfully", fileName); + else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to export image", fileName); return success; } @@ -513,7 +526,7 @@ Image GenImageColor(int width, int height, Color color) .data = pixels, .width = width, .height = height, - .format = UNCOMPRESSED_R8G8B8A8, + .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, .mipmaps = 1 }; @@ -542,7 +555,7 @@ Image GenImageGradientV(int width, int height, Color top, Color bottom) .data = pixels, .width = width, .height = height, - .format = UNCOMPRESSED_R8G8B8A8, + .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, .mipmaps = 1 }; @@ -570,7 +583,7 @@ Image GenImageGradientH(int width, int height, Color left, Color right) .data = pixels, .width = width, .height = height, - .format = UNCOMPRESSED_R8G8B8A8, + .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, .mipmaps = 1 }; @@ -607,7 +620,7 @@ Image GenImageGradientRadial(int width, int height, float density, Color inner, .data = pixels, .width = width, .height = height, - .format = UNCOMPRESSED_R8G8B8A8, + .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, .mipmaps = 1 }; @@ -632,7 +645,7 @@ Image GenImageChecked(int width, int height, int checksX, int checksY, Color col .data = pixels, .width = width, .height = height, - .format = UNCOMPRESSED_R8G8B8A8, + .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, .mipmaps = 1 }; @@ -654,7 +667,7 @@ Image GenImageWhiteNoise(int width, int height, float factor) .data = pixels, .width = width, .height = height, - .format = UNCOMPRESSED_R8G8B8A8, + .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, .mipmaps = 1 }; @@ -690,7 +703,7 @@ Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float .data = pixels, .width = width, .height = height, - .format = UNCOMPRESSED_R8G8B8A8, + .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, .mipmaps = 1 }; @@ -704,7 +717,7 @@ Image GenImageCellular(int width, int height, int tileSize) int seedsPerRow = width/tileSize; int seedsPerCol = height/tileSize; - int seedsCount = seedsPerRow * seedsPerCol; + int seedsCount = seedsPerRow*seedsPerCol; Vector2 *seeds = (Vector2 *)RL_MALLOC(seedsCount*sizeof(Vector2)); @@ -755,7 +768,7 @@ Image GenImageCellular(int width, int height, int tileSize) .data = pixels, .width = width, .height = height, - .format = UNCOMPRESSED_R8G8B8A8, + .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, .mipmaps = 1 }; @@ -845,7 +858,7 @@ void ImageCrop(Image *image, Rectangle crop) } if (image->mipmaps > 1) TRACELOG(LOG_WARNING, "Image manipulation only applied to base mipmap level"); - if (image->format >= COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); + if (image->format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); else { int bytesPerPixel = GetPixelDataSize(1, 1, image->format); @@ -886,7 +899,7 @@ void ImageFormat(Image *image, int newFormat) if ((newFormat != 0) && (image->format != newFormat)) { - if ((image->format < COMPRESSED_DXT1_RGB) && (newFormat < COMPRESSED_DXT1_RGB)) + if ((image->format < PIXELFORMAT_COMPRESSED_DXT1_RGB) && (newFormat < PIXELFORMAT_COMPRESSED_DXT1_RGB)) { Vector4 *pixels = LoadImageDataNormalized(*image); // Supports 8 to 32 bit per channel @@ -898,7 +911,7 @@ void ImageFormat(Image *image, int newFormat) switch (image->format) { - case UNCOMPRESSED_GRAYSCALE: + case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: { image->data = (unsigned char *)RL_MALLOC(image->width*image->height*sizeof(unsigned char)); @@ -908,7 +921,7 @@ void ImageFormat(Image *image, int newFormat) } } break; - case UNCOMPRESSED_GRAY_ALPHA: + case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: { image->data = (unsigned char *)RL_MALLOC(image->width*image->height*2*sizeof(unsigned char)); @@ -919,7 +932,7 @@ void ImageFormat(Image *image, int newFormat) } } break; - case UNCOMPRESSED_R5G6B5: + case PIXELFORMAT_UNCOMPRESSED_R5G6B5: { image->data = (unsigned short *)RL_MALLOC(image->width*image->height*sizeof(unsigned short)); @@ -937,7 +950,7 @@ void ImageFormat(Image *image, int newFormat) } } break; - case UNCOMPRESSED_R8G8B8: + case PIXELFORMAT_UNCOMPRESSED_R8G8B8: { image->data = (unsigned char *)RL_MALLOC(image->width*image->height*3*sizeof(unsigned char)); @@ -948,7 +961,7 @@ void ImageFormat(Image *image, int newFormat) ((unsigned char *)image->data)[i + 2] = (unsigned char)(pixels[k].z*255.0f); } } break; - case UNCOMPRESSED_R5G5B5A1: + case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: { image->data = (unsigned short *)RL_MALLOC(image->width*image->height*sizeof(unsigned short)); @@ -962,13 +975,13 @@ void ImageFormat(Image *image, int newFormat) r = (unsigned char)(round(pixels[i].x*31.0f)); g = (unsigned char)(round(pixels[i].y*31.0f)); b = (unsigned char)(round(pixels[i].z*31.0f)); - a = (pixels[i].w > ((float)UNCOMPRESSED_R5G5B5A1_ALPHA_THRESHOLD/255.0f))? 1 : 0; + a = (pixels[i].w > ((float)PIXELFORMAT_UNCOMPRESSED_R5G5B5A1_ALPHA_THRESHOLD/255.0f))? 1 : 0; ((unsigned short *)image->data)[i] = (unsigned short)r << 11 | (unsigned short)g << 6 | (unsigned short)b << 1 | (unsigned short)a; } } break; - case UNCOMPRESSED_R4G4B4A4: + case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: { image->data = (unsigned short *)RL_MALLOC(image->width*image->height*sizeof(unsigned short)); @@ -988,7 +1001,7 @@ void ImageFormat(Image *image, int newFormat) } } break; - case UNCOMPRESSED_R8G8B8A8: + case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: { image->data = (unsigned char *)RL_MALLOC(image->width*image->height*4*sizeof(unsigned char)); @@ -1000,7 +1013,7 @@ void ImageFormat(Image *image, int newFormat) ((unsigned char *)image->data)[i + 3] = (unsigned char)(pixels[k].w*255.0f); } } break; - case UNCOMPRESSED_R32: + case PIXELFORMAT_UNCOMPRESSED_R32: { // WARNING: Image is converted to GRAYSCALE eqeuivalent 32bit @@ -1011,7 +1024,7 @@ void ImageFormat(Image *image, int newFormat) ((float *)image->data)[i] = (float)(pixels[i].x*0.299f + pixels[i].y*0.587f + pixels[i].z*0.114f); } } break; - case UNCOMPRESSED_R32G32B32: + case PIXELFORMAT_UNCOMPRESSED_R32G32B32: { image->data = (float *)RL_MALLOC(image->width*image->height*3*sizeof(float)); @@ -1022,7 +1035,7 @@ void ImageFormat(Image *image, int newFormat) ((float *)image->data)[i + 2] = pixels[k].z; } } break; - case UNCOMPRESSED_R32G32B32A32: + case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: { image->data = (float *)RL_MALLOC(image->width*image->height*4*sizeof(float)); @@ -1165,12 +1178,12 @@ void ImageAlphaClear(Image *image, Color color, float threshold) if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; if (image->mipmaps > 1) TRACELOG(LOG_WARNING, "Image manipulation only applied to base mipmap level"); - if (image->format >= COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); + if (image->format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); else { switch (image->format) { - case UNCOMPRESSED_GRAY_ALPHA: + case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: { unsigned char thresholdValue = (unsigned char)(threshold*255.0f); for (int i = 1; i < image->width*image->height*2; i += 2) @@ -1182,7 +1195,7 @@ void ImageAlphaClear(Image *image, Color color, float threshold) } } } break; - case UNCOMPRESSED_R5G5B5A1: + case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: { unsigned char thresholdValue = ((threshold < 0.5f)? 0 : 1); @@ -1199,7 +1212,7 @@ void ImageAlphaClear(Image *image, Color color, float threshold) } } } break; - case UNCOMPRESSED_R4G4B4A4: + case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: { unsigned char thresholdValue = (unsigned char)(threshold*15.0f); @@ -1216,7 +1229,7 @@ void ImageAlphaClear(Image *image, Color color, float threshold) } } } break; - case UNCOMPRESSED_R8G8B8A8: + case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: { unsigned char thresholdValue = (unsigned char)(threshold*255.0f); for (int i = 3; i < image->width*image->height*4; i += 4) @@ -1230,7 +1243,7 @@ void ImageAlphaClear(Image *image, Color color, float threshold) } } } break; - case UNCOMPRESSED_R32G32B32A32: + case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: { for (int i = 3; i < image->width*image->height*4; i += 4) { @@ -1257,7 +1270,7 @@ void ImageAlphaMask(Image *image, Image alphaMask) { TRACELOG(LOG_WARNING, "IMAGE: Alpha mask must be same size as image"); } - else if (image->format >= COMPRESSED_DXT1_RGB) + else if (image->format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) { TRACELOG(LOG_WARNING, "IMAGE: Alpha mask can not be applied to compressed data formats"); } @@ -1265,10 +1278,10 @@ void ImageAlphaMask(Image *image, Image alphaMask) { // Force mask to be Grayscale Image mask = ImageCopy(alphaMask); - if (mask.format != UNCOMPRESSED_GRAYSCALE) ImageFormat(&mask, UNCOMPRESSED_GRAYSCALE); + if (mask.format != PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) ImageFormat(&mask, PIXELFORMAT_UNCOMPRESSED_GRAYSCALE); // In case image is only grayscale, we just add alpha channel - if (image->format == UNCOMPRESSED_GRAYSCALE) + if (image->format == PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) { unsigned char *data = (unsigned char *)RL_MALLOC(image->width*image->height*2); @@ -1281,12 +1294,12 @@ void ImageAlphaMask(Image *image, Image alphaMask) RL_FREE(image->data); image->data = data; - image->format = UNCOMPRESSED_GRAY_ALPHA; + image->format = PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA; } else { // Convert image to RGBA - if (image->format != UNCOMPRESSED_R8G8B8A8) ImageFormat(image, UNCOMPRESSED_R8G8B8A8); + if (image->format != PIXELFORMAT_UNCOMPRESSED_R8G8B8A8) ImageFormat(image, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8); // Apply alpha mask to alpha channel for (int i = 0, k = 3; (i < mask.width*mask.height) || (i < image->width*image->height); i++, k += 4) @@ -1329,7 +1342,7 @@ void ImageAlphaPremultiply(Image *image) int format = image->format; image->data = pixels; - image->format = UNCOMPRESSED_R8G8B8A8; + image->format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; ImageFormat(image, format); } @@ -1344,19 +1357,19 @@ void ImageResize(Image *image, int newWidth, int newHeight) if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; bool fastPath = true; - if ((image->format != UNCOMPRESSED_GRAYSCALE) && (image->format != UNCOMPRESSED_GRAY_ALPHA) && (image->format != UNCOMPRESSED_R8G8B8) && (image->format != UNCOMPRESSED_R8G8B8A8)) fastPath = true; + if ((image->format != PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) && (image->format != PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA) && (image->format != PIXELFORMAT_UNCOMPRESSED_R8G8B8) && (image->format != PIXELFORMAT_UNCOMPRESSED_R8G8B8A8)) fastPath = true; if (fastPath) { int bytesPerPixel = GetPixelDataSize(1, 1, image->format); - unsigned char *output = RL_MALLOC(newWidth*newHeight*bytesPerPixel); + unsigned char *output = (unsigned char *)RL_MALLOC(newWidth*newHeight*bytesPerPixel); switch (image->format) { - case UNCOMPRESSED_GRAYSCALE: stbir_resize_uint8((unsigned char *)image->data, image->width, image->height, 0, output, newWidth, newHeight, 0, 1); break; - case UNCOMPRESSED_GRAY_ALPHA: stbir_resize_uint8((unsigned char *)image->data, image->width, image->height, 0, output, newWidth, newHeight, 0, 2); break; - case UNCOMPRESSED_R8G8B8: stbir_resize_uint8((unsigned char *)image->data, image->width, image->height, 0, output, newWidth, newHeight, 0, 3); break; - case UNCOMPRESSED_R8G8B8A8: stbir_resize_uint8((unsigned char *)image->data, image->width, image->height, 0, output, newWidth, newHeight, 0, 4); break; + case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: stbir_resize_uint8((unsigned char *)image->data, image->width, image->height, 0, output, newWidth, newHeight, 0, 1); break; + case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: stbir_resize_uint8((unsigned char *)image->data, image->width, image->height, 0, output, newWidth, newHeight, 0, 2); break; + case PIXELFORMAT_UNCOMPRESSED_R8G8B8: stbir_resize_uint8((unsigned char *)image->data, image->width, image->height, 0, output, newWidth, newHeight, 0, 3); break; + case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: stbir_resize_uint8((unsigned char *)image->data, image->width, image->height, 0, output, newWidth, newHeight, 0, 4); break; default: break; } @@ -1382,7 +1395,7 @@ void ImageResize(Image *image, int newWidth, int newHeight) image->data = output; image->width = newWidth; image->height = newHeight; - image->format = UNCOMPRESSED_R8G8B8A8; + image->format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; ImageFormat(image, format); // Reformat 32bit RGBA image to original format } @@ -1420,7 +1433,7 @@ void ImageResizeNN(Image *image,int newWidth,int newHeight) image->data = output; image->width = newWidth; image->height = newHeight; - image->format = UNCOMPRESSED_R8G8B8A8; + image->format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; ImageFormat(image, format); // Reformat 32bit RGBA image to original format @@ -1435,7 +1448,7 @@ void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, i if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; if (image->mipmaps > 1) TRACELOG(LOG_WARNING, "Image manipulation only applied to base mipmap level"); - if (image->format >= COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); + if (image->format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); else if ((newWidth != image->width) || (newHeight != image->height)) { Rectangle srcRec = { 0, 0, (float)image->width, (float)image->height }; @@ -1558,7 +1571,7 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) // Security check to avoid program crash if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; - if (image->format >= COMPRESSED_DXT1_RGB) + if (image->format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) { TRACELOG(LOG_WARNING, "IMAGE: Compressed data formats can not be dithered"); return; @@ -1574,15 +1587,15 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) RL_FREE(image->data); // free old image data - if ((image->format != UNCOMPRESSED_R8G8B8) && (image->format != UNCOMPRESSED_R8G8B8A8)) + if ((image->format != PIXELFORMAT_UNCOMPRESSED_R8G8B8) && (image->format != PIXELFORMAT_UNCOMPRESSED_R8G8B8A8)) { TRACELOG(LOG_WARNING, "IMAGE: Format is already 16bpp or lower, dithering could have no effect"); } // Define new image format, check if desired bpp match internal known format - if ((rBpp == 5) && (gBpp == 6) && (bBpp == 5) && (aBpp == 0)) image->format = UNCOMPRESSED_R5G6B5; - else if ((rBpp == 5) && (gBpp == 5) && (bBpp == 5) && (aBpp == 1)) image->format = UNCOMPRESSED_R5G5B5A1; - else if ((rBpp == 4) && (gBpp == 4) && (bBpp == 4) && (aBpp == 4)) image->format = UNCOMPRESSED_R4G4B4A4; + if ((rBpp == 5) && (gBpp == 6) && (bBpp == 5) && (aBpp == 0)) image->format = PIXELFORMAT_UNCOMPRESSED_R5G6B5; + else if ((rBpp == 5) && (gBpp == 5) && (bBpp == 5) && (aBpp == 1)) image->format = PIXELFORMAT_UNCOMPRESSED_R5G5B5A1; + else if ((rBpp == 4) && (gBpp == 4) && (bBpp == 4) && (aBpp == 4)) image->format = PIXELFORMAT_UNCOMPRESSED_R4G4B4A4; else { image->format = 0; @@ -1669,7 +1682,7 @@ void ImageFlipVertical(Image *image) if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; if (image->mipmaps > 1) TRACELOG(LOG_WARNING, "Image manipulation only applied to base mipmap level"); - if (image->format >= COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); + if (image->format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); else { int bytesPerPixel = GetPixelDataSize(1, 1, image->format); @@ -1693,7 +1706,7 @@ void ImageFlipHorizontal(Image *image) if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; if (image->mipmaps > 1) TRACELOG(LOG_WARNING, "Image manipulation only applied to base mipmap level"); - if (image->format >= COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); + if (image->format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); else { int bytesPerPixel = GetPixelDataSize(1, 1, image->format); @@ -1738,7 +1751,7 @@ void ImageRotateCW(Image *image) if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; if (image->mipmaps > 1) TRACELOG(LOG_WARNING, "Image manipulation only applied to base mipmap level"); - if (image->format >= COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); + if (image->format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); else { int bytesPerPixel = GetPixelDataSize(1, 1, image->format); @@ -1770,7 +1783,7 @@ void ImageRotateCCW(Image *image) if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; if (image->mipmaps > 1) TRACELOG(LOG_WARNING, "Image manipulation only applied to base mipmap level"); - if (image->format >= COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); + if (image->format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); else { int bytesPerPixel = GetPixelDataSize(1, 1, image->format); @@ -1812,7 +1825,7 @@ void ImageColorTint(Image *image, Color color) { for (int x = 0; x < image->width; x++) { - int index = y * image->width + x; + int index = y*image->width + x; unsigned char r = (unsigned char)(((float)pixels[index].r/255*cR)*255.0f); unsigned char g = (unsigned char)(((float)pixels[index].g/255*cG)*255.0f); unsigned char b = (unsigned char)(((float)pixels[index].b/255*cB)*255.0f); @@ -1829,7 +1842,7 @@ void ImageColorTint(Image *image, Color color) RL_FREE(image->data); image->data = pixels; - image->format = UNCOMPRESSED_R8G8B8A8; + image->format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; ImageFormat(image, format); } @@ -1856,7 +1869,7 @@ void ImageColorInvert(Image *image) RL_FREE(image->data); image->data = pixels; - image->format = UNCOMPRESSED_R8G8B8A8; + image->format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; ImageFormat(image, format); } @@ -1864,7 +1877,7 @@ void ImageColorInvert(Image *image) // Modify image color: grayscale void ImageColorGrayscale(Image *image) { - ImageFormat(image, UNCOMPRESSED_GRAYSCALE); + ImageFormat(image, PIXELFORMAT_UNCOMPRESSED_GRAYSCALE); } // Modify image color: contrast @@ -1920,7 +1933,7 @@ void ImageColorContrast(Image *image, float contrast) RL_FREE(image->data); image->data = pixels; - image->format = UNCOMPRESSED_R8G8B8A8; + image->format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; ImageFormat(image, format); } @@ -1964,7 +1977,7 @@ void ImageColorBrightness(Image *image, int brightness) RL_FREE(image->data); image->data = pixels; - image->format = UNCOMPRESSED_R8G8B8A8; + image->format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; ImageFormat(image, format); } @@ -1998,7 +2011,7 @@ void ImageColorReplace(Image *image, Color color, Color replace) RL_FREE(image->data); image->data = pixels; - image->format = UNCOMPRESSED_R8G8B8A8; + image->format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; ImageFormat(image, format); } @@ -2012,18 +2025,18 @@ Color *LoadImageColors(Image image) Color *pixels = (Color *)RL_MALLOC(image.width*image.height*sizeof(Color)); - if (image.format >= COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "IMAGE: Pixel data retrieval not supported for compressed image formats"); + if (image.format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "IMAGE: Pixel data retrieval not supported for compressed image formats"); else { - if ((image.format == UNCOMPRESSED_R32) || - (image.format == UNCOMPRESSED_R32G32B32) || - (image.format == UNCOMPRESSED_R32G32B32A32)) TRACELOG(LOG_WARNING, "IMAGE: Pixel format converted from 32bit to 8bit per channel"); + if ((image.format == PIXELFORMAT_UNCOMPRESSED_R32) || + (image.format == PIXELFORMAT_UNCOMPRESSED_R32G32B32) || + (image.format == PIXELFORMAT_UNCOMPRESSED_R32G32B32A32)) TRACELOG(LOG_WARNING, "IMAGE: Pixel format converted from 32bit to 8bit per channel"); for (int i = 0, k = 0; i < image.width*image.height; i++) { switch (image.format) { - case UNCOMPRESSED_GRAYSCALE: + case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: { pixels[i].r = ((unsigned char *)image.data)[i]; pixels[i].g = ((unsigned char *)image.data)[i]; @@ -2031,7 +2044,7 @@ Color *LoadImageColors(Image image) pixels[i].a = 255; } break; - case UNCOMPRESSED_GRAY_ALPHA: + case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: { pixels[i].r = ((unsigned char *)image.data)[k]; pixels[i].g = ((unsigned char *)image.data)[k]; @@ -2040,7 +2053,7 @@ Color *LoadImageColors(Image image) k += 2; } break; - case UNCOMPRESSED_R5G5B5A1: + case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: { unsigned short pixel = ((unsigned short *)image.data)[i]; @@ -2050,7 +2063,7 @@ Color *LoadImageColors(Image image) pixels[i].a = (unsigned char)((pixel & 0b0000000000000001)*255); } break; - case UNCOMPRESSED_R5G6B5: + case PIXELFORMAT_UNCOMPRESSED_R5G6B5: { unsigned short pixel = ((unsigned short *)image.data)[i]; @@ -2060,7 +2073,7 @@ Color *LoadImageColors(Image image) pixels[i].a = 255; } break; - case UNCOMPRESSED_R4G4B4A4: + case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: { unsigned short pixel = ((unsigned short *)image.data)[i]; @@ -2070,7 +2083,7 @@ Color *LoadImageColors(Image image) pixels[i].a = (unsigned char)((float)(pixel & 0b0000000000001111)*(255/15)); } break; - case UNCOMPRESSED_R8G8B8A8: + case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: { pixels[i].r = ((unsigned char *)image.data)[k]; pixels[i].g = ((unsigned char *)image.data)[k + 1]; @@ -2079,7 +2092,7 @@ Color *LoadImageColors(Image image) k += 4; } break; - case UNCOMPRESSED_R8G8B8: + case PIXELFORMAT_UNCOMPRESSED_R8G8B8: { pixels[i].r = (unsigned char)((unsigned char *)image.data)[k]; pixels[i].g = (unsigned char)((unsigned char *)image.data)[k + 1]; @@ -2088,7 +2101,7 @@ Color *LoadImageColors(Image image) k += 3; } break; - case UNCOMPRESSED_R32: + case PIXELFORMAT_UNCOMPRESSED_R32: { pixels[i].r = (unsigned char)(((float *)image.data)[k]*255.0f); pixels[i].g = 0; @@ -2096,7 +2109,7 @@ Color *LoadImageColors(Image image) pixels[i].a = 255; } break; - case UNCOMPRESSED_R32G32B32: + case PIXELFORMAT_UNCOMPRESSED_R32G32B32: { pixels[i].r = (unsigned char)(((float *)image.data)[k]*255.0f); pixels[i].g = (unsigned char)(((float *)image.data)[k + 1]*255.0f); @@ -2105,7 +2118,7 @@ Color *LoadImageColors(Image image) k += 3; } break; - case UNCOMPRESSED_R32G32B32A32: + case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: { pixels[i].r = (unsigned char)(((float *)image.data)[k]*255.0f); pixels[i].g = (unsigned char)(((float *)image.data)[k]*255.0f); @@ -2195,14 +2208,14 @@ static Vector4 *LoadImageDataNormalized(Image image) { Vector4 *pixels = (Vector4 *)RL_MALLOC(image.width*image.height*sizeof(Vector4)); - if (image.format >= COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "IMAGE: Pixel data retrieval not supported for compressed image formats"); + if (image.format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "IMAGE: Pixel data retrieval not supported for compressed image formats"); else { for (int i = 0, k = 0; i < image.width*image.height; i++) { switch (image.format) { - case UNCOMPRESSED_GRAYSCALE: + case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: { pixels[i].x = (float)((unsigned char *)image.data)[i]/255.0f; pixels[i].y = (float)((unsigned char *)image.data)[i]/255.0f; @@ -2210,7 +2223,7 @@ static Vector4 *LoadImageDataNormalized(Image image) pixels[i].w = 1.0f; } break; - case UNCOMPRESSED_GRAY_ALPHA: + case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: { pixels[i].x = (float)((unsigned char *)image.data)[k]/255.0f; pixels[i].y = (float)((unsigned char *)image.data)[k]/255.0f; @@ -2219,7 +2232,7 @@ static Vector4 *LoadImageDataNormalized(Image image) k += 2; } break; - case UNCOMPRESSED_R5G5B5A1: + case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: { unsigned short pixel = ((unsigned short *)image.data)[i]; @@ -2229,7 +2242,7 @@ static Vector4 *LoadImageDataNormalized(Image image) pixels[i].w = ((pixel & 0b0000000000000001) == 0)? 0.0f : 1.0f; } break; - case UNCOMPRESSED_R5G6B5: + case PIXELFORMAT_UNCOMPRESSED_R5G6B5: { unsigned short pixel = ((unsigned short *)image.data)[i]; @@ -2239,7 +2252,7 @@ static Vector4 *LoadImageDataNormalized(Image image) pixels[i].w = 1.0f; } break; - case UNCOMPRESSED_R4G4B4A4: + case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: { unsigned short pixel = ((unsigned short *)image.data)[i]; @@ -2249,7 +2262,7 @@ static Vector4 *LoadImageDataNormalized(Image image) pixels[i].w = (float)(pixel & 0b0000000000001111)*(1.0f/15); } break; - case UNCOMPRESSED_R8G8B8A8: + case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: { pixels[i].x = (float)((unsigned char *)image.data)[k]/255.0f; pixels[i].y = (float)((unsigned char *)image.data)[k + 1]/255.0f; @@ -2258,7 +2271,7 @@ static Vector4 *LoadImageDataNormalized(Image image) k += 4; } break; - case UNCOMPRESSED_R8G8B8: + case PIXELFORMAT_UNCOMPRESSED_R8G8B8: { pixels[i].x = (float)((unsigned char *)image.data)[k]/255.0f; pixels[i].y = (float)((unsigned char *)image.data)[k + 1]/255.0f; @@ -2267,7 +2280,7 @@ static Vector4 *LoadImageDataNormalized(Image image) k += 3; } break; - case UNCOMPRESSED_R32: + case PIXELFORMAT_UNCOMPRESSED_R32: { pixels[i].x = ((float *)image.data)[k]; pixels[i].y = 0.0f; @@ -2275,7 +2288,7 @@ static Vector4 *LoadImageDataNormalized(Image image) pixels[i].w = 1.0f; } break; - case UNCOMPRESSED_R32G32B32: + case PIXELFORMAT_UNCOMPRESSED_R32G32B32: { pixels[i].x = ((float *)image.data)[k]; pixels[i].y = ((float *)image.data)[k + 1]; @@ -2284,7 +2297,7 @@ static Vector4 *LoadImageDataNormalized(Image image) k += 3; } break; - case UNCOMPRESSED_R32G32B32A32: + case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: { pixels[i].x = ((float *)image.data)[k]; pixels[i].y = ((float *)image.data)[k + 1]; @@ -2348,7 +2361,7 @@ Rectangle GetImageAlphaBorder(Image image, float threshold) // Clear image background with given color void ImageClearBackground(Image *dst, Color color) { - for (int i = 0; i < dst->width*dst->height; ++i) ImageDrawPixel(dst, i%dst->width, i/dst->height, color); + for (int i = 0; i < dst->width*dst->height; ++i) ImageDrawPixel(dst, i%dst->width, i/dst->width, color); } // Draw pixel within an image @@ -2360,7 +2373,7 @@ void ImageDrawPixel(Image *dst, int x, int y, Color color) switch (dst->format) { - case UNCOMPRESSED_GRAYSCALE: + case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: { // NOTE: Calculate grayscale equivalent color Vector3 coln = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f }; @@ -2369,7 +2382,7 @@ void ImageDrawPixel(Image *dst, int x, int y, Color color) ((unsigned char *)dst->data)[y*dst->width + x] = gray; } break; - case UNCOMPRESSED_GRAY_ALPHA: + case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: { // NOTE: Calculate grayscale equivalent color Vector3 coln = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f }; @@ -2379,7 +2392,7 @@ void ImageDrawPixel(Image *dst, int x, int y, Color color) ((unsigned char *)dst->data)[(y*dst->width + x)*2 + 1] = color.a; } break; - case UNCOMPRESSED_R5G6B5: + case PIXELFORMAT_UNCOMPRESSED_R5G6B5: { // NOTE: Calculate R5G6B5 equivalent color Vector3 coln = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f }; @@ -2391,7 +2404,7 @@ void ImageDrawPixel(Image *dst, int x, int y, Color color) ((unsigned short *)dst->data)[y*dst->width + x] = (unsigned short)r << 11 | (unsigned short)g << 5 | (unsigned short)b; } break; - case UNCOMPRESSED_R5G5B5A1: + case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: { // NOTE: Calculate R5G5B5A1 equivalent color Vector4 coln = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f, (float)color.a/255.0f }; @@ -2399,12 +2412,12 @@ void ImageDrawPixel(Image *dst, int x, int y, Color color) unsigned char r = (unsigned char)(round(coln.x*31.0f)); unsigned char g = (unsigned char)(round(coln.y*31.0f)); unsigned char b = (unsigned char)(round(coln.z*31.0f)); - unsigned char a = (coln.w > ((float)UNCOMPRESSED_R5G5B5A1_ALPHA_THRESHOLD/255.0f))? 1 : 0;; + unsigned char a = (coln.w > ((float)PIXELFORMAT_UNCOMPRESSED_R5G5B5A1_ALPHA_THRESHOLD/255.0f))? 1 : 0;; ((unsigned short *)dst->data)[y*dst->width + x] = (unsigned short)r << 11 | (unsigned short)g << 6 | (unsigned short)b << 1 | (unsigned short)a; } break; - case UNCOMPRESSED_R4G4B4A4: + case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: { // NOTE: Calculate R5G5B5A1 equivalent color Vector4 coln = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f, (float)color.a/255.0f }; @@ -2417,14 +2430,14 @@ void ImageDrawPixel(Image *dst, int x, int y, Color color) ((unsigned short *)dst->data)[y*dst->width + x] = (unsigned short)r << 12 | (unsigned short)g << 8 | (unsigned short)b << 4 | (unsigned short)a; } break; - case UNCOMPRESSED_R8G8B8: + case PIXELFORMAT_UNCOMPRESSED_R8G8B8: { ((unsigned char *)dst->data)[(y*dst->width + x)*3] = color.r; ((unsigned char *)dst->data)[(y*dst->width + x)*3 + 1] = color.g; ((unsigned char *)dst->data)[(y*dst->width + x)*3 + 2] = color.b; } break; - case UNCOMPRESSED_R8G8B8A8: + case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: { ((unsigned char *)dst->data)[(y*dst->width + x)*4] = color.r; ((unsigned char *)dst->data)[(y*dst->width + x)*4 + 1] = color.g; @@ -2432,7 +2445,7 @@ void ImageDrawPixel(Image *dst, int x, int y, Color color) ((unsigned char *)dst->data)[(y*dst->width + x)*4 + 3] = color.a; } break; - case UNCOMPRESSED_R32: + case PIXELFORMAT_UNCOMPRESSED_R32: { // NOTE: Calculate grayscale equivalent color (normalized to 32bit) Vector3 coln = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f }; @@ -2440,7 +2453,7 @@ void ImageDrawPixel(Image *dst, int x, int y, Color color) ((float *)dst->data)[y*dst->width + x] = coln.x*0.299f + coln.y*0.587f + coln.z*0.114f; } break; - case UNCOMPRESSED_R32G32B32: + case PIXELFORMAT_UNCOMPRESSED_R32G32B32: { // NOTE: Calculate R32G32B32 equivalent color (normalized to 32bit) Vector3 coln = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f }; @@ -2449,7 +2462,7 @@ void ImageDrawPixel(Image *dst, int x, int y, Color color) ((float *)dst->data)[(y*dst->width + x)*3 + 1] = coln.y; ((float *)dst->data)[(y*dst->width + x)*3 + 2] = coln.z; } break; - case UNCOMPRESSED_R32G32B32A32: + case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: { // NOTE: Calculate R32G32B32A32 equivalent color (normalized to 32bit) Vector4 coln = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f, (float)color.a/255.0f }; @@ -2579,7 +2592,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color (src.data == NULL) || (src.width == 0) || (src.height == 0)) return; if (dst->mipmaps > 1) TRACELOG(LOG_WARNING, "Image drawing only applied to base mipmap level"); - if (dst->format >= COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image drawing not supported for compressed formats"); + if (dst->format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image drawing not supported for compressed formats"); else { Image srcMod = { 0 }; // Source copy (in case it was required) @@ -2633,13 +2646,13 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color // [x] Optimize ColorAlphaBlend() for faster operations (maybe avoiding divs?) // [x] Consider fast path: no alpha blending required cases (src has no alpha) // [x] Consider fast path: same src/dst format with no alpha -> direct line copy - // [-] GetPixelColor(): Return Vector4 instead of Color, easier for ColorAlphaBlend() + // [-] GetPixelColor(): Get Vector4 instead of Color, easier for ColorAlphaBlend() Color colSrc, colDst, blend; bool blendRequired = true; // Fast path: Avoid blend if source has no alpha to blend - if ((tint.a == 255) && ((srcPtr->format == UNCOMPRESSED_GRAYSCALE) || (srcPtr->format == UNCOMPRESSED_R8G8B8) || (srcPtr->format == UNCOMPRESSED_R5G6B5))) blendRequired = false; + if ((tint.a == 255) && ((srcPtr->format == PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) || (srcPtr->format == PIXELFORMAT_UNCOMPRESSED_R8G8B8) || (srcPtr->format == PIXELFORMAT_UNCOMPRESSED_R5G6B5))) blendRequired = false; int strideDst = GetPixelDataSize(dst->width, 1, dst->format); int bytesPerPixelDst = strideDst/(dst->width); @@ -2745,29 +2758,29 @@ Texture2D LoadTextureFromImage(Image image) } // Load cubemap from image, multiple image cubemap layouts supported -TextureCubemap LoadTextureCubemap(Image image, int layoutType) +TextureCubemap LoadTextureCubemap(Image image, int layout) { TextureCubemap cubemap = { 0 }; - if (layoutType == CUBEMAP_AUTO_DETECT) // Try to automatically guess layout type + if (layout == CUBEMAP_LAYOUT_AUTO_DETECT) // Try to automatically guess layout type { // Check image width/height to determine the type of cubemap provided if (image.width > image.height) { - if ((image.width/6) == image.height) { layoutType = CUBEMAP_LINE_HORIZONTAL; cubemap.width = image.width/6; } - else if ((image.width/4) == (image.height/3)) { layoutType = CUBEMAP_CROSS_FOUR_BY_THREE; cubemap.width = image.width/4; } - else if (image.width >= (int)((float)image.height*1.85f)) { layoutType = CUBEMAP_PANORAMA; cubemap.width = image.width/4; } + if ((image.width/6) == image.height) { layout = CUBEMAP_LAYOUT_LINE_HORIZONTAL; cubemap.width = image.width/6; } + else if ((image.width/4) == (image.height/3)) { layout = CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE; cubemap.width = image.width/4; } + else if (image.width >= (int)((float)image.height*1.85f)) { layout = CUBEMAP_LAYOUT_PANORAMA; cubemap.width = image.width/4; } } else if (image.height > image.width) { - if ((image.height/6) == image.width) { layoutType = CUBEMAP_LINE_VERTICAL; cubemap.width = image.height/6; } - else if ((image.width/3) == (image.height/4)) { layoutType = CUBEMAP_CROSS_THREE_BY_FOUR; cubemap.width = image.width/3; } + if ((image.height/6) == image.width) { layout = CUBEMAP_LAYOUT_LINE_VERTICAL; cubemap.width = image.height/6; } + else if ((image.width/3) == (image.height/4)) { layout = CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR; cubemap.width = image.width/3; } } cubemap.height = cubemap.width; } - if (layoutType != CUBEMAP_AUTO_DETECT) + if (layout != CUBEMAP_LAYOUT_AUTO_DETECT) { int size = cubemap.width; @@ -2775,20 +2788,20 @@ TextureCubemap LoadTextureCubemap(Image image, int layoutType) Rectangle faceRecs[6] = { 0 }; // Face source rectangles for (int i = 0; i < 6; i++) faceRecs[i] = (Rectangle){ 0, 0, (float)size, (float)size }; - if (layoutType == CUBEMAP_LINE_VERTICAL) + if (layout == CUBEMAP_LAYOUT_LINE_VERTICAL) { faces = image; for (int i = 0; i < 6; i++) faceRecs[i].y = (float)size*i; } - else if (layoutType == CUBEMAP_PANORAMA) + else if (layout == CUBEMAP_LAYOUT_PANORAMA) { // TODO: Convert panorama image to square faces... // Ref: https://github.com/denivip/panorama/blob/master/panorama.cpp } else { - if (layoutType == CUBEMAP_LINE_HORIZONTAL) for (int i = 0; i < 6; i++) faceRecs[i].x = (float)size*i; - else if (layoutType == CUBEMAP_CROSS_THREE_BY_FOUR) + if (layout == CUBEMAP_LAYOUT_LINE_HORIZONTAL) for (int i = 0; i < 6; i++) faceRecs[i].x = (float)size*i; + else if (layout == CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR) { faceRecs[0].x = (float)size; faceRecs[0].y = (float)size; faceRecs[1].x = (float)size; faceRecs[1].y = (float)size*3; @@ -2797,7 +2810,7 @@ TextureCubemap LoadTextureCubemap(Image image, int layoutType) faceRecs[4].x = 0; faceRecs[4].y = (float)size; faceRecs[5].x = (float)size*2; faceRecs[5].y = (float)size; } - else if (layoutType == CUBEMAP_CROSS_FOUR_BY_THREE) + else if (layout == CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE) { faceRecs[0].x = (float)size*2; faceRecs[0].y = (float)size; faceRecs[1].x = 0; faceRecs[1].y = (float)size; @@ -2839,10 +2852,10 @@ RenderTexture2D LoadRenderTexture(int width, int height) rlEnableFramebuffer(target.id); // Create color texture (default to RGBA) - target.texture.id = rlLoadTexture(NULL, width, height, UNCOMPRESSED_R8G8B8A8, 1); + target.texture.id = rlLoadTexture(NULL, width, height, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, 1); target.texture.width = width; target.texture.height = height; - target.texture.format = UNCOMPRESSED_R8G8B8A8; + target.texture.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; target.texture.mipmaps = 1; // Create depth renderbuffer/texture @@ -2853,8 +2866,8 @@ RenderTexture2D LoadRenderTexture(int width, int height) target.depth.mipmaps = 1; // Attach color texture and depth renderbuffer/texture to FBO - rlFramebufferAttach(target.id, target.texture.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_TEXTURE2D); - rlFramebufferAttach(target.id, target.depth.id, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER); + rlFramebufferAttach(target.id, target.texture.id, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_TEXTURE2D, 0); + rlFramebufferAttach(target.id, target.depth.id, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER, 0); // Check if fbo is complete with attachments (valid) if (rlFramebufferComplete(target.id)) TRACELOG(LOG_INFO, "FBO: [ID %i] Framebuffer object created successfully", target.id); @@ -2911,7 +2924,7 @@ Image GetTextureData(Texture2D texture) { Image image = { 0 }; - if (texture.format < COMPRESSED_DXT1_RGB) + if (texture.format < PIXELFORMAT_COMPRESSED_DXT1_RGB) { image.data = rlReadTexturePixels(texture); @@ -2926,7 +2939,7 @@ Image GetTextureData(Texture2D texture) // NOTE: Data retrieved on OpenGL ES 2.0 should be RGBA, // coming from FBO color buffer attachment, but it seems // original texture format is retrieved on RPI... - image.format = UNCOMPRESSED_R8G8B8A8; + image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; #endif TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Pixel data retrieved successfully", texture.id); } @@ -2945,7 +2958,7 @@ Image GetScreenData(void) image.width = GetScreenWidth(); image.height = GetScreenHeight(); image.mipmaps = 1; - image.format = UNCOMPRESSED_R8G8B8A8; + image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; image.data = rlReadScreenPixels(image.width, image.height); return image; @@ -2963,95 +2976,95 @@ void GenTextureMipmaps(Texture2D *texture) } // Set texture scaling filter mode -void SetTextureFilter(Texture2D texture, int filterMode) +void SetTextureFilter(Texture2D texture, int filter) { - switch (filterMode) + switch (filter) { - case FILTER_POINT: + case TEXTURE_FILTER_POINT: { if (texture.mipmaps > 1) { - // RL_FILTER_MIP_NEAREST - tex filter: POINT, mipmaps filter: POINT (sharp switching between mipmaps) - rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_MIP_NEAREST); + // RL_TEXTURE_FILTER_MIP_NEAREST - tex filter: POINT, mipmaps filter: POINT (sharp switching between mipmaps) + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_TEXTURE_FILTER_MIP_NEAREST); - // RL_FILTER_NEAREST - tex filter: POINT (no filter), no mipmaps - rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_NEAREST); + // RL_TEXTURE_FILTER_NEAREST - tex filter: POINT (no filter), no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_TEXTURE_FILTER_NEAREST); } else { - // RL_FILTER_NEAREST - tex filter: POINT (no filter), no mipmaps - rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_NEAREST); - rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_NEAREST); + // RL_TEXTURE_FILTER_NEAREST - tex filter: POINT (no filter), no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_TEXTURE_FILTER_NEAREST); + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_TEXTURE_FILTER_NEAREST); } } break; - case FILTER_BILINEAR: + case TEXTURE_FILTER_BILINEAR: { if (texture.mipmaps > 1) { - // RL_FILTER_LINEAR_MIP_NEAREST - tex filter: BILINEAR, mipmaps filter: POINT (sharp switching between mipmaps) - // Alternative: RL_FILTER_NEAREST_MIP_LINEAR - tex filter: POINT, mipmaps filter: BILINEAR (smooth transition between mipmaps) - rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_LINEAR_MIP_NEAREST); + // RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST - tex filter: BILINEAR, mipmaps filter: POINT (sharp switching between mipmaps) + // Alternative: RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR - tex filter: POINT, mipmaps filter: BILINEAR (smooth transition between mipmaps) + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST); - // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps - rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); + // RL_TEXTURE_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_TEXTURE_FILTER_LINEAR); } else { - // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps - rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_LINEAR); - rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); + // RL_TEXTURE_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_TEXTURE_FILTER_LINEAR); + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_TEXTURE_FILTER_LINEAR); } } break; - case FILTER_TRILINEAR: + case TEXTURE_FILTER_TRILINEAR: { if (texture.mipmaps > 1) { - // RL_FILTER_MIP_LINEAR - tex filter: BILINEAR, mipmaps filter: BILINEAR (smooth transition between mipmaps) - rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_MIP_LINEAR); + // RL_TEXTURE_FILTER_MIP_LINEAR - tex filter: BILINEAR, mipmaps filter: BILINEAR (smooth transition between mipmaps) + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_TEXTURE_FILTER_MIP_LINEAR); - // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps - rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); + // RL_TEXTURE_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_TEXTURE_FILTER_LINEAR); } else { TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] No mipmaps available for TRILINEAR texture filtering", texture.id); - // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps - rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_LINEAR); - rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); + // RL_TEXTURE_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_TEXTURE_FILTER_LINEAR); + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_TEXTURE_FILTER_LINEAR); } } break; - case FILTER_ANISOTROPIC_4X: rlTextureParameters(texture.id, RL_TEXTURE_ANISOTROPIC_FILTER, 4); break; - case FILTER_ANISOTROPIC_8X: rlTextureParameters(texture.id, RL_TEXTURE_ANISOTROPIC_FILTER, 8); break; - case FILTER_ANISOTROPIC_16X: rlTextureParameters(texture.id, RL_TEXTURE_ANISOTROPIC_FILTER, 16); break; + case TEXTURE_FILTER_ANISOTROPIC_4X: rlTextureParameters(texture.id, RL_TEXTURE_FILTER_ANISOTROPIC, 4); break; + case TEXTURE_FILTER_ANISOTROPIC_8X: rlTextureParameters(texture.id, RL_TEXTURE_FILTER_ANISOTROPIC, 8); break; + case TEXTURE_FILTER_ANISOTROPIC_16X: rlTextureParameters(texture.id, RL_TEXTURE_FILTER_ANISOTROPIC, 16); break; default: break; } } // Set texture wrapping mode -void SetTextureWrap(Texture2D texture, int wrapMode) +void SetTextureWrap(Texture2D texture, int wrap) { - switch (wrapMode) + switch (wrap) { - case WRAP_REPEAT: + case TEXTURE_WRAP_REPEAT: { - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_WRAP_REPEAT); - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_WRAP_REPEAT); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_TEXTURE_WRAP_REPEAT); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_TEXTURE_WRAP_REPEAT); } break; - case WRAP_CLAMP: + case TEXTURE_WRAP_CLAMP: { - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_WRAP_CLAMP); - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_WRAP_CLAMP); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_TEXTURE_WRAP_CLAMP); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_TEXTURE_WRAP_CLAMP); } break; - case WRAP_MIRROR_REPEAT: + case TEXTURE_WRAP_MIRROR_REPEAT: { - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_WRAP_MIRROR_REPEAT); - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_WRAP_MIRROR_REPEAT); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_TEXTURE_WRAP_MIRROR_REPEAT); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_TEXTURE_WRAP_MIRROR_REPEAT); } break; - case WRAP_MIRROR_CLAMP: + case TEXTURE_WRAP_MIRROR_CLAMP: { - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_WRAP_MIRROR_CLAMP); - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_WRAP_MIRROR_CLAMP); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_TEXTURE_WRAP_MIRROR_CLAMP); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_TEXTURE_WRAP_MIRROR_CLAMP); } break; default: break; } @@ -3106,10 +3119,10 @@ void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangl // NOTE: For tilling a whole texture DrawTextureQuad() is better void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint) { - if (texture.id <= 0 || scale <= 0.0f) return; // Wanna see a infinite loop?!...just delete this line! + if ((texture.id <= 0) || (scale <= 0.0f)) return; // Wanna see a infinite loop?!...just delete this line! int tileWidth = (int)(source.width*scale), tileHeight = (int)(source.height*scale); - if (dest.width < tileWidth && dest.height < tileHeight) + if ((dest.width < tileWidth) && (dest.height < tileHeight)) { // Can fit only one tile DrawTexturePro(texture, (Rectangle){source.x, source.y, ((float)dest.width/tileWidth)*source.width, ((float)dest.height/tileHeight)*source.height}, @@ -3201,11 +3214,84 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 if (source.width < 0) { flipX = true; source.width *= -1; } if (source.height < 0) source.y -= source.height; - rlEnableTexture(texture.id); + Vector2 topLeft = { 0 }; + Vector2 topRight = { 0 }; + Vector2 bottomLeft = { 0 }; + Vector2 bottomRight = { 0 }; + // Only calculate rotation if needed + if (rotation == 0.0f) + { + float x = dest.x - origin.x; + float y = dest.y - origin.y; + topLeft = (Vector2){ x, y }; + topRight = (Vector2){ x + dest.width, y }; + bottomLeft = (Vector2){ x, y + dest.height }; + bottomRight = (Vector2){ x + dest.width, y + dest.height }; + } + else + { + float sinRotation = sinf(rotation*DEG2RAD); + float cosRotation = cosf(rotation*DEG2RAD); + float x = dest.x; + float y = dest.y; + float dx = -origin.x; + float dy = -origin.y; + + topLeft.x = x + dx*cosRotation - dy*sinRotation; + topLeft.y = y + dx*sinRotation + dy*cosRotation; + + topRight.x = x + (dx + dest.width)*cosRotation - dy*sinRotation; + topRight.y = y + (dx + dest.width)*sinRotation + dy*cosRotation; + + bottomLeft.x = x + dx*cosRotation - (dy + dest.height)*sinRotation; + bottomLeft.y = y + dx*sinRotation + (dy + dest.height)*cosRotation; + + bottomRight.x = x + (dx + dest.width)*cosRotation - (dy + dest.height)*sinRotation; + bottomRight.y = y + (dx + dest.width)*sinRotation + (dy + dest.height)*cosRotation; + } + + rlCheckRenderBatchLimit(4); // Make sure there is enough free space on the batch buffer + + rlSetTexture(texture.id); + rlBegin(RL_QUADS); + + rlColor4ub(tint.r, tint.g, tint.b, tint.a); + rlNormal3f(0.0f, 0.0f, 1.0f); // Normal vector pointing towards viewer + + // Top-left corner for texture and quad + if (flipX) rlTexCoord2f((source.x + source.width)/width, source.y/height); + else rlTexCoord2f(source.x/width, source.y/height); + rlVertex2f(topLeft.x, topLeft.y); + + // Bottom-left corner for texture and quad + if (flipX) rlTexCoord2f((source.x + source.width)/width, (source.y + source.height)/height); + else rlTexCoord2f(source.x/width, (source.y + source.height)/height); + rlVertex2f(bottomLeft.x, bottomLeft.y); + + // Bottom-right corner for texture and quad + if (flipX) rlTexCoord2f(source.x/width, (source.y + source.height)/height); + else rlTexCoord2f((source.x + source.width)/width, (source.y + source.height)/height); + rlVertex2f(bottomRight.x, bottomRight.y); + + // Top-right corner for texture and quad + if (flipX) rlTexCoord2f(source.x/width, source.y/height); + else rlTexCoord2f((source.x + source.width)/width, source.y/height); + rlVertex2f(topRight.x, topRight.y); + + rlEnd(); + rlSetTexture(0); + + // NOTE: Vertex position can be transformed using matrices + // but the process is way more costly than just calculating + // the vertex positions manually, like done above. + // I leave here the old implementation for educational pourposes, + // just in case someone wants to do some performance test + /* + rlSetTexture(texture.id); rlPushMatrix(); rlTranslatef(dest.x, dest.y, 0.0f); - rlRotatef(rotation, 0.0f, 0.0f, 1.0f); + if (rotation != 0.0f) rlRotatef(rotation, 0.0f, 0.0f, 1.0f); rlTranslatef(-origin.x, -origin.y, 0.0f); rlBegin(RL_QUADS); @@ -3233,8 +3319,8 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 rlVertex2f(dest.width, 0.0f); rlEnd(); rlPopMatrix(); - - rlDisableTexture(); + rlSetTexture(0); + */ } } @@ -3251,8 +3337,8 @@ void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, if (nPatchInfo.source.width < 0) nPatchInfo.source.x -= nPatchInfo.source.width; if (nPatchInfo.source.height < 0) nPatchInfo.source.y -= nPatchInfo.source.height; - if (nPatchInfo.type == NPT_3PATCH_HORIZONTAL) patchHeight = nPatchInfo.source.height; - if (nPatchInfo.type == NPT_3PATCH_VERTICAL) patchWidth = nPatchInfo.source.width; + if (nPatchInfo.layout == NPATCH_THREE_PATCH_HORIZONTAL) patchHeight = nPatchInfo.source.height; + if (nPatchInfo.layout == NPATCH_THREE_PATCH_VERTICAL) patchWidth = nPatchInfo.source.width; bool drawCenter = true; bool drawMiddle = true; @@ -3262,14 +3348,14 @@ void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, float bottomBorder = (float)nPatchInfo.bottom; // adjust the lateral (left and right) border widths in case patchWidth < texture.width - if (patchWidth <= (leftBorder + rightBorder) && nPatchInfo.type != NPT_3PATCH_VERTICAL) + if (patchWidth <= (leftBorder + rightBorder) && nPatchInfo.layout != NPATCH_THREE_PATCH_VERTICAL) { drawCenter = false; leftBorder = (leftBorder/(leftBorder + rightBorder))*patchWidth; rightBorder = patchWidth - leftBorder; } // adjust the lateral (top and bottom) border heights in case patchHeight < texture.height - if (patchHeight <= (topBorder + bottomBorder) && nPatchInfo.type != NPT_3PATCH_HORIZONTAL) + if (patchHeight <= (topBorder + bottomBorder) && nPatchInfo.layout != NPATCH_THREE_PATCH_HORIZONTAL) { drawMiddle = false; topBorder = (topBorder/(topBorder + bottomBorder))*patchHeight; @@ -3296,7 +3382,7 @@ void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, coordD.x = (nPatchInfo.source.x + nPatchInfo.source.width)/width; coordD.y = (nPatchInfo.source.y + nPatchInfo.source.height)/height; - rlEnableTexture(texture.id); + rlSetTexture(texture.id); rlPushMatrix(); rlTranslatef(dest.x, dest.y, 0.0f); @@ -3307,7 +3393,7 @@ void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, rlColor4ub(tint.r, tint.g, tint.b, tint.a); rlNormal3f(0.0f, 0.0f, 1.0f); // Normal vector pointing towards viewer - if (nPatchInfo.type == NPT_9PATCH) + if (nPatchInfo.layout == NPATCH_NINE_PATCH) { // ------------------------------------------------------------ // TOP-LEFT QUAD @@ -3373,7 +3459,7 @@ void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, rlTexCoord2f(coordD.x, coordC.y); rlVertex2f(vertD.x, vertC.y); // Top-right corner for texture and quad rlTexCoord2f(coordC.x, coordC.y); rlVertex2f(vertC.x, vertC.y); // Top-left corner for texture and quad } - else if (nPatchInfo.type == NPT_3PATCH_VERTICAL) + else if (nPatchInfo.layout == NPATCH_THREE_PATCH_VERTICAL) { // TOP QUAD // ----------------------------------------------------------- @@ -3400,7 +3486,7 @@ void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, rlTexCoord2f(coordD.x, coordC.y); rlVertex2f(vertD.x, vertC.y); // Top-right corner for texture and quad rlTexCoord2f(coordA.x, coordC.y); rlVertex2f(vertA.x, vertC.y); // Top-left corner for texture and quad } - else if (nPatchInfo.type == NPT_3PATCH_HORIZONTAL) + else if (nPatchInfo.layout == NPATCH_THREE_PATCH_HORIZONTAL) { // LEFT QUAD // ----------------------------------------------------------- @@ -3430,11 +3516,44 @@ void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, rlEnd(); rlPopMatrix(); - rlDisableTexture(); + rlSetTexture(0); } } -// Returns color with alpha applied, alpha goes from 0.0f to 1.0f +// Draw textured polygon, defined by vertex and texturecoordinates +// NOTE: Polygon center must have straight line path to all points +// without crossing perimeter, points must be in anticlockwise order +void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointsCount, Color tint) +{ + rlCheckRenderBatchLimit((pointsCount - 1)*4); + + rlSetTexture(texture.id); + + // Texturing is only supported on QUADs + rlBegin(RL_QUADS); + + rlColor4ub(tint.r, tint.g, tint.b, tint.a); + + for (int i = 0; i < pointsCount - 1; i++) + { + rlTexCoord2f(0.5f, 0.5f); + rlVertex2f(center.x, center.y); + + rlTexCoord2f(texcoords[i].x, texcoords[i].y); + rlVertex2f(points[i].x + center.x, points[i].y + center.y); + + rlTexCoord2f(texcoords[i + 1].x, texcoords[i + 1].y); + rlVertex2f(points[i + 1].x + center.x, points[i + 1].y + center.y); + + rlTexCoord2f(texcoords[i + 1].x, texcoords[i + 1].y); + rlVertex2f(points[i + 1].x + center.x, points[i + 1].y + center.y); + } + rlEnd(); + + rlSetTexture(0); +} + +// Get color with alpha applied, alpha goes from 0.0f to 1.0f Color Fade(Color color, float alpha) { if (alpha < 0.0f) alpha = 0.0f; @@ -3443,13 +3562,13 @@ Color Fade(Color color, float alpha) return (Color){color.r, color.g, color.b, (unsigned char)(255.0f*alpha)}; } -// Returns hexadecimal value for a Color +// Get hexadecimal value for a Color int ColorToInt(Color color) { return (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a); } -// Returns color normalized as float [0..1] +// Get color normalized as float [0..1] Vector4 ColorNormalize(Color color) { Vector4 result; @@ -3462,7 +3581,7 @@ Vector4 ColorNormalize(Color color) return result; } -// Returns color from normalized values [0..1] +// Get color from normalized values [0..1] Color ColorFromNormalized(Vector4 normalized) { Color result; @@ -3475,7 +3594,7 @@ Color ColorFromNormalized(Vector4 normalized) return result; } -// Returns HSV values for a Color +// Get HSV values for a Color // NOTE: Hue is returned as degrees [0..360] Vector3 ColorToHSV(Color color) { @@ -3527,7 +3646,7 @@ Vector3 ColorToHSV(Color color) return hsv; } -// Returns a Color from HSV values +// Get a Color from HSV values // Implementation reference: https://en.wikipedia.org/wiki/HSL_and_HSV#Alternative_HSV_conversion // NOTE: Color->HSV->Color conversion will not yield exactly the same color due to rounding errors // Hue is provided in degrees: [0..360] @@ -3563,7 +3682,7 @@ Color ColorFromHSV(float hue, float saturation, float value) return color; } -// Returns color with alpha applied, alpha goes from 0.0f to 1.0f +// Get color with alpha applied, alpha goes from 0.0f to 1.0f Color ColorAlpha(Color color, float alpha) { if (alpha < 0.0f) alpha = 0.0f; @@ -3572,7 +3691,7 @@ Color ColorAlpha(Color color, float alpha) return (Color){color.r, color.g, color.b, (unsigned char)(255.0f*alpha)}; } -// Returns src alpha-blended into dst color with tint +// Get src alpha-blended into dst color with tint Color ColorAlphaBlend(Color dst, Color src, Color tint) { Color out = WHITE; @@ -3627,7 +3746,7 @@ Color ColorAlphaBlend(Color dst, Color src, Color tint) return out; } -// Returns a Color struct from hexadecimal value +// Get a Color struct from hexadecimal value Color GetColor(int hexValue) { Color color; @@ -3647,9 +3766,9 @@ Color GetPixelColor(void *srcPtr, int format) switch (format) { - case UNCOMPRESSED_GRAYSCALE: col = (Color){ ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[0], 255 }; break; - case UNCOMPRESSED_GRAY_ALPHA: col = (Color){ ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[1] }; break; - case UNCOMPRESSED_R5G6B5: + case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: col = (Color){ ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[0], 255 }; break; + case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: col = (Color){ ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[1] }; break; + case PIXELFORMAT_UNCOMPRESSED_R5G6B5: { col.r = (unsigned char)((((unsigned short *)srcPtr)[0] >> 11)*255/31); col.g = (unsigned char)(((((unsigned short *)srcPtr)[0] >> 5) & 0b0000000000111111)*255/63); @@ -3657,7 +3776,7 @@ Color GetPixelColor(void *srcPtr, int format) col.a = 255; } break; - case UNCOMPRESSED_R5G5B5A1: + case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: { col.r = (unsigned char)((((unsigned short *)srcPtr)[0] >> 11)*255/31); col.g = (unsigned char)(((((unsigned short *)srcPtr)[0] >> 6) & 0b0000000000011111)*255/31); @@ -3665,7 +3784,7 @@ Color GetPixelColor(void *srcPtr, int format) col.a = (((unsigned short *)srcPtr)[0] & 0b0000000000000001)? 255 : 0; } break; - case UNCOMPRESSED_R4G4B4A4: + case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: { col.r = (unsigned char)((((unsigned short *)srcPtr)[0] >> 12)*255/15); col.g = (unsigned char)(((((unsigned short *)srcPtr)[0] >> 8) & 0b0000000000001111)*255/15); @@ -3673,11 +3792,11 @@ Color GetPixelColor(void *srcPtr, int format) col.a = (unsigned char)((((unsigned short *)srcPtr)[0] & 0b0000000000001111)*255/15); } break; - case UNCOMPRESSED_R8G8B8A8: col = (Color){ ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[1], ((unsigned char *)srcPtr)[2], ((unsigned char *)srcPtr)[3] }; break; - case UNCOMPRESSED_R8G8B8: col = (Color){ ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[1], ((unsigned char *)srcPtr)[2], 255 }; break; - // TODO: case UNCOMPRESSED_R32: break; - // TODO: case UNCOMPRESSED_R32G32B32: break; - // TODO: case UNCOMPRESSED_R32G32B32A32: break; + case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: col = (Color){ ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[1], ((unsigned char *)srcPtr)[2], ((unsigned char *)srcPtr)[3] }; break; + case PIXELFORMAT_UNCOMPRESSED_R8G8B8: col = (Color){ ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[1], ((unsigned char *)srcPtr)[2], 255 }; break; + // TODO: case PIXELFORMAT_UNCOMPRESSED_R32: break; + // TODO: case PIXELFORMAT_UNCOMPRESSED_R32G32B32: break; + // TODO: case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: break; default: break; } @@ -3689,7 +3808,7 @@ void SetPixelColor(void *dstPtr, Color color, int format) { switch (format) { - case UNCOMPRESSED_GRAYSCALE: + case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: { // NOTE: Calculate grayscale equivalent color Vector3 coln = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f }; @@ -3698,7 +3817,7 @@ void SetPixelColor(void *dstPtr, Color color, int format) ((unsigned char *)dstPtr)[0] = gray; } break; - case UNCOMPRESSED_GRAY_ALPHA: + case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: { // NOTE: Calculate grayscale equivalent color Vector3 coln = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f }; @@ -3708,7 +3827,7 @@ void SetPixelColor(void *dstPtr, Color color, int format) ((unsigned char *)dstPtr)[1] = color.a; } break; - case UNCOMPRESSED_R5G6B5: + case PIXELFORMAT_UNCOMPRESSED_R5G6B5: { // NOTE: Calculate R5G6B5 equivalent color Vector3 coln = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f }; @@ -3720,7 +3839,7 @@ void SetPixelColor(void *dstPtr, Color color, int format) ((unsigned short *)dstPtr)[0] = (unsigned short)r << 11 | (unsigned short)g << 5 | (unsigned short)b; } break; - case UNCOMPRESSED_R5G5B5A1: + case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: { // NOTE: Calculate R5G5B5A1 equivalent color Vector4 coln = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f, (float)color.a/255.0f }; @@ -3728,12 +3847,12 @@ void SetPixelColor(void *dstPtr, Color color, int format) unsigned char r = (unsigned char)(round(coln.x*31.0f)); unsigned char g = (unsigned char)(round(coln.y*31.0f)); unsigned char b = (unsigned char)(round(coln.z*31.0f)); - unsigned char a = (coln.w > ((float)UNCOMPRESSED_R5G5B5A1_ALPHA_THRESHOLD/255.0f))? 1 : 0;; + unsigned char a = (coln.w > ((float)PIXELFORMAT_UNCOMPRESSED_R5G5B5A1_ALPHA_THRESHOLD/255.0f))? 1 : 0;; ((unsigned short *)dstPtr)[0] = (unsigned short)r << 11 | (unsigned short)g << 6 | (unsigned short)b << 1 | (unsigned short)a; } break; - case UNCOMPRESSED_R4G4B4A4: + case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: { // NOTE: Calculate R5G5B5A1 equivalent color Vector4 coln = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f, (float)color.a/255.0f }; @@ -3746,14 +3865,14 @@ void SetPixelColor(void *dstPtr, Color color, int format) ((unsigned short *)dstPtr)[0] = (unsigned short)r << 12 | (unsigned short)g << 8 | (unsigned short)b << 4 | (unsigned short)a; } break; - case UNCOMPRESSED_R8G8B8: + case PIXELFORMAT_UNCOMPRESSED_R8G8B8: { ((unsigned char *)dstPtr)[0] = color.r; ((unsigned char *)dstPtr)[1] = color.g; ((unsigned char *)dstPtr)[2] = color.b; } break; - case UNCOMPRESSED_R8G8B8A8: + case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: { ((unsigned char *)dstPtr)[0] = color.r; ((unsigned char *)dstPtr)[1] = color.g; @@ -3774,27 +3893,27 @@ int GetPixelDataSize(int width, int height, int format) switch (format) { - case UNCOMPRESSED_GRAYSCALE: bpp = 8; break; - case UNCOMPRESSED_GRAY_ALPHA: - case UNCOMPRESSED_R5G6B5: - case UNCOMPRESSED_R5G5B5A1: - case UNCOMPRESSED_R4G4B4A4: bpp = 16; break; - case UNCOMPRESSED_R8G8B8A8: bpp = 32; break; - case UNCOMPRESSED_R8G8B8: bpp = 24; break; - case UNCOMPRESSED_R32: bpp = 32; break; - case UNCOMPRESSED_R32G32B32: bpp = 32*3; break; - case UNCOMPRESSED_R32G32B32A32: bpp = 32*4; break; - case COMPRESSED_DXT1_RGB: - case COMPRESSED_DXT1_RGBA: - case COMPRESSED_ETC1_RGB: - case COMPRESSED_ETC2_RGB: - case COMPRESSED_PVRT_RGB: - case COMPRESSED_PVRT_RGBA: bpp = 4; break; - case COMPRESSED_DXT3_RGBA: - case COMPRESSED_DXT5_RGBA: - case COMPRESSED_ETC2_EAC_RGBA: - case COMPRESSED_ASTC_4x4_RGBA: bpp = 8; break; - case COMPRESSED_ASTC_8x8_RGBA: bpp = 2; break; + case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: bpp = 8; break; + case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: + case PIXELFORMAT_UNCOMPRESSED_R5G6B5: + case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: + case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: bpp = 16; break; + case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: bpp = 32; break; + case PIXELFORMAT_UNCOMPRESSED_R8G8B8: bpp = 24; break; + case PIXELFORMAT_UNCOMPRESSED_R32: bpp = 32; break; + case PIXELFORMAT_UNCOMPRESSED_R32G32B32: bpp = 32*3; break; + case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: bpp = 32*4; break; + case PIXELFORMAT_COMPRESSED_DXT1_RGB: + case PIXELFORMAT_COMPRESSED_DXT1_RGBA: + case PIXELFORMAT_COMPRESSED_ETC1_RGB: + case PIXELFORMAT_COMPRESSED_ETC2_RGB: + case PIXELFORMAT_COMPRESSED_PVRT_RGB: + case PIXELFORMAT_COMPRESSED_PVRT_RGBA: bpp = 4; break; + case PIXELFORMAT_COMPRESSED_DXT3_RGBA: + case PIXELFORMAT_COMPRESSED_DXT5_RGBA: + case PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA: + case PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA: bpp = 8; break; + case PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA: bpp = 2; break; default: break; } @@ -3804,8 +3923,8 @@ int GetPixelDataSize(int width, int height, int format) // if texture is smaller, minimum dataSize is 8 or 16 if ((width < 4) && (height < 4)) { - if ((format >= COMPRESSED_DXT1_RGB) && (format < COMPRESSED_DXT3_RGBA)) dataSize = 8; - else if ((format >= COMPRESSED_DXT3_RGBA) && (format < COMPRESSED_ASTC_8x8_RGBA)) dataSize = 16; + if ((format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) && (format < PIXELFORMAT_COMPRESSED_DXT3_RGBA)) dataSize = 8; + else if ((format >= PIXELFORMAT_COMPRESSED_DXT3_RGBA) && (format < PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA)) dataSize = 16; } return dataSize; @@ -3903,7 +4022,7 @@ static Image LoadDDS(const unsigned char *fileData, unsigned int fileSize) memcpy(image.data, fileDataPtr, dataSize); - image.format = UNCOMPRESSED_R5G6B5; + image.format = PIXELFORMAT_UNCOMPRESSED_R5G6B5; } else if (ddsHeader->ddspf.flags == 0x41) // with alpha channel { @@ -3924,7 +4043,7 @@ static Image LoadDDS(const unsigned char *fileData, unsigned int fileSize) ((unsigned short *)image.data)[i] += alpha; } - image.format = UNCOMPRESSED_R5G5B5A1; + image.format = PIXELFORMAT_UNCOMPRESSED_R5G5B5A1; } else if (ddsHeader->ddspf.aBitMask == 0xf000) // 4bit alpha { @@ -3943,7 +4062,7 @@ static Image LoadDDS(const unsigned char *fileData, unsigned int fileSize) ((unsigned short *)image.data)[i] += alpha; } - image.format = UNCOMPRESSED_R4G4B4A4; + image.format = PIXELFORMAT_UNCOMPRESSED_R4G4B4A4; } } } @@ -3954,7 +4073,7 @@ static Image LoadDDS(const unsigned char *fileData, unsigned int fileSize) memcpy(image.data, fileDataPtr, dataSize); - image.format = UNCOMPRESSED_R8G8B8; + image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8; } else if (ddsHeader->ddspf.flags == 0x41 && ddsHeader->ddspf.rgbBitCount == 32) // DDS_RGBA, no compressed { @@ -3975,7 +4094,7 @@ static Image LoadDDS(const unsigned char *fileData, unsigned int fileSize) ((unsigned char *)image.data)[i + 2] = blue; } - image.format = UNCOMPRESSED_R8G8B8A8; + image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; } else if (((ddsHeader->ddspf.flags == 0x04) || (ddsHeader->ddspf.flags == 0x05)) && (ddsHeader->ddspf.fourCC > 0)) // Compressed { @@ -3993,11 +4112,11 @@ static Image LoadDDS(const unsigned char *fileData, unsigned int fileSize) { case FOURCC_DXT1: { - if (ddsHeader->ddspf.flags == 0x04) image.format = COMPRESSED_DXT1_RGB; - else image.format = COMPRESSED_DXT1_RGBA; + if (ddsHeader->ddspf.flags == 0x04) image.format = PIXELFORMAT_COMPRESSED_DXT1_RGB; + else image.format = PIXELFORMAT_COMPRESSED_DXT1_RGBA; } break; - case FOURCC_DXT3: image.format = COMPRESSED_DXT3_RGBA; break; - case FOURCC_DXT5: image.format = COMPRESSED_DXT5_RGBA; break; + case FOURCC_DXT3: image.format = PIXELFORMAT_COMPRESSED_DXT3_RGBA; break; + case FOURCC_DXT5: image.format = PIXELFORMAT_COMPRESSED_DXT5_RGBA; break; default: break; } } @@ -4080,9 +4199,9 @@ static Image LoadPKM(const unsigned char *fileData, unsigned int fileSize) memcpy(image.data, fileDataPtr, dataSize); - if (pkmHeader->format == 0) image.format = COMPRESSED_ETC1_RGB; - else if (pkmHeader->format == 1) image.format = COMPRESSED_ETC2_RGB; - else if (pkmHeader->format == 3) image.format = COMPRESSED_ETC2_EAC_RGBA; + if (pkmHeader->format == 0) image.format = PIXELFORMAT_COMPRESSED_ETC1_RGB; + else if (pkmHeader->format == 1) image.format = PIXELFORMAT_COMPRESSED_ETC2_RGB; + else if (pkmHeader->format == 3) image.format = PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA; } } @@ -4163,9 +4282,9 @@ static Image LoadKTX(const unsigned char *fileData, unsigned int fileSize) memcpy(image.data, fileDataPtr, dataSize); - if (ktxHeader->glInternalFormat == 0x8D64) image.format = COMPRESSED_ETC1_RGB; - else if (ktxHeader->glInternalFormat == 0x9274) image.format = COMPRESSED_ETC2_RGB; - else if (ktxHeader->glInternalFormat == 0x9278) image.format = COMPRESSED_ETC2_EAC_RGBA; + if (ktxHeader->glInternalFormat == 0x8D64) image.format = PIXELFORMAT_COMPRESSED_ETC1_RGB; + else if (ktxHeader->glInternalFormat == 0x9274) image.format = PIXELFORMAT_COMPRESSED_ETC2_RGB; + else if (ktxHeader->glInternalFormat == 0x9278) image.format = PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA; } } @@ -4359,24 +4478,24 @@ static Image LoadPVR(const unsigned char *fileData, unsigned int fileSize) image.mipmaps = pvrHeader->numMipmaps; // Check data format - if (((pvrHeader->channels[0] == 'l') && (pvrHeader->channels[1] == 0)) && (pvrHeader->channelDepth[0] == 8)) image.format = UNCOMPRESSED_GRAYSCALE; - else if (((pvrHeader->channels[0] == 'l') && (pvrHeader->channels[1] == 'a')) && ((pvrHeader->channelDepth[0] == 8) && (pvrHeader->channelDepth[1] == 8))) image.format = UNCOMPRESSED_GRAY_ALPHA; + if (((pvrHeader->channels[0] == 'l') && (pvrHeader->channels[1] == 0)) && (pvrHeader->channelDepth[0] == 8)) image.format = PIXELFORMAT_UNCOMPRESSED_GRAYSCALE; + else if (((pvrHeader->channels[0] == 'l') && (pvrHeader->channels[1] == 'a')) && ((pvrHeader->channelDepth[0] == 8) && (pvrHeader->channelDepth[1] == 8))) image.format = PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA; else if ((pvrHeader->channels[0] == 'r') && (pvrHeader->channels[1] == 'g') && (pvrHeader->channels[2] == 'b')) { if (pvrHeader->channels[3] == 'a') { - if ((pvrHeader->channelDepth[0] == 5) && (pvrHeader->channelDepth[1] == 5) && (pvrHeader->channelDepth[2] == 5) && (pvrHeader->channelDepth[3] == 1)) image.format = UNCOMPRESSED_R5G5B5A1; - else if ((pvrHeader->channelDepth[0] == 4) && (pvrHeader->channelDepth[1] == 4) && (pvrHeader->channelDepth[2] == 4) && (pvrHeader->channelDepth[3] == 4)) image.format = UNCOMPRESSED_R4G4B4A4; - else if ((pvrHeader->channelDepth[0] == 8) && (pvrHeader->channelDepth[1] == 8) && (pvrHeader->channelDepth[2] == 8) && (pvrHeader->channelDepth[3] == 8)) image.format = UNCOMPRESSED_R8G8B8A8; + if ((pvrHeader->channelDepth[0] == 5) && (pvrHeader->channelDepth[1] == 5) && (pvrHeader->channelDepth[2] == 5) && (pvrHeader->channelDepth[3] == 1)) image.format = PIXELFORMAT_UNCOMPRESSED_R5G5B5A1; + else if ((pvrHeader->channelDepth[0] == 4) && (pvrHeader->channelDepth[1] == 4) && (pvrHeader->channelDepth[2] == 4) && (pvrHeader->channelDepth[3] == 4)) image.format = PIXELFORMAT_UNCOMPRESSED_R4G4B4A4; + else if ((pvrHeader->channelDepth[0] == 8) && (pvrHeader->channelDepth[1] == 8) && (pvrHeader->channelDepth[2] == 8) && (pvrHeader->channelDepth[3] == 8)) image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; } else if (pvrHeader->channels[3] == 0) { - if ((pvrHeader->channelDepth[0] == 5) && (pvrHeader->channelDepth[1] == 6) && (pvrHeader->channelDepth[2] == 5)) image.format = UNCOMPRESSED_R5G6B5; - else if ((pvrHeader->channelDepth[0] == 8) && (pvrHeader->channelDepth[1] == 8) && (pvrHeader->channelDepth[2] == 8)) image.format = UNCOMPRESSED_R8G8B8; + if ((pvrHeader->channelDepth[0] == 5) && (pvrHeader->channelDepth[1] == 6) && (pvrHeader->channelDepth[2] == 5)) image.format = PIXELFORMAT_UNCOMPRESSED_R5G6B5; + else if ((pvrHeader->channelDepth[0] == 8) && (pvrHeader->channelDepth[1] == 8) && (pvrHeader->channelDepth[2] == 8)) image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8; } } - else if (pvrHeader->channels[0] == 2) image.format = COMPRESSED_PVRT_RGB; - else if (pvrHeader->channels[0] == 3) image.format = COMPRESSED_PVRT_RGBA; + else if (pvrHeader->channels[0] == 2) image.format = PIXELFORMAT_COMPRESSED_PVRT_RGB; + else if (pvrHeader->channels[0] == 3) image.format = PIXELFORMAT_COMPRESSED_PVRT_RGBA; fileDataPtr += pvrHeader->metaDataSize; // Skip meta data header @@ -4384,15 +4503,15 @@ static Image LoadPVR(const unsigned char *fileData, unsigned int fileSize) int bpp = 0; switch (image.format) { - case UNCOMPRESSED_GRAYSCALE: bpp = 8; break; - case UNCOMPRESSED_GRAY_ALPHA: - case UNCOMPRESSED_R5G5B5A1: - case UNCOMPRESSED_R5G6B5: - case UNCOMPRESSED_R4G4B4A4: bpp = 16; break; - case UNCOMPRESSED_R8G8B8A8: bpp = 32; break; - case UNCOMPRESSED_R8G8B8: bpp = 24; break; - case COMPRESSED_PVRT_RGB: - case COMPRESSED_PVRT_RGBA: bpp = 4; break; + case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: bpp = 8; break; + case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: + case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: + case PIXELFORMAT_UNCOMPRESSED_R5G6B5: + case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: bpp = 16; break; + case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: bpp = 32; break; + case PIXELFORMAT_UNCOMPRESSED_R8G8B8: bpp = 24; break; + case PIXELFORMAT_COMPRESSED_PVRT_RGB: + case PIXELFORMAT_COMPRESSED_PVRT_RGBA: bpp = 4; break; default: break; } @@ -4471,8 +4590,8 @@ static Image LoadASTC(const unsigned char *fileData, unsigned int fileSize) memcpy(image.data, fileDataPtr, dataSize); - if (bpp == 8) image.format = COMPRESSED_ASTC_4x4_RGBA; - else if (bpp == 2) image.format = COMPRESSED_ASTC_8x8_RGBA; + if (bpp == 8) image.format = PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA; + else if (bpp == 2) image.format = PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA; } else TRACELOG(LOG_WARNING, "IMAGE: ASTC block size configuration not supported"); } diff --git a/src/utils.c b/src/utils.c index de3acac99..2d15bdb3b 100644 --- a/src/utils.c +++ b/src/utils.c @@ -46,7 +46,7 @@ #endif #include // Required for: exit() -#include // Required for: vprintf() +#include // Required for: FILE, fopen(), fseek(), ftell(), fread(), fwrite(), fprintf(), vprintf(), fclose() #include // Required for: va_list, va_start(), va_end() #include // Required for: strcpy(), strcat() @@ -63,11 +63,23 @@ //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- +static int logTypeLevel = LOG_INFO; // Minimum log type level + +static TraceLogCallback traceLog = NULL; // TraceLog callback function pointer +static LoadFileDataCallback loadFileData = NULL; // LoadFileData callback funtion pointer +static SaveFileDataCallback saveFileData = NULL; // SaveFileText callback funtion pointer +static LoadFileTextCallback loadFileText = NULL; // LoadFileText callback funtion pointer +static SaveFileTextCallback saveFileText = NULL; // SaveFileText callback funtion pointer + +//---------------------------------------------------------------------------------- +// Functions to set internal callbacks +//---------------------------------------------------------------------------------- +void SetTraceLogCallback(TraceLogCallback callback) { traceLog = callback; } // Set custom trace log +void SetLoadFileDataCallback(LoadFileDataCallback callback) { loadFileData = callback; } // Set custom file data loader +void SetSaveFileDataCallback(SaveFileDataCallback callback) { saveFileData = callback; } // Set custom file data saver +void SetLoadFileTextCallback(LoadFileTextCallback callback) { loadFileText = callback; } // Set custom file text loader +void SetSaveFileTextCallback(SaveFileTextCallback callback) { saveFileText = callback; } // Set custom file text saver -// Log types messages -static int logTypeLevel = LOG_INFO; // Minimum log type level -static int logTypeExit = LOG_ERROR; // Log type that exits -static TraceLogCallback logCallback = NULL; // Log callback function pointer #if defined(PLATFORM_ANDROID) static AAssetManager *assetManager = NULL; // Android assets manager pointer @@ -92,22 +104,7 @@ static int android_close(void *cookie); //---------------------------------------------------------------------------------- // Set the current threshold (minimum) log level -void SetTraceLogLevel(int logType) -{ - logTypeLevel = logType; -} - -// Set the exit threshold (minimum) log level -void SetTraceLogExit(int logType) -{ - logTypeExit = logType; -} - -// Set a trace log callback to enable custom logging -void SetTraceLogCallback(TraceLogCallback callback) -{ - logCallback = callback; -} +void SetTraceLogLevel(int logType) { logTypeLevel = logType; } // Show trace log messages (LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_DEBUG) void TraceLog(int logType, const char *text, ...) @@ -119,9 +116,9 @@ void TraceLog(int logType, const char *text, ...) va_list args; va_start(args, text); - if (logCallback) + if (traceLog) { - logCallback(logType, text, args); + traceLog(logType, text, args); va_end(args); return; } @@ -158,15 +155,24 @@ void TraceLog(int logType, const char *text, ...) va_end(args); - if (logType >= logTypeExit) exit(1); // If exit message, exit program + if (logType == LOG_FATAL) exit(EXIT_FAILURE); // If fatal logging, exit program #endif // SUPPORT_TRACELOG } // Internal memory allocator +// NOTE: Initializes to zero by default void *MemAlloc(int size) { - return RL_MALLOC(size); + void *ptr = RL_CALLOC(size, 1); + return ptr; +} + +// Internal memory reallocator +void *MemRealloc(void *ptr, int size) +{ + void *ret = RL_REALLOC(ptr, size); + return ret; } // Internal memory free @@ -183,6 +189,12 @@ unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead) if (fileName != NULL) { + if (loadFileData) + { + data = loadFileData(fileName, bytesRead); + return data; + } +#if defined(SUPPORT_STANDARD_FILEIO) FILE *file = fopen(fileName, "rb"); if (file != NULL) @@ -209,6 +221,9 @@ unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead) fclose(file); } else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to open file", fileName); +#else + TRACELOG(LOG_WARNING, "FILEIO: Standard file io not supported, use custom file callback"); +#endif } else TRACELOG(LOG_WARNING, "FILEIO: File name provided is not valid"); @@ -228,6 +243,11 @@ bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite) if (fileName != NULL) { + if (saveFileData) + { + return saveFileData(fileName, data, bytesToWrite); + } +#if defined(SUPPORT_STANDARD_FILEIO) FILE *file = fopen(fileName, "wb"); if (file != NULL) @@ -242,6 +262,9 @@ bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite) if (result == 0) success = true; } else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to open file", fileName); +#else + TRACELOG(LOG_WARNING, "FILEIO: Standard file io not supported, use custom file callback"); +#endif } else TRACELOG(LOG_WARNING, "FILEIO: File name provided is not valid"); @@ -256,21 +279,27 @@ char *LoadFileText(const char *fileName) if (fileName != NULL) { - FILE *textFile = fopen(fileName, "rt"); + if (loadFileText) + { + text = loadFileText(fileName); + return text; + } +#if defined(SUPPORT_STANDARD_FILEIO) + FILE *file = fopen(fileName, "rt"); - if (textFile != NULL) + if (file != NULL) { // WARNING: When reading a file as 'text' file, // text mode causes carriage return-linefeed translation... // ...but using fseek() should return correct byte-offset - fseek(textFile, 0, SEEK_END); - unsigned int size = (unsigned int)ftell(textFile); - fseek(textFile, 0, SEEK_SET); + fseek(file, 0, SEEK_END); + unsigned int size = (unsigned int)ftell(file); + fseek(file, 0, SEEK_SET); if (size > 0) { text = (char *)RL_MALLOC((size + 1)*sizeof(char)); - unsigned int count = (unsigned int)fread(text, sizeof(char), size, textFile); + unsigned int count = (unsigned int)fread(text, sizeof(char), size, file); // WARNING: \r\n is converted to \n on reading, so, // read bytes count gets reduced by the number of lines @@ -283,9 +312,12 @@ char *LoadFileText(const char *fileName) } else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to read text file", fileName); - fclose(textFile); + fclose(file); } else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to open text file", fileName); +#else + TRACELOG(LOG_WARNING, "FILEIO: Standard file io not supported, use custom file callback"); +#endif } else TRACELOG(LOG_WARNING, "FILEIO: File name provided is not valid"); @@ -293,7 +325,7 @@ char *LoadFileText(const char *fileName) } // Unload file text data allocated by LoadFileText() -void UnloadFileText(unsigned char *text) +void UnloadFileText(char *text) { RL_FREE(text); } @@ -305,6 +337,11 @@ bool SaveFileText(const char *fileName, char *text) if (fileName != NULL) { + if (saveFileText) + { + return saveFileText(fileName, text); + } +#if defined(SUPPORT_STANDARD_FILEIO) FILE *file = fopen(fileName, "wt"); if (file != NULL) @@ -318,6 +355,9 @@ bool SaveFileText(const char *fileName, char *text) if (result == 0) success = true; } else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to open text file", fileName); +#else + TRACELOG(LOG_WARNING, "FILEIO: Standard file io not supported, use custom file callback"); +#endif } else TRACELOG(LOG_WARNING, "FILEIO: File name provided is not valid"); @@ -332,11 +372,11 @@ void InitAssetManager(AAssetManager *manager, const char *dataPath) internalDataPath = dataPath; } -// Replacement for fopen +// Replacement for fopen() // Ref: https://developer.android.com/ndk/reference/group/asset FILE *android_fopen(const char *fileName, const char *mode) { - if (mode[0] == 'w') // TODO: Test! + if (mode[0] == 'w') { // TODO: fopen() is mapped to android_fopen() that only grants read access // to assets directory through AAssetManager but we want to also be able to @@ -353,7 +393,7 @@ FILE *android_fopen(const char *fileName, const char *mode) if (asset != NULL) { - // Return pointer to file in the assets + // Get pointer to file in the assets return funopen(asset, android_read, android_write, android_seek, android_close); } else diff --git a/src/uwp_events.h b/src/uwp_events.h index 2c403fd36..09f7a7f7f 100644 --- a/src/uwp_events.h +++ b/src/uwp_events.h @@ -5,7 +5,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2020-2020 Reece Mackie (@Rover656) +* Copyright (c) 2020-2021 Reece Mackie (@Rover656) * * 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. diff --git a/templates/advance_game/Makefile b/templates/advance_game/Makefile index 7097e2c2c..8e3eb3fb9 100644 --- a/templates/advance_game/Makefile +++ b/templates/advance_game/Makefile @@ -25,7 +25,7 @@ # Define required raylib variables PROJECT_NAME ?= advance_game -RAYLIB_VERSION ?= 3.5.0 +RAYLIB_VERSION ?= 3.7.0 RAYLIB_PATH ?= ../.. # Define default options @@ -177,17 +177,17 @@ ifeq ($(PLATFORM),PLATFORM_WEB) CC = emcc endif -# Define default make program: Mingw32-make -MAKE = mingw32-make +# Define default make program +MAKE = make ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),LINUX) - MAKE = make - endif - ifeq ($(PLATFORM_OS),OSX) - MAKE = make + ifeq ($(PLATFORM_OS),WINDOWS) + MAKE = mingw32-make endif endif +ifeq ($(PLATFORM),PLATFORM_ANDROID) + MAKE = mingw32-make +endif # Define compiler flags: # -O1 defines optimization level @@ -237,7 +237,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) # -O2 # optimization level 2, if used, also set --memory-init-file 0 # -s USE_GLFW=3 # Use glfw3 library (context/input management) # -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! - # -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) + # -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB) # -s USE_PTHREADS=1 # multithreading support # -s WASM=0 # disable Web Assembly, emitted by default # -s ASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS @@ -246,6 +246,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) # --profiling # include information for code profiling # --memory-init-file 0 # to avoid an external memory initialization code file (.mem) # --preload-file resources # specify a resources folder for data compilation + # --source-map-base # allow debugging in browser with source map CFLAGS += -s USE_GLFW=3 -s TOTAL_MEMORY=67108864 -s FORCE_FILESYSTEM=1 --preload-file resources # Define a custom shell .html and output extension @@ -274,9 +275,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) INCLUDE_PATHS += -I/usr/local/include endif ifeq ($(PLATFORM_OS),LINUX) - # Reset everything. - # Precedence: immediately local, installed version, raysan5 provided libs -I$(RAYLIB_H_INSTALL_PATH) -I$(RAYLIB_PATH)/release/include - INCLUDE_PATHS = -I$(RAYLIB_H_INSTALL_PATH) -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src/external + INCLUDE_PATHS = -I$(RAYLIB_H_INSTALL_PATH) -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external endif endif @@ -307,10 +306,6 @@ ifeq ($(PLATFORM),PLATFORM_RPI) LDFLAGS += -L/opt/vc/lib endif -ifeq ($(PLATFORM),PLATFORM_DRM) - LDFLAGS += -lGLESv2 -lEGL -ldrm -lgbm -endif - # Define any libraries required on linking # if you want to link libraries (libname.so or libname.a), use the -lname ifeq ($(PLATFORM),PLATFORM_DESKTOP) diff --git a/templates/advance_game/Makefile.Android b/templates/advance_game/Makefile.Android index afa3024ac..5d1373fb1 100644 --- a/templates/advance_game/Makefile.Android +++ b/templates/advance_game/Makefile.Android @@ -31,67 +31,60 @@ RAYLIB_PATH ?= ..\.. ANDROID_ARCH ?= ARM64 ANDROID_API_VERSION = 29 -# Android required path variables -# NOTE: Starting with Android NDK r21, no more toolchain generation is required, NDK is the toolchain on itself -ifeq ($(OS),Windows_NT) - ANDROID_NDK = C:/android-ndk - ANDROID_TOOLCHAIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/windows-x86_64 -else - ANDROID_NDK ?= /usr/lib/android/ndk - ANDROID_TOOLCHAIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64 -endif - ifeq ($(ANDROID_ARCH),ARM) - ANDROID_ARCH_NAME = armeabi-v7a + ANDROID_ARCH_NAME = armeabi-v7a endif ifeq ($(ANDROID_ARCH),ARM64) - ANDROID_ARCH_NAME = arm64-v8a + ANDROID_ARCH_NAME = arm64-v8a endif ifeq ($(ANDROID_ARCH),x86) - ANDROID_ARCH_NAME = i686 + ANDROID_ARCH_NAME = i686 endif ifeq ($(ANDROID_ARCH),x86_64) - ANDROID_ARCH_NAME = x86_64 + ANDROID_ARCH_NAME = x86_64 endif # Required path variables # NOTE: JAVA_HOME must be set to JDK (using OpenJDK 13) JAVA_HOME ?= C:/open-jdk -ANDROID_HOME = C:/android-sdk -ANDROID_TOOLCHAIN = C:/android-ndk/toolchains/llvm/prebuilt/windows-x86_64 -ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/29.0.3 +ANDROID_HOME ?= C:/android-sdk +ANDROID_NDK ?= C:/android-ndk +ANDROID_TOOLCHAIN ?= $(ANDROID_NDK)/toolchains/llvm/prebuilt/windows-x86_64 +ANDROID_BUILD_TOOLS ?= $(ANDROID_HOME)/build-tools/29.0.3 ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools # Android project configuration variables PROJECT_NAME ?= raylib_game PROJECT_LIBRARY_NAME ?= main -PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME) +PROJECT_BUILD_ID ?= android +PROJECT_BUILD_PATH ?= $(PROJECT_BUILD_ID).$(PROJECT_NAME) PROJECT_RESOURCES_PATH ?= resources -PROJECT_SOURCE_FILES ?= raylib_game.c +PROJECT_SOURCE_FILES ?= simple_game.c +NATIVE_APP_GLUE_PATH = $(ANDROID_NDK)/sources/android/native_app_glue # Some source files are placed in directories, when compiling to some # output directory other than source, that directory must pre-exist. # Here we get a list of required folders that need to be created on # code output folder $(PROJECT_BUILD_PATH)\obj to avoid GCC errors. -PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES))) +PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES))) # Android app configuration variables -APP_LABEL_NAME ?= rGame -APP_COMPANY_NAME ?= raylib -APP_PRODUCT_NAME ?= rgame -APP_VERSION_CODE ?= 1 -APP_VERSION_NAME ?= 1.0 -APP_ICON_LDPI ?= $(RAYLIB_PATH)\logo\raylib_36x36.png -APP_ICON_MDPI ?= $(RAYLIB_PATH)\logo\raylib_48x48.png -APP_ICON_HDPI ?= $(RAYLIB_PATH)\logo\raylib_72x72.png +APP_LABEL_NAME ?= rGame +APP_COMPANY_NAME ?= raylib +APP_PRODUCT_NAME ?= rgame +APP_VERSION_CODE ?= 1 +APP_VERSION_NAME ?= 1.0 +APP_ICON_LDPI ?= $(RAYLIB_PATH)\logo\raylib_36x36.png +APP_ICON_MDPI ?= $(RAYLIB_PATH)\logo\raylib_48x48.png +APP_ICON_HDPI ?= $(RAYLIB_PATH)\logo\raylib_72x72.png APP_SCREEN_ORIENTATION ?= landscape -APP_KEYSTORE_PASS ?= raylib +APP_KEYSTORE_PASS ?= raylib # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) -RAYLIB_LIBTYPE ?= STATIC +RAYLIB_LIBTYPE ?= STATIC # Library path for libraylib.a/libraylib.so -RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src +RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src # Shared libs must be added to APK if required # NOTE: Generated NativeLoader.java automatically load those libraries @@ -108,6 +101,14 @@ ifeq ($(ANDROID_ARCH),ARM64) CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android$(ANDROID_API_VERSION)-clang AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar endif +ifeq ($(ANDROID_ARCH),x86) + CC = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android$(ANDROID_API_VERSION)-clang + AR = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android-ar +endif +ifeq ($(ANDROID_ARCH),x86_64) + CC = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android$(ANDROID_API_VERSION)-clang + AR = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android-ar +endif # Compiler flags for arquitecture ifeq ($(ANDROID_ARCH),ARM) @@ -124,7 +125,7 @@ CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION) # Paths containing required header files -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(NATIVE_APP_GLUE_PATH) # Linker options LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a @@ -154,8 +155,8 @@ all: create_temp_project_dirs \ compile_project_class \ compile_project_class_dex \ create_project_apk_package \ - sign_project_apk_package \ - zipalign_project_apk_package + zipalign_project_apk_package \ + sign_project_apk_package # Create required temp directories for APK building create_temp_project_dirs: @@ -253,7 +254,7 @@ config_project_package: # Compile native_app_glue code as static library: obj/libnative_app_glue.a compile_native_app_glue: - $(CC) -c $(RAYLIB_PATH)/src/external/android/native_app_glue/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS) + $(CC) -c $(NATIVE_APP_GLUE_PATH)/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS) $(AR) rcs $(PROJECT_BUILD_PATH)/obj/libnative_app_glue.a $(PROJECT_BUILD_PATH)/obj/native_app_glue.o # Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so diff --git a/templates/advance_game/advance_game.c b/templates/advance_game/advance_game.c index 45ad0897d..68d31b6ab 100644 --- a/templates/advance_game/advance_game.c +++ b/templates/advance_game/advance_game.c @@ -75,7 +75,7 @@ int main(void) InitLogoScreen(); #if defined(PLATFORM_WEB) - emscripten_set_main_loop(UpdateDrawFrame, 0, 1); + emscripten_set_main_loop(UpdateDrawFrame, 60, 1); #else SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- diff --git a/templates/simple_game/Makefile b/templates/simple_game/Makefile index e612ee403..cf5944aa4 100644 --- a/templates/simple_game/Makefile +++ b/templates/simple_game/Makefile @@ -25,7 +25,7 @@ # Define required raylib variables PROJECT_NAME ?= simple_game -RAYLIB_VERSION ?= 3.5.0 +RAYLIB_VERSION ?= 3.7.0 RAYLIB_PATH ?= ../.. # Define default options @@ -186,17 +186,17 @@ ifeq ($(PLATFORM),PLATFORM_WEB) CC = emcc endif -# Define default make program: Mingw32-make -MAKE = mingw32-make +# Define default make program +MAKE = make ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),LINUX) - MAKE = make - endif - ifeq ($(PLATFORM_OS),OSX) - MAKE = make + ifeq ($(PLATFORM_OS),WINDOWS) + MAKE = mingw32-make endif endif +ifeq ($(PLATFORM),PLATFORM_ANDROID) + MAKE = mingw32-make +endif # Define compiler flags: # -O1 defines optimization level @@ -246,7 +246,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) # -O2 # optimization level 2, if used, also set --memory-init-file 0 # -s USE_GLFW=3 # Use glfw3 library (context/input management) # -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! - # -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) + # -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB) # -s USE_PTHREADS=1 # multithreading support # -s WASM=0 # disable Web Assembly, emitted by default # -s ASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS @@ -290,7 +290,6 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),LINUX) # Reset everything. # Precedence: immediately local, installed version, raysan5 provided libs -I$(RAYLIB_H_INSTALL_PATH) -I$(RAYLIB_PATH)/release/include - #INCLUDE_PATHS = -I$(RAYLIB_H_INSTALL_PATH) -isystem. -isystem$(RAYLIB_PATH)/src -isystem$(RAYLIB_PATH)/release/include -isystem$(RAYLIB_PATH)/src/external INCLUDE_PATHS = -I$(RAYLIB_H_INSTALL_PATH) -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src/external endif endif @@ -399,11 +398,9 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) MAKEFILE_PARAMS = -f Makefile.Android # For Linux and macOS set make and makefile ifeq ($(PLATFORM_OS),LINUX) - MAKE = make MAKEFILE_PARAMS = -f Makefile.Android.linux endif ifeq ($(PLATFORM_OS),OSX) - MAKE = make MAKEFILE_PARAMS = -f Makefile.Android.macos endif export PROJECT_NAME diff --git a/templates/simple_game/Makefile.Android b/templates/simple_game/Makefile.Android index afa3024ac..4cfd1f5f0 100644 --- a/templates/simple_game/Makefile.Android +++ b/templates/simple_game/Makefile.Android @@ -31,67 +31,60 @@ RAYLIB_PATH ?= ..\.. ANDROID_ARCH ?= ARM64 ANDROID_API_VERSION = 29 -# Android required path variables -# NOTE: Starting with Android NDK r21, no more toolchain generation is required, NDK is the toolchain on itself -ifeq ($(OS),Windows_NT) - ANDROID_NDK = C:/android-ndk - ANDROID_TOOLCHAIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/windows-x86_64 -else - ANDROID_NDK ?= /usr/lib/android/ndk - ANDROID_TOOLCHAIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64 -endif - ifeq ($(ANDROID_ARCH),ARM) - ANDROID_ARCH_NAME = armeabi-v7a + ANDROID_ARCH_NAME = armeabi-v7a endif ifeq ($(ANDROID_ARCH),ARM64) - ANDROID_ARCH_NAME = arm64-v8a + ANDROID_ARCH_NAME = arm64-v8a endif ifeq ($(ANDROID_ARCH),x86) - ANDROID_ARCH_NAME = i686 + ANDROID_ARCH_NAME = i686 endif ifeq ($(ANDROID_ARCH),x86_64) - ANDROID_ARCH_NAME = x86_64 + ANDROID_ARCH_NAME = x86_64 endif # Required path variables # NOTE: JAVA_HOME must be set to JDK (using OpenJDK 13) JAVA_HOME ?= C:/open-jdk -ANDROID_HOME = C:/android-sdk -ANDROID_TOOLCHAIN = C:/android-ndk/toolchains/llvm/prebuilt/windows-x86_64 -ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/29.0.3 +ANDROID_HOME ?= C:/android-sdk +ANDROID_NDK ?= C:/android-ndk +ANDROID_TOOLCHAIN ?= $(ANDROID_NDK)/toolchains/llvm/prebuilt/windows-x86_64 +ANDROID_BUILD_TOOLS ?= $(ANDROID_HOME)/build-tools/29.0.3 ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools # Android project configuration variables PROJECT_NAME ?= raylib_game PROJECT_LIBRARY_NAME ?= main -PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME) +PROJECT_BUILD_ID ?= android +PROJECT_BUILD_PATH ?= $(PROJECT_BUILD_ID).$(PROJECT_NAME) PROJECT_RESOURCES_PATH ?= resources PROJECT_SOURCE_FILES ?= raylib_game.c +NATIVE_APP_GLUE_PATH = $(ANDROID_NDK)/sources/android/native_app_glue # Some source files are placed in directories, when compiling to some # output directory other than source, that directory must pre-exist. # Here we get a list of required folders that need to be created on # code output folder $(PROJECT_BUILD_PATH)\obj to avoid GCC errors. -PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES))) +PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES))) # Android app configuration variables -APP_LABEL_NAME ?= rGame -APP_COMPANY_NAME ?= raylib -APP_PRODUCT_NAME ?= rgame -APP_VERSION_CODE ?= 1 -APP_VERSION_NAME ?= 1.0 -APP_ICON_LDPI ?= $(RAYLIB_PATH)\logo\raylib_36x36.png -APP_ICON_MDPI ?= $(RAYLIB_PATH)\logo\raylib_48x48.png -APP_ICON_HDPI ?= $(RAYLIB_PATH)\logo\raylib_72x72.png +APP_LABEL_NAME ?= rGame +APP_COMPANY_NAME ?= raylib +APP_PRODUCT_NAME ?= rgame +APP_VERSION_CODE ?= 1 +APP_VERSION_NAME ?= 1.0 +APP_ICON_LDPI ?= $(RAYLIB_PATH)\logo\raylib_36x36.png +APP_ICON_MDPI ?= $(RAYLIB_PATH)\logo\raylib_48x48.png +APP_ICON_HDPI ?= $(RAYLIB_PATH)\logo\raylib_72x72.png APP_SCREEN_ORIENTATION ?= landscape -APP_KEYSTORE_PASS ?= raylib +APP_KEYSTORE_PASS ?= raylib # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) -RAYLIB_LIBTYPE ?= STATIC +RAYLIB_LIBTYPE ?= STATIC # Library path for libraylib.a/libraylib.so -RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src +RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src # Shared libs must be added to APK if required # NOTE: Generated NativeLoader.java automatically load those libraries @@ -108,6 +101,14 @@ ifeq ($(ANDROID_ARCH),ARM64) CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android$(ANDROID_API_VERSION)-clang AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar endif +ifeq ($(ANDROID_ARCH),x86) + CC = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android$(ANDROID_API_VERSION)-clang + AR = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android-ar +endif +ifeq ($(ANDROID_ARCH),x86_64) + CC = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android$(ANDROID_API_VERSION)-clang + AR = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android-ar +endif # Compiler flags for arquitecture ifeq ($(ANDROID_ARCH),ARM) @@ -124,7 +125,7 @@ CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION) # Paths containing required header files -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(NATIVE_APP_GLUE_PATH) # Linker options LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a @@ -154,8 +155,8 @@ all: create_temp_project_dirs \ compile_project_class \ compile_project_class_dex \ create_project_apk_package \ - sign_project_apk_package \ - zipalign_project_apk_package + zipalign_project_apk_package \ + sign_project_apk_package # Create required temp directories for APK building create_temp_project_dirs: @@ -253,7 +254,7 @@ config_project_package: # Compile native_app_glue code as static library: obj/libnative_app_glue.a compile_native_app_glue: - $(CC) -c $(RAYLIB_PATH)/src/external/android/native_app_glue/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS) + $(CC) -c $(NATIVE_APP_GLUE_PATH)/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS) $(AR) rcs $(PROJECT_BUILD_PATH)/obj/libnative_app_glue.a $(PROJECT_BUILD_PATH)/obj/native_app_glue.o # Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so diff --git a/templates/simple_game/Makefile.Android.linux b/templates/simple_game/Makefile.Android.linux index 1fbdc3146..ed9117f29 100644 --- a/templates/simple_game/Makefile.Android.linux +++ b/templates/simple_game/Makefile.Android.linux @@ -2,7 +2,10 @@ # # raylib makefile for Android project (APK building) # -# Copyright (c) 2017 Ramon Santamaria (@raysan5) +# NOTE: Ported by Jean-Sébastien Lebarbier (@jseb) to *nix platform. +# For comments, you can contact me: raylib(at)finiderire.com +# +# Copyright (c) 2017-2021 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. @@ -21,9 +24,6 @@ # #************************************************************************************************** -# Note : ported by Jean-Sébastien Lebarbier (@jseb) to *nix by using the Ramon Santamaria ms-windows version. -# For comments, you can contact me : raylib(at)finiderire.com - # debug : adb logcat *:W | grep -i raylib # Define required raylib variables @@ -31,54 +31,53 @@ PLATFORM ?= PLATFORM_ANDROID RAYLIB_PATH ?= ../../ # Define Android architecture (armeabi-v7a, arm64-v8a, x86, x86-64) and API version +# Starting in 2019 using ARM64 is mandatory for published apps, +# Starting on August 2020, minimum required target API is Android 10 (API level 29) ANDROID_ARCH ?= ARM64 ifeq ($(ANDROID_ARCH),ARM) ANDROID_ARCH_NAME = armeabi-v7a - # [JSEB] i have added ANDROID_TOOLCHAIN_LIBS for linking + # @jseb: Added ANDROID_TOOLCHAIN_LIBS for linking ANDROID_TOOLCHAIN_LIBS = arm-linux-androideabi endif ifeq ($(ANDROID_ARCH),ARM64) ANDROID_ARCH_NAME = arm64-v8a - # [JSEB] i have added ANDROID_TOOLCHAIN_LIBS for linking + # @jseb: Added ANDROID_TOOLCHAIN_LIBS for linking ANDROID_TOOLCHAIN_LIBS = aarch64-linux-android endif # Required path variables -# no need to define JAVA_HOME , JAVA_BIN in linux environment (binaries are in $PATH) +# NOTE: No need to define JAVA_HOME, JAVA_BIN in linux environment (binaries are in $PATH) #JAVA_HOME ?= C:/JavaJDK/ -#JAVA_BIN ?= $(JAVA_HOME)/bin/ +#JAVA_BIN ?= $(JAVA_HOME)/bin/ ANDROID_HOME ?= /opt/android-sdk -#ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION) -ANDROID_TOOLCHAIN ?= /opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/ +ANDROID_NDK ?= /opt/android-ndk +ANDROID_TOOLCHAIN ?= $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/ -# find the highest version available of build tools +# Find the highest version available of build tools ANDROID_BUILD_TOOLS = $(shell ls -1d $(ANDROID_HOME)/build-tools/* | tail -n 1)/ # and extracts the API version ANDROID_API_VERSION = $(shell echo $(ANDROID_BUILD_TOOLS) | sed 's/.*\/\([0-9]\+\).*/\1/') + $(warning [*] Using $(ANDROID_BUILD_TOOLS) , API version: $(ANDROID_API_VERSION)) # ANDROID_PLATFORM_TOOLS should be in $PATH too with linux (see /etc/profile.d/android* ) -# but anyway, let's define it here ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools - - - # Android project configuration variables PROJECT_NAME ?= raylib_game PROJECT_LIBRARY_NAME ?= main -PROJECT_BUILD_ID ?= android +PROJECT_BUILD_ID ?= android PROJECT_BUILD_PATH ?= $(PROJECT_BUILD_ID).$(PROJECT_NAME) PROJECT_RESOURCES_PATH ?= resources PROJECT_SOURCE_FILES ?= simple_game.c +NATIVE_APP_GLUE_PATH = $(ANDROID_NDK)/sources/android/native_app_glue # Some source files are placed in directories, when compiling to some # output directory other than source, that directory must pre-exist. # Here we get a list of required folders that need to be created on # code output folder $(PROJECT_BUILD_PATH)\obj to avoid GCC errors. -#PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES))) PROJECT_SOURCE_DIRS = $(dir $(PROJECT_SOURCE_FILES)) # Android app configuration variables @@ -107,19 +106,25 @@ endif # Compiler and archiver ifeq ($(ANDROID_ARCH),ARM) - CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-clang - AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar + CC = $(ANDROID_TOOLCHAIN)/bin/armv7a-linux-androideabi$(ANDROID_API_VERSION)-clang + AR = $(ANDROID_TOOLCHAIN)/bin/armv7a-linux-androideabi-ar endif ifeq ($(ANDROID_ARCH),ARM64) - #CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang - #AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android$(ANDROID_API_VERSION)-clang AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar endif +ifeq ($(ANDROID_ARCH),x86) + CC = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android$(ANDROID_API_VERSION)-clang + AR = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android-ar +endif +ifeq ($(ANDROID_ARCH),x86_64) + CC = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android$(ANDROID_API_VERSION)-clang + AR = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android-ar +endif # Compiler flags for arquitecture ifeq ($(ANDROID_ARCH),ARM) - CFLAGS = -std=c99 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 + CFLAGS = -std=c99 -march=armv7a -mfloat-abi=softfp -mfpu=vfpv3-d16 endif ifeq ($(ANDROID_ARCH),ARM64) CFLAGS = -std=c99 -target aarch64 -mfix-cortex-a53-835769 @@ -132,7 +137,7 @@ CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION) # Paths containing required header files -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(NATIVE_APP_GLUE_PATH) # Linker options LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a @@ -162,8 +167,8 @@ all: create_temp_project_dirs \ compile_project_class \ compile_project_class_dex \ create_project_apk_package \ - sign_project_apk_package \ - zipalign_project_apk_package + zipalign_project_apk_package \ + sign_project_apk_package # Create required temp directories for APK building create_temp_project_dirs: @@ -175,47 +180,20 @@ create_temp_project_dirs: mkdir -p $(PROJECT_BUILD_PATH)/obj/screens; \ mkdir -p $(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME); \ mkdir -p $(PROJECT_BUILD_PATH)/bin; \ - mkdir -p $(PROJECT_BUILD_PATH)/res/drawable-{l,m,h}dpi; \ + mkdir -p $(PROJECT_BUILD_PATH)/res/drawable-ldpi; \ + mkdir -p $(PROJECT_BUILD_PATH)/res/drawable-mdpi; \ + mkdir -p $(PROJECT_BUILD_PATH)/res/drawable-hdpi; \ mkdir -p $(PROJECT_BUILD_PATH)/res/values; \ mkdir -p $(PROJECT_BUILD_PATH)/assets/$(PROJECT_RESOURCES_PATH); \ $(foreach dir, $(PROJECT_SOURCE_DIRS), mkdir -p $(PROJECT_BUILD_PATH)/obj/$(dir) ); \ fi - -# if not exist $(PROJECT_BUILD_PATH) mkdir $(PROJECT_BUILD_PATH) -# if not exist $(PROJECT_BUILD_PATH)\obj mkdir $(PROJECT_BUILD_PATH)\obj -# if not exist $(PROJECT_BUILD_PATH)\src mkdir $(PROJECT_BUILD_PATH)\src -# if not exist $(PROJECT_BUILD_PATH)\src\com mkdir $(PROJECT_BUILD_PATH)\src\com -# if not exist $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME) mkdir $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME) -# if not exist $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)\$(APP_PRODUCT_NAME) mkdir $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)\$(APP_PRODUCT_NAME) -# if not exist $(PROJECT_BUILD_PATH)\lib mkdir $(PROJECT_BUILD_PATH)\lib -# if not exist $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME) mkdir $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME) -# if not exist $(PROJECT_BUILD_PATH)\bin mkdir $(PROJECT_BUILD_PATH)\bin -# if not exist $(PROJECT_BUILD_PATH)\res mkdir $(PROJECT_BUILD_PATH)\res -# if not exist $(PROJECT_BUILD_PATH)\res\drawable-ldpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-ldpi -# if not exist $(PROJECT_BUILD_PATH)\res\drawable-mdpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-mdpi -# if not exist $(PROJECT_BUILD_PATH)\res\drawable-hdpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-hdpi -# if not exist $(PROJECT_BUILD_PATH)\res\values mkdir $(PROJECT_BUILD_PATH)\res\values -# if not exist $(PROJECT_BUILD_PATH)\assets mkdir $(PROJECT_BUILD_PATH)\assets -# if not exist $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) mkdir $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) -# if not exist $(PROJECT_BUILD_PATH)\obj\screens mkdir $(PROJECT_BUILD_PATH)\obj\screens -# $(foreach dir, $(PROJECT_SOURCE_DIRS), $(call create_dir, $(dir))) - -#define create_dir -# if not exist $(PROJECT_BUILD_PATH)\obj\$(1) mkdir $(PROJECT_BUILD_PATH)\obj\$(1) -#endef # Copy required shared libs for integration into APK # NOTE: If using shared libs they are loaded by generated NativeLoader.java # -# FIXME really necessary to copy libraylib.a , which will be put into exe at link step ? +# FIXME! Really required to copy libraylib.a, which will be put into exe at link step? copy_project_required_libs: cp $(RAYLIB_LIB_PATH)/libraylib.* $(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME) -#ifeq ($(RAYLIB_LIBTYPE),SHARED) -# copy /Y $(RAYLIB_LIB_PATH)\libraylib.so $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.so -#endif -#ifeq ($(RAYLIB_LIBTYPE),STATIC) -# copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.a -#endif # Copy project required resources: strings.xml, icon.png, assets # NOTE: Required strings.xml is generated and game resources are copied to assets folder @@ -223,24 +201,18 @@ copy_project_resources: cp $(APP_ICON_LDPI) $(PROJECT_BUILD_PATH)/res/drawable-ldpi/icon.png cp $(APP_ICON_MDPI) $(PROJECT_BUILD_PATH)/res/drawable-mdpi/icon.png cp $(APP_ICON_HDPI) $(PROJECT_BUILD_PATH)/res/drawable-hdpi/icon.png - @echo -e "\n\ + @printf "\n\ \n\ \n\ $(APP_LABEL_NAME)\n\ \n\ " > $(PROJECT_BUILD_PATH)/res/values/strings.xml -# copy $(APP_ICON_LDPI) $(PROJECT_BUILD_PATH)\res\drawable-ldpi\icon.png /Y -# copy $(APP_ICON_MDPI) $(PROJECT_BUILD_PATH)\res\drawable-mdpi\icon.png /Y -# copy $(APP_ICON_HDPI) $(PROJECT_BUILD_PATH)\res\drawable-hdpi\icon.png /Y -# @echo ^ > $(PROJECT_BUILD_PATH)/res/values/strings.xml -# @echo ^^$(APP_LABEL_NAME)^^ >> $(PROJECT_BUILD_PATH)/res/values/strings.xml @if [ -d $(PROJECT_RESOURCES_PATH) ]; then \ cp -a $(PROJECT_RESOURCES_PATH) $(PROJECT_BUILD_PATH)/assets/; \ - else \ + else \ echo " [*] Project resources path not found: $(PROJECT_RESOURCES_PATH)"; \ - fi + fi -# if exist $(PROJECT_RESOURCES_PATH) C:\Windows\System32\xcopy $(PROJECT_RESOURCES_PATH) $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) /Y /E /F # Generate NativeLoader.java to load required shared libraries @@ -251,28 +223,20 @@ else nativeloader_sharedlib= endif generate_loader_script: - @echo -e "package com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME);\n\n\ + @printf "package com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME);\n\n\ public class NativeLoader extends android.app.NativeActivity {\n\ static {\n\ $(nativeloader_sharedlib);\n\ System.loadLibrary(\"$(PROJECT_LIBRARY_NAME)\");\n\ }\n\ }\n" > $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java -# @echo package com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME); > $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java -# @echo. >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java -# @echo public class NativeLoader extends android.app.NativeActivity { >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java -# @echo static { >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java -# @echo System.loadLibrary("$(PROJECT_LIBRARY_NAME)"); >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java -# @echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java -# @echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java - # Generate AndroidManifest.xml with all the required options # NOTE: Probably not the bet way to generate this file... but it works. -# TODO jseb : replacing @drawable/icon with @mipmap/icon ? +# TODO @jseb: Replace @drawable/icon with @mipmap/icon? # https://stackoverflow.com/questions/23796414/error-no-resource-found-that-matches-the-given-name-at-icon-with-value-dr generate_android_manifest: - @echo -e "\n\ + @printf "\n\ \n\ @@ -293,41 +257,19 @@ generate_android_manifest: \n\ " > $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo ^ > $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo ^> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo package="com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME)" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo android:versionCode="$(APP_VERSION_CODE)" android:versionName="$(APP_VERSION_NAME)" ^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo ^> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo android:configChanges="orientation|keyboardHidden|screenSize" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo android:screenOrientation="$(APP_SCREEN_ORIENTATION)" android:launchMode="singleTask" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo android:clearTaskOnLaunch="true"^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml -# @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - # Generate storekey for APK signing: $(PROJECT_NAME).keystore # NOTE: Configure here your Distinguished Names (-dname) if required! generate_apk_keystore: -# if not exist $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore $(JAVA_BIN)keytool -genkeypair -validity 1000 -dname "CN=$(APP_COMPANY_NAME),O=Android,C=ES" -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -alias $(PROJECT_NAME)Key -keyalg RSA -# infos sur keytools ici: https://coderwall.com/p/r09hoq/android-generate-release-debug-keystores -# keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 +# NOTE: https://coderwall.com/p/r09hoq/android-generate-release-debug-keystores +# keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 @if [ -s $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore ]; then \ echo " [*] $(PROJECT_NAME).keystore already exists."; \ - else \ + else \ echo " [*] $(PROJECT_NAME).keystore : generating now."; \ $(JAVA_BIN)keytool -genkeypair -validity 1000 -dname "CN=$(APP_COMPANY_NAME),O=Android,C=ES" -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -alias $(PROJECT_NAME)Key -keyalg RSA; \ - fi + fi # Config project package and resource using AndroidManifest.xml and res/values/strings.xml # NOTE: Generates resources file: src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java @@ -336,7 +278,7 @@ config_project_package: # Compile native_app_glue code as static library: obj/libnative_app_glue.a compile_native_app_glue: - $(CC) -c $(RAYLIB_PATH)/src/external/android/native_app_glue/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS) + $(CC) -c $(NATIVE_APP_GLUE_PATH)/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS) $(AR) rcs $(PROJECT_BUILD_PATH)/obj/libnative_app_glue.a $(PROJECT_BUILD_PATH)/obj/native_app_glue.o # Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so @@ -349,7 +291,6 @@ $(PROJECT_BUILD_PATH)/obj/%.o:%.c $(CC) -c $^ -o $@ $(INCLUDE_PATHS) $(CFLAGS) --sysroot=$(ANDROID_TOOLCHAIN)/sysroot # Compile project .java code into .class (Java bytecode) -# pour Unix, le séparateur pour les chemins indiqués dans -cp (-classpath) est ':' (pour windows: ';') compile_project_class: $(JAVA_BIN)javac -verbose -source 1.7 -target 1.7 -d $(PROJECT_BUILD_PATH)/obj -bootclasspath $(JAVA_HOME)/jre/lib/rt.jar -classpath $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar:$(PROJECT_BUILD_PATH)/obj -sourcepath $(PROJECT_BUILD_PATH)/src $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java @@ -369,11 +310,13 @@ create_project_apk_package: sign_project_apk_package: #keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 - $(JAVA_BIN)jarsigner -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -signedjar $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).signed.apk $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).unsigned.apk $(PROJECT_NAME)Key + $(ANDROID_BUILD_TOOLS)/apksigner sign --ks $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore --ks-pass pass:$(APP_KEYSTORE_PASS) --out $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).signed.apk $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).zipaligned.apk + rm $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).zipaligned.apk # Create zip-aligned APK package: $(PROJECT_NAME).apk zipalign_project_apk_package: - $(ANDROID_BUILD_TOOLS)/zipalign -f 4 $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).signed.apk $(PROJECT_NAME).apk + $(ANDROID_BUILD_TOOLS)/zipalign -f 4 $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).unsigned.apk $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).zipaligned.apk + rm $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).unsigned.apk # Install $(PROJECT_NAME).apk to default emulator/device # NOTE: Use -e (emulator) or -d (device) parameters if required @@ -397,7 +340,7 @@ deploy: #$(ANDROID_PLATFORM_TOOLS)/adb logcat *:W -# [JSEB] Clean everything, but avoid accidental removing of root dir, or $HOME, or whatever important +# @jseb: Clean everything, but avoid accidental removing of root dir, or $HOME, or whatever important clean: @if [ "$(shell echo $(PROJECT_BUILD_PATH) | grep "$(PROJECT_BUILD_ID)")" != "" ]; then \ rm -rf $(PROJECT_BUILD_PATH); \ diff --git a/templates/simple_game/Makefile.Android.macos b/templates/simple_game/Makefile.Android.macos index 77ac4778a..16f65c1d3 100644 --- a/templates/simple_game/Makefile.Android.macos +++ b/templates/simple_game/Makefile.Android.macos @@ -73,7 +73,7 @@ APP_KEYSTORE_PASS ?= raylib RAYLIB_LIBTYPE ?= STATIC # Library path for libraylib.a/libraylib.so -RAYLIB_LIB_PATH = $(RAYLIB_PATH)/src +RAYLIB_LIB_PATH = $(RAYLIB_PATH)/src/ # Shared libs must be added to APK if required # NOTE: Generated NativeLoader.java automatically load those libraries @@ -82,20 +82,26 @@ ifeq ($(RAYLIB_LIBTYPE),SHARED) endif # Compiler and archiver -# NOTE: GCC is being deprecated in Android NDK r16 -# NOTE: For some old androild device, maybe you should the CC to arm-linux-androideabi-clang ifeq ($(ANDROID_ARCH),ARM) - CC = $(ANDROID_TOOLCHAIN)/bin/armv7a-linux-androideabi29-clang - AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar + CC = $(ANDROID_TOOLCHAIN)/bin/armv7a-linux-androideabi$(ANDROID_API_VERSION)-clang + AR = $(ANDROID_TOOLCHAIN)/bin/armv7a-linux-androideabi-ar endif ifeq ($(ANDROID_ARCH),ARM64) - CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang + CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android$(ANDROID_API_VERSION)-clang AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar endif +ifeq ($(ANDROID_ARCH),x86) + CC = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android$(ANDROID_API_VERSION)-clang + AR = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android-ar +endif +ifeq ($(ANDROID_ARCH),x86_64) + CC = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android$(ANDROID_API_VERSION)-clang + AR = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android-ar +endif # Compiler flags for arquitecture ifeq ($(ANDROID_ARCH),ARM) - CFLAGS = -std=c99 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 + CFLAGS = -std=c99 -march=armv7a -mfloat-abi=softfp -mfpu=vfpv3-d16 endif ifeq ($(ANDROID_ARCH),ARM64) CFLAGS = -std=c99 -target aarch64 -mfix-cortex-a53-835769 @@ -108,7 +114,7 @@ CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION) # Paths containing required header files -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(NATIVE_APP_GLUE) # Linker options LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a @@ -116,12 +122,10 @@ LDFLAGS += -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl # Force linking of library module to define symbol LDFLAGS += -u ANativeActivity_onCreate # Library paths containing required libs -LDFLAGS += -L. -L$(PROJECT_BUILD_PATH)/obj -L$(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME) -L$(ANDROID_TOOLCHAIN)/sysroot/usr/lib +LDFLAGS += -L. -L$(PROJECT_BUILD_PATH)/obj -L$(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME) # Define any libraries to link into executable # if you want to link libraries (libname.so or libname.a), use the -lname - -#LDLIBS = -lraylib -lnative_app_glue -llog -landroid -lEGL -lGLESv2 -lOpenSLES -latomic -lc -lm -ldl LDLIBS = -lm -lc -lraylib -llog -landroid -lEGL -lGLESv2 -lOpenSLES -ldl # Generate target objects list from PROJECT_SOURCE_FILES @@ -140,14 +144,10 @@ all: create_temp_project_dirs \ compile_project_class \ compile_project_class_dex \ create_project_apk_package \ - sign_project_apk_package \ - zipalign_project_apk_package + zipalign_project_apk_package \ + sign_project_apk_package -# Create required temp directories - - - -APK building +# Create required temp directories for APK building create_temp_project_dirs: test -d $(PROJECT_BUILD_PATH) || mkdir -p $(PROJECT_BUILD_PATH) test -d $(PROJECT_BUILD_PATH)/obj || mkdir -p $(PROJECT_BUILD_PATH)/obj @@ -275,6 +275,7 @@ create_project_apk_package: cd $(PROJECT_BUILD_PATH) && $(ANDROID_BUILD_TOOLS)/aapt add bin/$(PROJECT_NAME).unsigned.apk lib/$(ANDROID_ARCH_NAME)/lib$(PROJECT_LIBRARY_NAME).so $(PROJECT_SHARED_LIBS) # Create signed APK package using generated Key: bin/$(PROJECT_NAME).signed.apk + sign_project_apk_package: $(JAVA_HOME)/bin/jarsigner -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -signedjar $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).signed.apk $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).unsigned.apk $(PROJECT_NAME)Key diff --git a/templates/standard_game/Makefile b/templates/standard_game/Makefile index 8c8070835..d25c47f13 100644 --- a/templates/standard_game/Makefile +++ b/templates/standard_game/Makefile @@ -25,7 +25,7 @@ # Define required raylib variables PROJECT_NAME ?= standard_game -RAYLIB_VERSION ?= 3.5.0 +RAYLIB_VERSION ?= 3.7.0 RAYLIB_PATH ?= ../.. # Define default options @@ -177,15 +177,12 @@ ifeq ($(PLATFORM),PLATFORM_WEB) CC = emcc endif -# Define default make program: Mingw32-make -MAKE = mingw32-make +# Define default make program +MAKE = make ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),LINUX) - MAKE = make - endif - ifeq ($(PLATFORM_OS),OSX) - MAKE = make + ifeq ($(PLATFORM_OS),WINDOWS) + MAKE = mingw32-make endif endif diff --git a/templates/standard_game/Makefile.Android b/templates/standard_game/Makefile.Android index afa3024ac..5d1373fb1 100644 --- a/templates/standard_game/Makefile.Android +++ b/templates/standard_game/Makefile.Android @@ -31,67 +31,60 @@ RAYLIB_PATH ?= ..\.. ANDROID_ARCH ?= ARM64 ANDROID_API_VERSION = 29 -# Android required path variables -# NOTE: Starting with Android NDK r21, no more toolchain generation is required, NDK is the toolchain on itself -ifeq ($(OS),Windows_NT) - ANDROID_NDK = C:/android-ndk - ANDROID_TOOLCHAIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/windows-x86_64 -else - ANDROID_NDK ?= /usr/lib/android/ndk - ANDROID_TOOLCHAIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64 -endif - ifeq ($(ANDROID_ARCH),ARM) - ANDROID_ARCH_NAME = armeabi-v7a + ANDROID_ARCH_NAME = armeabi-v7a endif ifeq ($(ANDROID_ARCH),ARM64) - ANDROID_ARCH_NAME = arm64-v8a + ANDROID_ARCH_NAME = arm64-v8a endif ifeq ($(ANDROID_ARCH),x86) - ANDROID_ARCH_NAME = i686 + ANDROID_ARCH_NAME = i686 endif ifeq ($(ANDROID_ARCH),x86_64) - ANDROID_ARCH_NAME = x86_64 + ANDROID_ARCH_NAME = x86_64 endif # Required path variables # NOTE: JAVA_HOME must be set to JDK (using OpenJDK 13) JAVA_HOME ?= C:/open-jdk -ANDROID_HOME = C:/android-sdk -ANDROID_TOOLCHAIN = C:/android-ndk/toolchains/llvm/prebuilt/windows-x86_64 -ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/29.0.3 +ANDROID_HOME ?= C:/android-sdk +ANDROID_NDK ?= C:/android-ndk +ANDROID_TOOLCHAIN ?= $(ANDROID_NDK)/toolchains/llvm/prebuilt/windows-x86_64 +ANDROID_BUILD_TOOLS ?= $(ANDROID_HOME)/build-tools/29.0.3 ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools # Android project configuration variables PROJECT_NAME ?= raylib_game PROJECT_LIBRARY_NAME ?= main -PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME) +PROJECT_BUILD_ID ?= android +PROJECT_BUILD_PATH ?= $(PROJECT_BUILD_ID).$(PROJECT_NAME) PROJECT_RESOURCES_PATH ?= resources -PROJECT_SOURCE_FILES ?= raylib_game.c +PROJECT_SOURCE_FILES ?= simple_game.c +NATIVE_APP_GLUE_PATH = $(ANDROID_NDK)/sources/android/native_app_glue # Some source files are placed in directories, when compiling to some # output directory other than source, that directory must pre-exist. # Here we get a list of required folders that need to be created on # code output folder $(PROJECT_BUILD_PATH)\obj to avoid GCC errors. -PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES))) +PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES))) # Android app configuration variables -APP_LABEL_NAME ?= rGame -APP_COMPANY_NAME ?= raylib -APP_PRODUCT_NAME ?= rgame -APP_VERSION_CODE ?= 1 -APP_VERSION_NAME ?= 1.0 -APP_ICON_LDPI ?= $(RAYLIB_PATH)\logo\raylib_36x36.png -APP_ICON_MDPI ?= $(RAYLIB_PATH)\logo\raylib_48x48.png -APP_ICON_HDPI ?= $(RAYLIB_PATH)\logo\raylib_72x72.png +APP_LABEL_NAME ?= rGame +APP_COMPANY_NAME ?= raylib +APP_PRODUCT_NAME ?= rgame +APP_VERSION_CODE ?= 1 +APP_VERSION_NAME ?= 1.0 +APP_ICON_LDPI ?= $(RAYLIB_PATH)\logo\raylib_36x36.png +APP_ICON_MDPI ?= $(RAYLIB_PATH)\logo\raylib_48x48.png +APP_ICON_HDPI ?= $(RAYLIB_PATH)\logo\raylib_72x72.png APP_SCREEN_ORIENTATION ?= landscape -APP_KEYSTORE_PASS ?= raylib +APP_KEYSTORE_PASS ?= raylib # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) -RAYLIB_LIBTYPE ?= STATIC +RAYLIB_LIBTYPE ?= STATIC # Library path for libraylib.a/libraylib.so -RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src +RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src # Shared libs must be added to APK if required # NOTE: Generated NativeLoader.java automatically load those libraries @@ -108,6 +101,14 @@ ifeq ($(ANDROID_ARCH),ARM64) CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android$(ANDROID_API_VERSION)-clang AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar endif +ifeq ($(ANDROID_ARCH),x86) + CC = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android$(ANDROID_API_VERSION)-clang + AR = $(ANDROID_TOOLCHAIN)/bin/i686-linux-android-ar +endif +ifeq ($(ANDROID_ARCH),x86_64) + CC = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android$(ANDROID_API_VERSION)-clang + AR = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android-ar +endif # Compiler flags for arquitecture ifeq ($(ANDROID_ARCH),ARM) @@ -124,7 +125,7 @@ CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION) # Paths containing required header files -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(NATIVE_APP_GLUE_PATH) # Linker options LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a @@ -154,8 +155,8 @@ all: create_temp_project_dirs \ compile_project_class \ compile_project_class_dex \ create_project_apk_package \ - sign_project_apk_package \ - zipalign_project_apk_package + zipalign_project_apk_package \ + sign_project_apk_package # Create required temp directories for APK building create_temp_project_dirs: @@ -253,7 +254,7 @@ config_project_package: # Compile native_app_glue code as static library: obj/libnative_app_glue.a compile_native_app_glue: - $(CC) -c $(RAYLIB_PATH)/src/external/android/native_app_glue/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS) + $(CC) -c $(NATIVE_APP_GLUE_PATH)/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS) $(AR) rcs $(PROJECT_BUILD_PATH)/obj/libnative_app_glue.a $(PROJECT_BUILD_PATH)/obj/native_app_glue.o # Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so