From c8ef3aeb6c27fd7422adf72d25c175d613ebaf83 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Sun, 27 Oct 2024 22:50:44 +0100 Subject: [PATCH] There are different types of gui properties Signed-off-by: Tomas Slusny --- src/Raylib.NET.Bindgen/Program.cs | 11 +++++------ src/Raylib.NET.Example/Program.cs | 2 +- src/Raylib.NET/Raygui.cs | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Raylib.NET.Bindgen/Program.cs b/src/Raylib.NET.Bindgen/Program.cs index eca6ade..e1cf276 100644 --- a/src/Raylib.NET.Bindgen/Program.cs +++ b/src/Raylib.NET.Bindgen/Program.cs @@ -5,12 +5,6 @@ var transformEnum = (string parent, string name) => parent switch { - "GuiGetStyle" or "GuiSetStyle" => name switch - { - "control" => "GuiControl", - "property" => "GuiDefaultProperty", - _ => null - }, "IsKeyPressed" or "IsKeyPressedRepeat" or "IsKeyDown" or "IsKeyReleased" or "IsKeyUp" or "GetKeyPressed" => name switch { "key" or "return" => "KeyboardKey", @@ -26,6 +20,11 @@ "button" or "return" => "GamepadButton", _ => null }, + "GuiGetStyle" or "GuiSetStyle" => name switch + { + "control" => "GuiControl", + _ => null + }, _ => null }; diff --git a/src/Raylib.NET.Example/Program.cs b/src/Raylib.NET.Example/Program.cs index c2c0055..b3dc27d 100644 --- a/src/Raylib.NET.Example/Program.cs +++ b/src/Raylib.NET.Example/Program.cs @@ -11,7 +11,7 @@ { BeginDrawing(); - ClearBackground(GetColor((uint)GuiGetStyle(GuiControl.DEFAULT, GuiDefaultProperty.BACKGROUND_COLOR))); + ClearBackground(GetColor((uint)GuiGetStyle(GuiControl.DEFAULT, (int)GuiDefaultProperty.BACKGROUND_COLOR))); DrawTexture(texture, 10, 40, Color.WHITE); diff --git a/src/Raylib.NET/Raygui.cs b/src/Raylib.NET/Raygui.cs index d865604..95fcb97 100644 --- a/src/Raylib.NET/Raygui.cs +++ b/src/Raylib.NET/Raygui.cs @@ -97,14 +97,14 @@ public static unsafe partial class Raygui /// [LibraryImport(LIBRARY, StringMarshalling = StringMarshalling.Utf8)] [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] - public static partial void GuiSetStyle(GuiControl control, GuiDefaultProperty @property, int value); + public static partial void GuiSetStyle(GuiControl control, int @property, int value); /// /// Get one style property /// [LibraryImport(LIBRARY, StringMarshalling = StringMarshalling.Utf8)] [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] - public static partial int GuiGetStyle(GuiControl control, GuiDefaultProperty @property); + public static partial int GuiGetStyle(GuiControl control, int @property); /// /// Load style file over global style variable (.rgs)