Explorar o código

Update OsWindow metrics when necessary

Daniele Bartolini %!s(int64=12) %!d(string=hai) anos
pai
achega
efbd964cdc
Modificáronse 2 ficheiros con 5 adicións e 6 borrados
  1. 1 6
      engine/os/linux/OsWindow.h
  2. 4 0
      engine/os/linux/main.cpp

+ 1 - 6
engine/os/linux/OsWindow.h

@@ -42,10 +42,6 @@ void oswindow_set_window(Display* dpy, Window win);
 class OsWindow
 {
 public:
-
-	/// Creates the window with the given @a width and @a height.
-	/// When @a parent is != 0, it is interpreted as the OS-specific
-	/// handle of the parent window.
 					OsWindow();
 					~OsWindow();
 					
@@ -72,7 +68,7 @@ public:
 	char*			title();
 	void			set_title(const char* title);
 
-private:
+public:
 
 	uint32_t		m_x;
 	uint32_t		m_y;
@@ -81,7 +77,6 @@ private:
 	bool			m_resizable;
 
 	bool			m_x11_detectable_autorepeat;
-
 };
 
 } // namespace crown

+ 4 - 0
engine/os/linux/main.cpp

@@ -320,6 +320,10 @@ public:
 					{
 						const OsMetricsEvent& ev = event.metrics;
 						m_mouse->set_metrics(ev.width, ev.height);
+						m_window->m_x = ev.x;
+						m_window->m_y = ev.y;
+						m_window->m_width = ev.width;
+						m_window->m_height = ev.height;
 						break;
 					}
 					case OsEvent::EXIT: