Merge branch 'raysan5:master' into master
This commit is contained in:
commit
0474d33096
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -56,6 +56,9 @@ packages/
|
||||||
*.so.*
|
*.so.*
|
||||||
*.dll
|
*.dll
|
||||||
|
|
||||||
|
# Emscripten
|
||||||
|
emsdk
|
||||||
|
|
||||||
# Ignore wasm data in examples/
|
# Ignore wasm data in examples/
|
||||||
examples/**/*.wasm
|
examples/**/*.wasm
|
||||||
examples/**/*.data
|
examples/**/*.data
|
||||||
|
|
|
||||||
290
BINDINGS.md
290
BINDINGS.md
|
|
@ -4,156 +4,158 @@ Some people ported raylib to other languages in form of bindings or wrappers to
|
||||||
|
|
||||||
### Language Bindings
|
### Language Bindings
|
||||||
|
|
||||||
| name | raylib version | language | license | repo |
|
| Name | raylib Version | Language | License |
|
||||||
|:------------------:|:---------------:|:---------:|:----------:|-----------------------------------------------------------|
|
| :--------------------------------------------------------------------------------------- | :--------------: | :------------------------------------------------------------------: | :------------------: |
|
||||||
| raylib | **5.0** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib | https://github.com/raysan5/raylib |
|
| [raylib](https://github.com/raysan5/raylib) | **5.0** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib |
|
||||||
| raylib-beef | **5.0** | [Beef](https://www.beeflang.org/) | MIT | https://github.com/Starpelly/raylib-beef |
|
| [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.0** | [Beef](https://www.beeflang.org) | MIT |
|
||||||
| raylib-boo | 3.7 | [Boo](http://boo-language.github.io/)| MIT | https://github.com/Rabios/raylib-boo |
|
| [raylib-boo](https://github.com/Rabios/raylib-boo) | 3.7 | [Boo](http://boo-language.github.io) | MIT |
|
||||||
| Raylib-cs | 5.0 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | https://github.com/ChrisDill/Raylib-cs |
|
| [Raylib-cs](https://github.com/ChrisDill/Raylib-cs) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib |
|
||||||
| Raylib-CsLo | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | https://github.com/NotNotTech/Raylib-CsLo |
|
| [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
|
||||||
| cl-raylib | 4.0 | [Common Lisp](https://common-lisp.net/) | MIT | https://github.com/longlene/cl-raylib |
|
| [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
|
||||||
| claylib/wrap | 4.5 | [Common Lisp](https://common-lisp.net/) | Zlib | https://github.com/defun-games/claylib |
|
| [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT |
|
||||||
| claw-raylib | **auto** | [Common Lisp](https://common-lisp.net/) | Apache-2.0 | https://github.com/bohonghuang/claw-raylib |
|
| [Raylib.NET](https://github.com/Odex64/Raylib.NET) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT |
|
||||||
| chez-raylib | **auto** | [Chez Scheme](https://cisco.github.io/ChezScheme/) | GPLv3 | https://github.com/Yunoinsky/chez-raylib |
|
| [cl-raylib](https://github.com/longlene/cl-raylib) | 4.0 | [Common Lisp](https://common-lisp.net) | MIT |
|
||||||
| raylib-cr | 4.6-dev (5e1a81) | [Crystal](https://crystal-lang.org/) | Apache-2.0 | https://github.com/sol-vin/raylib-cr |
|
| [claylib/wrap](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib |
|
||||||
| ray-cyber | 5.0 | [Cyber](https://cyberscript.dev) | MIT | https://github.com/fubark/ray-cyber |
|
| [claw-raylib](https://github.com/bohonghuang/claw-raylib) | **auto** | [Common Lisp](https://common-lisp.net) | Apache-2.0 |
|
||||||
| dart-raylib | 4.0 | [Dart](https://dart.dev/) | MIT | https://gitlab.com/wolfenrain/dart-raylib |
|
| [chez-raylib](https://github.com/Yunoinsky/chez-raylib) | **auto** | [Chez Scheme](https://cisco.github.io/ChezScheme) | GPLv3 |
|
||||||
| bindbc-raylib3 | **5.0** | [D](https://dlang.org/) | BSL-1.0 | https://github.com/o3o/bindbc-raylib3 |
|
| [raylib-cr](https://github.com/sol-vin/raylib-cr) | 4.6-dev (5e1a81) | [Crystal](https://crystal-lang.org) | Apache-2.0 |
|
||||||
| dray | 4.2 | [D](https://dlang.org/) | Apache-2.0 | https://github.com/redthing1/dray |
|
| [ray-cyber](https://github.com/fubark/ray-cyber) | **5.0** | [Cyber](https://cyberscript.dev) | MIT |
|
||||||
| raylib-d | **5.0** | [D](https://dlang.org/) | Zlib | https://github.com/schveiguy/raylib-d |
|
| [dart-raylib](https://gitlab.com/wolfenrain/dart-raylib) | 4.0 | [Dart](https://dart.dev) | MIT |
|
||||||
| rayex | 3.7 | [elixir](https://elixir-lang.org/) | Apache-2.0 | https://github.com/shiryel/rayex |
|
| [bindbc-raylib3](https://github.com/o3o/bindbc-raylib3) | **5.0** | [D](https://dlang.org) | BSL-1.0 |
|
||||||
| raylib-factor | 4.5 | [Factor](https://factorcode.org/) | BSD | https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor |
|
| [dray](https://github.com/redthing1/dray) | 4.2 | [D](https://dlang.org) | Apache-2.0 |
|
||||||
| raylib-freebasic | **5.0** | [FreeBASIC](https://www.freebasic.net/) | MIT | https://github.com/WIITD/raylib-freebasic |
|
| [raylib-d](https://github.com/schveiguy/raylib-d) | **5.0** | [D](https://dlang.org) | Zlib |
|
||||||
| fortran-raylib | 4.5 | [Fortran](https://fortran-lang.org/) | ISC | https://github.com/interkosmos/fortran-raylib |
|
| [rayex](https://github.com/shiryel/rayex) | 3.7 | [elixir](https://elixir-lang.org) | Apache-2.0 |
|
||||||
| raylib-go | **5.0** | [Go](https://golang.org/) | Zlib | https://github.com/gen2brain/raylib-go |
|
| [raylib-factor](https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor) | 4.5 | [Factor](https://factorcode.org) | BSD |
|
||||||
| raylib-guile | **auto** | [Guile](https://www.gnu.org/software/guile/) | Zlib | https://github.com/petelliott/raylib-guile |
|
| [raylib-freebasic](https://github.com/WIITD/raylib-freebasic) | **5.0** | [FreeBASIC](https://www.freebasic.net) | MIT |
|
||||||
| gforth-raylib | 3.5 | [Gforth](https://gforth.org/) | **???** | https://github.com/ArnautDaniel/gforth-raylib |
|
| [fortran-raylib](https://github.com/interkosmos/fortran-raylib) | 4.5 | [Fortran](https://fortran-lang.org) | ISC |
|
||||||
| h-raylib | **5.1-dev** | [Haskell](https://haskell.org/) | Apache-2.0 | https://github.com/Anut-py/h-raylib |
|
| [raylib-go](https://github.com/gen2brain/raylib-go) | **5.0** | [Go](https://golang.org) | Zlib |
|
||||||
| raylib-hx | 4.2 | [Haxe](https://haxe.org/) | Zlib | https://github.com/foreignsasquatch/raylib-hx |
|
| [raylib-guile](https://github.com/petelliott/raylib-guile) | **auto** | [Guile](https://www.gnu.org/software/guile) | Zlib |
|
||||||
| hb-raylib | 3.5 | [Harbour](https://harbour.github.io) | MIT | https://github.com/MarcosLeonardoMendezGerencir/hb-raylib |
|
| [gforth-raylib](https://github.com/ArnautDaniel/gforth-raylib) | 3.5 | [Gforth](https://gforth.org) | **???** |
|
||||||
| jaylib | 5.0 | [Janet](https://janet-lang.org/) | MIT | https://github.com/janet-lang/jaylib |
|
| [h-raylib](https://github.com/Anut-py/h-raylib) | **5.1-dev** | [Haskell](https://haskell.org) | Apache-2.0 |
|
||||||
| jaylib | 4.5 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE | https://github.com/electronstudio/jaylib/ |
|
| [raylib-hx](https://github.com/foreignsasquatch/raylib-hx) | 4.2 | [Haxe](https://haxe.org) | Zlib |
|
||||||
| raylib-j | 4.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib | https://github.com/CreedVI/Raylib-J |
|
| [hb-raylib](https://github.com/MarcosLeonardoMendezGerencir/hb-raylib) | 3.5 | [Harbour](https://harbour.github.io) | MIT |
|
||||||
| raylib.jl | 4.2 | [Julia](https://julialang.org/) | Zlib | https://github.com/irishgreencitrus/raylib.jl |
|
| [jaylib](https://github.com/janet-lang/jaylib) | **5.0** | [Janet](https://janet-lang.org) | MIT |
|
||||||
| kaylib | 3.7 | [Kotlin/native](https://kotlinlang.org) | ? | https://github.com/electronstudio/kaylib |
|
| [jaylib](https://github.com/electronstudio/jaylib/) | 4.5 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE |
|
||||||
| KaylibKit | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib | https://codeberg.org/Kenta/KaylibKit |
|
| [raylib-j](https://github.com/CreedVI/Raylib-J) | 4.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib |
|
||||||
| raylib-lua | 4.5 | [Lua](http://www.lua.org/) | ISC | https://github.com/TSnake41/raylib-lua |
|
| [raylib.jl](https://github.com/irishgreencitrus/raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib |
|
||||||
| raylua | 4.0 | [Lua](http://www.lua.org/) | MIT | https://github.com/Rabios/raylua |
|
| [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** |
|
||||||
| raylib-matte | 4.6-dev | [Matte](https://github.com/jcorks/matte/) | MIT | https://github.com/jcorks/raylib-matte |
|
| [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib |
|
||||||
| Raylib.nelua | **5.0** | [nelua](https://nelua.io/) | Zlib | https://github.com/AuzFox/Raylib.nelua |
|
| [raylib-lua](https://github.com/TSnake41/raylib-lua) | 4.5 | [Lua](http://www.lua.org) | ISC |
|
||||||
| NimraylibNow! | 4.2 | [Nim](https://nim-lang.org/) | MIT | https://github.com/greenfork/nimraylib_now |
|
| [raylua](https://github.com/Rabios/raylua) | 4.0 | [Lua](http://www.lua.org) | MIT |
|
||||||
| raylib-bindings | 4.5 | [Ruby](https://www.ruby-lang.org/en/) | Zlib | https://github.com/vaiorabbit/raylib-bindings |
|
| [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | MIT |
|
||||||
| raylib-Forever | auto | [Nim](https://nim-lang.org/) | ? | https://github.com/Guevara-chan/Raylib-Forever |
|
| [Raylib.nelua](https://github.com/AuzFox/Raylib.nelua) | **5.0** | [nelua](https://nelua.io) | Zlib |
|
||||||
| naylib | auto | [Nim](https://nim-lang.org/) | MIT | https://github.com/planetis-m/naylib |
|
| [raylib-bindings](https://github.com/vaiorabbit/raylib-bindings) | 4.5 | [Ruby](https://www.ruby-lang.org/en) | Zlib |
|
||||||
| node-raylib | 4.5 | [Node.js](https://nodejs.org/en/) | Zlib | https://github.com/RobLoach/node-raylib |
|
| [naylib](https://github.com/planetis-m/naylib) | **5.1-dev** | [Nim](https://nim-lang.org) | MIT |
|
||||||
| raylib-odin | 5.0 | [Odin](https://odin-lang.org/) | BSD-3Clause | https://github.com/odin-lang/Odin/tree/master/vendor/raylib |
|
| [node-raylib](https://github.com/RobLoach/node-raylib) | 4.5 | [Node.js](https://nodejs.org/en) | Zlib |
|
||||||
| raylib_odin_bindings | 4.0-dev | [Odin](https://odin-lang.org/) | MIT | https://github.com/Deathbat2190/raylib_odin_bindings |
|
| [raylib-odin](https://github.com/odin-lang/Odin/tree/master/vendor/raylib) | **5.0** | [Odin](https://odin-lang.org) | BSD-3Clause |
|
||||||
| raylib-ocaml | **5.0** | [OCaml](https://ocaml.org/) | MIT | https://github.com/tjammer/raylib-ocaml |
|
| [raylib_odin_bindings](https://github.com/Deathbat2190/raylib_odin_bindings) | 4.0-dev | [Odin](https://odin-lang.org) | MIT |
|
||||||
| TurboRaylib | 4.5 | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | MIT | https://github.com/turborium/TurboRaylib |
|
| [raylib-ocaml](https://github.com/tjammer/raylib-ocaml) | **5.0** | [OCaml](https://ocaml.org) | MIT |
|
||||||
| Ray4Laz | **5.0** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)| Zlib | https://github.com/GuvaCode/Ray4Laz |
|
| [TurboRaylib](https://github.com/turborium/TurboRaylib) | 4.5 | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | MIT |
|
||||||
| Raylib.4.0.Pascal | 4.0 | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)| Zlib | https://github.com/sysrpl/Raylib.4.0.Pascal |
|
| [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **5.0** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib |
|
||||||
| pyraylib | 3.7 | [Python](https://www.python.org/) | Zlib | https://github.com/Ho011/pyraylib |
|
| [Raylib.4.0.Pascal](https://github.com/sysrpl/Raylib.4.0.Pascal) | 4.0 | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib |
|
||||||
| raylib-python-cffi | 4.2 | [Python](https://www.python.org/) | EPL-2.0 | https://github.com/electronstudio/raylib-python-cffi |
|
| [pyraylib](https://github.com/Ho011/pyraylib) | 3.7 | [Python](https://www.python.org) | Zlib |
|
||||||
| raylibpyctbg | 4.5 | [Python](https://www.python.org/) | MIT | https://github.com/overdev/raylibpyctbg |
|
| [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | 4.2 | [Python](https://www.python.org) | EPL-2.0 |
|
||||||
| raylib-py | **5.0b1** | [Python](https://www.python.org/) | MIT | https://github.com/overdev/raylib-py |
|
| [raylibpyctbg](https://github.com/overdev/raylibpyctbg) | 4.5 | [Python](https://www.python.org) | MIT |
|
||||||
| raylib-python-ctypes | 4.6-dev | [Python](https://www.python.org/) | MIT | https://github.com/sDos280/raylib-python-ctypes |
|
| [raylib-py](https://github.com/overdev/raylib-py) | **5.0b1** | [Python](https://www.python.org) | MIT |
|
||||||
| raylib-pkpy-bindings | 4.6-dev | [pocketpy](https://pocketpy.dev/) | MIT | https://github.com/blueloveTH/pkpy-bindings |
|
| [raylib-python-ctypes](https://github.com/sDos280/raylib-python-ctypes) | 4.6-dev | [Python](https://www.python.org) | MIT |
|
||||||
| raylib-php | 4.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/joseph-montanez/raylib-php |
|
| [raylib-pkpy-bindings](https://github.com/blueloveTH/pkpy-bindings) | 4.6-dev | [pocketpy](https://pocketpy.dev) | MIT |
|
||||||
| raylib-phpcpp | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/oraoto/raylib-phpcpp |
|
| [raylib-php](https://github.com/joseph-montanez/raylib-php) | 4.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib |
|
||||||
| raylibr | 4.0 | [R](https://www.r-project.org) | MIT | https://github.com/jeroenjanssens/raylibr |
|
| [raylib-phpcpp](https://github.com/oraoto/raylib-phpcpp) | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib |
|
||||||
| raylib-ffi | 4.5 | [Rust](https://www.rust-lang.org/) | GPLv3 | https://github.com/ewpratten/raylib-ffi |
|
| [raylibr](https://github.com/jeroenjanssens/raylibr) | 4.0 | [R](https://www.r-project.org) | MIT |
|
||||||
| raylib-rs | 3.5 | [Rust](https://www.rust-lang.org/) | Zlib | https://github.com/deltaphc/raylib-rs |
|
| [raylib-ffi](https://github.com/ewpratten/raylib-ffi) | 4.5 | [Rust](https://www.rust-lang.org) | GPLv3 |
|
||||||
| Relib | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | ? | https://github.com/RedCubeDev-ByteSpace/Relib |
|
| [raylib-rs](https://github.com/raylib-rs/raylib-rs) | **5.0** | [Rust](https://www.rust-lang.org) | Zlib |
|
||||||
| racket-raylib | 4.0 | [Racket](https://racket-lang.org/) | MIT/Apache-2.0 | https://github.com/eutro/racket-raylib |
|
| [Relib](https://github.com/RedCubeDev-ByteSpace/Relib) | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | **???** |
|
||||||
| raylib-swift | 4.0 | [Swift](https://swift.org/) | MIT | https://github.com/STREGAsGate/Raylib |
|
| [racket-raylib](https://github.com/eutro/racket-raylib) | 4.0 | [Racket](https://racket-lang.org) | MIT/Apache-2.0 |
|
||||||
| raylib-scopes | auto | [Scopes](http://scopes.rocks) | MIT | https://github.com/salotz/raylib-scopes |
|
| [raylib-swift](https://github.com/STREGAsGate/Raylib) | 4.0 | [Swift](https://swift.org) | MIT |
|
||||||
| raylib-SmallBASIC | 5.0 | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | GPLv3 | https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib |
|
| [raylib-scopes](https://github.com/salotz/raylib-scopes) | auto | [Scopes](http://scopes.rocks) | MIT |
|
||||||
| raylib-umka | 4.5 | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib | https://github.com/robloach/raylib-umka |
|
| [raylib-SmallBASIC](https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib) | **5.0** | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | GPLv3 |
|
||||||
| raylib.v | 4.2 | [V](https://vlang.io/) | Zlib | https://github.com/irishgreencitrus/raylib.v |
|
| [raylib-umka](https://github.com/robloach/raylib-umka) | 4.5 | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib |
|
||||||
| raylib-vapi | 5.0 | [Vala](https://vala.dev/) | Zlib | https://github.com/lxmcf/raylib-vapi |
|
| [raylib.v](https://github.com/irishgreencitrus/raylib.v) | 4.2 | [V](https://vlang.io) | Zlib |
|
||||||
| raylib-wren | 4.0 | [Wren](http://wren.io/) | ISC | https://github.com/TSnake41/raylib-wren |
|
| [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **5.0** | [Vala](https://vala.dev) | Zlib |
|
||||||
| raylib-zig | 5.0 | [Zig](https://ziglang.org/) | MIT | https://github.com/Not-Nik/raylib-zig |
|
| [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.0 | [Wren](http://wren.io) | ISC |
|
||||||
| raylib.zig | 5.1-dev | [Zig](https://ziglang.org/) | MIT | https://github.com/ryupold/raylib.zig |
|
| [raylib-zig](https://github.com/Not-Nik/raylib-zig) | **5.0** | [Zig](https://ziglang.org) | MIT |
|
||||||
| hare-raylib | **auto** | [Hare](https://harelang.org/) | Zlib | https://git.sr.ht/~evantj/hare-raylib |
|
| [raylib.zig](https://github.com/ryupold/raylib.zig) | **5.1-dev** | [Zig](https://ziglang.org) | MIT |
|
||||||
| raylib-sunder | **auto** | [Sunder](https://github.com/ashn-dot-dev/sunder) | 0BSD | https://github.com/ashn-dot-dev/raylib-sunder |
|
| [hare-raylib](https://git.sr.ht/~evantj/hare-raylib) | **auto** | [Hare](https://harelang.org) | Zlib |
|
||||||
| rayed-bqn | **auto** | [BQN](https://mlochbaum.github.io/BQN/) | MIT | https://github.com/Brian-ED/rayed-bqn |
|
| [raylib-sunder](https://github.com/ashn-dot-dev/raylib-sunder) | **auto** | [Sunder](https://github.com/ashn-dot-dev/sunder) | 0BSD |
|
||||||
| rayjs | 4.6-dev | [QuickJS](https://bellard.org/quickjs/) | MIT | https://github.com/mode777/rayjs |
|
| [rayed-bqn](https://github.com/Brian-ED/rayed-bqn) | **auto** | [BQN](https://mlochbaum.github.io/BQN) | MIT |
|
||||||
| raylib-raku | **auto** | [Raku](https://www.raku.org/) | Artistic License 2.0 | https://github.com/vushu/raylib-raku |
|
| [rayjs](https://github.com/mode777/rayjs) | 4.6-dev | [QuickJS](https://bellard.org/quickjs) | MIT |
|
||||||
| Raylib.lean | 4.5 | [Lean4](https://lean-lang.org/) | BSD-3-Clause | https://github.com/KislyjKisel/Raylib.lean |
|
| [raylib-raku](https://github.com/vushu/raylib-raku) | **auto** | [Raku](https://www.raku.org) | Artistic License 2.0 |
|
||||||
| Raylib-CSharp-Vinculum | 5.0 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | https://github.com/ZeroElectric/Raylib-CSharp-Vinculum |
|
| [Raylib.lean](https://github.com/KislyjKisel/Raylib.lean) | 4.5 | [Lean4](https://lean-lang.org) | BSD-3-Clause |
|
||||||
| raylib-cobol | **auto** | [COBOL](https://gnucobol.sourceforge.io) | Public domain | https://codeberg.org/glowiak/raylib-cobol |
|
| [raylib-cobol](https://codeberg.org/glowiak/raylib-cobol) | **auto** | [COBOL](https://gnucobol.sourceforge.io) | Public domain |
|
||||||
| Raylib-CSharp | 5.0 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | https://github.com/MrScautHD/Raylib-CSharp |
|
|
||||||
|
|
||||||
### Utility Wrapers
|
### Utility Wrapers
|
||||||
|
|
||||||
These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's pardigm.
|
These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's pardigm.
|
||||||
| name | raylib version | language | license | repo |
|
| Name | raylib Version | Language | License |
|
||||||
|:------------------:|:-------------: | :--------:|:-------:|:-------------------------------------------------------------|
|
| ---------------------------------------------------- | :------------: | :------------------------------------------: | :-----: |
|
||||||
| raylib-cpp | **5.0** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib | https://github.com/robloach/raylib-cpp |
|
| [raylib-cpp](https://github.com/robloach/raylib-cpp) | **5.0** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib |
|
||||||
| claylib | **4.5** | [Common Lisp](https://common-lisp.net/) | Zlib | https://github.com/defun-games/claylib |
|
| [claylib](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib |
|
||||||
|
|
||||||
### Older or Unmaintained Language Bindings
|
### Older or Unmaintained Language Bindings
|
||||||
These are older raylib bindings that are more than 2 versions old or have not been maintained.
|
|
||||||
| name | raylib version | language | repo |
|
|
||||||
|:------------------:|:-------------: | :--------:|----------------------------------------------------------------------|
|
|
||||||
| raylib-cppsharp | 2.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/phxvyper/raylib-cppsharp |
|
|
||||||
| 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 |
|
|
||||||
| bindbc-raylib | 3.0 | [D](https://dlang.org/) | https://github.com/o3o/bindbc-raylib |
|
|
||||||
| go-raylib | 3.5 | [Go](https://golang.org/) | https://github.com/chunqian/go-raylib |
|
|
||||||
| 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 |
|
|
||||||
| raylib-luamore | 3.0 | [Lua](http://www.lua.org/) | https://github.com/HDPLocust/raylib-luamore |
|
|
||||||
| LuaJIT-Raylib | 2.6 | [Lua](http://www.lua.org/) | https://github.com/Bambofy/LuaJIT-Raylib |
|
|
||||||
| raylib-lua-sol | 2.5 | [Lua](http://www.lua.org/) | https://github.com/RobLoach/raylib-lua-sol |
|
|
||||||
| raylib-lua-ffi | 2.0 | [Lua](http://www.lua.org/) | https://github.com/raysan5/raylib/issues/693 |
|
|
||||||
| raylib-lua | 1.7 | [Lua](http://www.lua.org/) | https://github.com/raysan5/raylib-lua |
|
|
||||||
| raylib-nelua | 3.0 | [Nelua](https://nelua.io/) | https://github.com/Andre-LA/raylib-nelua |
|
|
||||||
| raylib-nim | 2.0 | [Nim](https://nim-lang.org/) | https://github.com/Skrylar/raylib-nim |
|
|
||||||
| raylib-Nim | 1.7 | [Nim](https://nim-lang.org/) | https://gitlab.com/define-private-public/raylib-Nim |
|
|
||||||
| nim-raylib | 3.1-dev | [Nim](https://nim-lang.org/) | https://github.com/tomc1998/nim-raylib |
|
|
||||||
| 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 |
|
|
||||||
| raylib.cr | 2.0 | [Crystal](https://crystal-lang.org/) | https://github.com/sam0x17/raylib.cr |
|
|
||||||
| cray | 1.8 | [Crystal](https://crystal-lang.org/) | https://gitlab.com/Zatherz/cray |
|
|
||||||
| raylib-pas | 3.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/tazdij/raylib-pas |
|
|
||||||
| raylib-pascal | 2.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/drezgames/raylib-pascal |
|
|
||||||
| Graphics-Raylib | 1.4 | [Perl](https://www.perl.org/) | https://github.com/athreef/Graphics-Raylib |
|
|
||||||
| raylib-ruby | 2.6 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/a0/raylib-ruby |
|
|
||||||
| raylib-ruby-ffi | 2.0 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/D3nX/raylib-ruby-ffi |
|
|
||||||
| raylib-mruby | 2.5-dev | [mruby](https://github.com/mruby/mruby) | https://github.com/lihaochen910/raylib-mruby |
|
|
||||||
| 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 |
|
|
||||||
| QuickJS-raylib | 3.0 | [QuickJS](https://bellard.org/quickjs/) | https://github.com/sntg-p/QuickJS-raylib |
|
|
||||||
| 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-ffi | 2.4-dev | [PHP](https://en.wikipedia.org/wiki/PHP) | https://github.com/oraoto/raylib-php-ffi |
|
|
||||||
| raylib-haxe | 2.4 | [Haxe](https://haxe.org/) | https://github.com/ibilon/raylib-haxe |
|
|
||||||
| ringraylib | 2.6 | [Ring](http://ring-lang.sourceforge.net/) | https://github.com/ringpackages/ringraylib |
|
|
||||||
| raylib-scm | 2.5 | [Chicken Scheme](https://www.call-cc.org/) | https://github.com/yashrk/raylib-scm |
|
|
||||||
| 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-odin | 3.0 | [Odin](https://odin-lang.org/) | https://github.com/kevinw/raylib-odin |
|
|
||||||
| vraylib | 3.5 | [V](https://vlang.io/) | https://github.com/waotzi/vraylib |
|
|
||||||
| raylib-vala | 3.0 | [Vala](https://wiki.gnome.org/Projects/Vala) | https://code.guddler.uk/mart/raylibVapi |
|
|
||||||
| raylib-jai | 3.1-dev | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | https://github.com/kujukuju/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 |
|
|
||||||
| raykit | ? | [Kit](https://www.kitlang.org/) | https://github.com/Gamerfiend/raykit |
|
|
||||||
| ray.mod | 3.0 | [BlitzMax](https://blitzmax.org/) | https://github.com/bmx-ng/ray.mod |
|
|
||||||
| 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 |
|
|
||||||
| raylib-fb | 3.0 | [FreeBasic](https://www.freebasic.net/) | https://github.com/IchMagBier/raylib-fb |
|
|
||||||
| raylib-purebasic | 3.0 | [PureBasic](https://www.purebasic.com/) | https://github.com/D-a-n-i-l-o/raylib-purebasic |
|
|
||||||
| 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-never | 3.0 | [Never](https://github.com/never-lang/never) | https://github.com/never-lang/raylib-never |
|
|
||||||
| raylib.cbl | 2.0 | [COBOL](https://en.wikipedia.org/wiki/COBOL) | *[code examples](https://github.com/Martinfx/Cobol/tree/master/OpenCobol/Games/raylib)* |
|
|
||||||
|
|
||||||
|
These are older raylib bindings that are more than 2 versions old or have not been maintained.
|
||||||
|
| Name | raylib Version | Language |
|
||||||
|
| ---------------------------------------------------------------------------------- | :------------: | :---------------------------------------------------------------------: |
|
||||||
|
| [raylib-cppsharp](https://github.com/phxvyper/raylib-cppsharp) | 2.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) |
|
||||||
|
| [RaylibFS](https://github.com/dallinbeutler/RaylibFS) | 2.5 | [F#](https://fsharp.org) |
|
||||||
|
| [raylib\*d](https://github.com/Sepheus/raylib_d) | 2.5 | [D](https://dlang.org) |
|
||||||
|
| [bindbc-raylib](https://github.com/o3o/bindbc-raylib) | 3.0 | [D](https://dlang.org) |
|
||||||
|
| [go-raylib](https://github.com/chunqian/go-raylib) | 3.5 | [Go](https://golang.org) |
|
||||||
|
| [raylib-goplus](https://github.com/Lachee/raylib-goplus) | 2.6-dev | [Go](https://golang.org) |
|
||||||
|
| [ray-go](https://github.com/hecate-tech/ray-go) | 2.6-dev | [Go](https://golang.org) |
|
||||||
|
| [raylib-luamore](https://github.com/HDPLocust/raylib-luamore) | 3.0 | [Lua](http://www.lua.org) |
|
||||||
|
| [LuaJIT-Raylib](https://github.com/Bambofy/LuaJIT-Raylib) | 2.6 | [Lua](http://www.lua.org) |
|
||||||
|
| [raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol) | 2.5 | [Lua](http://www.lua.org) |
|
||||||
|
| [raylib-lua-ffi](https://github.com/raysan5/raylib/issues/693) | 2.0 | [Lua](http://www.lua.org) |
|
||||||
|
| [raylib-lua](https://github.com/raysan5/raylib-lua) | 1.7 | [Lua](http://www.lua.org) |
|
||||||
|
| [raylib-nelua](https://github.com/Andre-LA/raylib-nelua) | 3.0 | [Nelua](https://nelua.io) |
|
||||||
|
| [raylib-nim](https://github.com/Skrylar/raylib-nim) | 2.0 | [Nim](https://nim-lang.org) |
|
||||||
|
| [raylib-Nim](https://gitlab.com/define-private-public/raylib-Nim) | 1.7 | [Nim](https://nim-lang.org) |
|
||||||
|
| [nim-raylib](https://github.com/tomc1998/nim-raylib) | 3.1-dev | [Nim](https://nim-lang.org) |
|
||||||
|
| [raylib-Forever](https://github.com/Guevara-chan/Raylib-Forever) | auto | [Nim](https://nim-lang.org) |
|
||||||
|
| [NimraylibNow!](https://github.com/greenfork/nimraylib_now) | 4.2 | [Nim](https://nim-lang.org) |
|
||||||
|
| [raylib-haskell](https://github.com/DevJac/raylib-haskell) | 2.0 | [Haskell](https://www.haskell.org) |
|
||||||
|
| [raylib-cr](https://github.com/AregevDev/raylib-cr) | 2.5-dev | [Crystal](https://crystal-lang.org) |
|
||||||
|
| [raylib.cr](https://github.com/sam0x17/raylib.cr) | 2.0 | [Crystal](https://crystal-lang.org) |
|
||||||
|
| [cray](https://gitlab.com/Zatherz/cray) | 1.8 | [Crystal](https://crystal-lang.org) |
|
||||||
|
| [raylib-pas](https://github.com/tazdij/raylib-pas) | 3.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal*(programming*language)) |
|
||||||
|
| [raylib-pascal](https://github.com/drezgames/raylib-pascal) | 2.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal*(programming*language)) |
|
||||||
|
| [Graphics-Raylib](https://github.com/athreef/Graphics-Raylib) | 1.4 | [Perl](https://www.perl.org) |
|
||||||
|
| [raylib-ruby](https://github.com/a0/raylib-ruby) | 2.6 | [Ruby](https://www.ruby-lang.org/en) |
|
||||||
|
| [raylib-ruby-ffi](https://github.com/D3nX/raylib-ruby-ffi) | 2.0 | [Ruby](https://www.ruby-lang.org/en) |
|
||||||
|
| [raylib-mruby](https://github.com/lihaochen910/raylib-mruby) | 2.5-dev | [mruby](https://github.com/mruby/mruby) |
|
||||||
|
| [raylib-java](https://github.com/XoanaIO/raylib-java) | 2.0 | [Java](https://en.wikipedia.org/wiki/Java*(programming_language)) |
|
||||||
|
| [clj-raylib](https://github.com/lsevero/clj-raylib) | 3.0 | [Clojure](https://clojure.org) |
|
||||||
|
| [QuickJS-raylib](https://github.com/sntg-p/QuickJS-raylib) | 3.0 | [QuickJS](https://bellard.org/quickjs) |
|
||||||
|
| [raylib-duktape](https://github.com/RobLoach/raylib-duktape) | 2.6 | [JavaScript (Duktape)](https://en.wikipedia.org/wiki/JavaScript) |
|
||||||
|
| [raylib-v7](https://github.com/Rabios/raylib-v7) | 3.5 | [JavaScript (v7)](https://en.wikipedia.org/wiki/JavaScript) |
|
||||||
|
| [raylib-chaiscript](https://github.com/RobLoach/raylib-chaiscript) | 2.6 | [ChaiScript](http://chaiscript.com) |
|
||||||
|
| [raylib-squirrel](https://github.com/RobLoach/raylib-squirrel) | 2.5 | [Squirrel](http://www.squirrel-lang.org) |
|
||||||
|
| [racket-raylib-2d](https://github.com/arvyy/racket-raylib-2d) | 2.5 | [Racket](https://racket-lang.org) |
|
||||||
|
| [raylib-php-ffi](https://github.com/oraoto/raylib-php-ffi) | 2.4-dev | [PHP](https://en.wikipedia.org/wiki/PHP) |
|
||||||
|
| [raylib-haxe](https://github.com/ibilon/raylib-haxe) | 2.4 | [Haxe](https://haxe.org) |
|
||||||
|
| [ringraylib](https://github.com/ringpackages/ringraylib) | 2.6 | [Ring](http://ring-lang.sourceforge.net) |
|
||||||
|
| [raylib-scm](https://github.com/yashrk/raylib-scm) | 2.5 | [Chicken Scheme](https://www.call-cc.org) |
|
||||||
|
| [raylib-chibi](https://github.com/VincentToups/raylib-chibi) | 2.5 | [Chibi-Scheme](https://github.com/ashinn/chibi-scheme) |
|
||||||
|
| [raylib-gambit-scheme](https://github.com/georgjz/raylib-gambit-scheme) | 3.1-dev | [Gambit Scheme](https://github.com/gambit/gambit) |
|
||||||
|
| [Euraylib](https://github.com/gAndy50/Euraylib) | 3.0 | [Euphoria](https://openeuphoria.org) |
|
||||||
|
| [raylib-odin](https://github.com/kevinw/raylib-odin) | 3.0 | [Odin](https://odin-lang.org) |
|
||||||
|
| [vraylib](https://github.com/waotzi/vraylib) | 3.5 | [V](https://vlang.io) |
|
||||||
|
| [raylib-vala](https://code.guddler.uk/mart/raylibVapi) | 3.0 | [Vala](https://wiki.gnome.org/Projects/Vala) |
|
||||||
|
| [raylib-jai](https://github.com/kujukuju/raylib-jai) | 3.1-dev | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) |
|
||||||
|
| [ray.zig](https://github.com/BitPuffin/zig-raylib-experiments) | 2.5 | [Zig](https://ziglang.org) |
|
||||||
|
| [raylib-Ada](https://github.com/mimo/raylib-Ada) | 3.0 | [Ada](https://www.adacore.com/about-ada) |
|
||||||
|
| [raykit](https://github.com/Gamerfiend/raykit) | **???** | [Kit](https://www.kitlang.org) |
|
||||||
|
| [ray.mod](https://github.com/bmx-ng/ray.mod) | 3.0 | [BlitzMax](https://blitzmax.org) |
|
||||||
|
| [raylib-mosaic](https://github.com/pluckyporcupine/raylib-mosaic) | 3.0 | [Mosaic](https://github.com/sal55/langs/tree/master/Mosaic) |
|
||||||
|
| [raylib-xdpw](https://github.com/vtereshkov/raylib-xdpw) | 2.6 | [XD Pascal](https://github.com/vtereshkov/xdpw) |
|
||||||
|
| [raylib-carp](https://github.com/pluckyporcupine/raylib-carp) | 3.0 | [Carp](https://github.com/carp-lang/Carp) |
|
||||||
|
| [raylib-fb](https://github.com/IchMagBier/raylib-fb) | 3.0 | [FreeBasic](https://www.freebasic.net) |
|
||||||
|
| [raylib-purebasic](https://github.com/D-a-n-i-l-o/raylib-purebasic) | 3.0 | [PureBasic](https://www.purebasic.com) |
|
||||||
|
| [raylib-ats2](https://github.com/mephistopheles-8/raylib-ats2) | 3.0 | [ATS2](http://www.ats-lang.org) |
|
||||||
|
| [raylib-beef](https://github.com/M0n7y5/raylib-beef) | 3.0 | [Beef](https://www.beeflang.org) |
|
||||||
|
| [raylib-never](https://github.com/never-lang/raylib-never) | 3.0 | [Never](https://github.com/never-lang/never) |
|
||||||
|
| [raylib.cbl](https://github.com/Martinfx/Cobol/tree/master/OpenCobol/Games/raylib) | 2.0 | [COBOL](https://en.wikipedia.org/wiki/COBOL) |
|
||||||
|
|
||||||
Missing some language or wrapper? Feel free to create a new one! :)
|
Missing some language or wrapper? Feel free to create a new one! :)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ int main ()
|
||||||
Camera2D camera = { 0 };
|
Camera2D camera = { 0 };
|
||||||
camera.zoom = 1.0f;
|
camera.zoom = 1.0f;
|
||||||
|
|
||||||
|
int zoomMode = 0; // 0-Mouse Wheel, 1-Mouse Move
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -39,42 +41,69 @@ int main ()
|
||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
if (IsKeyPressed(KEY_ONE)) zoomMode = 0;
|
||||||
|
else if (IsKeyPressed(KEY_TWO)) zoomMode = 1;
|
||||||
|
|
||||||
// Translate based on mouse right click
|
// Translate based on mouse right click
|
||||||
if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT))
|
if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT))
|
||||||
{
|
{
|
||||||
Vector2 delta = GetMouseDelta();
|
Vector2 delta = GetMouseDelta();
|
||||||
delta = Vector2Scale(delta, -1.0f/camera.zoom);
|
delta = Vector2Scale(delta, -1.0f/camera.zoom);
|
||||||
|
|
||||||
camera.target = Vector2Add(camera.target, delta);
|
camera.target = Vector2Add(camera.target, delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zoom based on mouse wheel
|
if (zoomMode == 0)
|
||||||
float wheel = GetMouseWheelMove();
|
|
||||||
if (wheel != 0)
|
|
||||||
{
|
{
|
||||||
// Get the world point that is under the mouse
|
// Zoom based on mouse wheel
|
||||||
Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera);
|
float wheel = GetMouseWheelMove();
|
||||||
|
if (wheel != 0)
|
||||||
// Set the offset to where the mouse is
|
{
|
||||||
camera.offset = GetMousePosition();
|
// Get the world point that is under the mouse
|
||||||
|
Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera);
|
||||||
|
|
||||||
// Set the target to match, so that the camera maps the world space point
|
// Set the offset to where the mouse is
|
||||||
// under the cursor to the screen space point under the cursor at any zoom
|
camera.offset = GetMousePosition();
|
||||||
camera.target = mouseWorldPos;
|
|
||||||
|
|
||||||
// Zoom increment
|
// Set the target to match, so that the camera maps the world space point
|
||||||
const float zoomIncrement = 0.125f;
|
// under the cursor to the screen space point under the cursor at any zoom
|
||||||
|
camera.target = mouseWorldPos;
|
||||||
|
|
||||||
camera.zoom += (wheel*zoomIncrement);
|
// Zoom increment
|
||||||
if (camera.zoom < zoomIncrement) camera.zoom = zoomIncrement;
|
float scaleFactor = 1.0f + (0.25f*fabsf(wheel));
|
||||||
|
if (wheel < 0) scaleFactor = 1.0f/scaleFactor;
|
||||||
|
camera.zoom = Clamp(camera.zoom*scaleFactor, 0.125f, 64.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Zoom based on mouse left click
|
||||||
|
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
|
||||||
|
{
|
||||||
|
// Get the world point that is under the mouse
|
||||||
|
Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera);
|
||||||
|
|
||||||
|
// Set the offset to where the mouse is
|
||||||
|
camera.offset = GetMousePosition();
|
||||||
|
|
||||||
|
// Set the target to match, so that the camera maps the world space point
|
||||||
|
// under the cursor to the screen space point under the cursor at any zoom
|
||||||
|
camera.target = mouseWorldPos;
|
||||||
|
}
|
||||||
|
if (IsMouseButtonDown(MOUSE_BUTTON_LEFT))
|
||||||
|
{
|
||||||
|
// Zoom increment
|
||||||
|
float deltaX = GetMouseDelta().x;
|
||||||
|
float scaleFactor = 1.0f + (0.01f*fabsf(deltaX));
|
||||||
|
if (deltaX < 0) scaleFactor = 1.0f/scaleFactor;
|
||||||
|
camera.zoom = Clamp(camera.zoom*scaleFactor, 0.125f, 64.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
BeginDrawing();
|
BeginDrawing();
|
||||||
ClearBackground(BLACK);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
BeginMode2D(camera);
|
BeginMode2D(camera);
|
||||||
|
|
||||||
|
|
@ -87,11 +116,13 @@ int main ()
|
||||||
rlPopMatrix();
|
rlPopMatrix();
|
||||||
|
|
||||||
// Draw a reference circle
|
// Draw a reference circle
|
||||||
DrawCircle(100, 100, 50, YELLOW);
|
DrawCircle(GetScreenWidth()/2, GetScreenHeight()/2, 50, MAROON);
|
||||||
|
|
||||||
EndMode2D();
|
EndMode2D();
|
||||||
|
|
||||||
DrawText("Mouse right button drag to move, mouse wheel to zoom", 10, 10, 20, WHITE);
|
DrawText("[1][2] Select mouse zoom mode (Wheel or Move)", 20, 20, 20, DARKGRAY);
|
||||||
|
if (zoomMode == 0) DrawText("Mouse right button drag to move, mouse wheel to zoom", 20, 50, 20, DARKGRAY);
|
||||||
|
else DrawText("Mouse right button drag to move, mouse press and move to zoom", 20, 50, 20, DARKGRAY);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ int main(void)
|
||||||
if (currentPalette >= MAX_PALETTES) currentPalette = 0;
|
if (currentPalette >= MAX_PALETTES) currentPalette = 0;
|
||||||
else if (currentPalette < 0) currentPalette = MAX_PALETTES - 1;
|
else if (currentPalette < 0) currentPalette = MAX_PALETTES - 1;
|
||||||
|
|
||||||
// Send new value to the shader to be used on drawing.
|
// Send palette data to the shader to be used on drawing
|
||||||
// NOTE: We are sending RGB triplets w/o the alpha channel
|
// NOTE: We are sending RGB triplets w/o the alpha channel
|
||||||
SetShaderValueV(shader, paletteLoc, palettes[currentPalette], SHADER_UNIFORM_IVEC3, COLORS_PER_PALETTE);
|
SetShaderValueV(shader, paletteLoc, palettes[currentPalette], SHADER_UNIFORM_IVEC3, COLORS_PER_PALETTE);
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -11231,7 +11231,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "WaveCrop",
|
"name": "WaveCrop",
|
||||||
"description": "Crop a wave to defined samples range",
|
"description": "Crop a wave to defined frames range",
|
||||||
"returnType": "void",
|
"returnType": "void",
|
||||||
"params": [
|
"params": [
|
||||||
{
|
{
|
||||||
|
|
@ -11240,11 +11240,11 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "int",
|
"type": "int",
|
||||||
"name": "initSample"
|
"name": "initFrame"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "int",
|
"type": "int",
|
||||||
"name": "finalSample"
|
"name": "finalFrame"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -7733,12 +7733,12 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "WaveCrop",
|
name = "WaveCrop",
|
||||||
description = "Crop a wave to defined samples range",
|
description = "Crop a wave to defined frames range",
|
||||||
returnType = "void",
|
returnType = "void",
|
||||||
params = {
|
params = {
|
||||||
{type = "Wave *", name = "wave"},
|
{type = "Wave *", name = "wave"},
|
||||||
{type = "int", name = "initSample"},
|
{type = "int", name = "initFrame"},
|
||||||
{type = "int", name = "finalSample"}
|
{type = "int", name = "finalFrame"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4314,10 +4314,10 @@ Function 523: WaveCopy() (1 input parameters)
|
||||||
Function 524: WaveCrop() (3 input parameters)
|
Function 524: WaveCrop() (3 input parameters)
|
||||||
Name: WaveCrop
|
Name: WaveCrop
|
||||||
Return type: void
|
Return type: void
|
||||||
Description: Crop a wave to defined samples range
|
Description: Crop a wave to defined frames range
|
||||||
Param[1]: wave (type: Wave *)
|
Param[1]: wave (type: Wave *)
|
||||||
Param[2]: initSample (type: int)
|
Param[2]: initFrame (type: int)
|
||||||
Param[3]: finalSample (type: int)
|
Param[3]: finalFrame (type: int)
|
||||||
Function 525: WaveFormat() (4 input parameters)
|
Function 525: WaveFormat() (4 input parameters)
|
||||||
Name: WaveFormat
|
Name: WaveFormat
|
||||||
Return type: void
|
Return type: void
|
||||||
|
|
|
||||||
|
|
@ -2870,10 +2870,10 @@
|
||||||
<Function name="WaveCopy" retType="Wave" paramCount="1" desc="Copy a wave to a new wave">
|
<Function name="WaveCopy" retType="Wave" paramCount="1" desc="Copy a wave to a new wave">
|
||||||
<Param type="Wave" name="wave" desc="" />
|
<Param type="Wave" name="wave" desc="" />
|
||||||
</Function>
|
</Function>
|
||||||
<Function name="WaveCrop" retType="void" paramCount="3" desc="Crop a wave to defined samples range">
|
<Function name="WaveCrop" retType="void" paramCount="3" desc="Crop a wave to defined frames range">
|
||||||
<Param type="Wave *" name="wave" desc="" />
|
<Param type="Wave *" name="wave" desc="" />
|
||||||
<Param type="int" name="initSample" desc="" />
|
<Param type="int" name="initFrame" desc="" />
|
||||||
<Param type="int" name="finalSample" desc="" />
|
<Param type="int" name="finalFrame" desc="" />
|
||||||
</Function>
|
</Function>
|
||||||
<Function name="WaveFormat" retType="void" paramCount="4" desc="Convert wave data to desired format">
|
<Function name="WaveFormat" retType="void" paramCount="4" desc="Convert wave data to desired format">
|
||||||
<Param type="Wave *" name="wave" desc="" />
|
<Param type="Wave *" name="wave" desc="" />
|
||||||
|
|
|
||||||
|
|
@ -1006,8 +1006,14 @@ int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
funcEnd = c + 2;
|
funcEnd = c + 2;
|
||||||
|
|
||||||
// Check if previous word is void
|
// Check if there are no parameters
|
||||||
if ((linePtr[c - 4] == 'v') && (linePtr[c - 3] == 'o') && (linePtr[c - 2] == 'i') && (linePtr[c - 1] == 'd')) break;
|
if ((funcEnd - funcParamsStart == 2) ||
|
||||||
|
((linePtr[c - 4] == 'v') &&
|
||||||
|
(linePtr[c - 3] == 'o') &&
|
||||||
|
(linePtr[c - 2] == 'i') &&
|
||||||
|
(linePtr[c - 1] == 'd'))) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Get parameter type + name, extract info
|
// Get parameter type + name, extract info
|
||||||
char funcParamTypeName[128] = { 0 };
|
char funcParamTypeName[128] = { 0 };
|
||||||
|
|
@ -1237,7 +1243,7 @@ static char **GetTextLines(const char *buffer, int length, int *linesCount)
|
||||||
while ((bufferPtr[index] == ' ') || (bufferPtr[index] == '\t')) index++;
|
while ((bufferPtr[index] == ' ') || (bufferPtr[index] == '\t')) index++;
|
||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
while (bufferPtr[index + j] != '\n')
|
while (bufferPtr[index + j] != '\n' && bufferPtr[index + j] != '\0')
|
||||||
{
|
{
|
||||||
lines[i][j] = bufferPtr[index + j];
|
lines[i][j] = bufferPtr[index + j];
|
||||||
j++;
|
j++;
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,10 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
||||||
try c_source_files.append("rtextures.c");
|
try c_source_files.append("rtextures.c");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.opengl_version != .auto) {
|
||||||
|
raylib.defineCMacro(options.opengl_version.toCMacroStr(), null);
|
||||||
|
}
|
||||||
|
|
||||||
switch (target.result.os.tag) {
|
switch (target.result.os.tag) {
|
||||||
.windows => {
|
.windows => {
|
||||||
try c_source_files.append("rglfw.c");
|
try c_source_files.append("rglfw.c");
|
||||||
|
|
@ -134,7 +138,11 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
||||||
|
|
||||||
raylib.defineCMacro("PLATFORM_DESKTOP", null);
|
raylib.defineCMacro("PLATFORM_DESKTOP", null);
|
||||||
} else {
|
} else {
|
||||||
raylib.linkSystemLibrary("GLESv2");
|
if (options.opengl_version == .auto) {
|
||||||
|
raylib.linkSystemLibrary("GLESv2");
|
||||||
|
raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null);
|
||||||
|
}
|
||||||
|
|
||||||
raylib.linkSystemLibrary("EGL");
|
raylib.linkSystemLibrary("EGL");
|
||||||
raylib.linkSystemLibrary("drm");
|
raylib.linkSystemLibrary("drm");
|
||||||
raylib.linkSystemLibrary("gbm");
|
raylib.linkSystemLibrary("gbm");
|
||||||
|
|
@ -145,7 +153,6 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
||||||
raylib.addIncludePath(.{ .cwd_relative = "/usr/include/libdrm" });
|
raylib.addIncludePath(.{ .cwd_relative = "/usr/include/libdrm" });
|
||||||
|
|
||||||
raylib.defineCMacro("PLATFORM_DRM", null);
|
raylib.defineCMacro("PLATFORM_DRM", null);
|
||||||
raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null);
|
|
||||||
raylib.defineCMacro("EGL_NO_X11", null);
|
raylib.defineCMacro("EGL_NO_X11", null);
|
||||||
raylib.defineCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", "2048");
|
raylib.defineCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", "2048");
|
||||||
}
|
}
|
||||||
|
|
@ -183,7 +190,9 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
||||||
},
|
},
|
||||||
.emscripten => {
|
.emscripten => {
|
||||||
raylib.defineCMacro("PLATFORM_WEB", null);
|
raylib.defineCMacro("PLATFORM_WEB", null);
|
||||||
raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null);
|
if (options.opengl_version == .auto) {
|
||||||
|
raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null);
|
||||||
|
}
|
||||||
|
|
||||||
if (b.sysroot == null) {
|
if (b.sysroot == null) {
|
||||||
@panic("Pass '--sysroot \"$EMSDK/upstream/emscripten\"'");
|
@panic("Pass '--sysroot \"$EMSDK/upstream/emscripten\"'");
|
||||||
|
|
@ -195,7 +204,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
||||||
var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!");
|
var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!");
|
||||||
dir.close();
|
dir.close();
|
||||||
|
|
||||||
raylib.addIncludePath(.{ .path = cache_include });
|
raylib.addIncludePath(b.path(cache_include));
|
||||||
},
|
},
|
||||||
else => {
|
else => {
|
||||||
@panic("Unsupported OS");
|
@panic("Unsupported OS");
|
||||||
|
|
@ -239,11 +248,34 @@ pub const Options = struct {
|
||||||
platform_drm: bool = false,
|
platform_drm: bool = false,
|
||||||
shared: bool = false,
|
shared: bool = false,
|
||||||
linux_display_backend: LinuxDisplayBackend = .X11,
|
linux_display_backend: LinuxDisplayBackend = .X11,
|
||||||
|
opengl_version: OpenglVersion = .auto,
|
||||||
|
|
||||||
raylib_dependency_name: []const u8 = "raylib",
|
raylib_dependency_name: []const u8 = "raylib",
|
||||||
raygui_dependency_name: []const u8 = "raygui",
|
raygui_dependency_name: []const u8 = "raygui",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub const OpenglVersion = enum {
|
||||||
|
auto,
|
||||||
|
gl_1_1,
|
||||||
|
gl_2_1,
|
||||||
|
gl_3_3,
|
||||||
|
gl_4_3,
|
||||||
|
gles_2,
|
||||||
|
gles_3,
|
||||||
|
|
||||||
|
pub fn toCMacroStr(self: @This()) []const u8 {
|
||||||
|
switch (self) {
|
||||||
|
.auto => @panic("OpenglVersion.auto cannot be turned into a C macro string"),
|
||||||
|
.gl_1_1 => return "GRAPHICS_API_OPENGL_11",
|
||||||
|
.gl_2_1 => return "GRAPHICS_API_OPENGL_21",
|
||||||
|
.gl_3_3 => return "GRAPHICS_API_OPENGL_33",
|
||||||
|
.gl_4_3 => return "GRAPHICS_API_OPENGL_43",
|
||||||
|
.gles_2 => return "GRAPHICS_API_OPENGL_ES2",
|
||||||
|
.gles_3 => return "GRAPHICS_API_OPENGL_ES3",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
pub const LinuxDisplayBackend = enum {
|
pub const LinuxDisplayBackend = enum {
|
||||||
X11,
|
X11,
|
||||||
Wayland,
|
Wayland,
|
||||||
|
|
@ -270,6 +302,7 @@ pub fn build(b: *std.Build) !void {
|
||||||
.rshapes = b.option(bool, "rshapes", "Compile with shapes support") orelse defaults.rshapes,
|
.rshapes = b.option(bool, "rshapes", "Compile with shapes support") orelse defaults.rshapes,
|
||||||
.shared = b.option(bool, "shared", "Compile as shared library") orelse defaults.shared,
|
.shared = b.option(bool, "shared", "Compile as shared library") orelse defaults.shared,
|
||||||
.linux_display_backend = b.option(LinuxDisplayBackend, "linux_display_backend", "Linux display backend to use") orelse defaults.linux_display_backend,
|
.linux_display_backend = b.option(LinuxDisplayBackend, "linux_display_backend", "Linux display backend to use") orelse defaults.linux_display_backend,
|
||||||
|
.opengl_version = b.option(OpenglVersion, "opengl_version", "OpenGL version to use") orelse defaults.opengl_version,
|
||||||
};
|
};
|
||||||
|
|
||||||
const lib = try compileRaylib(b, target, optimize, options);
|
const lib = try compileRaylib(b, target, optimize, options);
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@
|
||||||
#define SUPPORT_DEFAULT_FONT 1
|
#define SUPPORT_DEFAULT_FONT 1
|
||||||
// Selected desired font fileformats to be supported for loading
|
// Selected desired font fileformats to be supported for loading
|
||||||
#define SUPPORT_FILEFORMAT_TTF 1
|
#define SUPPORT_FILEFORMAT_TTF 1
|
||||||
//#define SUPPORT_FILEFORMAT_FNT 1
|
#define SUPPORT_FILEFORMAT_FNT 1
|
||||||
//#define SUPPORT_FILEFORMAT_BDF 1
|
//#define SUPPORT_FILEFORMAT_BDF 1
|
||||||
|
|
||||||
// Support text management functions
|
// Support text management functions
|
||||||
|
|
|
||||||
|
|
@ -1499,11 +1499,6 @@ int InitPlatform(void)
|
||||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
|
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CORE.Window.flags & FLAG_VSYNC_HINT)
|
|
||||||
{
|
|
||||||
SDL_GL_SetSwapInterval(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CORE.Window.flags & FLAG_MSAA_4X_HINT)
|
if (CORE.Window.flags & FLAG_MSAA_4X_HINT)
|
||||||
{
|
{
|
||||||
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
|
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
|
||||||
|
|
@ -1537,6 +1532,9 @@ int InitPlatform(void)
|
||||||
TRACELOG(LOG_INFO, " > Screen size: %i x %i", CORE.Window.screen.width, CORE.Window.screen.height);
|
TRACELOG(LOG_INFO, " > Screen size: %i x %i", CORE.Window.screen.width, CORE.Window.screen.height);
|
||||||
TRACELOG(LOG_INFO, " > Render size: %i x %i", CORE.Window.render.width, CORE.Window.render.height);
|
TRACELOG(LOG_INFO, " > Render size: %i x %i", CORE.Window.render.width, CORE.Window.render.height);
|
||||||
TRACELOG(LOG_INFO, " > Viewport offsets: %i, %i", CORE.Window.renderOffset.x, CORE.Window.renderOffset.y);
|
TRACELOG(LOG_INFO, " > Viewport offsets: %i, %i", CORE.Window.renderOffset.x, CORE.Window.renderOffset.y);
|
||||||
|
|
||||||
|
if (CORE.Window.flags & FLAG_VSYNC_HINT) SDL_GL_SetSwapInterval(1);
|
||||||
|
else SDL_GL_SetSwapInterval(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,8 @@ static const char cursorLUT[11][12] = {
|
||||||
"not-allowed" // 10 MOUSE_CURSOR_NOT_ALLOWED
|
"not-allowed" // 10 MOUSE_CURSOR_NOT_ALLOWED
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Vector2 lockedMousePos = { 0 };
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Module Internal Functions Declaration
|
// Module Internal Functions Declaration
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
@ -131,6 +133,7 @@ static EM_BOOL EmscriptenWindowResizedCallback(int eventType, const EmscriptenUi
|
||||||
static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *event, void *userData);
|
static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *event, void *userData);
|
||||||
|
|
||||||
// Emscripten input callback events
|
// Emscripten input callback events
|
||||||
|
static EM_BOOL EmscriptenMouseMoveCallback(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData);
|
||||||
static EM_BOOL EmscriptenMouseCallback(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData);
|
static EM_BOOL EmscriptenMouseCallback(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData);
|
||||||
static EM_BOOL EmscriptenPointerlockCallback(int eventType, const EmscriptenPointerlockChangeEvent *pointerlockChangeEvent, void *userData);
|
static EM_BOOL EmscriptenPointerlockCallback(int eventType, const EmscriptenPointerlockChangeEvent *pointerlockChangeEvent, void *userData);
|
||||||
static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData);
|
static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData);
|
||||||
|
|
@ -862,6 +865,8 @@ void SetMousePosition(int x, int y)
|
||||||
CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y };
|
CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y };
|
||||||
CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition;
|
CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition;
|
||||||
|
|
||||||
|
if (CORE.Input.Mouse.cursorHidden) lockedMousePos = CORE.Input.Mouse.currentPosition;
|
||||||
|
|
||||||
// NOTE: emscripten not implemented
|
// NOTE: emscripten not implemented
|
||||||
glfwSetCursorPos(platform.handle, CORE.Input.Mouse.currentPosition.x, CORE.Input.Mouse.currentPosition.y);
|
glfwSetCursorPos(platform.handle, CORE.Input.Mouse.currentPosition.x, CORE.Input.Mouse.currentPosition.y);
|
||||||
}
|
}
|
||||||
|
|
@ -1270,6 +1275,9 @@ int InitPlatform(void)
|
||||||
emscripten_set_click_callback("#canvas", NULL, 1, EmscriptenMouseCallback);
|
emscripten_set_click_callback("#canvas", NULL, 1, EmscriptenMouseCallback);
|
||||||
emscripten_set_pointerlockchange_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, NULL, 1, EmscriptenPointerlockCallback);
|
emscripten_set_pointerlockchange_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, NULL, 1, EmscriptenPointerlockCallback);
|
||||||
|
|
||||||
|
// Following the mouse delta when the mouse is locked
|
||||||
|
emscripten_set_mousemove_callback("#canvas", NULL, 1, EmscriptenMouseMoveCallback);
|
||||||
|
|
||||||
// Support touch events
|
// Support touch events
|
||||||
emscripten_set_touchstart_callback("#canvas", NULL, 1, EmscriptenTouchCallback);
|
emscripten_set_touchstart_callback("#canvas", NULL, 1, EmscriptenTouchCallback);
|
||||||
emscripten_set_touchend_callback("#canvas", NULL, 1, EmscriptenTouchCallback);
|
emscripten_set_touchend_callback("#canvas", NULL, 1, EmscriptenTouchCallback);
|
||||||
|
|
@ -1477,9 +1485,13 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int
|
||||||
// GLFW3 Cursor Position Callback, runs on mouse move
|
// GLFW3 Cursor Position Callback, runs on mouse move
|
||||||
static void MouseCursorPosCallback(GLFWwindow *window, double x, double y)
|
static void MouseCursorPosCallback(GLFWwindow *window, double x, double y)
|
||||||
{
|
{
|
||||||
CORE.Input.Mouse.currentPosition.x = (float)x;
|
// If the pointer is not locked, follow the position
|
||||||
CORE.Input.Mouse.currentPosition.y = (float)y;
|
if (!CORE.Input.Mouse.cursorHidden)
|
||||||
CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition;
|
{
|
||||||
|
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)
|
#if defined(SUPPORT_GESTURES_SYSTEM) && defined(SUPPORT_MOUSE_GESTURES)
|
||||||
// Process mouse events as touches to be able to use mouse-gestures
|
// Process mouse events as touches to be able to use mouse-gestures
|
||||||
|
|
@ -1505,6 +1517,18 @@ static void MouseCursorPosCallback(GLFWwindow *window, double x, double y)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static EM_BOOL EmscriptenMouseMoveCallback(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData)
|
||||||
|
{
|
||||||
|
// To emulate the GLFW_RAW_MOUSE_MOTION property.
|
||||||
|
if (CORE.Input.Mouse.cursorHidden)
|
||||||
|
{
|
||||||
|
CORE.Input.Mouse.previousPosition.x = lockedMousePos.x - mouseEvent->movementX;
|
||||||
|
CORE.Input.Mouse.previousPosition.y = lockedMousePos.y - mouseEvent->movementY;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1; // The event was consumed by the callback handler
|
||||||
|
}
|
||||||
|
|
||||||
// GLFW3 Scrolling Callback, runs on mouse wheel
|
// GLFW3 Scrolling Callback, runs on mouse wheel
|
||||||
static void MouseScrollCallback(GLFWwindow *window, double xoffset, double yoffset)
|
static void MouseScrollCallback(GLFWwindow *window, double xoffset, double yoffset)
|
||||||
{
|
{
|
||||||
|
|
@ -1598,6 +1622,12 @@ static EM_BOOL EmscriptenPointerlockCallback(int eventType, const EmscriptenPoin
|
||||||
{
|
{
|
||||||
CORE.Input.Mouse.cursorHidden = EM_ASM_INT( { if (document.pointerLockElement) return 1; }, 0);
|
CORE.Input.Mouse.cursorHidden = EM_ASM_INT( { if (document.pointerLockElement) return 1; }, 0);
|
||||||
|
|
||||||
|
if (CORE.Input.Mouse.cursorHidden)
|
||||||
|
{
|
||||||
|
lockedMousePos = CORE.Input.Mouse.currentPosition;
|
||||||
|
CORE.Input.Mouse.previousPosition = lockedMousePos;
|
||||||
|
}
|
||||||
|
|
||||||
return 1; // The event was consumed by the callback handler
|
return 1; // The event was consumed by the callback handler
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
13
src/raudio.c
13
src/raudio.c
|
|
@ -1274,17 +1274,17 @@ Wave WaveCopy(Wave wave)
|
||||||
return newWave;
|
return newWave;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Crop a wave to defined samples range
|
// Crop a wave to defined frames range
|
||||||
// NOTE: Security check in case of out-of-range
|
// NOTE: Security check in case of out-of-range
|
||||||
void WaveCrop(Wave *wave, int initSample, int finalSample)
|
void WaveCrop(Wave *wave, int initFrame, int finalFrame)
|
||||||
{
|
{
|
||||||
if ((initSample >= 0) && (initSample < finalSample) && ((unsigned int)finalSample < (wave->frameCount*wave->channels)))
|
if ((initFrame >= 0) && (initFrame < finalFrame) && ((unsigned int)finalFrame < wave->frameCount))
|
||||||
{
|
{
|
||||||
int sampleCount = finalSample - initSample;
|
int frameCount = finalFrame - initFrame;
|
||||||
|
|
||||||
void *data = RL_MALLOC(sampleCount*wave->sampleSize/8);
|
void *data = RL_MALLOC(frameCount*wave->channels*wave->sampleSize/8);
|
||||||
|
|
||||||
memcpy(data, (unsigned char *)wave->data + (initSample*wave->channels*wave->sampleSize/8), sampleCount*wave->sampleSize/8);
|
memcpy(data, (unsigned char *)wave->data + (initFrame*wave->channels*wave->sampleSize/8), frameCount*wave->channels*wave->sampleSize/8);
|
||||||
|
|
||||||
RL_FREE(wave->data);
|
RL_FREE(wave->data);
|
||||||
wave->data = data;
|
wave->data = data;
|
||||||
|
|
@ -1348,7 +1348,6 @@ Music LoadMusicStream(const char *fileName)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
drwav_uninit(ctxWav);
|
|
||||||
RL_FREE(ctxWav);
|
RL_FREE(ctxWav);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1624,7 +1624,7 @@ RLAPI void SetSoundVolume(Sound sound, float volume); // Set vol
|
||||||
RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level)
|
RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level)
|
||||||
RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 is center)
|
RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 is center)
|
||||||
RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave
|
RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave
|
||||||
RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range
|
RLAPI void WaveCrop(Wave *wave, int initFrame, int finalFrame); // Crop a wave to defined frames range
|
||||||
RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format
|
RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format
|
||||||
RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a 32bit float data array
|
RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a 32bit float data array
|
||||||
RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples()
|
RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples()
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Defines and Macros
|
// Defines and Macros
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -591,8 +591,8 @@ RLAPI void rlFrustum(double left, double right, double bottom, double top, doubl
|
||||||
RLAPI void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar);
|
RLAPI void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar);
|
||||||
RLAPI void rlViewport(int x, int y, int width, int height); // Set the viewport area
|
RLAPI void rlViewport(int x, int y, int width, int height); // Set the viewport area
|
||||||
RLAPI void rlSetClipPlanes(double near, double far); // Set clip planes distances
|
RLAPI void rlSetClipPlanes(double near, double far); // Set clip planes distances
|
||||||
RLAPI double rlGetCullDistanceNear(); // Get cull plane distance near
|
RLAPI double rlGetCullDistanceNear(void); // Get cull plane distance near
|
||||||
RLAPI double rlGetCullDistanceFar(); // Get cull plane distance far
|
RLAPI double rlGetCullDistanceFar(void); // Get cull plane distance far
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Functions Declaration - Vertex level operations
|
// Functions Declaration - Vertex level operations
|
||||||
|
|
@ -2038,7 +2038,7 @@ void rlClearScreenBuffers(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check and log OpenGL error codes
|
// Check and log OpenGL error codes
|
||||||
void rlCheckErrors()
|
void rlCheckErrors(void)
|
||||||
{
|
{
|
||||||
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||||
int check = 1;
|
int check = 1;
|
||||||
|
|
|
||||||
|
|
@ -3431,7 +3431,7 @@ void GenMeshTangents(Mesh *mesh)
|
||||||
Vector3 *tan1 = (Vector3 *)RL_MALLOC(mesh->vertexCount*sizeof(Vector3));
|
Vector3 *tan1 = (Vector3 *)RL_MALLOC(mesh->vertexCount*sizeof(Vector3));
|
||||||
Vector3 *tan2 = (Vector3 *)RL_MALLOC(mesh->vertexCount*sizeof(Vector3));
|
Vector3 *tan2 = (Vector3 *)RL_MALLOC(mesh->vertexCount*sizeof(Vector3));
|
||||||
|
|
||||||
for (int i = 0; i < mesh->vertexCount; i += 3)
|
for (int i = 0; i < mesh->vertexCount - 3; i += 3)
|
||||||
{
|
{
|
||||||
// Get triangle vertices
|
// Get triangle vertices
|
||||||
Vector3 v1 = { mesh->vertices[(i + 0)*3 + 0], mesh->vertices[(i + 0)*3 + 1], mesh->vertices[(i + 0)*3 + 2] };
|
Vector3 v1 = { mesh->vertices[(i + 0)*3 + 0], mesh->vertices[(i + 0)*3 + 1], mesh->vertices[(i + 0)*3 + 2] };
|
||||||
|
|
|
||||||
|
|
@ -2240,7 +2240,11 @@ static Font LoadBMFont(const char *fileName)
|
||||||
// Fill character image data from full font data
|
// Fill character image data from full font data
|
||||||
font.glyphs[i].image = ImageFromImage(fullFont, font.recs[i]);
|
font.glyphs[i].image = ImageFromImage(fullFont, font.recs[i]);
|
||||||
}
|
}
|
||||||
else TRACELOG(LOG_WARNING, "FONT: [%s] Some characters data not correctly provided", fileName);
|
else
|
||||||
|
{
|
||||||
|
font.glyphs[i].image = GenImageColor(font.recs[i].width, font.recs[i].height, BLACK);
|
||||||
|
TRACELOG(LOG_WARNING, "FONT: [%s] Some characters data not correctly provided", fileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UnloadImage(fullFont);
|
UnloadImage(fullFont);
|
||||||
|
|
|
||||||
|
|
@ -4510,8 +4510,13 @@ Color Fade(Color color, float alpha)
|
||||||
// Get hexadecimal value for a Color
|
// Get hexadecimal value for a Color
|
||||||
int ColorToInt(Color color)
|
int ColorToInt(Color color)
|
||||||
{
|
{
|
||||||
int result = (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a);
|
int result = 0;
|
||||||
|
|
||||||
|
result = (int)(((unsigned int)color.r << 24) |
|
||||||
|
((unsigned int)color.g << 16) |
|
||||||
|
((unsigned int)color.b << 8) |
|
||||||
|
(unsigned int)color.a);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user