Untested update to raylib 3.7
This commit is contained in:
parent
1996635c5b
commit
3e6462d3af
7 changed files with 369 additions and 284 deletions
40
ReadMe.md
40
ReadMe.md
|
|
@ -4,14 +4,16 @@
|
|||
|
||||
Manually tweaked, auto generated [raylib](https://github.com/raysan5/raylib) bindings for zig.
|
||||
|
||||
Bindings tested on raylib version 3.0 and Zig 0.9.0-dev
|
||||
Bindings tested on raylib version 3.7 and Zig 0.9.0-dev
|
||||
|
||||
Thanks to jessrud and sacredbirdman for their contributions to this binding.
|
||||
Thanks to jessrud, mbcrocci, Gertkeno and sacredbirdman for their contributions to this binding.
|
||||
|
||||
The binding currently only supports a subset of raylib. For more information read [here](https://github.com/Not-Nik/raylib-zig#technical-restrictions). Some of these issues are fixed on the [workaround branch](https://github.com/Not-Nik/raylib-zig/tree/workaround), however, this is entirely experimental.
|
||||
The binding currently only supports a subset of raylib. For more information read [here](https://github.com/Not-Nik/raylib-zig#technical-restrictions).
|
||||
|
||||
## Example
|
||||
|
||||
We can copy the default example with some minor changes:
|
||||
|
||||
```zig
|
||||
usingnamespace @import("raylib");
|
||||
|
||||
|
|
@ -50,27 +52,33 @@ pub fn main() anyerror!void
|
|||
```
|
||||
|
||||
## Technical restrictions
|
||||
Due to zig being a relatively new language it does [not have full C ABI support](https://github.com/ziglang/zig/issues/1481) at the moment. For use that mainly means we can't use any functions that return structs that are less than 16 bytes large.
|
||||
Here is an incomplete list of some functions affected by this:
|
||||
|
||||
Due to zig being a relatively new language it does [not have full C ABI support](https://github.com/ziglang/zig/issues/1481) at the moment. For use that mainly means we
|
||||
can't use any functions that return structs that are less than 16 bytes large. Here is an incomplete list of some functions affected by this:
|
||||
|
||||
+ DrawCircleV
|
||||
+ DrawRectangleRec
|
||||
+ DrawModel and all its variations
|
||||
|
||||
Parts of these issue are resolved on the [workaround branch](https://github.com/Not-Nik/raylib-zig/tree/workaround)
|
||||
|
||||
## Building the examples
|
||||
To build all available examples simply `zig build examples`. To list available examples run `zig build --help`. If you want to run and examples, say `basic_window` run `zig build basic_window`
|
||||
|
||||
To build all available examples simply `zig build examples`. To list available examples run `zig build --help`. If you want to run and examples, say `basic_window`
|
||||
run `zig build basic_window`
|
||||
|
||||
## Building and using
|
||||
+ Install raylib
|
||||
+ Execute `projectSetup.sh project_name`, this will create a folder with the name specified
|
||||
+ You can copy that folder anywhere you want and edit the source
|
||||
+ Run `zig build run` at any time to test your project
|
||||
|
||||
+ (Optional) Install raylib
|
||||
+ Execute `projectSetup.sh project_name`, this will create a folder with the name specified
|
||||
+ You can copy that folder anywhere you want and edit the source
|
||||
+ Run `zig build run` at any time to test your project
|
||||
|
||||
### When is the binding updated?
|
||||
I plan on updating it every mayor release (2.5, 3.0, etc.). Keep in mind these are technically header files, so any implementation stuff should be updatable with some hacks on your side.
|
||||
|
||||
I plan on updating it every mayor release (2.5, 3.0, etc.). Keep in mind these are technically header files, so any implementation stuff should be updatable with some
|
||||
hacks on your side.
|
||||
|
||||
### What's to be done?
|
||||
+ _(Done)_ Set up a proper package build and a build script for the examples
|
||||
+ Port all the examples
|
||||
+ Object orientation
|
||||
|
||||
+ _(Done)_ Set up a proper package build and a build script for the examples
|
||||
+ Port all the examples
|
||||
+ Object orientation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue