This allows for headless operation. Currently GLFW throws an error
if you call glfwInit without an X server running, preventing lovr
from starting at all in that situation.
Because GLFW is currently used for time functions, those had to be
moved into the platform layer. There's lots of duplication here,
ideally the platform layer would just return raw timer values and the
timer module would handle the epoch logic, but it was too difficult to
coordinate that right now.
Also, lovrPlatformInit is guaranteed to set the time epoch to 0 now.
- One toplevel Tupfile that makes it more clear what happens.
- Add config flags for -Werror, -fsanitize, and separate debug/optimize flags.
- Automatically integrate with libs built by CMake (build folder, rpath, libs folder).
- Disabling modules actually works, only the stuff that's needed is built.
- Ref struct only stores refcount now and is more general.
- Proxy stores a hash of its type name instead of an enum.
- Variants store additional information instead of using a vtable.
- Remove the concept of superclasses from the API.
- Clean up some miscellaneous includes.
Dynamically loading things was cool but is causing more pain than
pleasure because it just barely doesn't work everywhere. Instead,
find a better way to load modules. Use a data driven luaL_Reg array
to define the module mapping and luaL_register to smoosh it into
package.preload at boot time. Benefits:
- LOVR_ENABLE_<x> defines are respected and only require a single #if
- Module list is data driven and defined in one place
- It's faster (luax_preloadmodule did a global lookup every invocation)
- It works everywhere
Oh also threads were totally broken and this (mostly) fixes them.
Back out lovrHeadsetExtractRenderFn, don't let oculus_mobile.c pcall the render function, instead fit the render error saving inside renderHelper (emscripten/oculusmobile path). The render error is now saved in the environment at _lovrHeadsetRenderError. For this to work, luax now keeps track of a global variable for the current "main" environment.
This does means the render error path now works on emscripten (this has not been tested).
This is used in the oculus mobile driver, allowing replacement of the (dubious) recursive-copy-from-zip code.
In order for this to work, the argument parsing must be beefed up a bit and also PhysFS must be updated to the newest master in order to get a new PHYSFS_setRoot. The github submodule source has been changed to one which updates more frequently to get this.
There are breaking changes:
- lovr.step is removed.
- lovr.run is expected to return a main loop wrapped in a function. The
returned function is run as a coroutine to facilitate a cooperative
main loop.
- lovr.errhand should return a loop function instead of while true-ing.