You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,6 @@ Though this binding tries to stay close to the simple C API, it makes some chang
21
21
22
22
Most development happens over at: https://github.com/raylib-rs/raylib-rs
23
23
24
-
25
24
- Resources are automatically cleaned up when they go out of scope (or when `std::mem::drop` is called). This is essentially RAII. This means that "Unload" functions are not exposed (and not necessary unless you obtain a `Weak` resource using make_weak()).
26
25
- Most of the Raylib API is exposed through `RaylibHandle`, which is for enforcing that Raylib is only initialized once, and for making sure the window is closed properly. RaylibHandle has no size and goes away at compile time. Because of mutability rules, Raylib-rs is thread safe!
27
26
- A `RaylibHandle` and `RaylibThread` are obtained through `raylib::init_window(...)` or through the newer `init()` function which will allow you to `build` up some window options before initialization (replaces `set_config_flags`). RaylibThread should not be sent to any other threads, or used in a any syncronization primitives (Mutex, Arc) etc.
@@ -30,15 +29,17 @@ Most development happens over at: https://github.com/raylib-rs/raylib-rs
30
29
-`Font::from_data`, `Font::set_chars`, and `Font::set_texture` methods were added to create a `Font` from loaded `CharInfo` data.
31
30
-`SubText` and `FormatText` are omitted, and are instead covered by Rust's string slicing and Rust's `format!` macro, respectively.
32
31
32
+
Versions normally match Raylib's own, with the minor number incremented for any patches (i.e. 5.5.1 for Raylib v5.5). On occassion, if enough breaking changes are made in between Raylib releases, we'll release a 5.6, which is 5.5 but with breaking changes.
@@ -49,7 +50,7 @@ Follow instructions for building raylib for your platform [here](https://github.
49
50
50
51
```toml
51
52
[dependencies]
52
-
raylib = { version = "5.5" }
53
+
raylib = { version = "5.6" }
53
54
```
54
55
55
56
2. Start coding!
@@ -78,7 +79,7 @@ To use raylib-rs on NixOS there's a provided nix-shell file `shell.nix` at the r
78
79
79
80
`nix-shell ./shell.nix`
80
81
81
-
You'll also need to enable the Wayland feature on the raylib crate:
82
+
You'll also need to enable the Wayland feature on the raylib crate:
82
83
83
84
`cargo add raylib -F wayland`
84
85
@@ -87,7 +88,7 @@ Contributions are welcome to improve or fix the shell.nix!
87
88
# Tech Notes
88
89
89
90
- Structs holding resources have RAII/move semantics, including: `Image`, `Texture2D`, `RenderTexture2D`, `Font`, `Mesh`, `Shader`, `Material`, and `Model`.
90
-
-`Wave`, `Sound`, `Music`, and `AudioStream` have lifetimes bound to `AudioHandle`.
91
+
-`Wave`, `Sound`, `Music`, and `AudioStream` have lifetimes bound to `AudioHandle`.
91
92
- Functions dealing with string data take in `&str` and/or return an owned `String`, for the sake of safety. The exception to this is the gui draw functions which take &CStr to avoid per frame allocations. The `rstr!` macro helps make this easy.
92
93
- In C, `LoadFontData` returns a pointer to a heap-allocated array of `CharInfo` structs. In this Rust binding, said array is copied into an owned `Vec<CharInfo>`, the original data is freed, and the owned Vec is returned.
93
94
- In C, `LoadDroppedFiles` returns a pointer to an array of strings owned by raylib. Again, for safety and also ease of use, this binding copies said array into a `Vec<String>` which is returned to the caller.
@@ -102,7 +103,8 @@ Contributions are welcome to improve or fix the shell.nix!
###### Note that this may not be a comprehensive list, please add details for your distribution or expand on these packages if you believe this to be incomplete.
107
109
108
110
4. Enable wayland by adding `features=["wayland"]` to your dependency definition
0 commit comments