diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-12 17:06:14 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@CROOKED-SCHEMER> | 2016-08-12 17:11:40 +0200 |
commit | 33c1683b37265001eb91024290f7137c5b3c5411 (patch) | |
tree | f1a620e9fdba06590d9db14ae8c352a3ad2ddc47 /opentrack-dinput/win32-joystick.hpp | |
parent | edbd6759b563026435476ade5dc1e92cfa187263 (diff) |
dinput: hold dinput reference through entire lifetime
Diffstat (limited to 'opentrack-dinput/win32-joystick.hpp')
-rw-r--r-- | opentrack-dinput/win32-joystick.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/opentrack-dinput/win32-joystick.hpp b/opentrack-dinput/win32-joystick.hpp index a69ec765..ef8f59b0 100644 --- a/opentrack-dinput/win32-joystick.hpp +++ b/opentrack-dinput/win32-joystick.hpp @@ -75,12 +75,13 @@ struct OPENTRACK_DINPUT_EXPORT win32_joy_ctx using di_t = dinput_handle::di_t; private: - static QString guid_to_string(const GUID guid); + static QString guid_to_string(const GUID& guid); - class enum_state final + class OPENTRACK_DINPUT_EXPORT enum_state final { std::vector<QString> all; joys_t joys; + dinput_handle::di_t di; static BOOL CALLBACK EnumJoysticksCallback(const DIDEVICEINSTANCE* pdidInstance, VOID* pContext); static BOOL CALLBACK EnumObjectsCallback(const DIDEVICEOBJECTINSTANCE* pdidoi, VOID* ctx); @@ -91,7 +92,7 @@ private: enum_state(); ~enum_state(); void refresh(); - const joys_t& get_joys() const { return joys; } + const joys_t& get_joys() const; }; static enum_state enumerator; |