From 561b7aa7937e5a8412bbfe93c04f1167007177d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 1 Sep 2015 22:15:47 -0700 Subject: [PATCH] Cleanup. --- examples/common/entry/entry.cpp | 2 +- examples/common/entry/entry_windows.cpp | 21 +++++++++++---------- src/bgfx_p.h | 5 ++++- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/examples/common/entry/entry.cpp b/examples/common/entry/entry.cpp index 773ec5f4b..fa83cce89 100644 --- a/examples/common/entry/entry.cpp +++ b/examples/common/entry/entry.cpp @@ -291,7 +291,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); { entry::Key::KeyQ, entry::Modifier::RightCtrl, 1, NULL, "exit" }, { entry::Key::KeyF, entry::Modifier::LeftCtrl, 1, NULL, "graphics fullscreen" }, { entry::Key::KeyF, entry::Modifier::RightCtrl, 1, NULL, "graphics fullscreen" }, - { entry::Key::F11, entry::Modifier::None, 1, NULL, "graphics fullscreen" }, + { entry::Key::Return, entry::Modifier::RightAlt, 1, NULL, "graphics fullscreen" }, { entry::Key::F1, entry::Modifier::None, 1, NULL, "graphics stats" }, { entry::Key::GamepadStart, entry::Modifier::None, 1, NULL, "graphics stats" }, { entry::Key::F1, entry::Modifier::LeftShift, 1, NULL, "graphics stats 0\ngraphics text 0" }, diff --git a/examples/common/entry/entry_windows.cpp b/examples/common/entry/entry_windows.cpp index 376ce8aca..a6a5ff2c9 100644 --- a/examples/common/entry/entry_windows.cpp +++ b/examples/common/entry/entry_windows.cpp @@ -836,7 +836,7 @@ namespace entry void adjust(HWND _hwnd, uint32_t _width, uint32_t _height, bool _windowFrame) { - m_width = _width; + m_width = _width; m_height = _height; m_aspectRatio = float(_width)/float(_height); @@ -868,15 +868,16 @@ namespace entry GetMonitorInfo(monitor, &mi); newrect = mi.rcMonitor; rect = mi.rcMonitor; + m_aspectRatio = float(newrect.right - newrect.left)/float(newrect.bottom - newrect.top); #endif // !defined(__MINGW__) } SetWindowLong(_hwnd, GWL_STYLE, style); - uint32_t prewidth = newrect.right - newrect.left; + uint32_t prewidth = newrect.right - newrect.left; uint32_t preheight = newrect.bottom - newrect.top; AdjustWindowRect(&newrect, style, FALSE); - m_frameWidth = (newrect.right - newrect.left) - prewidth; - m_frameHeight = (newrect.bottom - newrect.top) - preheight; + m_frameWidth = (newrect.right - newrect.left) - prewidth; + m_frameHeight = (newrect.bottom - newrect.top ) - preheight; UpdateWindow(_hwnd); if (rect.left == -32000 @@ -886,19 +887,19 @@ namespace entry rect.top = 0; } - int32_t left = rect.left; - int32_t top = rect.top; - int32_t width = (newrect.right-newrect.left); + int32_t left = rect.left; + int32_t top = rect.top; + int32_t width = (newrect.right-newrect.left); int32_t height = (newrect.bottom-newrect.top); if (!_windowFrame) { float aspectRatio = 1.0f/m_aspectRatio; - width = bx::uint32_max(ENTRY_DEFAULT_WIDTH/4, width); + width = bx::uint32_max(ENTRY_DEFAULT_WIDTH/4, width); height = uint32_t(float(width)*aspectRatio); - left = newrect.left+(newrect.right-newrect.left-width)/2; - top = newrect.top+(newrect.bottom-newrect.top-height)/2; + left = newrect.left+(newrect.right -newrect.left-width)/2; + top = newrect.top +(newrect.bottom-newrect.top-height)/2; } HWND parent = GetWindow(_hwnd, GW_OWNER); diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 18b7e50f5..3fc84cc00 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -1088,7 +1088,10 @@ namespace bgfx for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++ii) { - m_bind[ii].m_idx = invalidHandle; + Binding& bind = m_bind[ii]; + bind.m_idx = invalidHandle; + bind.m_type = 0; + bind.m_un.m_draw.m_flags = 0; } }