Window.SetPosition
							parent
							
								
									cba6ca59d3
								
							
						
					
					
						commit
						099c07aa39
					
				|  | @ -21,6 +21,15 @@ namespace MoonWorks | ||||||
| 		public bool Claimed { get; internal set; } | 		public bool Claimed { get; internal set; } | ||||||
| 		public MoonWorks.Graphics.TextureFormat SwapchainFormat { 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 bool IsDisposed; | ||||||
| 
 | 
 | ||||||
| 		private static Dictionary<uint, Window> idLookup = new Dictionary<uint, Window>(); | 		private static Dictionary<uint, Window> idLookup = new Dictionary<uint, Window>(); | ||||||
|  | @ -113,6 +122,14 @@ namespace MoonWorks | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		/// <summary> | ||||||
|  | 		/// Sets the window position. | ||||||
|  | 		/// </summary> | ||||||
|  | 		public void SetPosition(int x, int y) | ||||||
|  | 		{ | ||||||
|  | 			SDL.SDL_SetWindowPosition(Handle, x, y); | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
| 		internal static Window Lookup(uint windowID) | 		internal static Window Lookup(uint windowID) | ||||||
| 		{ | 		{ | ||||||
| 			return idLookup.ContainsKey(windowID) ? idLookup[windowID] : null; | 			return idLookup.ContainsKey(windowID) ? idLookup[windowID] : null; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue