Commit Graph

60 Commits

Author SHA1 Message Date
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
mcc 8052896b33 Restart-without-quit support: lovr.event.quit("restart") and return-from-run() both support the string "restart" in place of an exit code. When this happens, the program reruns itself in a new, isolated environment. In Emscripten, no reboot occurs and the program only quits. 2018-01-25 21:32:16 -05:00
bjorn aae636debb Move GLFW into LOVR; 2016-11-25 17:31:41 -08:00
bjorn e988f7ae41 Start lovr.filesystem; 2016-10-31 17:14:31 -07:00
bjorn 125e2d0e13 Skybox rough draft; 2016-10-23 19:03:10 -07:00
bjorn 9f9b2ef7e2 Include stb_image I guess ugh; 2016-10-15 16:36:31 -07:00
bjorn 315475e5be Remove global variable; 2016-09-17 18:15:47 -07:00
bjorn bbc2a32937 Support lovr /path/to/game; 2016-08-08 13:51:22 -07:00
bjorn 9c3e4ddec9 lovr.errhand; 2016-08-08 12:22:33 -07:00
bjorn 03b0c00253 Clean up main; 2016-08-08 03:47:05 -07:00