mirror of https://github.com/bjornbytes/lovr.git
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:
parent
b2cb2c8752
commit
43d5bc78f0
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue