Commit Graph

130 Commits

Author SHA1 Message Date
bjorn 6f6de92d19 Add preliminary WebXR backend; 2020-03-04 22:47:24 -08:00
bjorn 90b605f012 Add restart cookie; lovr.event.restart; arg.restart; 2020-02-26 14:40:40 -08:00
mcc c604149428 Y-flip mirror texture on Oculus
Oculus gives us the mirror texture "upside down" compared to every other driver, so flip it rightside up before drawing in boot.lua.
2019-06-28 22:46:23 -04:00
bjorn 488c125c5f Draw the rest of the owl; 2019-12-10 12:19:50 -08:00
bjorn b69a5ba1a3 Update conf.version;
opps
2019-11-27 20:48:58 -08:00
bjorn 17dda66b69 boot.lua works without headset module; 2019-10-02 16:20:50 -07:00
bjorn 5ed132635a Fix error screen when headset module is disabled; 2019-09-03 15:34:41 -07:00
bjorn 00412e2e79 Add a conf.lua flag for making the window resizable; 2019-08-28 00:59:03 -07:00
bjorn e6c9fd1a6e rm error screen buttons; 2019-08-19 14:52:56 -07:00
bjorn 584261e21f rm ffi vectors; 2019-08-19 14:13:36 -07:00
bjorn 851f5f27ec Add more default headset drivers; 2019-08-09 00:00:42 -07:00
bjorn db57592646 Attempt to display SOME relevant message for 'error occurred while displaying another error' in the luajit-only nonstandard crash path 2019-08-02 20:29:28 -07:00
bjorn ecac39c08b Add experimental buttons to default error screen; 2019-08-01 00:14:37 -07:00
bjorn 9712f4765c lovr.headset.hands is CURSED; 2019-07-30 20:17:38 -07:00
bjorn 9156fa2cbf Vector rework; 2019-07-16 20:30:51 -07:00
bjorn 348798b86c Make shader in nogame screen more correct; 2019-07-02 20:12:24 -07:00
mcc dc98846169 Fix error screen on Android
As discussed in slack, lovr.errhand appears to predate lovr.graphics.hasWindow() and does not use it. This resulted in a crash on Oculus Go
2019-07-02 18:45:08 -07:00
bjorn d3f08fd1f0 rm logo.png; 2019-06-29 18:28:20 -07:00
bjorn b2df3e9816 Update nogame screen;
- Slightly dim background color (may change).
- Use a shader for the logo (it's centered now, not quite 100% like the image).
- Adjust text optical weight (I hate it).
2019-06-29 18:27:55 -07:00
bjorn e9853ed3c7 t.math.ffi conf flag; 2019-06-10 00:11:20 -07:00
bjorn 575552a147 Restart hotkey works on default error screen; 2019-06-02 03:29:34 -07:00
bjorn 374492c586 Add experimental hotkeys flag;
- Add t.hotkeys flag to conf.lua, which defaults to true.
- If t.hotkeys is truthy, the following hotkeys will be enabled:
  - Escape: Quit the experience
  - F5: Restart the experience
2019-06-02 03:00:12 -07:00
bjorn 6134abe866 Handle vsync better;
- Add vsync flag to t.window and lovr.graphics.createWindow.
- vsync is 1 by default.
- Some headset drivers override vsync if they have special timing requirements.
2019-05-14 00:18:22 -07:00
bjorn 51ce0c1418 rm compat; 2019-05-12 22:28:02 -07:00
bjorn 9382afb94d Put controller models back on nogame screen; 2019-05-12 22:23:08 -07:00
bjorn 89ccf750ba Start compat system; 2019-05-12 22:23:02 -07:00
bjorn da6fd4d07c Remove Controllers; 2019-05-12 22:22:29 -07:00
bjorn c9775c84ac Remove t.gammacorrect flag;
Gamma correct rendering is core in all supported OpenGL versions,
and it's usually a good idea to enable it.
2019-05-03 17:53:33 -07:00
bjorn ed92c4e6db font:setFlipEnabled(false) in lovr.errhand;
To prevent text from being upside down if you flipped the default font.
2019-04-13 15:40:47 -07:00
bjorn 59e4a5bb8e Oops, re-enable graphics module in boot.lua;
Also change format of message.
2019-04-08 05:18:28 -07:00
bjorn 0f6bcad90b Nogame screen works without the graphics module; 2019-04-08 03:25:45 -07:00
bjorn d45e56146a Rename fake to desktop; 2019-03-06 23:02:47 -08:00
bjorn 0cba1ba28d lovr.audio.getPose; lovr.audio.setPose; 2019-02-17 18:26:56 -08:00
bjorn a081ab8aed Update lovr.headset in the error screen; 2019-02-13 20:37:06 -08:00
bjorn 4a25a0120f Vector rework; 2019-02-08 08:13:47 -08:00
bjorn 0d81745282 Fix error screen; 2019-02-05 13:15:27 -08:00
bjorn b37fc5dbbe Remove fixed-function mirroring code from headset drivers; 2019-01-28 18:29:50 -08:00
bjorn f2cb7e7e3d Reset color to white after drawing nogame screen; 2019-01-28 18:21:46 -08:00
mcc b09c3adeec Fixes to lovr.mirror() requested in PR 2019-01-28 15:03:58 -08:00
mcc aab1bda92d Implementation of getMirrorTexture() 2019-01-28 15:03:58 -08:00
mcc 95fcc3eb0b Attempt to make a lovr.mirror() for Window purposes as discussed in chat.
Adds lovr.graphics.hasWindow()
2019-01-28 15:03:58 -08:00
bjorn 7338c82d7f Add resizable vector pools;
It seems too dangerous/annoying to have pools error when they run
out of memory.  Instead, we'll make it so you can choose to make
a pool resizable, where it enlarges its memory if it runs out. By
default Pools aren't resizable, but the default math pool is.

Also, reduce the size of the default pool from 640k to 4k.
2019-01-10 14:10:04 -08:00
bjorn ba192374dc Start math types; 2018-12-02 12:08:07 -08:00
mcc 778b654f1d Move lovr.android.getApplicationId() to lovr.filesystem.getApplicationId(). Kill Android module
This requires adding an application id function to platform and adding a mini definition to sds into platform.h. All platforms except Android return NULL (no application id)
2018-11-27 15:02:25 -08:00
mcc 961bf859f6 Android lua module
Currently provides only a lovr.android.getApplicationId(). This returns an Android-specific identifier that doesn't cleanly map to anything specific in other OSes.
2018-11-27 15:02:25 -08:00
mcc 8e8091ccbc Fixes to error handling in boot.lua
- The pcalls to run conf were triggering their error very late, and were detecting error based on the second return value of pcall being non-nil. In fact the second return value of pcall is often non-nil in the case of *success*. We should check the first parameter, success/failure, instead.

- It is possible in principle to call error() with a non-string value, so errhand should sanitize its values with tostring.

- There is a check in the main boot.lua loop whether xpcall returned a string, which is the sign luajit hit an error in an error handler. This check was occurring in the wrong place (my fault; merge error when preparing PR) so if lovr.load() hit this case we were falling back to the horrible “could not call a string” error.
2018-11-24 18:48:29 -08:00
bjorn 5c3280ba2a boot.lua: Improve errors when loading modules fails;
Remove hardcoded list of modules as well.
2018-11-16 02:27:34 -08:00
bjorn ab232571d0 Make sure error messages get printed; 2018-11-15 07:51:21 -08:00
mcc 684fd77316 Various changes around error reporting to support Oculus Mobile
General changes:

- Amended the boot.lua error handling so when an error occurs in the error handler, the inner error is printed before quitting
- Silent quit instead of crash if a user implements lovr.errhand but it doesn't return a function

Oculus Mobile changes:

- The lovr.errhand screen is now correctly invoked for errors that occur inside lovr.draw. Multiple changes were needed to make this work:
    - Instead of calling renderHelper, which uses lua_call (unsafe as Oculus Mobile does not call renderHelper) the oculus driver gets hold of the Lua ref and lua_pcalls itself. A new lovrHeadsetExtractRenderFn is added to make this possible.
    - A mechanism is added where if the coroutine resume in boot.lua returns a value, boot.lua treats this as the string returned from luax_getstack and invokes lovr.errhand.
- Added a custom atpanic that routes through lovrThrow (since stderr gets eaten). With the draw() changes this should never be encountered, but it's good just in case. In current testing the tracebacks this prints don't seem to be right.
- Fix major bug in android_vthrow that meant % codes didn't work in lovrThrow on Android
- Nothing to do with errors, but fix getAxis("trigger")
2018-11-13 16:50:31 -08:00
mcc 5ad8fdd3e3 Fixes as far as running without crashes, no display yet 2018-10-24 23:40:11 -04:00
bjorn 816fda2177 Fix everything and merge; 2018-09-27 18:38:44 -07:00
bjorn 92e6ad93cb Dynamically load modules; 2018-09-27 18:38:44 -07:00
bjorn 5a9cd5187c Make CMakeLists more modular;
- Enable/disable individual modules, including enet/json
- Enable/disable different "backends" (audio/headset)
- Choose to use system vs. source versions of different libraries
2018-09-21 19:25:48 -07:00
bjorn 72158f103a Update for stereo rendering and new headset API; 2018-09-11 15:30:31 -07:00
bjorn 7c21d77a6e rm singlepass conf flag; Viewports; getSupported.singlepass; 2018-08-30 04:02:58 -07:00
bjorn 7569b7934f conf flag for singlepass; Shader fixes; 2018-08-23 12:52:18 -07:00
bjorn 8f529d3a37 Fix potential infinite loop in error handler; 2018-08-06 13:26:17 -07:00
bjorn a713a3d14f Use 4 for default msaa instead of max;
Turns out msaa of 32 is really really slow
2018-08-04 18:44:36 -07:00
bjorn 785913fd45 Add conf.headset.msaa config;
For separate window/headset msaa settings.  Currently only applies
to OpenVR since the other drivers render directly to the window.
2018-07-28 18:12:57 -07:00
bjorn c6a97a9a23 Fix issue where nogame's conf was ignored; 2018-07-19 01:08:50 -07:00
bjornbytes c68d65441c Draw the rest of the fucking owl; 2018-05-27 19:05:10 -07:00
bjorn 8c2e9df1b4 Fix error handler when graphics module is disabled; 2018-05-27 19:05:10 -07:00
bjorn 93e082c8cc WebVR;
- Add FORCE_FILESYSTEM
- Handle THREAD_ERROR event with noop case
- Remove hopefully redundant lovr.graphics.clear in errhand
- Finally use correct type signature for assimpFileTell
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 3ed16a0a68 Work around driver bug to fix error screen; 2018-03-22 09:57:44 -07:00
bjorn 221015677f Nogame screen align; 2018-03-22 09:57:44 -07:00
bjorn ddb22aef0e Refactor headset offset; 2018-03-22 09:57:44 -07:00
bjorn 5a74b8765b Change default window size; 2018-03-22 09:57:44 -07:00
bjorn fdb3a29a05 Add separate x/y scale to lovr.graphics.plane; 2018-03-19 13:09:03 -07:00
bjorn 8be201c040 Add default lovr.threaderror callback; 2018-03-12 10:37:45 -07:00
bjorn 3a36bcceae lovr.mount; lovr.headset.isMounted; isPresent changes;
Remove lovr.headset.isPresent.
Replace Controller:isPresent with Controller:isConnected.
Add lovr.headset.isMounted and lovr.mount callback.
2018-02-25 16:42:31 -08:00
bjorn 4cca193fcb lovr.threaderror callback; 2018-02-23 18:38:52 -08:00
bjorn f010a0ffc2 Basic module setup; 2018-02-23 18:38:33 -08:00
bjorn 5493a980ff Move Blob to lovr.data;
Keep lovr.filesystem.newBlob though...
2018-02-19 21:04:53 -08:00
bjorn a14f5734d5 Add lovr.data module; 2018-01-15 23:13:26 -08:00
bjorn f634e17e5c Avoid resetting clock after boot.lua;
Fixes an issue where the initial dt was negative.
2018-01-13 16:00:47 -08:00
bjorn e2c27fb74c Fix lovr.draw arguments; 2018-01-08 18:33:51 -08:00
bjorn aef6345606 Prevent loading of conf.lua outside project directory; 2018-01-05 23:04:47 -08:00
bjorn 662572c4e0 Add boot.lua back; 2017-12-18 16:01:12 -08:00