Skip to content

Commit

Permalink
There are different types of gui properties
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Slusny <[email protected]>
  • Loading branch information
deathbeam committed Oct 27, 2024
1 parent f956579 commit c8ef3ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions src/Raylib.NET.Bindgen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -26,6 +20,11 @@
"button" or "return" => "GamepadButton",
_ => null
},
"GuiGetStyle" or "GuiSetStyle" => name switch
{
"control" => "GuiControl",
_ => null
},
_ => null
};

Expand Down
2 changes: 1 addition & 1 deletion src/Raylib.NET.Example/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/Raylib.NET/Raygui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ public static unsafe partial class Raygui
/// </summary>
[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);

/// <summary>
/// Get one style property
/// </summary>
[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);

/// <summary>
/// Load style file over global style variable (.rgs)
Expand Down

0 comments on commit c8ef3ae

Please sign in to comment.