Skip to content

v5.5 #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 105 commits into
base: master
Choose a base branch
from
Open

v5.5 #223

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
d50f3ed
well that also works ig
bitten2up Dec 13, 2023
7494295
oops
bitten2up Dec 13, 2023
6a9e404
remove some documentation
bitten2up Dec 14, 2023
2ac057b
Merge old 5.1.0 commits into new 5.1.0 branch (#52)
IoIxD Jun 2, 2024
3efccc2
left some merge conflicts in by accident
IoIxD Jun 2, 2024
29cb99e
submodule bump
IoIxD Jun 2, 2024
b391151
Fix: `draw_mesh` receives reference instead of owned value
OrangethewellTest Jun 2, 2024
39f5a12
well that also works ig
bitten2up Dec 13, 2023
774560a
remove some documentation
bitten2up Dec 14, 2023
13b8c5e
Fix: `draw_mesh` receives reference instead of owned value
OrangethewellTest Jun 2, 2024
fac4086
Merge branch 'raylib-rs-5.1.0' into 5.1.0
OrangethewellTest Jun 2, 2024
f8a3fc2
fix conflicts
OrangethewellTest Jun 2, 2024
cd37940
Merge pull request #54 from orangethewell/5.1.0
IoIxD Jun 2, 2024
11112ee
Initial fixes to get 5.1 building
IoIxD Jun 2, 2024
256584c
get rid of the lint
IoIxD Jun 2, 2024
1056357
general: initial fixes to get 5.1 building.
IoIxD Jun 2, 2024
3716554
wrote a small python script to check what functions need to be implem…
IoIxD Jun 3, 2024
fed3cae
Merge branch '5.1.0' of github.com:raylib-rs/raylib-rs into 5.1.0
IoIxD Jun 3, 2024
ee6d42b
Add `isShaderReady()` wrapper #56
OrangethewellTest Jun 3, 2024
6172a7c
Add `GetShaderLocationAttrib()` wrapper
OrangethewellTest Jun 3, 2024
80205cf
Add `DrawCircleLinesV()` wrapper
OrangethewellTest Jun 3, 2024
c36dd4c
Add `DrawCubeWiresV()` wrapper
OrangethewellTest Jun 3, 2024
35d5811
Add `DrawCylinderEx()` wrapper
OrangethewellTest Jun 3, 2024
6127d2a
Add `DrawCylinderWiresEx()` wrapper
OrangethewellTest Jun 3, 2024
f0dfc56
Fix docs for `draw_rectangle_rounded_*` functions
OrangethewellTest Jun 3, 2024
d57f116
Fix `draw_circle_lines_v()` missing name
OrangethewellTest Jun 3, 2024
d8cc4d5
fix shader `is_ready` function name
OrangethewellTest Jun 5, 2024
0dd73a0
all: added basic functions
IoIxD Jun 6, 2024
1774f9c
drawing: accidentally had draw_capsule_wires call DrawCapsule
IoIxD Jun 6, 2024
beafa78
audio: oh, we don't drop sound alias
IoIxD Jun 6, 2024
ad0dccf
Fix update_camera_pro
fooeyround Jun 6, 2024
c251dde
Rework callback system to use atomic instead of Mutex.
TSnake41 Jul 6, 2024
dfd1ae0
Relax &mut self requirements on Audio types
Kacper-Kondracki Jul 22, 2024
6643a54
feat(error)!: add designated error type
alexmozaidze Jul 7, 2024
aa6f971
fix matrix rotation on axis
computermouth Aug 9, 2024
f799b09
Replaced `naglebra_interop` with `convert_mint` feature.
nikhilr612 Aug 4, 2024
3d4d52d
Merge branch 'master' into 5.1.0
IoIxD Aug 16, 2024
38b61df
Merge pull request #76 from raylib-rs/5.1.0
IoIxD Aug 16, 2024
4b1da95
readme: fixed readme
IoIxD Aug 16, 2024
172810a
Implementing DerefMut for most RaylibDrawHandle Modes
Mathys-Gasnier Aug 16, 2024
5ff0261
Merge pull request #77 from Mathys-Gasnier/5.1.0
IoIxD Aug 16, 2024
20370d9
Merge branch 'deltaphc:master' into 5.1.0
IoIxD Aug 20, 2024
722d632
Merge pull request #79 from raylib-rs/5.1.0
IoIxD Aug 20, 2024
2eafc33
Merge the changes just made to stable back into unstable (#82)
IoIxD Aug 21, 2024
dd266a4
Added more 5.5 functions (#78)
IoIxD Aug 21, 2024
a170cee
Add closure equivalants to the begin_... functions (#84)
IoIxD Sep 16, 2024
f9f435d
fix: fix build on arm (#88)
theoparis Oct 24, 2024
0f239c9
Routine 5.5 update (#91)
IoIxD Oct 24, 2024
e831eab
remove double &mut (#61)
NewGirlJade Oct 24, 2024
0c8d134
unremove the file module (#92)
IoIxD Oct 24, 2024
17142a6
remove unused dependencies (#94)
jestarray Oct 27, 2024
3592c29
partial android support (#98)
jestarray Oct 29, 2024
230012a
make raylib-sys/raylib submodule shallow (#99)
jestarray Oct 31, 2024
a2e4125
make sure gles2 links to needed libs and added gles3 (#100)
jestarray Nov 2, 2024
8683f0a
added desktop sdl backend support (#101)
jestarray Nov 3, 2024
6545445
[general] bumped submodule to 5.5
IoIxD Dec 2, 2024
19dcfd1
Rest of 5.5 (#103)
IoIxD Dec 2, 2024
cae1e5d
[build] we will not be getting better wasm compilation after all (#105)
IoIxD Dec 3, 2024
181e473
[readme] version bump, remove outdated "future changes" section, move…
IoIxD Dec 3, 2024
64a16f9
[find_unimplemented] raygui functions
IoIxD Dec 3, 2024
2491aee
[raygui] Remove IntoCStr, add a few more functions.
IoIxD Dec 3, 2024
9446281
[raygui] we can bind GuiColorBarHue safely as it's a pointer to a float
IoIxD Dec 3, 2024
93d7990
Merge branch 'unstable' into rgui-fix
IoIxD Dec 3, 2024
7d70bc6
Decouple the callback functions from RaylibHandle, allowing them to u…
IoIxD Dec 6, 2024
943b819
add new constructor function for Ray (#109)
sockentrocken Dec 18, 2024
b0d1f9a
rlImGui bindings (#107)
IoIxD Dec 25, 2024
2860541
[samples] working rgui example
IoIxD Dec 28, 2024
25e817a
[rgui] enforce usage of GuiProperty enums
IoIxD Dec 28, 2024
2f34c5e
Merge branch 'unstable' into rgui-fix
IoIxD Dec 28, 2024
ded9b79
[rgui] impl Into<String> -> &str
IoIxD Dec 28, 2024
aae1d32
[imgui] accidentally left an import in mod.rs that errors if imgui fe…
IoIxD Dec 29, 2024
ba1f5d9
Rework gui_list_view_ex.
TSnake41 Dec 30, 2024
6d0d128
Various examples fixes (#115)
TSnake41 Dec 30, 2024
7654752
Audio improvements (#116)
TSnake41 Jan 22, 2025
68dd743
Merge pull request #106 from IoIxD/rgui-fix
TSnake41 Jan 22, 2025
9ac3acf
feat: add nixos shell.nix and docs for it (#123)
JamesKEbert Feb 6, 2025
fbe882a
added back nobuild because removing it was stupid why did i do that w…
IoIxD Feb 14, 2025
34f21f6
Put specs behind feature (#125)
izzymg Feb 14, 2025
2fd6fcd
Expanded nobuild flag (#127)
IoIxD Feb 15, 2025
eca46e2
Added binding for SetAudioStreamBufferSizeDefault(int) (#128)
Barysk Mar 17, 2025
317a0b5
attach_audio_stream_processor_to_music: attach one or more closures a…
goto40 Mar 17, 2025
d952343
Assorted 5.5 fixes (#132)
IoIxD Mar 21, 2025
a725c30
[raylib-test] remove set_file_text_loader (#134)
IoIxD Mar 21, 2025
789ede0
[raylib-sys] bindgen feature should be default oops (#136)
IoIxD Mar 21, 2025
fba491e
Imgui bindings are only called when imgui feature is enabled (#142)
AustinOliverHaskell Mar 25, 2025
91bcb49
Version bump to 5.5.1 so that I can publish the MacOS fix (#145)
IoIxD Mar 30, 2025
bdc64b2
Change get_mouse_wheel_move_v return type (#139)
AmityWilder Mar 30, 2025
0a9e8b2
Move check_collision_circle_line out of Rectangle impl (#149)
AmityWilder Apr 2, 2025
95234d1
[rgui] gui_panel handles empty str (#150)
jgabaut Apr 2, 2025
aadf1a7
Fix double-end-draw bug (#152)
AmityWilder Apr 2, 2025
cb0c004
Fix update_texture_rec precondition (#153)
AmityWilder Apr 2, 2025
ac948ce
Fix documentation mistake (#154)
AmityWilder Apr 2, 2025
4ef4837
Implement `DataBuf` structure (#155)
AmityWilder Apr 3, 2025
bd8b94d
fix: Image::get_color should not require mut (#157)
edvinsternvik Apr 6, 2025
d830925
[readme] remove mention of physac (#151)
IoIxD Apr 6, 2025
0bb5495
Move `.as_ptr()` so its return doesn't dangle (#163)
AmityWilder Apr 9, 2025
86dfff7
Remove dependency on cfg-if (#159)
AmityWilder Apr 9, 2025
25f6790
Simplify Serde `use` statements in `color.rs` and `window.rs` (#161)
AmityWilder Apr 9, 2025
a3d13c1
Make draw modes slightly more versatile (#165)
AmityWilder Apr 9, 2025
85d67ce
Remove redundant camera argument (#167)
AmityWilder Apr 9, 2025
e6f7a59
Get `load_shader` and `load_shader_from_memory` working with Option e…
AmityWilder Apr 10, 2025
927dccd
Implement lazy iterators (#171)
AmityWilder Apr 12, 2025
7ed5adb
Fix inconsistencies in documentation/attributes/function inclusion (#…
AmityWilder Apr 12, 2025
4d53bd4
Fix lifetime mistake (#176)
AmityWilder Apr 12, 2025
93dde6b
Better errors (#173)
AmityWilder Apr 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 6 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -26,31 +26,7 @@ jobs:
run: git submodule init; git submodule update
- name: Install alsa, udev, glfw3, sdl, and wayland
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libglfw3-dev libwayland-dev libsdl2-dev
- name: Run doc tests with all features (this also compiles README examples)
run: cargo test --doc --all-features
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ubuntu-latest-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
override: true
- name: Setup git submodules
run: git submodule init; git submodule update
- name: Install alsa, udev, glfw3, sdl, and wayland
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libglfw3-dev libwayland-dev libsdl2-dev
- name: Run clippy
run: cargo clippy --workspace --all-targets --all-features
- name: Check format
run: cargo fmt --all -- --check
- name: Clone latest GLFW3
run: git clone https://github.com/glfw/glfw; cd glfw; mkdir build; cd build; cmake ..; make -j$(nproc); sudo make install; cd ../..;
- name: Run doc tests (this also compiles README examples)
run: cargo test --doc
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/target
target
**/*.rs.bk
Cargo.lock
/.vscode
Expand Down
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[submodule "raylib-sys/raylib"]
path = raylib-sys/raylib
url = https://github.com/raysan5/raylib
commit = "5.5"
shallow = true
[submodule "raylib-sys/binding/rlImGui"]
path = raylib-sys/binding/rlImGui
url = https://github.com/raylib-extras/rlImGui/
commit = "7864355"
82 changes: 15 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
<p align="center">

![rust](https://img.shields.io/badge/rust-1.77+-orange.svg?style=flat-square&logo=rust)
[![crates.io](https://img.shields.io/crates/v/raylib.svg?style=flat-square)](https://crates.io/crates/raylib)
[![docs](https://docs.rs/raylib/badge.svg)](https://docs.rs/raylib)
[![discord](https://img.shields.io/discord/426912293134270465)](https://discord.gg/VkzNHUE)

</p>

<table border="0">
<tr>
<td>
Expand All @@ -18,7 +9,7 @@

# raylib-rs

raylib-rs is a Rust binding for [raylib](http://www.raylib.com/) 5.0. It currently targets the _stable_ Rust toolchain, version 1.78 or higher.
raylib-rs is a Rust binding for [raylib](http://www.raylib.com/) 5.5. It currently targets Rust toolchain version 1.78 or higher.

Please checkout the showcase directory to find usage examples!

Expand Down Expand Up @@ -47,7 +38,6 @@ Most development happens over at: https://github.com/raylib-rs/raylib-rs
| ------ | ------------------ | ------------------ | ------------------ | -------------- | ------- |
| core | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: |
| rgui | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | ❔ | :x: |
| physac | :construction: | :construction: | :construction: | ❔ | :x: |
| rlgl | :heavy_check_mark: | :x: | :x: | ❔ | :x: |

## Build Dependencies
Expand All @@ -59,7 +49,7 @@ Follow instructions for building raylib for your platform [here](https://github.

```toml
[dependencies]
raylib = { version = "5.0" }
raylib = { version = "5.5" }
```

2. Start coding!
Expand All @@ -82,6 +72,18 @@ fn main() {
}
```

### NixOS

To use raylib-rs on NixOS there's a provided nix-shell file `shell.nix` at the root of the repo that should get you up and running, which can be used like so:

`nix-shell ./shell.nix`

You'll also need to enable the Wayland feature on the raylib crate:

`cargo add raylib -F wayland`

Contributions are welcome to improve or fix the shell.nix!

# Tech Notes

- Structs holding resources have RAII/move semantics, including: `Image`, `Texture2D`, `RenderTexture2D`, `Font`, `Mesh`, `Shader`, `Material`, and `Model`.
Expand All @@ -107,53 +109,7 @@ fn main() {

## Cross-compiling using `cross`

The [@rust-embedded](https://github.com/rust-embedded) project provides a handy tool called [`cross`](https://github.com/rust-embedded/cross) that uses docker to cross-compile any cargo project to one of their many [supported platforms](https://github.com/rust-embedded/cross#supported-targets). This tool makes it easy to cross-compile `raylib-rs` for binary distribution (in cases where you are producing a pre-compiled game for example).

### Anything to Windows

Cross-compiling from other platforms to Windows is the simplest. Just build your project with this command instead of the usual `cargo build`:

```sh
cross build --target x86_64-pc-windows-gnu --release
```

It should be noted that the resulting exe will likely not run under `wine` due to an issue with Raylib's audio handling.

### Anything to Linux

Cross-compiling from any platform to Linux, or from Linux to Linux requires a little extra work since `raylib-sys` has some system dependencies not provided by `cross`. This following example assumes you are compiling for `x86_64-unknown-linux-gnu`, but it can be any Linux-y triple.

Firstly, a custom build container must be defined. The following `Dockerfile` is the minimum setup for compiling `raylib-sys`:

```Dockerfile
FROM rustembedded/cross:x86_64-unknown-linux-gnu-0.2.1

RUN apt-get update -y
RUN apt-get install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev -y
```

With the image defined, build it locally with:

```sh
docker build -t raylib_rs_env .
```

This will produce a local docker image called `raylib_rs_env` which `cross` will use instead of the default Linux image(s). To tell `cross` to use this image, create a `Cross.toml` file beside your `Cargo.toml`, and add the following (remembering to change things to suit your setup):

```toml
[target.x86_64-unknown-linux-gnu]
image = "raylib_rs_env"
```

The Linux build can now be produced with:

```sh
cross build --target x86_64-unknown-linux-gnu --release
```

# MacOS / Darwin / IOS

`cross` does not support cross-compilation to any of Apple's operating systems as of now. Keep an eye on their repository in case this ever changes.
Cross compiling with raylib-rs can be made easier with cross. [See more on the wiki](https://github.com/raylib-rs/raylib-rs/wiki/Cross%E2%80%90compiling-using-cross)

# Extras

Expand All @@ -164,14 +120,6 @@ cross build --target x86_64-unknown-linux-gnu --release

The raylib-test crate tests the bindings by opening a window, and checking the results of various functions. It requires nightly to use.

# Future Goals

- Port raylib examples over to Rust.
- More tests.
- More platform testing.
- Even more testing.
- Physac port?

# Contribution & Support

All contributions are welcome. Chat about raylib on [discord](https://discord.gg/VkzNHUE)
86 changes: 86 additions & 0 deletions find_unimplemented.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import os

# Functions we won't implement.
wont_impl = [
# We have this implemented in a C file so it's not caught.
"SetTraceLogCallback",
# UTF-8 functions
"GetCodepointNext",
"GetCodepointPrevious",
"CodepointToUTF8",
"LoadUTF8",
"UnloadUTF8",
# Text functions
"TextCopy",
"TextIsEqual",
"TextLength",
"TextFormat",
"TextSubtext",
"TextReplace",
"TextInsert",
"TextJoin",
"TextSplit",
"TextAppend",
"TextFindIndex",
"TextToUpper",
"TextToLower",
"TextToPascal",
"TextToSnake",
"TextToCamel",
"TextToInteger",
"TextToFloat",
# file functions
"LoadFileData",
"UnloadFileData",
"SaveFileData",
"LoadFileText",
"UnloadFileText",
"SaveFileText",
"FileExists",
"DirectoryExists",
"GetFileExtension",
"GetFileName",
"GetFileNameWithoutExt",
"GetDirectoryPath",
"GetPrevDirectoryPath",
"GetWorkingDirectory",
"MakeDirectory",
"ChangeDirectory",
"IsFileNameValid",
"GetFileModTime",
"ComputeCRC32",
"ComputeMD5",
"ComputeSHA1",
# Misc functions that aren't needed.
"MemRealloc",
]


def file_find(lib, src, dest, opener):
print("=====",lib,"=====")

files = os.scandir(dest)
src_files = []

for file in files:
if file.is_file(follow_symlinks=True):
f = open(file.path)
src_files.append("\n".join(f.readlines()))

d = open(src)
lines = list(filter(lambda f: f.startswith(opener),d.readlines()))

for line in lines:
func_name = list(filter(lambda f: "(" in f, line.split(" ")))[0].split("(")[0].replace("*","")

in_a_file = False
for file in src_files:
if func_name in wont_impl or "ffi::"+func_name in file:
in_a_file = True
break
if not in_a_file:
print("- [ ] "+func_name)
print("")

file_find("Raylib","./raylib-sys/raylib/src/raylib.h", "./raylib/src/core/", "RLAPI")
file_find("Raygui","./raylib-sys/binding/raygui.h","./raylib/src/rgui", " RAYGUIAPI")
34 changes: 25 additions & 9 deletions raylib-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "raylib-sys"
version = "5.0.1"
authors = ["DeltaPHC <phclem@protonmail.com>"]
version = "5.5.1"
authors = ["raylib-rs team <https://github.com/raylib-rs/raylib-rs>"]
license = "Zlib"
description = "Raw FFI bindings for Raylib"
documentation = "https://docs.rs/raylib-sys"
Expand All @@ -11,25 +11,41 @@ categories = ["external-ffi-bindings"]
edition = "2018"
exclude = ["raylib/examples/*", "raylib/projects/*", "raylib/templates/*"]

[dependencies]
imgui = { version = "0.12.0", optional = true, features = [] }
imgui-sys = { version = "0.12.0", optional = true }

[build-dependencies]
fs_extra = "1.2"
cmake = "0.1.49"
cmake = "0.1.51"
cc = "1.0"
bindgen = "0.69.0"
bindgen = "0.70"

[features]
default = []
# Build Raylib headless for docs. Up to you to link
#nobuild = []

# Build Raylib headless for docs/esoteric platforms. Up to you to link.
nobuild = []
# Generate bindings automatically.
# You can turn this off if you wanna go into the source and put in your own bindings.rs, which is
# useful since bindgen doesn't work on esoteric platforms.
bindgen = []
# Build for wayland on linux. Should fix #119
wayland = []
# Bindgen is default
default = ["bindgen"]

# OpenGL stuff, intended for fixing #122
opengl_33 = []
opengl_21 = []
# opengl_11 = [] I couldn't get this one working, the others were fine in my limited testing (unsure about wayland compatibility)
opengl_es_20 = []
opengl_es_30 = []
sdl = []

# Allow disabling screenshots and gifs on f12
noscreenshot = []
nogif = []

# config.h's SUPPORT_CUSTOM_FRAME_CONTROL
custom_frame_control = []

# ImGui support
imgui = ["dep:imgui", "dep:imgui-sys"]
3 changes: 3 additions & 0 deletions raylib-sys/binding/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rlImGui/** linguist-vendored
imgui/** linguist-vendored
raygui.h linguist-vendored
1 change: 1 addition & 0 deletions raylib-sys/binding/binding.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "../raylib/src/rlgl.h"
#include "utils_log.h"


typedef enum
{
RAYGUI_ICON_NONE = 0,
Expand Down
11 changes: 11 additions & 0 deletions raylib-sys/binding/imgui/decoy/imgui.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* Decoy imgui.h because bindgen can't actually (and shouldn't actually) bind a
* C++ file*/

#ifndef IMGUI_DECOY
#define IMGUI_DECOY

#define IMGUI_IMPL_API
typedef struct ImVec2 ImVec2;
typedef struct ImGuiContext ImGuiContext;

#endif
Loading
Loading