1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-05 22:03:36 +00:00
Commit graph

1884 commits

Author SHA1 Message Date
bjorn ac33b8b085 Add Buffer objects; 2018-12-06 16:14:30 -08:00
bjorn b586bc2cce lovrFontRender uses raw float* instead of VertexPointer; 2018-12-05 10:23:26 -08:00
bjorn a8361677f5 Move pose from Mesh to DrawCommand; 2018-12-05 10:22:12 -08:00
bjorn 0a6de472ae Add ARB_buffer_storage; 2018-12-05 10:19:24 -08:00
mcc 4238402ec0 lovrFileWrite buffer can be const and therefore should 2018-12-04 12:40:30 -08:00
bjorn 3a774354e8 Remove lovrHeadsetGetEyePose;
A lot of drivers didn't bother to support it, it's not used very often,
and there are better ways to expose it that will soon be implemented.
2018-12-02 13:27:55 -08:00
bjorn 9a3ba5fb52 LuaJIT: mat4:scale accepts single number; 2018-12-02 13:03:29 -08:00
bjorn 9d965e1d7a LuaJIT: mat4:translate, rotate, scale support chaining; 2018-12-02 13:02:10 -08:00
bjorn 0054c771b2 Properly release Curves on creation; 2018-12-02 12:51:20 -08:00
bjorn fb455a671c LuaJIT: dereference vector pointers before use;
That way __sub doesn't break due to built-in pointer operator.
2018-12-02 12:48:44 -08:00
bjorn 4e6bf41e67 mat4 fixes; 2018-12-02 12:08:07 -08:00
bjorn ecabec9bf2 Finish LuaJIT API; 2018-12-02 12:08:07 -08:00
bjorn 43567e561a Update lovr.graphics.points/lines to work with vectors; 2018-12-02 12:08:07 -08:00
bjorn 2aadc9bde1 rm Transform; 2018-12-02 12:08:07 -08:00
bjorn c7934b3b13 Update API to work with vectors; 2018-12-02 12:08:07 -08:00
bjorn ba192374dc Start math types; 2018-12-02 12:08:07 -08:00
mcc ca75cb37c1 Awkward hotfix to tinycthread.h
Becuase of https://github.com/tinycthread/tinycthread/issues/47 . Only needed on Android. Not needed in the glfw tinycthread because we don't use glfw on Android.
2018-11-30 13:00:28 -08:00
bjorn 783115c2cf Add newlines to the end of some files; 2018-11-27 15:03:52 -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 264db37ce6 Fix lovr.event.quit("restart") on Android 2018-11-27 15:02:25 -08:00
mcc adabf4c6ef Fix broken android lua module
The LOVR_ENABLE_ANDROID flag wasn't getting passed to C, and the getApplicationId code had bugs
2018-11-27 15:02:25 -08:00
mcc 99026af5ca Fix Android compile 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 0e99d47394 Fix module destruction;
There is a problem when a Thread stops: it destroys all of the modules
that it required.  This is because we unconditionally call luax_atexit
when modules are required, and when the thread lua_State dies it takes
all of the modules with it.  To fix this, lovr<Module>Init will return
whether or not initialization successfully happened, which provides us
with enough info to know if we should place the luax_atexit destructor
2018-11-19 09:24:28 -08:00
bjorn 465e5c2010 Controller:getVelocity; Controller:getAngularVelocity; 2018-11-19 09:24:10 -08:00
bjorn cc62f26976 appveyor: Only build on master; 2018-11-19 08:23:43 -08:00
bjorn e5dd0a2c17 Fix wasm build.........; 2018-11-16 07:36:44 -08:00
bjorn 6168ec243f Add platform/glfw.h;
Platforms that want to use glfw for most of their platform code can
include "glfw.h" for common functions, in a single-file-lib fashion.

All glfw code is in this file.
2018-11-16 07:24:20 -08:00
bjorn 217a2f6354 Fix problems not caught by MSVC; 2018-11-16 07:19:29 -08:00
bjorn 9bc4ee7c94 Android: omit linux.c in favor of android.c; 2018-11-16 04:53:44 -08:00
bjorn fcc3313c69 rm unused LOVR_ANDROID_FLAGS;
Can be added again if necessary.
2018-11-16 04:51:59 -08:00
bjorn 63103b13a5 rm NO_WINDOW define; 2018-11-16 04:51:17 -08:00
bjorn ca0034e0aa rm lib/glfw; 2018-11-16 04:44:36 -08:00
bjorn ba253a0716 oculus_mobile: lovrPlatform instead of glfw;
please don't break!
2018-11-16 04:44:20 -08:00
bjorn c9793eae49 lovrPlatform: init/destroy; 2018-11-16 03:59:06 -08:00
bjorn b7deda3758 lovrPlatform: Keyboard/mouse;
Update fake.c
2018-11-16 03:18:08 -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 ba60e99890 lovrPlatform: Window creation; 2018-11-16 02:26:56 -08:00
bjorn 6514492cb8 glfwGetTime -> lovrPlatformGetTime;
Same for glfwSetTime;
2018-11-16 00:28:45 -08:00
bjorn 4cd5505ac2 glfwPollEvents -> lovrPlatformPollEvents; 2018-11-16 00:24:43 -08:00
bjorn da92cce634 Fix wasm build; 2018-11-15 08:21:26 -08:00
bjorn 1ce7e49df5 Update CMakeLists; 2018-11-15 08:18:30 -08:00
bjorn 005d4b93f2 Move math helpers into lib;
They aren't really part of the math module since they are shared
across several modules, more "util"-y.
2018-11-15 08:03:51 -08:00
bjorn 2238f51338 Use lovrLog functions in oculus_mobile.c;
Question: Are we okay to simplify log levels to DEBUG/WARN?  If not,
maybe we add a LOVR_LOG_LEVEL thing...
2018-11-15 07:51:21 -08:00
bjorn 81451eb99d rm trailing whitespace; 2018-11-15 07:51:21 -08:00
bjorn ab232571d0 Make sure error messages get printed; 2018-11-15 07:51:21 -08:00
bjorn 0b78e238b3 luax_traceback;
Simplifies traceback code by adding a polyfill for Lua 5.2's
luaL_traceback function that can be used by the panic helper and
luax_getstack.
2018-11-15 07:51:21 -08:00
bjorn c6126bed59 Move print_override to luax;
It makes more sense for it to live there since it's a Lua override.
I misunderstood something when communicating about this initially.
2018-11-15 07:51:21 -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