mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
Merge pull request #361 from MikePopoloski/master
Small cleanup of entry_winrt
This commit is contained in:
commit
aefa069a72
1 changed files with 11 additions and 16 deletions
|
@ -26,10 +26,10 @@ static entry::EventQueue g_eventQueue;
|
||||||
|
|
||||||
ref class App sealed : public IFrameworkView
|
ref class App sealed : public IFrameworkView
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
App()
|
App()
|
||||||
: m_windowVisible(true)
|
: m_windowVisible(true)
|
||||||
, m_windowClosed(false)
|
, m_windowClosed(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,13 +57,14 @@ ref class App sealed : public IFrameworkView
|
||||||
thread.init(MainThreadFunc, nullptr);
|
thread.init(MainThreadFunc, nullptr);
|
||||||
|
|
||||||
CoreWindow^ window = CoreWindow::GetForCurrentThread();
|
CoreWindow^ window = CoreWindow::GetForCurrentThread();
|
||||||
if (window == nullptr) {
|
auto bounds = window->Bounds;
|
||||||
int i = 4;
|
auto dpi = DisplayInformation::GetForCurrentView()->LogicalDpi;
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
//auto bounds = window->Bounds;
|
static const float dipsPerInch = 96.0f;
|
||||||
//g_eventQueue.postSizeEvent(g_defaultWindow, bounds.Width, bounds.Height);
|
g_eventQueue.postSizeEvent(g_defaultWindow
|
||||||
|
, lround(floorf(bounds.Width * dpi / dipsPerInch + 0.5f))
|
||||||
|
, lround(floorf(bounds.Height * dpi / dipsPerInch + 0.5f))
|
||||||
|
);
|
||||||
|
|
||||||
while (!m_windowClosed)
|
while (!m_windowClosed)
|
||||||
{
|
{
|
||||||
|
@ -92,12 +93,6 @@ private:
|
||||||
|
|
||||||
void OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args)
|
void OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args)
|
||||||
{
|
{
|
||||||
CoreWindow^ window = CoreWindow::GetForCurrentThread();
|
|
||||||
if (window == nullptr) {
|
|
||||||
int i = 4;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
CoreWindow::GetForCurrentThread()->Activate();
|
CoreWindow::GetForCurrentThread()->Activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue