Branimir Karadžić 8 years ago
parent
commit
1a90c93458
2 changed files with 8 additions and 3 deletions
  1. 1 1
      examples/22-windows/windows.cpp
  2. 7 2
      examples/common/entry/entry.cpp

+ 1 - 1
examples/22-windows/windows.cpp

@@ -167,7 +167,7 @@ public:
 
 	bool update() override
 	{
-		if ( !entry::processWindowEvents(m_state, m_debug, m_reset) )
+		if (!entry::processWindowEvents(m_state, m_debug, m_reset) )
 		{
 			entry::MouseState mouseState = m_state.m_mouse;
 

+ 7 - 2
examples/common/entry/entry.cpp

@@ -652,6 +652,8 @@ restart:
 		return result;
 	}
 
+	WindowState s_window[ENTRY_CONFIG_MAX_WINDOWS];
+
 	bool processEvents(uint32_t& _width, uint32_t& _height, uint32_t& _debug, uint32_t& _reset, MouseState* _mouse)
 	{
 		s_debug = _debug;
@@ -732,6 +734,11 @@ restart:
 				case Event::Size:
 					{
 						const SizeEvent* size = static_cast<const SizeEvent*>(ev);
+						WindowState& win = s_window[0];
+						win.m_handle = size->m_handle;
+						win.m_width  = size->m_width;
+						win.m_height = size->m_height;
+
 						handle  = size->m_handle;
 						_width  = size->m_width;
 						_height = size->m_height;
@@ -777,8 +784,6 @@ restart:
 		return s_exit;
 	}
 
-	WindowState s_window[ENTRY_CONFIG_MAX_WINDOWS];
-
 	bool processWindowEvents(WindowState& _state, uint32_t& _debug, uint32_t& _reset)
 	{
 		s_debug = _debug;