1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-03 04:53:35 +00:00
Commit graph

136 commits

Author SHA1 Message Date
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 ee27af1a85 graphics: forward declarations; 2019-04-05 04:59:14 -07:00
bjorn d31dca5520 Free objects in their destructors; 2019-04-05 03:56:10 -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 c2c4322e3b Add drawMode to lovrModelDraw Batch; 2019-04-05 01:23:48 -07:00
bjorn 69b6e599e9 Re-add Model:getMaterial and Model:setMaterial; 2019-02-13 23:55:47 -08:00
bjorn a02d4eb659 rm VertexData; 2019-02-13 15:10:52 -08:00
bjorn 4373e29bea OBJ groups/materials; 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 9deab224da Handle scene root properly; 2019-02-13 15:10:52 -08:00
bjorn d25f59582e Handle missing textures better; 2019-02-13 15:10:52 -08:00
bjorn 09936a8ae2 Load animation names; General testing; 2019-02-13 15:10:52 -08:00
bjorn a8566e2c7c Load materials; 2019-02-13 15:10:52 -08:00
bjorn 540b6a60e0 Refactoring; 2019-02-13 15:10:52 -08:00
bjorn 6bb569192f Make sure bone indices are ints; 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 d14af4a79c Fix traversal; 2019-02-13 15:10:52 -08:00
bjorn 80b584aeb5 Compute global transforms better; 2019-02-13 15:10:52 -08:00
bjorn 2692abb83c Render nodes properly; 2019-02-13 15:10:52 -08:00
bjorn 6b323e3476 Start parsing glTF; 2019-02-13 15:10:52 -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 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 379dc74cd5 Mesh fixes; 2019-01-04 18:01:01 -08:00
bjorn ea3a77a73a Many batching improvements; Refactoring; 2019-01-04 18:01:01 -08:00
bjorn 2ceb474b04 DrawCommand -> DrawRequest; 2019-01-04 18:01:01 -08:00
bjorn 086f7f4e47 lovrRelease frees objects instead of destructor;
That way objects allocated on the stack can be destroyed.
2018-12-19 01:41:01 -08:00
bjorn 155a0c1449 lovr*Create -> lovr*Init; lovr*Create macro; 2018-12-19 01:04:42 -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 b02eae30b4 Autoinstancing; 2018-12-11 22:10:29 -08:00
bjorn 18fdd0c062 Autobatching; 2018-12-11 13:27:59 -08:00
bjorn e2886d3bb5 Mesh uses Buffer; 2018-12-07 15:57:45 -08:00
bjorn a8361677f5 Move pose from Mesh to DrawCommand; 2018-12-05 10:22:12 -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 28c56f959d Use MAT4_IDENTITY macro; 2018-10-06 21:58:40 -07:00
bjorn 7aedff1278 Fix srgb settings for model import; 2018-09-01 06:27:24 -07:00
bjorn a5256aaa27 Happy little graphics refactors; 2018-08-31 06:03:35 -07:00
bjorn 3fb1b49549 MSAA canvases/textures but no resolving yet; 2018-08-29 21:22:12 -07:00
bjorn b8faff6986 Add writable and usage flags to ShaderBlock; 2018-08-02 05:04:40 -07:00
bjorn bc2d638b00 Refs know their type; 2018-07-24 19:14:29 -07:00
bjorn 5641afee13 Remove isDefault flag from Material; 2018-07-18 00:34:21 -07:00
bjorn 132442cb01 Fix something that got messed up in Model; 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 0ee5d0b8f2 Anonymous materials for draw calls; 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