mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Making setWindowTitle() on Windows thread safe.
This commit is contained in:
parent
2b01f8a874
commit
65f5faceec
1 changed files with 8 additions and 6 deletions
|
@ -17,6 +17,7 @@
|
|||
#define WM_USER_SET_WINDOW_SIZE (WM_USER+0)
|
||||
#define WM_USER_TOGGLE_WINDOW_FRAME (WM_USER+1)
|
||||
#define WM_USER_MOUSE_LOCK (WM_USER+2)
|
||||
#define WM_USER_SET_WINDOW_TITLE (WM_USER+3)
|
||||
|
||||
namespace entry
|
||||
{
|
||||
|
@ -259,6 +260,12 @@ namespace entry
|
|||
}
|
||||
break;
|
||||
|
||||
case WM_USER_SET_WINDOW_TITLE:
|
||||
{
|
||||
SetWindowText(_hwnd, (const char*)_lparam);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_USER_TOGGLE_WINDOW_FRAME:
|
||||
{
|
||||
if (m_frame)
|
||||
|
@ -586,11 +593,6 @@ namespace entry
|
|||
}
|
||||
}
|
||||
|
||||
void setWindowTitle(const char* _title)
|
||||
{
|
||||
SetWindowText(m_hwnd, _title);
|
||||
}
|
||||
|
||||
static LRESULT CALLBACK wndProc(HWND _hwnd, UINT _id, WPARAM _wparam, LPARAM _lparam);
|
||||
|
||||
EventQueue m_eventQueue;
|
||||
|
@ -641,7 +643,7 @@ namespace entry
|
|||
|
||||
void setWindowTitle(const char* _title)
|
||||
{
|
||||
s_ctx.setWindowTitle(_title);
|
||||
PostMessage(s_ctx.m_hwnd, WM_USER_SET_WINDOW_TITLE, 0, (LPARAM)_title);
|
||||
}
|
||||
|
||||
void toggleWindowFrame()
|
||||
|
|
Loading…
Reference in a new issue