Branimir Karadžić 10 years ago
parent
commit
561b7aa793
3 changed files with 16 additions and 12 deletions
  1. 1 1
      examples/common/entry/entry.cpp
  2. 11 10
      examples/common/entry/entry_windows.cpp
  3. 4 1
      src/bgfx_p.h

+ 1 - 1
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" },

+ 11 - 10
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);

+ 4 - 1
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;
 			}
 		}