diff options
author | Nicholas Rishel <rishel.nick@gmail.com> | 2020-12-17 02:32:18 +0300 |
---|---|---|
committer | Nicholas Rishel <rishel.nick@gmail.com> | 2020-12-17 02:32:18 +0300 |
commit | 3a1d1aaa86d0d7cc6aaf0e6633d557bbcdd0b514 (patch) | |
tree | fa3aa8b33c299a792561bdec4da2dc33f62e1ac0 /intern/ghost/intern/GHOST_WindowWin32.h | |
parent | 9f588432e9dbf4dc8f0c822fdbad2f7dc4b5ca47 (diff) |
Synchronize Wintab and Win32 time.
Time is synchronized by the difference between the WT_PACKET receive
time and the last received PACKET's pkTime. This is used to prevent
Wintab packets from being prematurely expired.
Diffstat (limited to 'intern/ghost/intern/GHOST_WindowWin32.h')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowWin32.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWin32.h b/intern/ghost/intern/GHOST_WindowWin32.h index a761d7d84dc..829bbdea051 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.h +++ b/intern/ghost/intern/GHOST_WindowWin32.h @@ -486,9 +486,14 @@ class GHOST_WindowWin32 : public GHOST_Window { GHOST_TSuccess getWintabInfo(std::vector<GHOST_WintabInfoWin32> &outWintabInfo); /** - * Updates stored pending Wintab events. + * Updates pending Wintab events and syncs Wintab time with OS time. */ - void updatePendingWintabEvents(); + void updateWintabEventsSyncTime(); + + /** + * Updates pending Wintab events. + */ + void updateWintabEvents(); GHOST_TSuccess beginFullScreen() const { @@ -629,6 +634,7 @@ class GHOST_WindowWin32 : public GHOST_Window { GHOST_TUns8 numSysButtons = 0; /** Cursors currently in contact mapped to system buttons */ DWORD sysButtonsPressed = 0; + DWORD sysTimeOffset = 0; LONG maxPressure = 0; LONG maxAzimuth = 0, maxAltitude = 0; /** Reusable buffer to read in Wintab Packets. */ @@ -642,6 +648,10 @@ class GHOST_WindowWin32 : public GHOST_Window { */ void initializeWintab(); + void readWintabEvents(); + + void expireWintabEvents(); + /** * Convert Wintab system mapped (mouse) buttons into Ghost button mask. * \param cursor: The Wintab cursor associated to the button. |