diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-11-22 15:49:52 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-11-22 15:55:44 +0100 |
commit | 86f1df90b405b56b46d698b4059ed2c6b10df8b3 (patch) | |
tree | 94fd2ed0d5caa4e2ae0a617d598787d3e2890e3a /opentrack/win32-joystick-shortcuts.cpp | |
parent | e44b2853196565ebd22eb1e27109e5e54e77ed15 (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.cpp | 6 |
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; +} |