summaryrefslogtreecommitdiffhomepage
path: root/opentrack/win32-joystick-shortcuts.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-11-22 15:49:52 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-11-22 15:55:44 +0100
commit86f1df90b405b56b46d698b4059ed2c6b10df8b3 (patch)
tree94fd2ed0d5caa4e2ae0a617d598787d3e2890e3a /opentrack/win32-joystick-shortcuts.cpp
parente44b2853196565ebd22eb1e27109e5e54e77ed15 (diff)
api/joy: protect dinput with mutex in all cases
Also practice object-oriented information hiding to avoid accesses without the mutex. Also provide basic joy information (guid, name) without exposing dinput handles and so on.
Diffstat (limited to 'opentrack/win32-joystick-shortcuts.cpp')
-rw-r--r--opentrack/win32-joystick-shortcuts.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/opentrack/win32-joystick-shortcuts.cpp b/opentrack/win32-joystick-shortcuts.cpp
index 44659b7e..61a2a74a 100644
--- a/opentrack/win32-joystick-shortcuts.cpp
+++ b/opentrack/win32-joystick-shortcuts.cpp
@@ -22,3 +22,9 @@ std::unordered_map<QString, std::shared_ptr<win32_joy_ctx::joy>>& win32_joy_ctx:
return js;
}
+
+win32_joy_ctx& win32_joy_ctx::make()
+{
+ static win32_joy_ctx ret;
+ return ret;
+}