Ignore mouse events outside the video region

This commit is contained in:
Cameron Gutman 2020-07-12 15:06:36 -07:00
commit ab5025efbf
4 changed files with 71 additions and 5 deletions

View file

@ -5,6 +5,9 @@
#include <SDL.h>
#define SDL_CODE_HIDE_CURSOR 1
#define SDL_CODE_SHOW_CURSOR 2
struct GamepadState {
SDL_GameController* controller;
SDL_JoystickID jsId;
@ -125,6 +128,8 @@ private:
int windowWidth, windowHeight;
} m_MousePositionReport;
SDL_atomic_t m_MousePositionUpdated;
bool m_MouseWasInVideoRegion;
bool m_PendingMouseButtonsAllUpOnVideoRegionLeave;
int m_GamepadMask;
GamepadState m_GamepadState[MAX_GAMEPADS];