Closed db47h closed 6 years ago
Hey, sorry, I've been working double-long hackathon-level days at work recently. If you submit a PR I'd be glad to accept it, but it will probably have to wait a few weeks otherwise.
No worries, PR incoming.
As I wrote a test for the fix, I found out that GLToScreenCoords inverts the sign of the returned y-coordinate. So that'll get fixed as well.
Reminder to self: trivial tests for trivial functions are not that useless :wink:
Unless I'm mistaken, screen X coordinates are in the range [0, screenWidth-1], not [0, screenWidth] (the same applies to the Y coordinate), and GL's coordinate system maps [screenWidth-1,0] to [1.0,1.0] and [0,screenHeight-1] to [-1.0,-1.0].
So the code for ScreenToGLCoords should be: