Y-flip mirror texture on Oculus

Oculus gives us the mirror texture "upside down" compared to every other driver, so flip it rightside up before drawing in boot.lua.
This commit is contained in:
mcc 2019-06-28 22:46:23 -04:00
parent 18dcb07b98
commit c604149428
1 changed files with 5 additions and 1 deletions

View File

@ -188,7 +188,11 @@ function lovr.mirror()
if lovr.headset then -- On some systems, headset module will be disabled
local texture = lovr.headset.getMirrorTexture()
if texture then -- On some drivers, texture is printed directly to the window
lovr.graphics.fill(texture)
if lovr.headset.getDriver() == 'oculus' then
lovr.graphics.fill(lovr.headset.getMirrorTexture(), 0, 1, 1, -1)
else
lovr.graphics.fill(lovr.headset.getMirrorTexture())
end
end
else
lovr.graphics.clear()