Fix mouse position backward compatibility with new SDL2 versions.

Clamp the mouse coordinates to the window's dimensions.
This commit is contained in:
Sasha Szpakowski
2023-07-01 17:53:29 -03:00
parent 6563aec89d
commit e582677344
5 changed files with 50 additions and 14 deletions
+2
View File
@@ -193,6 +193,8 @@ public:
virtual int getPixelWidth() const = 0;
virtual int getPixelHeight() const = 0;
virtual void clampPositionInWindow(double *wx, double *wy) const = 0;
// Note: window-space coordinates are not necessarily the same as
// density-independent units (which toPixels and fromPixels use.)
virtual void windowToPixelCoords(double *x, double *y) const = 0;