diff options
author | 2015-05-30 14:57:13 +0200 | |
---|---|---|
committer | 2015-05-30 14:57:13 +0200 | |
commit | d1d9dfc2d4be85cee8c8c990950d72ee6df78e5e (patch) | |
tree | 495d4e5a066ee13be131f08437732b3588d43a42 /3rdparty/bgfx/examples/common/entry/entry_winrt.cpp | |
parent | fe71f92dd24270ae7c5621166b096c665ca0e4f5 (diff) | |
parent | 51709eef04f9f0c6d621447c568e170927fa9472 (diff) |
Merge pull request #4 from mamedev/master
Sync to base master
Diffstat (limited to '3rdparty/bgfx/examples/common/entry/entry_winrt.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/common/entry/entry_winrt.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/entry_winrt.cpp b/3rdparty/bgfx/examples/common/entry/entry_winrt.cpp index e7cf8214de6..1bca2de28da 100644 --- a/3rdparty/bgfx/examples/common/entry/entry_winrt.cpp +++ b/3rdparty/bgfx/examples/common/entry/entry_winrt.cpp @@ -26,10 +26,10 @@ static entry::EventQueue g_eventQueue; ref class App sealed : public IFrameworkView { - public: - App() - : m_windowVisible(true) - , m_windowClosed(false) +public: + App() + : m_windowVisible(true) + , m_windowClosed(false) { } @@ -57,13 +57,14 @@ ref class App sealed : public IFrameworkView thread.init(MainThreadFunc, nullptr); CoreWindow^ window = CoreWindow::GetForCurrentThread(); - if (window == nullptr) { - int i = 4; - i++; - } + auto bounds = window->Bounds; + auto dpi = DisplayInformation::GetForCurrentView()->LogicalDpi; - //auto bounds = window->Bounds; - //g_eventQueue.postSizeEvent(g_defaultWindow, bounds.Width, bounds.Height); + static const float dipsPerInch = 96.0f; + g_eventQueue.postSizeEvent(g_defaultWindow + , lround(floorf(bounds.Width * dpi / dipsPerInch + 0.5f)) + , lround(floorf(bounds.Height * dpi / dipsPerInch + 0.5f)) + ); while (!m_windowClosed) { @@ -92,12 +93,6 @@ private: void OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args) { - CoreWindow^ window = CoreWindow::GetForCurrentThread(); - if (window == nullptr) { - int i = 4; - i++; - } - CoreWindow::GetForCurrentThread()->Activate(); } |