summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples/common/entry/entry_windows.cpp')
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_windows.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/entry_windows.cpp b/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
index 39be55abfc3..076bd03b2da 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2019 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
@@ -23,6 +23,7 @@
#include <windows.h>
#include <windowsx.h>
#include <xinput.h>
+#include <shellapi.h>
#ifndef XINPUT_GAMEPAD_GUIDE
# define XINPUT_GAMEPAD_GUIDE 0x400
@@ -572,6 +573,8 @@ namespace entry
, (HINSTANCE)GetModuleHandle(NULL)
, 0
);
+
+ adjust(hwnd, msg->m_width, msg->m_height, true);
clear(hwnd);
m_hwnd[_wparam] = hwnd;
@@ -1023,7 +1026,9 @@ namespace entry
void setMouseLock(HWND _hwnd, bool _lock)
{
- if (_hwnd != m_mouseLock)
+ HWND newMouseLock = _lock ? _hwnd : 0;
+
+ if (newMouseLock != m_mouseLock)
{
if (_lock)
{
@@ -1038,7 +1043,7 @@ namespace entry
ShowCursor(true);
}
- m_mouseLock = _hwnd;
+ m_mouseLock = newMouseLock;
}
}