Improved the performance of love.window.getPixelScale / toPixels / fromPixels by caching some values. Made some coordinate space-sensitive code use the proper conversions to get to the correct coordinate space.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2015-02-23 17:55:30 -04:00
parent 182792de85
commit 52c4f2c119
14 changed files with 112 additions and 114 deletions
+5 -1
View File
@@ -115,7 +115,7 @@ public:
virtual bool setFullscreen(bool fullscreen, FullscreenType fstype) = 0;
virtual bool setFullscreen(bool fullscreen) = 0;
virtual bool onWindowResize(int width, int height) = 0;
virtual bool onSizeChanged(int width, int height) = 0;
virtual int getDisplayCount() const = 0;
@@ -154,6 +154,10 @@ public:
virtual bool isMouseGrabbed() const = 0;
virtual void getPixelDimensions(int &w, int &h) 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;
virtual void pixelToWindowCoords(double *x, double *y) const = 0;
virtual double getPixelScale() const = 0;