Open zwirec opened 5 years ago
Uh, unfortunately I don't have the hardware nor software to recreate this scenario, I'm not sure how could I solve this problem or help you out on your issue. I ran your code on my computer (which also uses Windows) but the problem does not seem to show up to me. Sorry.
I tried to reproduce this as well on my Linux laptop and I cannot reproduce - I get the correct behavior in the second screenshot without modifying the highdpi to false
I am using f8d1c8c89fe621447d066ea6c2cdea306cf988c2 and LOVE 11.1 (Mysterious Mysteries)
I guess this effect is appear by reason of Mac Retina mode
Anyway I would be glad if someone would help me
It would seem this is a Mac specific flag in Love anyway so it will not be reproducible elsewhere.
the window may take up the same physical size as an 800x600 window, but the area inside the window uses 1600x1200 pixels
Which means, I would have to multiply the canvas size that is being sent to the shader (before it actually is sent to the shader), by the DPI scale.
Edit: Or either use this. https://love2d.org/wiki/love.graphics.getPixelDimensions
What do you guys suggest?
This issue brings a lot of changes, as most of the things that are being sent to the shaders are erroneous
I think another concern is that you cannot cache the DPI scale as it might be changed while the application is running. I think multiplying by love.graphics.getDPIScale()
everywhere would be more clear when reading the code - however it also seems not all units reported by Love need scaling.
The units of love.graphics.getWidth, love.graphics.getHeight, love.mouse.getPosition, mouse events, love.touch.getPosition, and touch events are always in DPI-scaled units rather than pixels. In LÖVE 0.10 and older they were in pixels.
OS: MacOS 10.14.2 (18C54)
I have a simple code snippet similar to code located in wiki page https://github.com/matiasah/shadows/wiki/Standard-Demonstration
There is my code:
I set options
highdpi
for window totrue
and I gotWith
highdpi=false
everything looks as it should be: