2
0
Dario Manesku 11 жил өмнө
parent
commit
f1a7e1696d

+ 5 - 0
examples/common/entry/entry.h

@@ -146,6 +146,11 @@ namespace entry
 
 	bool processEvents(uint32_t& _width, uint32_t& _height, uint32_t& _debug, uint32_t& _reset, MouseState* _mouse = NULL);
 
+	void setWindowSize(uint32_t _width, uint32_t _height);
+	bool setWindowTitle(const char* _title);
+	void toggleWindowFrame();
+	void setMouseLock(bool _lock);
+
 	bx::FileReaderI* getFileReader();
 	bx::FileWriterI* getFileWriter();
 

+ 5 - 0
examples/common/entry/entry_android.cpp

@@ -207,6 +207,11 @@ namespace entry
 		BX_UNUSED(_width, _height);
 	}
 
+	bool setWindowTitle(const char* _title)
+	{
+		BX_UNUSED(_title);
+	}
+
 	void toggleWindowFrame()
 	{
 	}

+ 5 - 0
examples/common/entry/entry_asmjs.cpp

@@ -24,6 +24,11 @@ namespace entry
 	{
 	}
 
+	bool setWindowTitle(const char* _title)
+	{
+		BX_UNUSED(_title);
+	}
+
 	void toggleWindowFrame()
 	{
 	}

+ 5 - 0
examples/common/entry/entry_ios.mm

@@ -86,6 +86,11 @@ namespace entry
 		BX_UNUSED(_width, _height);
 	}
 
+	bool setWindowTitle(const char* _title)
+	{
+		BX_UNUSED(_title);
+	}
+
 	void toggleWindowFrame()
 	{
 	}

+ 5 - 0
examples/common/entry/entry_linux.cpp

@@ -326,6 +326,11 @@ namespace entry
 		XSendEvent(s_ctx.m_display, s_ctx.m_window, false, ResizeRedirectMask, (XEvent*)&ev);
 	}
 
+	bool setWindowTitle(const char* _title)
+	{
+		BX_UNUSED(_title);
+	}
+
 	void toggleWindowFrame()
 	{
 	}

+ 5 - 0
examples/common/entry/entry_nacl.cpp

@@ -61,6 +61,11 @@ namespace entry
 		BX_UNUSED(_width, _height);
 	}
 
+	bool setWindowTitle(const char* _title)
+	{
+		BX_UNUSED(_title);
+	}
+
 	void toggleWindowFrame()
 	{
 	}

+ 5 - 0
examples/common/entry/entry_osx.mm

@@ -281,6 +281,11 @@ namespace entry
 		BX_UNUSED(_width, _height);
 	}
 
+	bool setWindowTitle(const char* _title)
+	{
+		BX_UNUSED(_title);
+	}
+
 	void toggleWindowFrame()
 	{
 	}

+ 0 - 4
examples/common/entry/entry_p.h

@@ -70,10 +70,6 @@ namespace entry
 	const Event* poll();
 	void release(const Event* _event);
 
-	void setWindowSize(uint32_t _width, uint32_t _height);
-	void toggleWindowFrame();
-	void setMouseLock(bool _lock);
-
 	class EventQueue
 	{
 	public:

+ 5 - 0
examples/common/entry/entry_qnx.cpp

@@ -25,6 +25,11 @@ namespace entry
 	{
 	}
 
+	bool setWindowTitle(const char* _title)
+	{
+		BX_UNUSED(_title);
+	}
+
 	void toggleWindowFrame()
 	{
 	}

+ 10 - 0
examples/common/entry/entry_sdl.cpp

@@ -304,6 +304,11 @@ namespace entry
 			}
 		}
 
+		bool setWindowTitle(const char* _title)
+		{
+			SDL_WM_SetCaption(_title, NULL);
+		}
+
 		MainThreadEntry m_mte;
 		bx::Thread m_thread;
 
@@ -342,6 +347,11 @@ namespace entry
 		SDL_PushEvent(&event);
 	}
 
+	bool setWindowTitle(const char* _title)
+	{
+		s_ctx.setWindowTitle(_title);
+	}
+
 	void toggleWindowFrame()
 	{
 	}

+ 11 - 1
examples/common/entry/entry_windows.cpp

@@ -324,7 +324,7 @@ namespace entry
 							rect.bottom = rect.top + height + m_frameHeight;
 							break;
 						}
-						
+
 						m_eventQueue.postSizeEvent(m_width, m_height);
 					}
 					return 0;
@@ -574,6 +574,11 @@ namespace entry
 			}
 		}
 
+		bool setWindowTitle(const char* _title)
+		{
+			return (1 == SetWindowText(m_hwnd, _title));
+		}
+
 		static LRESULT CALLBACK wndProc(HWND _hwnd, UINT _id, WPARAM _wparam, LPARAM _lparam);
 
 		EventQueue m_eventQueue;
@@ -621,6 +626,11 @@ namespace entry
 		PostMessage(s_ctx.m_hwnd, WM_USER_SET_WINDOW_SIZE, 0, (_height<<16) | (_width&0xffff) );
 	}
 
+	bool setWindowTitle(const char* _title)
+	{
+		return s_ctx.setWindowTitle(_title);
+	}
+
 	void toggleWindowFrame()
 	{
 		PostMessage(s_ctx.m_hwnd, WM_USER_TOGGLE_WINDOW_FRAME, 0, 0);