Right, here is the current (experimental) branch:
GitHub link
It's a giant mess right now, which I am going to sort out after I fixed the glitching. You have been warned!
Resike apparently posted some code which is no longer visible here, maybe it was filtered? I've stored it here in the meantime:
https://gist.github.com/SacredDuckwh...8b9558fb67fd20
What I meant earlier was that the internal resolution doesn't match the actual screen size (as you have said), so I am looking for a way to map it to that cleanly after scaling it according to the user's settings. This is a direct comparison of the frame at a pixel-perfect scale and upscaled with glitching:
Due to the rounding taking place every once in a while pixels will glitch. I tried applying the rounding that was mentioned here, and it did help, but it isn't quite enough... so I figured I need to make sure the points are anchored to integer coordinates (and I rounded them, which again helped somewhat). For some reason, there are still some glitched borders though.
Examples:
Proper UI scale of 768/1080 and then
my normal UI scale of ~0.889 (not pixel-perfect and glitched after scaling) - as well as the
zoomed-in comparison