From 099c07aa3927f17dcbd1eb44c63e4198b47825d8 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Tue, 5 Mar 2024 23:19:07 -0800 Subject: [PATCH] Window.SetPosition --- src/Window.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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;