Commit Graph

143 Commits

Author SHA1 Message Date
bjorn 18dcb07b98 Convert stuff over to use new enum system; 2020-02-16 18:31:02 -08:00
bjorn 67ba5f3a82 Add more graphics stats; 2020-01-31 03:43:52 -08:00
bjorn 78f272247b newCanvas creates array textures when multiview; 2020-01-30 17:48:01 -08:00
bjorn 56dc8d0b9e Handle stereo shaders better;
- Creating a shader from a DefaultShader will respect the stereo flags.
- Auto shaders will properly be stereo/nonstereo based on the target Canvas.
2020-01-27 16:33:15 -08:00
bjorn 4379d25e1c Organization; 2020-01-27 14:02:54 -08:00
Cassie Jones 3e09120173 Compile shaders using source lengths
The previous implementation relied on glShaderSource inferring source
lengths when the lengths weren't specified. This relies on the sources
being properly null-terminated, however, which isn't the case due to
file loading changes which now use pointer + length. This could cause
intermittent crashes.

Changing this on the shader side meant adding some extra arguments for
passing around shader source lengths. For most of the other cases, where
we're using string literals as the sources, we can just specify -1 as
the length, since OpenGL will calculate the string length for you any
time the length is negative.
2020-01-27 16:13:21 -05:00
Nevyn Bengtsson 95edb43654 TextureData: holds Blob instead of being Blob, just like SoundData
also replaces TextureData:getPointer with TextureData;getBlob
2020-01-19 22:59:44 +01:00
bjorn a103637419 Fix ModelData refcounting; 2019-12-20 04:52:55 -08:00
bjorn e316e6156b lovr.graphics.get/setColorMask; 2019-12-10 13:44:51 -08:00
bjorn 403ed8d3b0 Windows; 2019-12-10 12:19:50 -08:00
bjorn 1902787b1b Modify GPU timer API;
- lovr.graphics.tock returns the latest value of the timer, or 0.
- Timers are not in the stats table anymore.

This is to prepare for an upcoming internal change that affects timers.
2019-09-18 18:21:38 -07:00
bjorn 00412e2e79 Add a conf.lua flag for making the window resizable; 2019-08-28 00:59:03 -07:00
bjorn 31fed6a940 Fix stereo flag for custom shaders; 2019-08-27 14:59:17 -07:00
bjorn 305596adf8 Fix windows build;
LOVR_EXPORT needs to be on the declaration, unfortunately.
2019-08-26 15:53:10 -07:00
bjorn 9b0e43b249 Fix t.window = nil; 2019-08-21 22:26:31 -07:00
bjorn 8d4760167f luax is now api; 2019-08-21 15:27:26 -07:00
bjorn 26e7233fde Fix some API issues with lightuserdata; 2019-08-19 14:35:06 -07:00
bjorn c703092f87 Add missing timers GraphicsFeature; 2019-08-13 22:11:59 -07:00
bjorn 93f076acc9 Fix default uniform values;
Not supported in GLES.
2019-08-09 17:36:14 -07:00
bjorn 289d365866 Better error messages when loading cubemaps; 2019-08-07 15:14:59 -07:00
bjorn 96c47d590c rm lovrEnvironmentTexture from Material; 2019-08-05 15:20:17 -07:00
bjorn 06fb8b2503 Simplify fill;
lovr.graphics.fill renders a fullscreen quad, it's convenient because
you don't need to set up a mesh and toggle all the pipeline states.

However, if you are dealing with copying/rendering between stereo
textures, you have to write your own shader for that.  For now.
2019-08-03 16:03:13 -07:00
bjorn 7690db28af Windows: Fix all the int warnings; 2019-07-31 17:51:49 -07:00
bjorn ca8e280dcd Fix texture refcounting in lovr.graphics.newTexture;
Also a memory leak with window icons (does anyone use that?)
2019-07-31 14:43:35 -07:00
bjorn 9156fa2cbf Vector rework; 2019-07-16 20:30:51 -07:00
bjorn 4b4020d3a7 Model:pose; Model:getNodePose; 2019-07-11 20:09:46 -07:00
bjorn 3c07ad6b0b Replace Animator with Model:animate; 2019-07-10 22:08:19 -07:00
bjorn 2fb393306c rm skybox args;
They used to always be necessary, now they are almost never necessary.
2019-06-29 21:01:03 -07:00
bjorn 551dea8c86 Adjust includes; 2019-06-27 13:44:09 -07:00
bjorn 928ccee5f1 Multiview; 2019-06-25 01:21:59 -07:00
bjorn 879c789a08 Polyfill M_PI;
It technically isn't part of C, which is causing problems on some systems.
2019-06-20 21:43:40 -07:00
bjorn 4611b1c9a3 Add no-op standard shader; 2019-06-20 14:21:35 -07:00
bjorn eb1e257209 Add new array implementation; Upgrade filesystem;
Filesystem:

- Uses streaming file IO.
- Uses less memory when requiring files.
- Simplifies its require path implementation.
2019-06-16 13:30:30 -07:00
bjorn 79083c7df1 Fix warnings on newer versions of gcc; 2019-06-11 19:57:20 -07:00
bjorn 98f4365474 Add astc and dxt GraphicsFeatures; 2019-06-09 23:59:57 -07:00
bjorn b0a7d5c122 ASTC textures;
I like typing numbers.
2019-06-09 09:11:29 -07:00
bjorn 06c6b172de vec3 has 4 elements; 2019-06-03 07:20:03 -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 d2bff7d239 lovr.graphics.tick and tock;
Initial support for GPU timer queries.
2019-06-01 17:29:53 -07:00
bjorn c5210deae8 Fix ShaderFlag parsing; 2019-05-28 03:43:12 -07:00
bjorn 3bf08f0ca3 Add the ability to create default shaders;
lovr.graphics.newShader('font')
2019-05-22 18:00:02 -07:00
bjorn c464bde609 Add DefaultShaders enum; 2019-05-22 16:36:40 -07:00
bjorn 4a47afca38 Organize api folder; 2019-05-19 00:31:42 -07:00
Renamed from src/api/graphics.c (Browse further)