mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-08 19:47:28 +00:00
Use proper enums for GuiGetStyle
/GuiSetStyle
(#125)
This commit is contained in:
parent
6efc03f6fe
commit
c96627f91a
@ -104,7 +104,9 @@ def add_namespace_to_type(t: str) -> str:
|
||||
t = t[6:]
|
||||
pre += "const "
|
||||
|
||||
if t[0].isupper():
|
||||
if t.startswith("Gui"):
|
||||
t = "rgui." + t
|
||||
elif t[0].isupper():
|
||||
t = "rl." + t
|
||||
elif t in ["float3", "float16"]:
|
||||
t = "rlm." + t
|
||||
@ -168,6 +170,8 @@ _fix_enums_data = [
|
||||
("flags", "Gesture", r"SetGesturesEnabled"),
|
||||
("button", "GamepadButton", r".*GamepadButton.*"),
|
||||
("button", "MouseButton", r".*MouseButton.*"),
|
||||
("control", "GuiState", r"Gui.etStyle"),
|
||||
("property", "GuiControlProperty", r"Gui.etStyle"),
|
||||
]
|
||||
def fix_enums(arg_name, arg_type, func_name):
|
||||
if func_name.startswith("rl"):
|
||||
|
@ -1 +1,4 @@
|
||||
// raylib-zig (c) Nikolas Wipper 2024
|
||||
|
||||
const rl = @import("raylib-zig");
|
||||
const rgui = @import("raygui.zig");
|
||||
|
@ -1,4 +1,7 @@
|
||||
// raylib-zig (c) Nikolas Wipper 2024
|
||||
|
||||
const rl = @import("raylib-zig");
|
||||
const rgui = @import("raygui.zig");
|
||||
|
||||
pub extern "c" fn GuiEnable() void;
|
||||
pub extern "c" fn GuiDisable() void;
|
||||
@ -10,8 +13,8 @@ pub extern "c" fn GuiSetState(state: c_int) void;
|
||||
pub extern "c" fn GuiGetState() c_int;
|
||||
pub extern "c" fn GuiSetFont(font: rl.Font) void;
|
||||
pub extern "c" fn GuiGetFont() rl.Font;
|
||||
pub extern "c" fn GuiSetStyle(control: c_int, property: c_int, value: c_int) void;
|
||||
pub extern "c" fn GuiGetStyle(control: c_int, property: c_int) c_int;
|
||||
pub extern "c" fn GuiSetStyle(control: rgui.GuiState, property: rgui.GuiControlProperty, value: c_int) void;
|
||||
pub extern "c" fn GuiGetStyle(control: rgui.GuiState, property: rgui.GuiControlProperty) c_int;
|
||||
pub extern "c" fn GuiLoadStyle(fileName: [*c]const u8) void;
|
||||
pub extern "c" fn GuiLoadStyleDefault() void;
|
||||
pub extern "c" fn GuiEnableTooltip() void;
|
||||
|
@ -513,13 +513,13 @@ pub fn guiGetFont() Font {
|
||||
}
|
||||
|
||||
/// Set one style property
|
||||
pub fn guiSetStyle(control: i32, property: i32, value: i32) void {
|
||||
cdef.GuiSetStyle(@as(c_int, control), @as(c_int, property), @as(c_int, value));
|
||||
pub fn guiSetStyle(control: GuiState, property: GuiControlProperty, value: i32) void {
|
||||
cdef.GuiSetStyle(control, property, @as(c_int, value));
|
||||
}
|
||||
|
||||
/// Get one style property
|
||||
pub fn guiGetStyle(control: i32, property: i32) i32 {
|
||||
return @as(i32, cdef.GuiGetStyle(@as(c_int, control), @as(c_int, property)));
|
||||
pub fn guiGetStyle(control: GuiState, property: GuiControlProperty) i32 {
|
||||
return @as(i32, cdef.GuiGetStyle(control, property));
|
||||
}
|
||||
|
||||
/// Load style file over global style variable (.rgs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user