/// <summary> /// Gets the Game View window's bottom right corner Position. /// </summary> /// <remarks>Overridden in test project. Do not remove without updating tests.</remarks> protected virtual Vector2 GetWindowBottomRight() { var clientRect = new Win32Helpers.RECT(); Win32Helpers.GetClientRect(Hwnd, ref clientRect); var bottomRight = new Win32Helpers.POINT { x = clientRect.right, y = clientRect.bottom }; Win32Helpers.ClientToScreen(Hwnd, ref bottomRight); return(new Vector2(bottomRight.x, bottomRight.y)); }
protected override Rect GetViewportLogicalBounds() { var clientRect = new Win32Helpers.RECT(); Win32Helpers.GetClientRect(_hwnd, ref clientRect); var topLeft = new Win32Helpers.POINT(); Win32Helpers.ClientToScreen(_hwnd, ref topLeft); var bottomRight = new Win32Helpers.POINT { x = clientRect.right, y = clientRect.bottom }; Win32Helpers.ClientToScreen(_hwnd, ref bottomRight); return(new Rect(topLeft.x, topLeft.y, bottomRight.x - topLeft.x, bottomRight.y - topLeft.y)); }
/// <summary> /// Gets the Game View window's bottom right corner position. /// </summary> /// <remarks>Overridden in test project. Do not remove without updating tests.</remarks> protected virtual Vector2 GetWindowBottomRight() { if (IntPtr.Zero == _gameViewWindowHandle) { return(new Vector2(float.NaN, float.NaN)); } var clientRect = new Win32Helpers.RECT(); Win32Helpers.GetClientRect(_gameViewWindowHandle, ref clientRect); var bottomRight = new Win32Helpers.POINT { x = clientRect.right, y = clientRect.bottom }; Win32Helpers.ClientToScreen(_gameViewWindowHandle, ref bottomRight); return(new Vector2(bottomRight.x, bottomRight.y)); }
protected override Rect GetViewportLogicalBounds() { var clientRect = new Win32Helpers.RECT(); Win32Helpers.GetClientRect(_hwnd, ref clientRect); var topLeft = new Win32Helpers.POINT(); Win32Helpers.ClientToScreen(_hwnd, ref topLeft); var bottomRight = new Win32Helpers.POINT { x = clientRect.right, y = clientRect.bottom }; Win32Helpers.ClientToScreen(_hwnd, ref bottomRight); return new Rect(topLeft.x, topLeft.y, bottomRight.x - topLeft.x, bottomRight.y - topLeft.y); }