mirror of https://github.com/bjornbytes/lovr.git
Minor boot.lua refactors;
This commit is contained in:
parent
703e9d3c36
commit
a1309cfe87
101
etc/boot.lua
101
etc/boot.lua
|
@ -1,57 +1,56 @@
|
|||
lovr = require 'lovr'
|
||||
local lovr = lovr
|
||||
|
||||
-- Note: Cannot be overloaded
|
||||
function lovr.boot()
|
||||
local conf = {
|
||||
version = '0.17.0',
|
||||
identity = 'default',
|
||||
saveprecedence = true,
|
||||
modules = {
|
||||
audio = true,
|
||||
data = true,
|
||||
event = true,
|
||||
graphics = true,
|
||||
headset = true,
|
||||
math = true,
|
||||
physics = true,
|
||||
system = true,
|
||||
thread = true,
|
||||
timer = true
|
||||
},
|
||||
audio = {
|
||||
start = true,
|
||||
spatializer = nil
|
||||
},
|
||||
graphics = {
|
||||
debug = false,
|
||||
vsync = true,
|
||||
stencil = false,
|
||||
antialias = true,
|
||||
shadercache = true
|
||||
},
|
||||
headset = {
|
||||
drivers = { 'openxr', 'webxr', 'desktop' },
|
||||
supersample = false,
|
||||
seated = false,
|
||||
stencil = false,
|
||||
antialias = true,
|
||||
submitdepth = true,
|
||||
overlay = false
|
||||
},
|
||||
math = {
|
||||
globals = true
|
||||
},
|
||||
window = {
|
||||
width = 720,
|
||||
height = 800,
|
||||
fullscreen = false,
|
||||
resizable = false,
|
||||
title = 'LÖVR',
|
||||
icon = nil
|
||||
}
|
||||
local conf = {
|
||||
version = '0.17.0',
|
||||
identity = 'default',
|
||||
saveprecedence = true,
|
||||
modules = {
|
||||
audio = true,
|
||||
data = true,
|
||||
event = true,
|
||||
graphics = true,
|
||||
headset = true,
|
||||
math = true,
|
||||
physics = true,
|
||||
system = true,
|
||||
thread = true,
|
||||
timer = true
|
||||
},
|
||||
audio = {
|
||||
start = true,
|
||||
spatializer = nil
|
||||
},
|
||||
graphics = {
|
||||
debug = false,
|
||||
vsync = true,
|
||||
stencil = false,
|
||||
antialias = true,
|
||||
shadercache = true
|
||||
},
|
||||
headset = {
|
||||
drivers = { 'openxr', 'webxr', 'desktop' },
|
||||
supersample = false,
|
||||
seated = false,
|
||||
stencil = false,
|
||||
antialias = true,
|
||||
submitdepth = true,
|
||||
overlay = false
|
||||
},
|
||||
math = {
|
||||
globals = true
|
||||
},
|
||||
window = {
|
||||
width = 720,
|
||||
height = 800,
|
||||
fullscreen = false,
|
||||
resizable = false,
|
||||
title = 'LÖVR',
|
||||
icon = nil
|
||||
}
|
||||
}
|
||||
|
||||
function lovr.boot()
|
||||
lovr.filesystem = require('lovr.filesystem')
|
||||
local main = arg[0] and arg[0]:match('[^\\/]-%.lua$') or 'main.lua'
|
||||
local hasConf, hasMain = lovr.filesystem.isFile('conf.lua'), lovr.filesystem.isFile(main)
|
||||
|
@ -233,7 +232,7 @@ function lovr.log(message, level, tag)
|
|||
print(message)
|
||||
end
|
||||
|
||||
return function()
|
||||
return coroutine.create(function()
|
||||
local errored = false
|
||||
|
||||
local function onerror(...)
|
||||
|
@ -266,4 +265,4 @@ return function()
|
|||
|
||||
coroutine.yield()
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -111,10 +111,7 @@ int main(int argc, char** argv) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
lua_State* T = lua_newthread(L);
|
||||
lua_pushvalue(L, -2);
|
||||
lua_xmove(L, T, 1);
|
||||
|
||||
lua_State* T = lua_tothread(L, -1);
|
||||
lovrSetErrorCallback(luax_vthrow, T);
|
||||
lovrSetLogCallback(luax_vlog, T);
|
||||
|
||||
|
|
Loading…
Reference in New Issue