Fix errhand;

This commit is contained in:
bjorn 2022-08-06 00:29:40 -07:00
parent b60a9b7b40
commit dd40e6c829
1 changed files with 5 additions and 11 deletions

View File

@ -163,7 +163,6 @@ function lovr.errhand(message, traceback)
print('Error:\n' .. message) print('Error:\n' .. message)
if not lovr.graphics then return function() return 1 end end if not lovr.graphics then return function() return 1 end end
lovr.graphics.submit()
lovr.graphics.setBackground(.11, .10, .14) lovr.graphics.setBackground(.11, .10, .14)
local scale = .3 local scale = .3
@ -194,21 +193,15 @@ function lovr.errhand(message, traceback)
local passes = {} local passes = {}
if lovr.headset then if lovr.headset then
lovr.headset.update() lovr.headset.update()
local texture = lovr.headset.getTexture() local pass = lovr.headset.getPass()
if texture then if pass then
local pass = lovr.graphics.getPass('render', texture)
local near, far = lovr.headset.getClipDistance()
for i = 1, lovr.headset.getViewCount() do
pass:setViewPose(i, lovr.headset.getViewPose(i))
local left, right, up, down = lovr.headset.getViewAngles(i)
pass:setProjection(i, left, right, up, down, near, far)
end
render(pass) render(pass)
passes[#passes + 1] = pass passes[#passes + 1] = pass
end end
end end
if lovr.system.isWindowOpen() then if lovr.system.isWindowOpen() then
local pass = lovr.graphics.getPass('render', 'window') local pass = lovr.graphics.getWindowPass()
pass:reset()
local width, height = lovr.system.getWindowDimensions() local width, height = lovr.system.getWindowDimensions()
local projection = lovr.math.mat4():perspective(1.0, width / height, .1, 100) local projection = lovr.math.mat4():perspective(1.0, width / height, .1, 100)
pass:setProjection(1, projection) pass:setProjection(1, projection)
@ -216,6 +209,7 @@ function lovr.errhand(message, traceback)
passes[#passes + 1] = pass passes[#passes + 1] = pass
end end
lovr.graphics.submit(passes) lovr.graphics.submit(passes)
if lovr.headset then lovr.headset.submit() end
if lovr.math then lovr.math.drain() end if lovr.math then lovr.math.drain() end
end end
end end