mirror of https://github.com/ppy/SDL3-CS.git
Add a simple usage test for SDL_GetWindows()
This commit is contained in:
parent
5a7b49ca74
commit
d5287637ef
|
|
@ -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])}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue