Add a simple usage test for SDL_GetWindows()

This commit is contained in:
Susko3 2024-12-17 17:18:50 +01:00
parent 5a7b49ca74
commit d5287637ef
1 changed files with 14 additions and 0 deletions

View File

@ -32,6 +32,8 @@ namespace SDL.Tests
window.Setup();
window.Create();
printWindows();
const SDL_Keymod state = SDL_Keymod.SDL_KMOD_CAPS | SDL_Keymod.SDL_KMOD_ALT;
SDL_SetModState(state);
Debug.Assert(SDL_GetModState() == state);
@ -64,5 +66,17 @@ namespace SDL.Tests
}
}
}
private static unsafe void printWindows()
{
using var windows = SDL_GetWindows();
if (windows == null)
return;
for (int i = 0; i < windows.Count; i++)
{
Console.WriteLine($"Window {i} title: {SDL_GetWindowTitle(windows[i])}");
}
}
}
}