lovr.mirror disables blending when drawing headset texture;

This is so transparent headset textures (when rendering overlays)
don't ghost.  Alternatively, clear could be used.
This commit is contained in:
bjorn 2020-10-27 01:41:14 -06:00
parent b2cb2c8752
commit 43d5bc78f0
1 changed files with 3 additions and 0 deletions

View File

@ -218,6 +218,8 @@ end
function lovr.mirror()
if lovr.headset then -- On some systems, headset module will be disabled
local blend, alpha = lovr.graphics.getBlendMode()
lovr.graphics.setBlendMode()
local texture = lovr.headset.getMirrorTexture()
if texture then -- On some drivers, texture is printed directly to the window
if lovr.headset.getDriver() == 'oculus' then
@ -226,6 +228,7 @@ function lovr.mirror()
lovr.graphics.fill(lovr.headset.getMirrorTexture())
end
end
lovr.graphics.setBlendMode(blend, alpha)
else
lovr.graphics.clear()
lovr.draw()