Skip to content
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

v5.5 #223

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

v5.5 #223

Changes from 1 commit
Commits
Show all changes
85 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
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
Prev Previous commit
Next Next commit
[rgui] impl Into<String> -> &str
IoIxD committed Dec 28, 2024
commit ded9b798dd96f415ce5774e8105ca726c401b5cc
190 changes: 82 additions & 108 deletions raylib/src/rgui/safe.rs
Original file line number Diff line number Diff line change
@@ -76,8 +76,8 @@ impl RaylibHandle {
}
/// Load style file (.rgs)
#[inline]
pub fn gui_load_style(&mut self, filename: impl Into<String>) {
let c_filename = CString::new(filename.into()).unwrap();
pub fn gui_load_style(&mut self, filename: &str) {
let c_filename = CString::new(filename).unwrap();
unsafe { ffi::GuiLoadStyle(c_filename.as_ptr()) }
}
/// Load style default over global style
@@ -100,8 +100,8 @@ impl RaylibHandle {

/// Set tooltip string
#[inline]
pub fn gui_set_tooltip(&mut self, tooltip: impl Into<String>) {
let c_text = CString::new(tooltip.into()).unwrap();
pub fn gui_set_tooltip(&mut self, tooltip: &str) {
let c_text = CString::new(tooltip).unwrap();
unsafe {
ffi::GuiSetTooltip(c_text.as_ptr());
}
@@ -188,8 +188,8 @@ pub trait RaylibDrawGui {
}
/// Load style file (.rgs)
#[inline]
fn gui_load_style(&mut self, filename: impl Into<String>) {
let c_filename = CString::new(filename.into()).unwrap();
fn gui_load_style(&mut self, filename: &str) {
let c_filename = CString::new(filename).unwrap();
unsafe { ffi::GuiLoadStyle(c_filename.as_ptr()) }
}
/// Load style default over global style
@@ -199,49 +199,41 @@ pub trait RaylibDrawGui {
}
/// Window Box control, shows a window that can be closed
#[inline]
fn gui_window_box(
&mut self,
bounds: impl Into<ffi::Rectangle>,
title: impl Into<String>,
) -> bool {
let c_filename = CString::new(title.into()).unwrap();
fn gui_window_box(&mut self, bounds: impl Into<ffi::Rectangle>, title: &str) -> bool {
let c_filename = CString::new(title).unwrap();
unsafe { ffi::GuiWindowBox(bounds.into(), c_filename.as_ptr()) > 0 }
}
/// Group Box control with text name
#[inline]
fn gui_group_box(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
) -> bool {
let c_filename = CString::new(text.into()).unwrap();
fn gui_group_box(&mut self, bounds: impl Into<ffi::Rectangle>, text: &str) -> bool {
let c_filename = CString::new(text).unwrap();
unsafe { ffi::GuiGroupBox(bounds.into(), c_filename.as_ptr()) > 0 }
}
/// Line separator control, could contain text
#[inline]
fn gui_line(&mut self, bounds: impl Into<ffi::Rectangle>, text: impl Into<String>) -> bool {
let c_filename = CString::new(text.into()).unwrap();
fn gui_line(&mut self, bounds: impl Into<ffi::Rectangle>, text: &str) -> bool {
let c_filename = CString::new(text).unwrap();
unsafe { ffi::GuiLine(bounds.into(), c_filename.as_ptr()) > 0 }
}
/// Panel control, useful to group controls
#[inline]
fn gui_panel(&mut self, bounds: impl Into<ffi::Rectangle>, text: impl Into<String>) -> bool {
let c_filename = CString::new(text.into()).unwrap();
fn gui_panel(&mut self, bounds: impl Into<ffi::Rectangle>, text: &str) -> bool {
let c_filename = CString::new(text).unwrap();
unsafe { ffi::GuiPanel(bounds.into(), c_filename.as_ptr()) > 0 }
}
/// Scroll Panel control
#[inline]
fn gui_scroll_panel(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
text: &str,
content: impl Into<ffi::Rectangle>,
scroll: impl Into<ffi::Vector2>,
view: impl Into<ffi::Rectangle>,
) -> (bool, Rectangle, Vector2) {
let mut scroll = scroll.into();
let mut view = view.into();
let c_filename = CString::new(text.into()).unwrap();
let c_filename = CString::new(text).unwrap();
let result = unsafe {
ffi::GuiScrollPanel(
bounds.into(),
@@ -255,94 +247,90 @@ pub trait RaylibDrawGui {
}
/// Label control, shows text
#[inline]
fn gui_label(&mut self, bounds: impl Into<ffi::Rectangle>, text: impl Into<String>) -> bool {
let c_text = CString::new(text.into()).unwrap();
fn gui_label(&mut self, bounds: impl Into<ffi::Rectangle>, text: &str) -> bool {
let c_text = CString::new(text).unwrap();
unsafe { ffi::GuiLabel(bounds.into(), c_text.as_ptr()) > 0 }
}
/// Button control, returns true when clicked
#[inline]
fn gui_button(&mut self, bounds: impl Into<ffi::Rectangle>, text: impl Into<String>) -> bool {
let c_text = CString::new(text.into()).unwrap();
fn gui_button(&mut self, bounds: impl Into<ffi::Rectangle>, text: &str) -> bool {
let c_text = CString::new(text).unwrap();
unsafe { ffi::GuiButton(bounds.into(), c_text.as_ptr()) > 0 }
}
/// Label button control, show true when clicked
#[inline]
fn gui_label_button(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
) -> bool {
let c_text = CString::new(text.into()).unwrap();
fn gui_label_button(&mut self, bounds: impl Into<ffi::Rectangle>, text: &str) -> bool {
let c_text = CString::new(text).unwrap();
unsafe { ffi::GuiLabelButton(bounds.into(), c_text.as_ptr()) > 0 }
}
/// Toggle Button control, returns true when active
#[inline]
fn gui_toggle(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
text: &str,
active: &mut bool,
) -> bool {
let c_text = CString::new(text.into()).unwrap();
let c_text = CString::new(text).unwrap();
unsafe { ffi::GuiToggle(bounds.into(), c_text.as_ptr(), active) > 0 }
}
/// Toggle Group control, returns active toggle index
#[inline]
fn gui_toggle_group(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
text: &str,
active: &mut i32,
) -> i32 {
let c_text = CString::new(text.into()).unwrap();
let c_text = CString::new(text).unwrap();
unsafe { ffi::GuiToggleGroup(bounds.into(), c_text.as_ptr(), active) }
}
/// Check Box control, returns true when active
#[inline]
fn gui_check_box(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
text: &str,
checked: &mut bool,
) -> bool {
let c_text = CString::new(text.into()).unwrap();
let c_text = CString::new(text).unwrap();
unsafe { ffi::GuiCheckBox(bounds.into(), c_text.as_ptr(), checked) > 0 }
}
/// Combo Box control, returns selected item index
#[inline]
fn gui_combo_box(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
text: &str,
active: &mut i32,
) -> i32 {
let c_text = CString::new(text.into()).unwrap();
let c_text = CString::new(text).unwrap();
unsafe { ffi::GuiComboBox(bounds.into(), c_text.as_ptr(), active) }
}
/// Dropdown Box control, returns selected item
#[inline]
fn gui_dropdown_box(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
text: &str,
active: &mut i32,
edit_mode: bool,
) -> bool {
let c_text = CString::new(text.into()).unwrap();
let c_text = CString::new(text).unwrap();
unsafe { ffi::GuiDropdownBox(bounds.into(), c_text.as_ptr(), active, edit_mode) > 0 }
}
/// Spinner control, returns selected value
#[inline]
fn gui_spinner(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
text: &str,
value: &mut i32,
min_value: i32,
max_value: i32,
edit_mode: bool,
) -> bool {
let c_text = CString::new(text.into()).unwrap();
let c_text = CString::new(text).unwrap();
unsafe {
ffi::GuiSpinner(
bounds.into(),
@@ -360,13 +348,13 @@ pub trait RaylibDrawGui {
fn gui_value_box(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
text: &str,
value: &mut i32,
min_value: i32,
max_value: i32,
edit_mode: bool,
) -> bool {
let c_text = CString::new(text.into()).unwrap();
let c_text = CString::new(text).unwrap();
unsafe {
ffi::GuiValueBox(
bounds.into(),
@@ -403,14 +391,14 @@ pub trait RaylibDrawGui {
fn gui_slider(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text_left: impl Into<String>,
text_right: impl Into<String>,
text_left: &str,
text_right: &str,
value: &mut f32,
min_value: f32,
max_value: f32,
) -> bool {
let c_text_left = CString::new(text_left.into()).unwrap();
let c_text_right = CString::new(text_right.into()).unwrap();
let c_text_left = CString::new(text_left).unwrap();
let c_text_right = CString::new(text_right).unwrap();
unsafe {
ffi::GuiSlider(
bounds.into(),
@@ -427,14 +415,14 @@ pub trait RaylibDrawGui {
fn gui_slider_bar(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text_left: impl Into<String>,
text_right: impl Into<String>,
text_left: &str,
text_right: &str,
value: &mut f32,
min_value: f32,
max_value: f32,
) -> bool {
let c_text_left = CString::new(text_left.into()).unwrap();
let c_text_right = CString::new(text_right.into()).unwrap();
let c_text_left = CString::new(text_left).unwrap();
let c_text_right = CString::new(text_right).unwrap();
unsafe {
ffi::GuiSliderBar(
bounds.into(),
@@ -451,14 +439,14 @@ pub trait RaylibDrawGui {
fn gui_progress_bar(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text_left: impl Into<String>,
text_right: impl Into<String>,
text_left: &str,
text_right: &str,
value: &mut f32,
min_value: f32,
max_value: f32,
) -> bool {
let c_text_left = CString::new(text_left.into()).unwrap();
let c_text_right = CString::new(text_right.into()).unwrap();
let c_text_left = CString::new(text_left).unwrap();
let c_text_right = CString::new(text_right).unwrap();
unsafe {
ffi::GuiProgressBar(
bounds.into(),
@@ -472,12 +460,8 @@ pub trait RaylibDrawGui {
}
/// Status Bar control, shows info text
#[inline]
fn gui_status_bar(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
) -> bool {
let c_text = CString::new(text.into()).unwrap();
fn gui_status_bar(&mut self, bounds: impl Into<ffi::Rectangle>, text: &str) -> bool {
let c_text = CString::new(text).unwrap();
unsafe { ffi::GuiStatusBar(bounds.into(), c_text.as_ptr()) > 0 }
}

@@ -486,11 +470,11 @@ pub trait RaylibDrawGui {
fn gui_grid(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
text: &str,
spacing: f32,
subdivs: i32,
) -> (bool, Vector2) {
let c_text = CString::new(text.into()).unwrap();
let c_text = CString::new(text).unwrap();
let mut mouseCell = ffi::Vector2 { x: 0.0, y: 0.0 };
(
unsafe {
@@ -510,11 +494,11 @@ pub trait RaylibDrawGui {
fn gui_list_view(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
text: &str,
scroll_index: &mut i32,
active: &mut i32,
) -> i32 {
let c_text = CString::new(text.into()).unwrap();
let c_text = CString::new(text).unwrap();
unsafe { ffi::GuiListView(bounds.into(), c_text.as_ptr(), scroll_index, active) }
}
/// List View with extended parameters
@@ -547,13 +531,13 @@ pub trait RaylibDrawGui {
fn gui_message_box(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
message: impl Into<String>,
buttons: impl Into<String>,
text: &str,
message: &str,
buttons: &str,
) -> i32 {
let c_text = CString::new(text.into()).unwrap();
let c_message = CString::new(message.into()).unwrap();
let c_buttons = CString::new(buttons.into()).unwrap();
let c_text = CString::new(text).unwrap();
let c_message = CString::new(message).unwrap();
let c_buttons = CString::new(buttons).unwrap();
unsafe {
ffi::GuiMessageBox(
bounds.into(),
@@ -568,18 +552,18 @@ pub trait RaylibDrawGui {
fn gui_text_input_box(
&mut self,
bounds: impl Into<ffi::Rectangle>,
title: impl Into<String>,
message: impl Into<String>,
buttons: impl Into<String>,
title: &str,
message: &str,
buttons: &str,
text: &mut String,
text_max_size: i32,
secret_view_active: &mut bool,
) -> i32 {
// rgui.h: line 3699 MAX_FILENAME_LEN
text.reserve((256 - text.len()).max(0) as usize);
let c_title = CString::new(title.into()).unwrap();
let c_message = CString::new(message.into()).unwrap();
let c_buttons = CString::new(buttons.into()).unwrap();
let c_title = CString::new(title).unwrap();
let c_message = CString::new(message).unwrap();
let c_buttons = CString::new(buttons).unwrap();
let btn_index = unsafe {
ffi::GuiTextInputBox(
bounds.into(),
@@ -600,11 +584,11 @@ pub trait RaylibDrawGui {
fn gui_color_picker(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
text: &str,
color: impl Into<ffi::Color>,
) -> Color {
let mut out = color.into();
let c_text = CString::new(text.into()).unwrap();
let c_text = CString::new(text).unwrap();

let result = unsafe { ffi::GuiColorPicker(bounds.into(), c_text.as_ptr(), &mut out) };
return out.into();
@@ -613,12 +597,8 @@ pub trait RaylibDrawGui {
// NOTE: Useful to add icons by name id (enum) instead of
// a number that can change between ricon versions
#[inline]
fn gui_icon_text(
&mut self,
icon_id: crate::consts::GuiIconName,
text: impl Into<String>,
) -> String {
let c_text = CString::new(text.into()).unwrap();
fn gui_icon_text(&mut self, icon_id: crate::consts::GuiIconName, text: &str) -> String {
let c_text = CString::new(text).unwrap();
let buffer = unsafe { ffi::GuiIconText(icon_id as i32, c_text.as_ptr()) };
if buffer.is_null() {
let ptr = c_text.as_ptr();
@@ -640,10 +620,10 @@ pub trait RaylibDrawGui {
fn gui_color_bar_alpha(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
text: &str,
alpha: &mut f32,
) -> bool {
let c_text = CString::new(text.into()).unwrap();
let c_text = CString::new(text).unwrap();

unsafe { ffi::GuiColorBarAlpha(bounds.into(), c_text.as_ptr(), alpha) > 0 }
}
@@ -653,22 +633,18 @@ pub trait RaylibDrawGui {
fn gui_toggle_slider(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
text: &str,
active: &mut i32,
) -> bool {
let c_text = CString::new(text.into()).unwrap();
let c_text = CString::new(text).unwrap();

unsafe { ffi::GuiToggleSlider(bounds.into(), c_text.as_ptr(), active) > 0 }
}

/// Dummy control for placeholders
#[inline]
fn gui_dummy_rec(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
) -> bool {
let c_text = CString::new(text.into()).unwrap();
fn gui_dummy_rec(&mut self, bounds: impl Into<ffi::Rectangle>, text: &str) -> bool {
let c_text = CString::new(text).unwrap();

unsafe { ffi::GuiDummyRec(bounds.into(), c_text.as_ptr()) > 0 }
}
@@ -678,15 +654,19 @@ pub trait RaylibDrawGui {
fn gui_color_bar_hue(
&mut self,
bounds: impl Into<ffi::Rectangle>,
text: impl Into<String>,
text: &str,
value: &mut f32,
) -> bool {
let c_text = CString::new(text.into()).unwrap();
let c_text = CString::new(text).unwrap();

unsafe { ffi::GuiColorBarHue(bounds.into(), c_text.as_ptr(), value) > 0 }
}
}

#[diagnostic::on_unimplemented(
message = "{Self} is not a gui property, or does not implement the GuiProperty trait.",
note = "As of Raylib 5.5, raygui functions that once took \"property enum as i32\" now just take the enum."
)]
pub trait GuiProperty {
fn as_i32(self) -> i32;
}
@@ -751,9 +731,3 @@ impl GuiProperty for crate::consts::GuiToggleProperty {
self as i32
}
}

impl GuiProperty for i32 {
fn as_i32(self) -> i32 {
self
}
}