Skip to content

Commit

Permalink
Fix SDL3 backend
Browse files Browse the repository at this point in the history
.NET 9 update changed library import generator behavior and it broke my funny shit.
  • Loading branch information
PJB3005 committed Jan 8, 2025
1 parent 1984e97 commit f2b096f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public static partial class SDL
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static unsafe partial void SDL_ShowFileDialogWithProperties(int type, delegate* unmanaged[Cdecl]<void*, byte**, int, void> callback, void* userdata, uint properties);

[LibraryImport(nativeLibName, EntryPoint = "SDL_WaitEvent")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial SDLBool SDL_WaitEventRef(ref SDL_Event @event);

public const byte SDL_BUTTON_LEFT = 1;
public const byte SDL_BUTTON_MIDDLE = 2;
public const byte SDL_BUTTON_RIGHT = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void EnterWindowLoop()

while (_windowingRunning)
{
var res = SDL.SDL_WaitEvent(out Unsafe.NullRef<SDL.SDL_Event>());
var res = SDL.SDL_WaitEventRef(ref Unsafe.NullRef<SDL.SDL_Event>());
if (!res)
{
_sawmill.Error("Error while waiting on SDL3 events: {error}", SDL.SDL_GetError());
Expand Down

0 comments on commit f2b096f

Please sign in to comment.