diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-12 17:05:12 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-12 17:05:12 +0200 |
commit | edbd6759b563026435476ade5dc1e92cfa187263 (patch) | |
tree | 7d92fc8bba3a8fbc0332002bb62db95ad45eda56 /opentrack-dinput/dinput.hpp | |
parent | 554e6da35c973004f7b8617a99b9eb1773bc2442 (diff) |
dinput: allow for empty di_t handle. refactor.
Diffstat (limited to 'opentrack-dinput/dinput.hpp')
-rw-r--r-- | opentrack-dinput/dinput.hpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/opentrack-dinput/dinput.hpp b/opentrack-dinput/dinput.hpp index 37a6d723..53f1c4af 100644 --- a/opentrack-dinput/dinput.hpp +++ b/opentrack-dinput/dinput.hpp @@ -35,16 +35,19 @@ public: { friend class dinput_handle; - LPDIRECTINPUT8& handle; + LPDIRECTINPUT8* handle; di_t(LPDIRECTINPUT8& handle); void free_di(); + void unref_di(); + void ref_di(); public: - LPDIRECTINPUT8 operator->() { return handle; } - operator LPDIRECTINPUT8() { return handle; } - LPDIRECTINPUT8 di() { return handle; } - + LPDIRECTINPUT8 operator->() { return *handle; } + operator LPDIRECTINPUT8() { return *handle; } + LPDIRECTINPUT8 di() { return *handle; } + di_t& operator=(const di_t& new_di); + di_t(); ~di_t(); }; |