bjorn
bb06b211cd
Add missing getDirection binding;
2019-05-12 22:22:29 -07:00
bjorn
5c6163580b
rm unused headset.h;
2019-05-12 22:22:29 -07:00
bjorn
d8581106d4
Support Vive trackers again;
...
/trackers/1
2019-05-12 22:22:29 -07:00
bjorn
85d461e71c
Fixup lovr.headset.getName;
2019-05-12 22:22:29 -07:00
bjorn
50e77fc023
Combine getVelocity and getAngularVelocity impls;
2019-05-12 22:22:29 -07:00
bjorn
a9ef3656a1
lovr.headset.getDirection;
2019-05-12 22:22:29 -07:00
bjorn
965f39f834
Do less work in lovr.headset.getPosition/getOrientation;
2019-05-12 22:22:29 -07:00
bjorn
9a8b119a81
Add missing enum;
2019-05-12 22:22:29 -07:00
bjorn
77f848ea8f
Update oculus backend;
2019-05-12 22:22:29 -07:00
bjorn
f5b976cfae
Actually read paths in API;
2019-05-12 22:22:29 -07:00
bjorn
e406678b1c
rm luax_pushpath;
2019-05-12 22:22:29 -07:00
bjorn
2584809c23
Reorganize path enum;
2019-05-12 22:22:29 -07:00
bjorn
4edb8de0b0
Shorten path enum prefix;
2019-05-12 22:22:29 -07:00
bjorn
86537141ac
Add eye path;
2019-05-12 22:22:29 -07:00
bjorn
b42c3ffc0e
Rename hands to hand;
2019-05-12 22:22:29 -07:00
bjorn
60d2111937
Add proximity to Subpaths;
2019-05-12 22:22:29 -07:00
bjorn
b0067233f7
getType -> getName;
2019-05-12 22:22:29 -07:00
bjorn
fd985c95ff
rm isMounted;
2019-05-12 22:22:29 -07:00
bjorn
da6fd4d07c
Remove Controllers;
2019-05-12 22:22:29 -07:00
bjorn
bd609fc338
rm Controller:getHand;
2019-05-12 22:21:06 -07:00
bjorn
cb0a40a4b6
lovr.headset.isDown; lovr.headset.isTouched;
2019-05-12 22:21:06 -07:00
bjorn
45757f2fa3
Fixes;
2019-05-12 22:21:06 -07:00
bjorn
b95280006a
lovr.headset.newModel;
2019-05-12 22:21:06 -07:00
bjorn
cb79973b98
lovr.headset.vibrate;
...
Signature changed to take strength, duration, and frequency. All
are optional.
2019-05-12 22:21:06 -07:00
bjorn
36e4529dca
lovr.headset.getAxis;
...
Takes a path and returns 1-3 float values representing the components
of the axis at the path. The "touchx" and "touchy" axes are now just
"touchpad".
2019-05-12 22:21:06 -07:00
bjorn
5ab8904809
Controller polyfill; rm Controller pose functions; OpenVR paths;
2019-05-12 22:21:06 -07:00
bjorn
f87b4e6a25
Read paths; Desktop driver uses paths;
2019-05-12 22:21:06 -07:00
bjorn
48cf7e1874
Start paths;
2019-05-12 22:21:06 -07:00
bjorn
8208238df7
Support multiple tracking drivers;
...
Now the lovr.headset module initializes one display driver (the
first one in the list) and multiple tracking drivers. Only drivers
that implement 'renderTo' will be considered for display driver.
Tracking drivers are stored in a linked list, and retrieving pose
information involves trying all of the tracking drivers until the
pose is found.
2019-05-12 22:21:06 -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
594921d2ec
newThread: can load thread code from a file or Blob;
...
Also fix a lifetime issue: If the string containing thread code was
garbage collected before you started the thread, you would have been
running free'd memory as Lua code!
2019-05-02 15:09:54 -07:00
bjorn
0e0cfee6e8
Font:getWidth returns lineCount;
2019-04-27 11:13:37 -07:00
bjorn
c021afedae
Fix more warnings;
2019-04-20 18:42:25 -07:00
bjorn
b95c97ff57
rm unused mat4_setTransform function;
2019-04-20 14:15:43 -07:00
bjorn
0341233876
Also support hexcodes in lovr.graphics.clear;
2019-04-20 13:38:09 -07:00
bjorn
f268810d2a
Minor cleanup; Fix some undefined behavior;
2019-04-20 13:11:11 -07:00
bjorn
ec7afed2cb
Update one trailing reference to lib/math.h;
...
In a comment...
2019-04-20 11:41:29 -07:00
bjorn
196b4ed010
Rename math to maf;
...
It's funnier and more compatible with some compiler setups,
since it won't get confused with the system <math.h>.
2019-04-20 11:39:20 -07:00
bjorn
9d90e83657
Fix Mesh attribute normalization;
...
Normalize i8 and u8 attribute by default.
Forward attribute normalization from glTF accessors.
2019-04-13 16:08:58 -07:00
bjorn
44be3608a7
lovr.headset.getDirection; Controller:getDirection;
2019-04-12 15:08:45 -07:00
bjorn
fa4f240b7b
Fix plane uv argument parsing;
2019-04-05 05:50:43 -07:00
bjorn
011db5f1e5
Revert "Free objects in their destructors;"
...
This reverts commit d31dca5520
.
We can't unconditionally free because sometimes objects are temporarily
allocated on the stack.
2019-04-05 05:45:05 -07:00
bjorn
a5891bad92
lovr.graphics.plane uv arguments;
2019-04-05 05:34:28 -07:00
bjorn
941fc1717f
headset: forward declarations;
2019-04-05 05:08:03 -07:00
bjorn
ee27af1a85
graphics: forward declarations;
2019-04-05 04:59:14 -07:00
bjorn
66b7288764
event: forward declarations;
2019-04-05 04:32:58 -07:00
bjorn
0d30448bd0
audio: forward declarations;
2019-04-05 04:16:34 -07:00
bjorn
ae470d8804
Make registertype/extend type a macro;
...
Just a nice-to-have.
2019-04-05 03:48:36 -07:00
bjorn
6fdeda9e61
Make lovrRelease non-generic;
...
We know what type we're releasing 99% of the time, we don't need to
play a guessing game in lovrRelease, just have the caller say which
destructor to use.
There is lovrGenericRelease for situations where we need it, which
does the slower lookup of the destructor.
2019-04-05 03:41:03 -07:00
bjorn
efbc88073e
Write vertices at batch time;
2019-04-05 00:49:50 -07:00
bjorn
7409f34d36
lovr.graphics.getStats does a flush;
2019-04-01 07:37:05 +09:00
bjorn
ab42e2ca18
Fix bug when reading point/line/triangle primitive data;
...
- When reading points from a table of numbers, the array
indexing was not correct and vertex positions were not
getting correctly written.
- The normals/texture coordinates weren't getting written,
so their values were using whatever was in the buffer.
Now they are always set to zero.
2019-03-31 00:23:02 +09:00
bjorn
85c51399a6
Fix MSVC warnings;
2019-03-17 00:58:13 -07:00
bjorn
7441456aab
Rename lovr.graphics.getSupported and getSystemLimits;
...
"Features" and "Limits" will be the standard terminology used now.
2019-03-14 21:24:25 -07:00
bjorn
bf5dd56254
vec3:add and vec3:sub accept numbers;
2019-03-13 20:36:50 -07:00
bjorn
8722b6e296
Improve Canvas attachment errors;
2019-03-13 09:35:28 -07:00
bjorn
921d14014e
TextureData:setPixel supports more formats;
2019-03-11 13:36:22 -07: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
d45e56146a
Rename fake to desktop;
2019-03-06 23:02:47 -08:00
bjorn
d340fc7aaa
Polyfill LUA_RIDX_MAINTHREAD;
...
Instead of using a static variable.
2019-03-06 08:42:32 -08:00
bjorn
d4c8382306
Fix improper istype calls in LuaJIT;
2019-03-05 02:45:46 -08:00
bjorn
55670ab408
rm trailing whitespace;
2019-03-05 02:29:21 -08:00
bjorn
3d928c1118
lovr.graphics.newMesh accepts Blob again;
2019-03-05 02:08:53 -08:00
bjorn
27e2c56bee
lovr.filesystem.read takes and returns byte count;
2019-03-05 01:59:31 -08:00
bjorn
a8e201d89e
TextureData:getFormat;
2019-02-28 19:29:30 -08:00
bjorn
5e0c2e531f
Source:getPose; Source:setPose;
2019-02-18 18:07:28 -08:00
bjorn
41dbf6115b
Source:getOrientation; Source:setOrientation;
2019-02-18 18:01:17 -08:00
bjorn
af155ff0c5
Ensure Blob size is positive;
2019-02-17 18:43:52 -08:00
bjorn
0cba1ba28d
lovr.audio.getPose; lovr.audio.setPose;
2019-02-17 18:26:56 -08:00
bjorn
075b71e58c
Collider:getPose; Collider:setPose;
2019-02-17 18:20:35 -08:00
bjorn
90d6e2b407
Make binding functions static;
2019-02-17 14:52:22 -08:00
bjorn
d529620fea
rm unused variables;
2019-02-17 14:19:39 -08:00
bjorn
581d1d7a74
Fix warnings;
2019-02-16 23:43:20 -08:00
bjorn
62bce139d3
Fix mat4 constructor;
2019-02-14 10:31:22 -08:00
bjorn
69b6e599e9
Re-add Model:getMaterial and Model:setMaterial;
2019-02-13 23:55:47 -08:00
bjorn
b9b719e862
Fix gamma correct issue with built-in Camera;
2019-02-13 21:14:45 -08:00
bjorn
be58911276
Fix several Mesh problems;
2019-02-13 17:20:43 -08:00
bjorn
a02d4eb659
rm VertexData;
2019-02-13 15:10:52 -08:00
bjorn
9136c7e3c1
Model:getAABB;
...
It takes animated node transforms into account! But not skinning.
2019-02-13 15:10:52 -08:00
bjorn
a24d7e5447
Bugfixes during testing;
2019-02-13 15:10:52 -08:00
bjorn
3911c9d7c8
Support animation names;
2019-02-13 15:10:52 -08:00
bjorn
bea2140676
Animation optimization; Cleanup;
2019-02-13 15:10:52 -08:00
bjorn
09936a8ae2
Load animation names; General testing;
2019-02-13 15:10:52 -08:00
bjorn
540b6a60e0
Refactoring;
2019-02-13 15:10:52 -08:00
bjorn
0a4344577e
Skinning work; Bugfixes;
2019-02-13 15:10:52 -08:00
bjorn
70dc871f88
More work on Animator;
2019-02-13 15:10:52 -08:00
bjorn
80bb75968e
WIP animator rewrite;
2019-02-13 15:10:52 -08:00
bjorn
6b323e3476
Start parsing glTF;
2019-02-13 15:10:52 -08:00
bjorn
50e86579c2
vec3:min; vec3:max;
2019-02-08 12:39:10 -08:00
bjorn
3c83b36845
LuaJIT: Add .name metafields for compatibility;
2019-02-08 08:13:47 -08:00
bjorn
4a25a0120f
Vector rework;
2019-02-08 08:13:47 -08:00
bjorn
dc7f9cd0d5
lovr.graphics.getPixelDensity;
2019-02-05 12:46:48 -08:00
bjorn
8e942561f1
Simplify CompareMode handling;
2019-02-01 15:10:12 -08:00
bjorn
85ab7c7c6e
Fix comment typo;
2019-02-01 14:44:13 -08:00
mcc
4859360209
Fix compile with -DLOVR_ENABLE_HEADSET=NO
2019-02-01 13:20:28 -08:00
bjorn
eae3669fea
Rebuild math.lua.h;
2019-01-31 13:54:54 -08:00
bjorn
a1361fcd41
mat4:unpack accepts raw flag; rm redundant functions;
2019-01-30 16:18:08 -08:00
bjorn
0eb2789a2d
Improve mat4:set;
...
Ended up removing the diagonal variant, sorry holo.
2019-01-30 16:13:44 -08:00
bjorn
3d4cb166bc
Add quat:length;
2019-01-30 00:56:57 -08:00
bjorn
bf89216997
Explicitly convert lua_Numbers to floats;
2019-01-29 22:04:04 -08:00
bjorn
03e3e14718
Font:setFlipEnabled; Font:isFlipEnabled;
2019-01-29 21:49:49 -08:00
bjorn
6291a5ad5a
Always check malloc result; Less calloc;
...
Some more questions:
- Should there be some kind of allocation helper so you don't need
to always check the result?
- Throwing an error on OOM is convenient and is probably correct 90%
of the time, it even provides a nice error message instead of a
nil dereference somewhere. But it's inflexible. Is it the right
thing to do?
2019-01-29 16:53:01 -08:00
bjorn
5d29ec2db1
Curve supports vec3;
2019-01-29 16:33:44 -08:00
bjorn
a878139e26
rm math out args;
...
Needs more consideration before it can be added at the desired quality level.
2019-01-29 16:05:48 -08:00
bjorn
6c5ceabe02
Fix quat:set(nil) in vanillua;
2019-01-29 16:05:48 -08:00
bjorn
dac289d624
mat4:__mul works with vec3 in vanillua;
2019-01-29 16:05:48 -08:00
bjorn
9839277e8d
Fix quat:mul edge case;
2019-01-29 16:05:48 -08:00
bjorn
c08cb664e7
mat4:mul;
2019-01-29 16:05:48 -08:00
bjorn
6c961bb404
rm math copy functions;
...
They are redundant.
2019-01-29 03:57:11 -08:00
bjorn
b37fc5dbbe
Remove fixed-function mirroring code from headset drivers;
2019-01-28 18:29:50 -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
b410227990
Font:getRasterizer; Font:setPixelDensity(nil);
2019-01-25 12:54:11 -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
c473bf50e8
Buffers individually keep track of their flush range;
...
Fixes bugs with attached Mesh attributes, where flushing wasn't
happening when it should have.
2019-01-22 12:11:01 -08:00
bjorn
25606738c5
rm Curve:getDegree;
2019-01-21 09:49:07 -08:00
bjorn
8e0ccbf09a
Curve:split -> Curve:slice;
2019-01-20 20:36:42 -08:00
bjorn
5deae0a103
Rename setWindow back to createWindow;
...
I'm not sure why this was changed. It doesn't make very much sense
because setWindow can't be called multiple times, and it can't be
called with nil/NULL.
2019-01-20 20:06:40 -08:00
bjorn
8f9d24c51f
Replace sprintf with stb version;
2019-01-18 08:55:29 -08:00
bjorn
e6d9b82bba
Adjust BlockType; getValue -> read;
2019-01-16 10:02:44 -08:00
bjorn
ee7544eba8
ShaderBlock:getValue; Shader:send vector fixes;
...
Allows you to read back values from a ShaderBlock.
- This is also probably useful for Shaders.
- This creates SO MANY tables. It feels so bad to expose this. But
also it's the only way to read values back from a compute operation,
so it's pretty indispensable. In the future there could be a Blob
variant.
2019-01-16 10:02:44 -08:00
bjorn
27000d2238
Rebuild math.lua.h;
2019-01-14 12:30:47 -08:00
bjorn
aa56cbc7b0
Fix crash on repeated calls to Channel:peek;
2019-01-12 20:51:50 -08:00
bjorn
bb9d354ac9
Fix missing LuaJIT return;
2019-01-12 05:06:57 -08:00
bjorn
6bfc6623ac
More consistent matrix out args;
2019-01-12 04:58:05 -08:00
bjorn
577ed57b2d
oops, access the two types of Pools properly;
2019-01-12 04:22:11 -08:00
bjorn
c41a5c4e3c
Math copy functions allow you to specify a Pool;
2019-01-12 03:46:14 -08:00
bjorn
990544d3f4
Fix quat:save in LuaJIT;
2019-01-12 03:06:40 -08:00
bjorn
90cacd03ca
Handle numbers more consistently in Lua API;
...
I still don't know if I should cast or not, but at least now things
will be consistently right or wrong.
2019-01-11 22:37:54 -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
f709a6849b
Fix crashes with :save'd vectors in LuaJIT;
2019-01-08 02:37:50 -08:00
bjorn
dee53f953c
Fix vector save functions in LuaJIT;
2019-01-08 00:54:07 -08:00
bjorn
40c7deaefe
Vector API improvements;
2019-01-06 03:25:00 -08:00
bjorn
c7fa8f8497
Fix vec3:set;
2019-01-05 00:21:56 -08:00
bjorn
cc88a0b919
Expose option to flip TextureData on load;
2019-01-04 23:32:25 -08:00
bjorn
379dc74cd5
Mesh fixes;
2019-01-04 18:01:01 -08:00
bjorn
1068dd1081
Rework cylinder;
2019-01-04 18:01:01 -08:00
bjorn
ea3a77a73a
Many batching improvements; Refactoring;
2019-01-04 18:01:01 -08:00
bjorn
d66057ee70
Avoid redundant strlen in font printing;
2019-01-04 18:01:01 -08:00
bjorn
62645cde28
Pipeline -> 4 bytes; lineWidth -> uint8_t;
2019-01-04 18:01:01 -08:00
bjorn
2ceb474b04
DrawCommand -> DrawRequest;
2019-01-04 18:01:01 -08:00
bjorn
779e28353d
Rebuild math.lua.h;
2019-01-04 02:19:10 -08:00
bjorn
4f716499b0
Fix declspec for math functions;
...
LuaJIT can't find math functions on windows unless they are exported.
2019-01-04 02:18:21 -08:00
bjorn
60a12a6b7e
Rename thread module init/destroy;
2018-12-19 01:04:42 -08:00
bjorn
ab8e86b9a5
Fix vec3() in LuaJIT;
2018-12-17 20:14:10 -08:00
bjorn
68a0bf4a10
mat4:transformPoint;
2018-12-17 20:07:19 -08:00
bjorn
b0a146919f
Add vec3:length;
2018-12-17 19:32:43 -08:00
bjorn
1fb2d6be02
Always use pushliteral when possible;
2018-12-15 21:45:32 -08:00
bjorn
ad10f3bc37
Fix rgb10a2 constant;
2018-12-15 17:35:57 -08:00
bjorn
ff581d2e07
Fix Mesh:draw;
2018-12-12 19:39:01 -08:00
bjorn
a67f59000f
DrawMode -> DrawStyle; MeshDrawMode -> DrawMode;
...
Renaming enums doesn't really have an impact on the API usage, just
the docs and internal naming of things.
2018-12-12 18:43:04 -08:00
bjorn
2540953422
lovr.graphics.setAlphaSampling for alpha to coverage;
2018-12-11 22:52:58 -08:00
bjorn
2435108d4d
rm drawInstanced (last argument of draw instead);
...
Willing to revert this, but I think this is the cleaner API to use.
2018-12-11 22:16:40 -08:00
bjorn
259dbd5758
completely rm lovrGraphics from opengl.c;
2018-12-11 22:12:19 -08:00
bjorn
b02eae30b4
Autoinstancing;
2018-12-11 22:10:29 -08:00
bjorn
18fdd0c062
Autobatching;
2018-12-11 13:27:59 -08:00
bjorn
387a91d5e4
lovr.graphics.flush;
2018-12-11 11:13:46 -08:00
bjorn
2e5c927b92
Expose max UBO size in lovr.graphics.getSystemLimits;
2018-12-11 11:13:02 -08:00
bjorn
7f333ce956
Refactor Mesh attributes;
2018-12-07 19:11:14 -08:00
bjorn
e2886d3bb5
Mesh uses Buffer;
2018-12-07 15:57:45 -08:00
bjorn
9a0f7c919a
ShaderBlocks use Buffers;
2018-12-06 16:34:14 -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
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
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
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
ba60e99890
lovrPlatform: Window creation;
2018-11-16 02:26:56 -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
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
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
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
a1237029de
lovr.graphics.translate: Arguments default to 0;
2018-11-12 19:28:41 -08:00
bjorn
112d775635
Font:hasGlyphs;
2018-11-11 17:29:41 -08:00
bjorn
76c2dc757a
Curve:getTangent;
2018-11-08 12:56:45 -08:00
bjorn
2703192f1d
Make a constructor;
2018-11-08 12:56:45 -08:00
bjorn
2acf49fb34
Curve;
2018-11-08 12:56:45 -08:00
bjorn
bfeb3d2d51
lovr.graphics.discard;
2018-11-08 11:58:31 -08:00
mcc
a46b4afbb8
Split out the "oculus mobile" headset type into GEAR and GO.
2018-11-07 14:34:51 -05:00
mcc
8301bd7dd8
Remerge oculus-mobile branch with master
2018-11-02 18:10:08 -04:00
mcc
79b0c19254
Oculus mobile: First round of fixes requested in PR review
...
Formatting, back out bad change to Win32 build, support getOs()
2018-10-28 22:55:37 -04:00
mcc
dd440b2ada
Code cleanup after all these changes, fix build
2018-10-28 15:31:27 -04:00
bjorn
654b894ded
Add lovr.graphics.setProjection;
...
It's not very good. It only takes Transforms and sets the projection
for both eyes. And the projection gets reset at the beginning and
end of lovr.headset.renderTo. It's meant to be a backdoor.
2018-10-26 17:17:18 -07:00
mcc
b892d0143f
Remerge oculus mobile and master branches (to get lovrCanvasCreateFromHandle)
2018-10-25 00:06:39 -04:00
mcc
5ad8fdd3e3
Fixes as far as running without crashes, no display yet
2018-10-24 23:40:11 -04:00
bjorn
5f8f8a540e
lovr.filesystem no longer relies on arg global;
2018-10-23 11:12:13 -07:00
bjorn
43309efc57
Fix problems with variants;
2018-10-23 11:11:47 -07:00
bjorn
cf3b060fe5
Fix MSVC issues with variables named near/far;
2018-10-22 16:40:12 -07:00
bjorn
485f65b013
Transform:setOrthographic; Transform:setPerspective;
2018-10-21 09:06:37 -07:00
bjorn
518d26aad8
getDisplayDimensions: Use unsigned ints;
...
Fixes a warning.
2018-10-21 08:40:57 -07:00
bjorn
e1d980a2d6
Re-add lovr.headset.getBoundsGeometry;
...
Looks like more runtimes are starting to support it.
2018-10-09 17:51:05 -07:00
bjorn
086a0030b1
Shader:send/ShaderBlock:send fills in nils with 0's;
2018-10-06 16:15:38 -07:00
bjorn
8d076f31c1
Fill accepts UV subrect to use;
2018-09-30 18:58:51 -07:00
bjorn
a9e92b5185
Add ability to mirror specific eyes;
...
Doesn't work yet for OpenVR/Oculus.
2018-09-30 18:58:51 -07:00
bjorn
2398e592a9
Darn USE_MATH_DEFINES;
2018-09-27 20:32:45 -07:00
bjorn
816fda2177
Fix everything and merge;
2018-09-27 18:38:44 -07:00
bjorn
238af0064f
Add missing lovr.filesystem.unmount function;
2018-09-27 18:38:44 -07:00
bjorn
3e2259fc99
version/os refactor;
2018-09-27 18:38:44 -07:00
bjorn
cee3c28f4e
luax_atexit; rm lovrDestroy;
...
Modules register themselves in the registry for destruction at
lua_close instead of having a hardcoded list in lovrDestroy.
2018-09-27 18:38:44 -07:00
bjorn
92e6ad93cb
Dynamically load modules;
2018-09-27 18:38:44 -07:00
bjorn
e02d22365f
api: refactor;
2018-09-27 18:38:44 -07:00
bjorn
792834623c
api: more modular helper functions;
2018-09-27 18:38:44 -07:00
bjorn
1f12717357
Canvas creates Textures with clamp filter;
2018-09-27 18:37:13 -07:00
bjorn
cfac548e7b
Add flag to make Canvas depth texture readable;
...
- DepthFormat is now just TextureFormat.
- Canvas:getDepthTexture instead of Canvas:getDepthFormat.
2018-09-27 18:34:43 -07:00
bjorn
148a2bdb45
Error system no longer relies on Lua;
2018-09-26 10:39:17 -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
924eb5fa0a
Shader:send: Add a missing break;
...
opps
2018-09-05 10:13:04 -07:00
bjorn
7a8abc80a2
Copy Transform objects more safely in Shader[Block]:send;
2018-09-05 04:22:12 -07:00
bjorn
a5b9d267d0
Ensure int attributes are signed;
2018-09-05 03:25:13 -07:00
bjorn
7e1687ce6b
Fix Shader:sendImage;
2018-09-04 06:58:54 -07:00
bjorn
4e1757210e
Load cubemap images better;
2018-09-03 20:59:12 -07:00
bjorn
fbd294f76d
Empty textures default to linear instead of sRGB;
2018-09-02 21:15:59 -07:00
bjorn
3cc1b60fd8
Better default for anonymous texture depth;
2018-09-02 21:11:48 -07:00
bjorn
064adef0bb
Transform:getMatrix accepts target table;
2018-09-01 02:52:16 -07:00
bjorn
ea331a12be
Fix bugs;
2018-08-31 23:24:59 -07:00
bjorn
dca52ee967
Improve newCanvas API;
2018-08-31 16:37:30 -07:00
bjorn
a5256aaa27
Happy little graphics refactors;
2018-08-31 06:03:35 -07:00
bjorn
f872a5f094
Re-enable threads for emscripten;
...
They don't appear to work very well but this simplifies code a lot.
2018-08-30 22:09:54 -07:00
bjorn
7e889a564a
Emscripten fixes;
2018-08-30 20:56:08 -07:00
bjorn
7c21d77a6e
rm singlepass conf flag; Viewports; getSupported.singlepass;
2018-08-30 04:02:58 -07:00
bjorn
a97c8e2266
Fix skybox texture mapping;
2018-08-30 00:06:29 -07:00
bjorn
1f4fee9b28
Fix newTexture flags;
2018-08-29 21:45:08 -07:00
bjorn
4215ea2e24
Canvas getters;
2018-08-29 21:22:13 -07:00
bjorn
e287cee1c9
Canvas:newTextureData;
2018-08-29 21:22:12 -07:00
bjorn
74fec01e60
Canvas mipmaps flag;
2018-08-29 21:22:12 -07:00
bjorn
3fb1b49549
MSAA canvases/textures but no resolving yet;
2018-08-29 21:22:12 -07:00
bjorn
6b87a71261
Allow Canvases to be used as Textures sometimes;
2018-08-29 21:22:11 -07:00
bjorn
590668a8d6
lovrGraphicsBlit;
2018-08-29 21:21:38 -07:00
bjorn
671f0835c0
Fix lovr.headset.getDisplayWidth/Height;
2018-08-29 21:19:07 -07:00
bjorn
ee0f75484d
newCanvas stereo flag;
2018-08-29 21:18:33 -07:00
bjorn
329668eb39
Additional Canvas validation;
2018-08-29 21:18:33 -07:00
bjorn
68d66f3f98
Canvas:renderTo;
2018-08-29 21:18:33 -07:00
bjorn
4cc8bd7582
Canvas depth buffer;
2018-08-29 21:18:33 -07:00
bjorn
e8ec73657d
lovrCanvasBind;
2018-08-29 21:18:33 -07:00
bjorn
7e74441afd
getCanvas; setCanvas; Canvas attachments;
2018-08-29 21:18:33 -07:00
bjorn
d39e9f1687
Depth texture formats;
...
I hope I don't hate myself for calling them d16, d32, etc.
2018-08-29 21:18:32 -07:00
bjorn
f09f0d9424
newTexture takes w/h/format;
2018-08-29 21:18:32 -07:00
bjorn
e9ebdc2d58
Rework TextureData creation functions;
2018-08-29 21:18:32 -07:00
bjorn
7795bb9276
I came in like a wrecking ball;
2018-08-29 21:18:32 -07:00
bjorn
7569b7934f
conf flag for singlepass; Shader fixes;
2018-08-23 12:52:18 -07:00
bjorn
b50c2d018a
Texture is optional in lovr.graphics.fill;
2018-08-23 11:44:00 -07:00
bjorn
7a866552e9
Fix remaining physics leaks;
2018-08-22 09:29:34 -07:00
bjorn
1f00948da0
Fix world/collider memory leaks;
2018-08-18 21:16:19 -07:00
bjorn
d2b6def5c2
Shader:sendImage;
...
Can be used to bind images with specific slices, mipmap levels,
and access hints.
2018-08-17 19:53:54 -07:00
bjorn
cab12ba945
Shader:setBlock accepts access hint;
2018-08-17 19:53:54 -07:00
bjorn
198400828d
Source:getType;
2018-08-17 19:53:54 -07:00
bjorn
b5d7c0742f
Fix Texture:setFilter;
2018-08-17 19:53:54 -07:00
bjorn
96cfeedc94
Add rg16f and rg32f texture formats;
2018-08-16 14:54:37 -07:00
bjorn
a30fdc9749
Texture:getFormat;
2018-08-16 14:27:45 -07:00
bjorn
7f158a3473
Tiny fix for headset msaa default;
2018-08-15 17:57:05 -07:00
bjorn
a18540a934
Proper validation of uniform texture types;
2018-08-13 17:03:39 -07:00
bjorn
cc440c9784
Support format parameter in newTextureData;
2018-08-11 00:09:47 -07:00
bjorn
9ce462a67f
Image uniforms;
2018-08-11 00:08:34 -07:00
bjorn
d961614184
Attempt automatic glMemoryBarrier;
2018-08-11 00:08:34 -07:00
bjorn
c3823a6f9a
ARB_shader_image_load_store; rm opengl es from glad;
...
This means we had to remove rgb565 and FRAMEBUFFER_INCOMPLETE_DIMENSIONS.
2018-08-11 00:08:34 -07:00
bjorn
902239c017
lovr.graphics.wait; Barrier;
2018-08-11 00:08:34 -07:00
bjorn
5c65fc811f
Change "drawing" to "rendering" in comments;
2018-08-11 00:08:33 -07:00
bjorn
98e518683a
Add computeshaders to lovr.graphics.getSupported;
2018-08-11 00:08:33 -07:00
bjorn
3b51056870
lovr.graphics.compute;
2018-08-11 00:08:33 -07:00
bjorn
2cb6de47f2
Compute shader creation;
2018-08-11 00:08:33 -07:00
bjorn
b1079f5ce8
Separate initialization for graphics/compute shaders;
2018-08-11 00:08:33 -07:00
bjorn
bf3ed3ed1f
Texture improvements;
...
Textures no longer keep references to their TextureData.
lovrTextureAllocate can now be used to allocate texture storage,
and isn't weirdly coupled to lovrTextureReplacePixels.
Better error messages for textures.
2018-08-09 16:12:57 -07:00
Bjorn Swenson
06379f33ee
Merge pull request #49 from bjornbytes/shader-block
...
ShaderBlock
2018-08-07 15:17:06 -07:00
bjorn
78d9cc0031
Actually set shader uniforms;
2018-08-06 13:44:46 -07:00
bjorn
175de8924f
Ensure uniform count is always positive;
2018-08-06 13:25:04 -07:00
bjorn
bdf130800e
ShaderBlock:getShaderCode;
2018-08-06 11:46:42 -07:00
bjorn
f95685ba80
ShaderBlock:send(blob);
2018-08-06 10:42:23 -07:00
bjorn
86380e7694
ShaderBlock:getOffset;
2018-08-06 10:42:19 -07:00
bjorn
e3e17bc84c
ShaderBlock:isWritable;
2018-08-06 10:41:57 -07:00
bjorn
70b27bd846
Use new table shorthand for newShaderBlock formats;
...
Also luax_checkuniformtype and error message improvements.
2018-08-06 10:34:12 -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
1b7261de5c
lovr.graphics.getSupported;
2018-08-03 11:46:21 -07:00
bjorn
f6f322fc7f
Treat UBOs and SSBOs more similarly to reduce duplication;
2018-08-03 11:34:11 -07:00
bjorn
7d9b728669
Remove 32 uniform limit;
2018-08-02 16:13:27 -07:00
bjorn
b8faff6986
Add writable and usage flags to ShaderBlock;
2018-08-02 05:04:40 -07:00
bjorn
7e3f256ba2
Spacing;
2018-08-02 05:04:40 -07:00
bjorn
ce19599fec
Improve uniform error messages;
2018-08-02 05:04:40 -07:00
bjorn
4589ce66d0
luax_checkuniform supports samplers;
2018-08-02 05:04:40 -07:00
bjorn
2b093b5828
ShaderBlock:send; Helper function for reading uniforms;
2018-08-02 05:04:40 -07:00
bjorn
a4052430a4
Shader:getBlock; Shader:setBlock;
2018-08-02 05:04:40 -07:00
bjorn
854431c9ea
Rebase;
2018-08-02 05:04:40 -07:00
bjorn
a372abb810
Reorganize uniform/block data structures;
2018-08-02 05:04:40 -07:00
bjorn
85ff844d24
lovrShaderBlockCreate;
2018-08-02 05:03:28 -07:00
bjorn
823886f03f
Start newShaderBlock;
2018-08-02 05:03:28 -07:00
bjorn
e5fd9c7412
Fix SoundData leaks;
2018-08-02 03:27:16 -07:00
bjorn
2acc4761b7
Fixes for WebGL; rm sharpness from texture filter;
2018-08-02 01:31:23 -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
9e494cae46
Make custom events work;
2018-07-26 19:38:01 -07:00
bjorn
156c0cde5d
Condense event code a bit;
2018-07-26 19:38:01 -07:00
bjorn
693766cf3b
Hmm, byte vertex attributes can have more than 1 component;
2018-07-25 00:01:22 -07:00
bjorn
0b922a9703
rm Variant type name tracking;
2018-07-24 21:21:37 -07:00
bjorn
d6daa885c8
Simplify luax_checktype and inheritance;
2018-07-24 21:15:07 -07:00
bjorn
83ddb82162
Simplify Lua object management;
2018-07-24 20:13:54 -07:00
bjorn
eb45b6f04f
Add the ability to set Texture LOD bias;
2018-07-22 20:37:27 -07:00
bjorn
66ca77abd1
Texture:replacePixels supports mipmap;
2018-07-22 20:37:27 -07:00
bjorn
98e0522c4f
Add more texture formats;
2018-07-20 17:45:25 -07:00
bjorn
5f06ca44c9
Improve error messages for bad vertex formats;
2018-07-20 15:53:53 -07:00
bjorn
686f621928
That error message was such a liar;
2018-07-20 15:51:58 -07:00
bjorn
c46cff496e
Fix minor issue with texture flag defaults;
2018-07-19 19:30:37 -07:00
bjorn
11a3937a5d
Improved mipmap support;
...
- Texture dimensions functions take an optional mipmap level.
- Add Texture:getMipmapCount.
- Fix issue where textures always allocated mipmap storage.
2018-07-19 19:28:27 -07:00
bjorn
c19d69cfdd
Fix dll/so loading; Respect hyphens;
2018-07-18 17:09:47 -07:00
bjorn
d4c28f5770
Texture:replacePixels accepts x/y offset;
2018-07-18 01:36:29 -07:00
bjorn
8cc795aa9d
Material:getTransform; Material:setTransform;
2018-07-18 01:17:16 -07:00
bjorn
5641afee13
Remove isDefault flag from Material;
2018-07-18 00:34:21 -07:00
bjorn
f1f2c7b401
Yay all opengl is in opengl.c;
2018-07-17 17:21:15 -07:00
bjorn
2cf0e15eb0
Morganization; Fix some Canvas issues;
2018-07-17 17:21:15 -07:00
bjorn
f57810cd7a
Morganization;
2018-07-17 17:21:15 -07:00
bjorn
56bbf1cf56
Organization;
2018-07-17 17:21:15 -07:00
bjorn
4239bc46ea
Refactor graphics stats;
2018-07-17 17:21:14 -07:00
bjorn
0ee5d0b8f2
Anonymous materials for draw calls;
2018-07-17 17:21:14 -07:00
bjorn
fe75c666a9
Simplify lovr.graphics.getWidth/Height;
2018-07-17 17:21:14 -07:00
bjorn
b64489b020
Pipeline stack for graphics state; Simplify clearing;
2018-07-17 17:21:14 -07:00
bjorn
e0063995b3
More data driven primitives;
2018-07-17 17:21:14 -07:00
bjorn
e6e8e137c0
Clean up drawing;
2018-07-17 17:21:14 -07:00
bjorn
322c0bdef7
GpuStats;
2018-07-17 17:21:14 -07:00
bjorn
8bf60b73ec
Add opengl header; Migrate relevant object implementations;
2018-07-17 17:21:14 -07:00
bjorn
c86bb419f1
Use indirection for graphics object access;
...
This will make it easier to move stuff around.
2018-07-17 17:21:14 -07:00
bjorn
b1b9dc734d
Woops make sure to use cross platform dlsym;
2018-07-07 13:57:32 -07:00
bjorn
0214c7605e
Support requiring dll/so files;
...
Still WIP
2018-07-07 13:55:22 -07:00
bjorn
22f6e7831b
Support C require paths;
2018-07-06 21:21:07 -07:00
bjorn
fedab9e46f
lovr.math.noise;
2018-07-06 18:39:34 -07:00
bjorn
b650f2b770
Add Microphone objects for audio capture;
2018-07-06 17:57:31 -07:00
bjorn
e3b2a4d974
lovr.graphics.newShader accepts Blobs;
2018-07-06 01:35:00 -07:00
bjorn
f444809f0f
Assert is the bessstt;
2018-07-06 01:25:08 -07:00
bjorn
371551ca42
Add lineloop constant;
2018-07-05 23:44:45 -07:00
bjorn
fdef90b7bc
Add AudioStream:decode;
2018-07-05 23:30:37 -07:00
bjorn
4e146197b4
Remove AudioStream:seek;
2018-07-05 22:51:52 -07:00
bjorn
a670435239
Load static and stream Sources;
2018-07-05 22:08:14 -07:00
bjorn
bc61e02f84
SoundData:getSample; SoundData:setSample;
2018-07-05 20:45:09 -07:00
bjorn
764f6eb595
Basic SoundData objects;
2018-07-05 20:23:46 -07:00
bjorn
f903b6014c
Use arrays for enums instead of maps;
2018-07-04 20:11:52 -07:00
bjorn
94c432b4b4
rm length parameter from lovrRandomGeneratorSetState;
2018-07-04 14:07:48 -07:00
bjorn
57c8dfe146
Clean up includes;
2018-07-04 13:51:35 -07:00
bjorn
183f6003e9
rm mapped buffers mostly;
2018-06-03 19:00:31 -07:00
bjorn
6ff7292333
Mostly remove instanced stereo rendering;
2018-06-03 17:18:42 -07:00
bjorn
7273811120
Some extra graphics state diffing;
2018-06-02 15:30:26 -07:00
bjornbytes
c68d65441c
Draw the rest of the fucking owl;
2018-05-27 19:05:10 -07:00
bjorn
781a5a7688
Rename luax_stubnil to luax_emptymodule;
2018-05-27 19:05:10 -07:00
bjorn
7ffd3fc25d
Use more primitive getControllers signature;
2018-05-27 19:05:10 -07:00
bjorn
a3e4b9b2b3
Change mat4_transform signature;
2018-05-27 19:05:10 -07:00
bjorn
498a1843ad
Work on WebVR pose input;
2018-05-27 19:05:10 -07:00
bjorn
859251d020
Start WebVR rewrite;
2018-05-27 19:05:10 -07:00
bjorn
c767e9c165
Simplify headset structure;
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
275006847d
Prepend @ to loaded Lua chunks for better errors;
2018-05-27 19:05:10 -07:00
bjorn
012ba07063
Disable threads in WebVR;
...
Browser/emscripten support is currently unstable.
2018-05-27 19:05:10 -07:00
bjorn
8783d36183
luax_readvertices returns vertex count correctly;
2018-04-11 00:26:26 -07:00
bjorn
8b3fcc94b8
Event module is thread safe;
2018-04-01 22:43:54 -07:00
bjorn
40c363fff4
lovr.data.newVertexData accepts a vertex table;
2018-04-01 21:57:16 -07:00
bjorn
b180b28037
Mesh:getVertexMap with tables and Blobs;
2018-04-01 21:25:48 -07:00
bjorn
25a267acd1
ModelData:getTriangle;
2018-04-01 21:00:20 -07:00
bjorn
823b7000da
Texture:getDepth; Also change Texture:getDimensions;
2018-04-01 20:54:05 -07:00
bjorn
be67da4c09
Rename Blob:getFilename to Blob:getName;
2018-03-24 13:16:08 -07:00
bjorn
1911d5b90e
Make depth test more flexible;
2018-03-24 12:50:09 -07:00
bjorn
fe47104869
More memory stuff;
2018-03-24 01:17:36 -07:00
bjorn
bdc9b63b8a
Fix lots of memory leaks;
...
Especially when restarting or using threads.
2018-03-23 19:31:45 -07:00
bjorn
f9ce6d3425
Mesh:setVertexMap accepts a Blob for fast updates;
2018-03-22 11:22:06 -07:00
bjorn
471540433c
Add Canvas:newTextureData;
2018-03-22 11:15:17 -07:00
bjorn
1ad00328c1
Add a flag for autogenerating Canvas mipmaps;
2018-03-22 10:58:53 -07:00
bjorn
5fd20cc955
Fix lovr.filesystem.setRequirePath;
2018-03-22 10:39:31 -07:00
bjorn
adee0a3012
Replace dots with slashes instead of question marks;
...
In filesystem loader.
2018-03-22 10:07:19 -07:00
bjorn
95da07d165
Stereo canvases;
...
Canvases can be created with the "stereo" flag to make it a stereo
Canvas. If a Canvas is stereo, everything rendered to it will be
rendered to the left and right halves of it, using left/right
view and projection matrices. Headset drivers will use stereo
Canvases to improve performance.
2018-03-22 09:57:44 -07:00
bjorn
c0ea3240c3
Organize drawing code;
2018-03-22 09:57:44 -07:00
bjorn
988d8c7d23
Rename blit to fill;
2018-03-22 09:57:44 -07:00
bjorn
5feb47c5b7
Remove eye argument from lovr.draw;
2018-03-22 09:57:44 -07:00
bjorn
8b201838b6
Add lovr.graphics.blit for fullscreen quads;
2018-03-22 09:57:44 -07:00
bjorn
e6a76e2a61
rm MatrixType;
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
1cd1b5e11d
Use a Mesh for primitives;
2018-03-22 09:46:26 -07:00
bjorn
d77b139d21
Make Mesh more lightweight;
2018-03-21 15:36:00 -07:00
bjorn
4b82a12b15
Add lovr.filesystem.getWorkingDirectory;
2018-03-19 16:52:17 -07:00
bjorn
fdb3a29a05
Add separate x/y scale to lovr.graphics.plane;
2018-03-19 13:09:03 -07:00
bjorn
05413adf74
Make detaching attributes more flexible;
2018-03-13 17:53:09 -07:00
bjorn
6fb977b5bb
Improve Mesh VAO state diffing;
...
Also permit empty tables for vertex formats.
2018-03-13 16:12:12 -07:00
bjorn
dd3644bafd
Add bounds checking to Shader:send with Blobs;
2018-03-12 13:27:14 -07:00
bjorn
d8c18f1535
Shader:send supports Blobs;
2018-03-12 11:25:28 -07:00
bjorn
8be201c040
Add default lovr.threaderror callback;
2018-03-12 10:37:45 -07:00
bjorn
a8545f75dc
Rename getShapeList to getShapes; Fix getJoints;
2018-03-12 10:10:10 -07:00
bjorn
399544cf9d
lovr.filesystem.getRequirePath; setRequirePath;
2018-03-11 16:25:21 -07:00
bjorn
c0ebb8f873
Mesh:setVertices accepts VertexData;
2018-03-11 11:43:01 -07:00
bjorn
c0d4d33d47
lovr.graphics.newMesh accepts VertexData;
2018-03-11 11:24:11 -07:00
Bjorn Swenson
9eeca62b78
Merge pull request #41 from mcclure/attach-mesh
...
Implementation of mesh:attachAttributes(), with instance divisor
2018-03-11 11:05:19 -07:00
bjorn
86ce6bc44a
lovr.data.newBlob accepts Blobs to clone them;
2018-03-10 21:37:05 -08:00
bjorn
6916137dc6
VertexData and TextureData properly extend Blob;
...
...He hates it!
2018-03-10 21:28:22 -08:00
bjorn
22cda40163
Fix Collider:getJointList;
2018-03-10 21:02:43 -08:00
mcc
1732384262
Implementation of mesh:attachAttributes(), with optional instance divisor
...
Some features remain to be implemented, these are marked with TODOs.
Currently it is not allowed to attach a mesh which itself has attachments.
2018-03-04 17:07:54 -05:00
bjorn
cb7b99f9a6
Optimize skybox rendering;
...
- Fix winding order of skybox cubemaps.
- Fix skybox image ordering in lovr.graphics.newTexture.
- Change skybox shader to allow rendering cubemap skyboxes last for
early z rejection.
- Remove overriding of depth write and depth test state for cubemap
skyboxes.
2018-02-26 02:10:53 -08:00
bjorn
4df836727c
Simplify refcounting;
2018-02-26 00:59:03 -08:00
bjorn
ac582890fc
Resurrect lovr.audio.getDopplerEffect and setDopplerEffect;
2018-02-25 22:07:14 -08:00
bjorn
272cce65a2
Weird compile fixes;
2018-02-25 21:41:02 -08: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
8fb3421658
Fix everything on windows;
2018-02-23 18:38:53 -08:00
bjorn
9d42d7737a
Finish Channel API;
2018-02-23 18:38:53 -08:00
bjorn
b5534c37b7
Release Channels in thread.getChannel;
2018-02-23 18:38:53 -08:00
bjorn
bf88ddb575
Release thread lua state;
2018-02-23 18:38:53 -08:00
bjorn
c92604859a
Start Channel;
2018-02-23 18:38:53 -08:00
bjorn
4cca193fcb
lovr.threaderror callback;
2018-02-23 18:38:52 -08:00
bjorn
583afc9f16
Reorganize main/lovr separation;
2018-02-23 18:38:34 -08:00
bjorn
109b40bcb4
Thread:wait; Thread:getError; Thread:isRunning;
2018-02-23 18:38:34 -08:00
bjorn
5c9f234075
Basic working threads;
2018-02-23 18:38:34 -08:00
bjorn
f010a0ffc2
Basic module setup;
2018-02-23 18:38:33 -08:00
bjorn
d4b8274879
Push nil instead of 'unknown' for unknown buttons;
2018-02-21 22:12:38 -08:00
bjorn
67d3c49a76
Add support for 3d textures;
2018-02-20 17:57:47 -08:00
bjorn
07af705e37
Texture:getType;
2018-02-20 17:27:35 -08:00
bjorn
f75530b9e1
Add support for 2d array textures; Improve mipmaps;
...
lovr.graphics.newTexture has been changed.
2018-02-20 17:15:47 -08:00
bjorn
5493a980ff
Move Blob to lovr.data;
...
Keep lovr.filesystem.newBlob though...
2018-02-19 21:04:53 -08:00
bjorn
7cecc1489e
getCanvas; setCanvas; MRT; MULTICANVAS define;
2018-02-15 19:58:35 -08:00
bjorn
cca1f32d10
PBR material properties;
2018-02-11 19:16:40 -08:00
bjorn
d5a1928b3d
Rename a bunch of files;
2018-02-11 15:22:04 -08:00
bjorn
ece5bf2f9c
Node and material accessors for ModelData;
2018-02-11 13:03:52 -08:00
bjorn
d7bf96f952
ModelData:getVertexData;
2018-02-10 17:33:45 -08:00
bjorn
8ad882e7a4
Add VertexData object;
2018-02-10 17:27:29 -08:00
bjorn
18be34a903
Expose depth write setting;
2018-02-08 21:50:47 -08:00
bjorn
3fd6f27768
Allow custom values when clearing color, depth, and stencil buffers;
2018-02-08 21:26:53 -08:00
bjorn
c538474339
TextureData:encode;
2018-02-08 20:17:50 -08:00
bjorn
9205663d69
Texture:replacePixels;
2018-02-08 19:46:24 -08:00
bjorn
964614c3fd
Move TextureData assertions into constructors;
2018-02-08 19:22:30 -08:00
bjorn
eab8b8a354
lovr.data.newTextureData can create empty textures;
2018-02-08 19:21:33 -08:00
bjorn
c8e1e3ffd9
TextureData:getPixel; TextureData:setPixel;
2018-02-07 09:08:16 -08:00
Bjorn Swenson
55ba402fd2
Merge pull request #35 from mcclure/audio-crash
...
Error message instead of crash on invalid audio.newSource call
2018-02-03 07:24:46 -08:00
mcc
b1cbb4bb1e
Error message instead of crash on audio.newSource with non-understood file
2018-02-03 09:34:30 -05:00
bjorn
14a54fa7b0
rm MaterialData;
2018-01-29 21:44:32 -08:00
bjorn
4a68067e28
rm AnimationData;
2018-01-29 20:30:13 -08:00
bjorn
e859350e25
TextureData:getDimensions;
2018-01-29 19:15:58 -08:00
bjorn
78774d65be
Actually hold off on node APIs for now;
2018-01-29 19:09:43 -08:00
bjorn
b5b58f9d56
Start node API;
2018-01-27 17:26:11 -08:00
bjorn
3ed5419005
ModelData vertex accessors;
2018-01-27 13:43:20 -08:00
bjorn
032788003a
VertexData; IndexData;
2018-01-27 12:51:41 -08:00
bjorn
84de048fa3
Fix warnings;
2018-01-26 19:11:42 -08:00
bjorn
66d0e42908
Refactor VertexFormat;
2018-01-26 19:11:40 -08:00
bjorn
dc801d8590
luax_pushvertex;
2018-01-26 19:01:41 -08:00
bjorn
ea7f3d48a2
Refactor MeshFormat;
2018-01-26 19:01:41 -08:00
Bjorn Swenson
1f3deae6ec
Merge pull request #32 from mcclure/reload-support-2
...
Restart-without-quit support: lovr.event.quit("restart")
2018-01-25 19:08:30 -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
b549688c44
Add a bunch of Rasterizer functions;
2018-01-22 18:49:45 -08:00
bjorn
3cce5fd991
ModelData;
2018-01-22 18:24:39 -08:00
bjorn
a2e0f592a3
Create Fonts from Rasterizers;
2018-01-22 08:46:09 -08:00
bjorn
99a302ff38
Rasterizer;
2018-01-22 08:40:47 -08:00
bjorn
a22740084c
Rename FontData to Rasterizer;
2018-01-22 08:28:33 -08:00
bjorn
89891811b7
Create Sources from AudioStreams;
2018-01-22 08:14:24 -08:00
bjorn
e5a17a4160
Create Textures from TextureData;
2018-01-22 08:14:18 -08:00
bjorn
1b9f81b57f
Fix refcounting in lovr.data;
2018-01-22 08:08:47 -08:00
bjorn
0cad6271dd
AudioStream;
2018-01-21 13:26:00 -08:00
bjorn
fa630b6414
AudioStream bufferSize is configurable;
2018-01-21 13:10:16 -08:00
bjorn
9cd47faf05
Rename SourceData to AudioStream;
2018-01-21 12:54:16 -08:00
bjorn
82ca82862d
Source:getChannels -> Source:getChannelCount;
2018-01-21 12:23:49 -08:00
bjorn
1e97c716de
TextureData;
2018-01-20 21:33:09 -08:00
bjorn
a14f5734d5
Add lovr.data module;
2018-01-15 23:13:26 -08:00
bjorn
3d0e761198
Fix problem passing flags to lovr.graphics.newTexture;
2018-01-14 13:05:14 -08:00
bjorn
8d49e05772
Don't cast floats to ints in Shader:send;
2018-01-09 20:55:14 -08:00
bjorn
d67ec24884
Fix Joint:getType returning nil for DistanceJoints;
2018-01-09 19:42:09 -08:00
bjorn
7f73dfeb24
Pass arguments through to Canvas:renderTo callback;
2018-01-08 21:54:34 -08:00
bjorn
f9e49f5afa
Error if Canvas:renderTo does not receive a function;
2018-01-08 21:52:43 -08:00
bjorn
444abcb1c3
Improve lovr.graphics.newCanvas error messages;
...
Returns better error messages when width or height is not positive.
2018-01-08 21:22:42 -08:00
bjorn
e2c27fb74c
Fix lovr.draw arguments;
2018-01-08 18:33:51 -08:00
bjorn
11586e8248
rm lovr.headset.getBoundsGeometry;
2018-01-06 15:49:19 -08:00
bjorn
2727544408
Copy strings in loader;
2018-01-04 18:49:14 -08:00
bjorn
de320be1cd
Improve error messages in the filesystem loader;
...
Also fix a memory leak in lovr.filesystem.load.
2017-12-31 13:20:42 -08:00
bjorn
aa4ceafbf2
Add headset type for Windows MR headsets;
2017-12-30 12:21:51 -08:00
bjorn
77d8b96cfd
lovr.graphics.stencil;
2017-12-18 19:48:28 -08:00
bjorn
8acd7444af
lovr.graphics.getStencilTest; lovr.graphics.setStencilTest;
2017-12-18 18:37:03 -08:00
bjorn
f43272adc3
lovr.headset.getPose; Controller:getPose;
...
Remove lovr.headset.getEyePosition. It is now an optional first
argument to the other lovr.headset functions.
2017-12-17 22:20:29 -08:00
bjorn
1d20e49829
Move api header;
2017-12-10 12:41:43 -08:00
bjorn
72aa7e858a
Rename loaders to data;
2017-12-10 12:41:43 -08:00
bjorn
c3fc7b61fd
Fix crash with lovr.graphics.newMaterial;
2017-12-10 12:41:43 -08:00
bjorn
6f58b758e3
Fix texture coordinates;
2017-12-09 20:09:27 -08:00
bjorn
6df8dfe456
Canvas:getFormat;
2017-12-09 20:09:27 -08:00
bjorn
ee36b47864
Depth/stencil buffers; More work on Canvas API;
2017-12-09 20:09:27 -08:00
bjorn
c6a395fa21
Switch to table variant of newCanvas API;
2017-12-09 20:09:27 -08:00
bjorn
0eebea28a9
Canvas:getMSAA;
2017-12-09 20:09:27 -08:00
bjorn
6577133635
Canvases can be used anywhere Textures are;
2017-12-09 20:09:27 -08:00
bjorn
d261e4b00d
Start Canvas objects;
2017-12-09 20:09:27 -08:00
bjorn
8eec247adb
lovr.graphics.getStats;
2017-12-09 20:07:42 -08:00
bjorn
650f100b15
Fix bug where Shader:send uses incorrect number of values;
2017-12-08 13:04:43 -08:00
bjorn
3756c06ec7
More flexible shorthands for texture and material args;
2017-11-28 20:42:36 -08:00
bjorn
097a88302e
Add lines and linestrip MeshDrawModes;
2017-11-25 19:49:22 -08:00
bjorn
ddd905627b
Mesh:drawInstanced; Model:drawInstanced;
...
No attribute divisors yet.
2017-11-25 19:45:44 -08:00
bjorn
cb2265e547
Remove material from graphics state;
...
It is now local state to models and meshes and can be passed as
an optional first argument to most primitives.
2017-11-25 19:02:28 -08:00
bjorn
c6d29f5de3
Add the ability to select headset drivers at runtime;
...
Messy.
2017-11-25 13:02:09 -08:00
bjorn
ef0ba9124d
lovr.math.gammaToLinear; lovr.math.linearToGamma;
2017-11-24 00:53:08 -08:00