Change WindowBase to allow for better code sharing for platforms without advanced windowing

This commit is contained in:
Wojtek Figat
2021-07-22 17:02:27 +02:00
parent e92bdf164c
commit 1e6d4026da
4 changed files with 48 additions and 125 deletions

View File

@@ -81,19 +81,20 @@ WindowBase::WindowBase(const CreateWindowSettings& settings)
, _minimized(false)
, _maximized(false)
, _isClosing(false)
, _showAfterFirstPaint(settings.ShowAfterFirstPaint)
, _focused(false)
, _swapChain(nullptr)
, _settings(settings)
, _title(settings.Title)
, _cursor(CursorType::Default)
, _clientSize(settings.Size)
, _dpi(96)
, _dpiScale(1.0f)
, _trackingMouseOffset(Vector2::Zero)
, _isUsingMouseOffset(false)
, _isTrackingMouse(false)
, RenderTask(nullptr)
{
_showAfterFirstPaint = settings.ShowAfterFirstPaint;
_clientSize = Vector2(settings.Size.X, settings.Size.Y);
// Update window location based on start location
if (settings.StartPosition == WindowStartPosition::CenterParent
|| settings.StartPosition == WindowStartPosition::CenterScreen)
@@ -522,6 +523,8 @@ void WindowBase::Show()
void WindowBase::Hide()
{
if (!_visible)
return;
_visible = false;
_showAfterFirstPaint = _settings.ShowAfterFirstPaint;
Hidden();