diff --git a/src/Window.cs b/src/Window.cs index 958c9bb..4cc1b6e 100644 --- a/src/Window.cs +++ b/src/Window.cs @@ -21,6 +21,15 @@ namespace MoonWorks public bool Claimed { get; internal set; } public MoonWorks.Graphics.TextureFormat SwapchainFormat { get; internal set; } + public (int, int) Position + { + get + { + SDL.SDL_GetWindowPosition(Handle, out var x, out var y); + return (x, y); + } + } + private bool IsDisposed; private static Dictionary idLookup = new Dictionary(); @@ -113,6 +122,14 @@ namespace MoonWorks } } + /// + /// Sets the window position. + /// + public void SetPosition(int x, int y) + { + SDL.SDL_SetWindowPosition(Handle, x, y); + } + internal static Window Lookup(uint windowID) { return idLookup.ContainsKey(windowID) ? idLookup[windowID] : null;