1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-03 04:53:35 +00:00
Commit graph

69 commits

Author SHA1 Message Date
bjorn 79fd5ad7d8 Name boot.lua chunk properly;
This makes error messages nicer.
2019-12-28 23:18:03 -08:00
bjorn e2d8f8c645 platform -> os;
The function names are staying the same for now.
2019-12-13 19:55:46 -08:00
bjorn 63dc8f6c9b Only use glfw for window creation;
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.
2019-12-13 19:55:46 -08:00
bjorn 6f24da9f7f Rework Tupfiles;
- 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.
2019-12-13 06:52:57 -08:00
bjorn 2f9400a5f7 Adjust includes; 2019-12-10 13:01:28 -08:00
sophia ef84a16716 Throw lua errors in the error handler; 2019-09-24 12:04:36 -07:00
bjorn 13655d0df4 Simplify logging; 2019-08-21 19:02:02 -07:00
bjorn 8d4760167f luax is now api; 2019-08-21 15:27:26 -07:00
bjorn 0d5c776b02 Windows opens console with --console argument;
Instead of all the time.
2019-08-01 13:49:39 -07:00
bjorn 6b2d06e766 Add lovrPlatformOpenConsole; 2019-06-16 18:55:43 -07:00
bjorn 575552a147 Restart hotkey works on default error screen; 2019-06-02 03:29:34 -07:00
bjorn 22fe333150 Update refcounting (again);
- 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.
2019-06-02 01:02:26 -07:00
bjorn 67ddefd0c2 Ensure platform functions have prefix; 2019-05-20 04:02:25 -07:00
bjorn 7645f4c014 Add core folder; 2019-05-20 02:47:33 -07:00
bjorn 4a47afca38 Organize api folder; 2019-05-19 00:31:42 -07:00
bjorn b28face914 Handle coroutine stuff properly; 2019-03-07 01:04:45 -08:00
bjorn ce029cb5c5 Fix emscripten; Properly clear error on Android; 2019-03-06 23:17:29 -08:00
bjorn 569c9f7a11 Refactor asynchronous headset render errors;
It's now a more general error stored in the registry instead of
in a global variable.  There are more helper functions.
2019-03-06 23:17:29 -08:00
bjorn d340fc7aaa Polyfill LUA_RIDX_MAINTHREAD;
Instead of using a static variable.
2019-03-06 08:42:32 -08:00
bjorn d529620fea rm unused variables; 2019-02-17 14:19:39 -08:00
bjorn a763a6d2e1 Fix emscripten entry/exit points; 2019-02-14 09:22:00 -08:00
bjorn 6fd4b9ef4c Header cleanup; 2019-01-24 17:43:25 -08:00
bjorn cb9f166234 Revert "Replace sprintf with stb version;"
This reverts commit 8f9d24c51f.
2019-01-24 17:39:27 -08:00
bjorn 8f9d24c51f Replace sprintf with stb version; 2019-01-18 08:55:29 -08:00
bjorn 1fb2d6be02 Always use pushliteral when possible; 2018-12-15 21:45:32 -08:00
bjorn e5dd0a2c17 Fix wasm build.........; 2018-11-16 07:36:44 -08:00
bjorn c9793eae49 lovrPlatform: init/destroy; 2018-11-16 03:59:06 -08:00
bjorn 6514492cb8 glfwGetTime -> lovrPlatformGetTime;
Same for glfwSetTime;
2018-11-16 00:28:45 -08:00
bjorn da92cce634 Fix wasm build; 2018-11-15 08:21:26 -08:00
bjorn 784d61ef4a Modify module loading;
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.
2018-11-15 07:51:21 -08:00
mcc 64b187ef3f Manual merge args-and-physfs PR branch with master 2018-11-13 22:09:47 -05:00
mcc 91daeae634 Style/functional fixes to args for PR. --inside is now --root 2018-11-13 22:07:19 -05:00
mcc 96eed2786c Amend oculus_mobile error handling so headset.c renderHelper drives
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).
2018-11-13 16:50:31 -08:00
mcc 2213b3bcfd Allow the mountpoint to be set "inside" a zip file, using an --inside parameter.
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.
2018-11-13 15:20:04 -05:00
mcc 26af794e3c Adjust the lovr command line construction to follow the lua/love standards. This is a BC-breaking change.
Source for lua standard: https://en.wikibooks.org/wiki/Lua_Programming/command_line_parameter
2018-11-13 16:28:56 -05:00
bjorn 185bb8438e Set error handler context to correct Lua state; 2018-11-11 17:33:16 -08:00
mcc 8301bd7dd8 Remerge oculus-mobile branch with master 2018-11-02 18:10:08 -04:00
bjorn f8011f7bf7 Initial platform.h; 2018-10-29 14:00:16 -07:00
bjorn d5064844a7 Rewrite main.c; 2018-10-29 13:52:50 -07:00
bjorn a0f2a34647 Prefer modules in the exe to modules on disk;
This fixes the lovr-docs loader and is arguably the better behavior.
2018-10-25 06:49:03 -07:00
mcc 5ad8fdd3e3 Fixes as far as running without crashes, no display yet 2018-10-24 23:40:11 -04:00
bjorn eb40c1980b Merge lovr.c into main.c; 2018-09-27 18:38:44 -07:00
bjorn 3e2259fc99 version/os refactor; 2018-09-27 18:38:44 -07:00
bjorn faeb12f206 Refactor main loop; 2018-05-27 19:05:10 -07:00
bjorn 0d7810b333 Fix some issues with lovr.event.quit('restart'); 2018-05-27 19:05:10 -07:00
bjorn 8702d7422f Rewrite boot.lua, main.c, and exception handling;
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.
2018-05-27 19:05:10 -07:00
bjorn a3a50e5ca7 Ensure arg gets passed to lovr.load; 2018-03-30 18:48:20 -07:00
bjorn bdc9b63b8a Fix lots of memory leaks;
Especially when restarting or using threads.
2018-03-23 19:31:45 -07:00
bjorn f5fa9a4e5c Make modules more restartable;
Except headset.  Screw you, headset.
2018-02-23 18:38:53 -08:00
bjorn 583afc9f16 Reorganize main/lovr separation; 2018-02-23 18:38:34 -08:00