1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-06 14:23:34 +00:00
Commit graph

1347 commits

Author SHA1 Message Date
bjorn ea551203c0 Refcount pipeline objects properly; 2018-07-17 17:21:15 -07:00
bjorn 65cd5e2eb9 Fix fake headset display dimensions in lovr.load; 2018-07-17 17:21:15 -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 b4752dd6a1 Yay no GL in graphics.c; 2018-07-17 17:21:15 -07:00
bjorn 5c34406060 Use glfw constants instead of opengl constants for window hints; 2018-07-17 17:21:15 -07:00
bjorn 89fe9fa894 Organize limits; 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 6933914650 Shift around glfw includes; 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 7c7714214e Start gpuDraw; 2018-07-17 17:21:14 -07:00
bjorn c35415ba66 Move over texture binding; 2018-07-17 17:21:14 -07:00
bjorn 3c623bdc2e Move around texture helpers; 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 eb456f5b52 rm stdio from graphics; 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 49e0438bd3 Remove unused shader properties; 2018-07-17 17:21:14 -07:00
bjorn 89c8ee3d06 Begin OpenGL quarantine; 2018-07-17 17:21:14 -07:00
bjorn b7a43e1762 Fix build; 2018-07-11 18:24:21 -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 9208474203 Add noise1234; 2018-07-06 18:27:40 -07:00
bjorn b650f2b770 Add Microphone objects for audio capture; 2018-07-06 17:57:31 -07:00
bjorn 889144cc45 Add VERTEX and PIXEL/FRAGMENT defines to shader header; 2018-07-06 01:38:15 -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 ba503cdee7 Static source playback; 2018-07-05 22:46:30 -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 56ea2d43d0 Bones are ints; 2018-07-04 15:02:25 -07:00
bjorn bcd4d74f13 Use compound literals a bit more; 2018-07-04 14:46: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 8217cb4abd Disable stb_vorbis stdio functions; 2018-06-17 02:15:36 -07:00
bjorn f976b47b2d Omit stb_vorbis pushdata API; 2018-06-17 02:10:26 -07:00
bjorn 6ac3829c62 Change audio velocity to have 3 components; 2018-06-17 01:59:15 -07:00
bjorn 2ebefd07a9 v0.10.0; 2018-06-13 21:20:33 -07:00
bjorn 6cbf4075ec Render OpenVR mirror window in stereo; 2018-06-12 20:14:53 -07:00
bjorn d71eccfd0b Ensure Mesh attachments are unmapped before drawing; 2018-06-12 02:05:19 -07:00
bjorn f4b9552052 Remove msaa check for framebuffer resolve;
Since resolve now does MSAA and mips.
2018-06-11 19:31:58 -07:00
bjorn b47e26e688 Disable GL clipping plane;
It was used for instanced stereo.
2018-06-11 19:31:35 -07:00
bjorn 26bb0ea1ac Reset canvas state in lovr.graphics.reset; 2018-06-11 19:00:43 -07:00
bjorn 54a9a8eb78 Fix lovrGraphicsSetCanvas framebuffer binding; 2018-06-11 19:00:43 -07:00
bjorn 4370b7f0f5 Fake headset cleanup; 2018-06-10 10:18:54 -07:00
bjorn df87eeee31 Inertia tuning; 2018-06-10 09:51:34 -07:00
bjorn ab1e46cab4 Add inertia timeout; 2018-06-10 09:51:34 -07:00
bjorn 8e013877d6 Add inertia to fake headset mouselook; 2018-06-10 09:51:34 -07:00
bjorn fb3eed5518 Fix skybox shaders for WebGL; 2018-06-09 23:18:02 -07:00
bjorn 17bf06b817 Fixes for openvr driver; 2018-06-04 19:49:36 -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 df876bf3b2 Static display; 2018-05-27 19:05:10 -07:00
bjorn 8bc7802246 Controller events; 2018-05-27 19:05:10 -07:00
bjorn b51e8694ac Add lovrQuit; 2018-05-27 19:05:10 -07:00
bjorn faeb12f206 Refactor main loop; 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 0d7810b333 Fix some issues with lovr.event.quit('restart'); 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 f4ecdb074b WebVR isMounted I guess; 2018-05-27 19:05:10 -07:00
bjorn a3a59f01a3 WebVR controller input;
No events yet.
2018-05-27 19:05:10 -07:00
bjornbytes 389a95c9ce WebVR; 2018-05-27 19:05:10 -07:00
bjornbytes 2b183a49be Work around emscripten window limitation; 2018-05-27 19:05:10 -07:00
bjorn be217a9b63 Some basic WebVR Controller functions; 2018-05-27 19:05:10 -07:00
bjorn 805629b4ca WebVR controller list; 2018-05-27 19:05:10 -07:00
bjorn 1b0f1acaf1 Simplify C defines; 2018-05-27 19:05:10 -07:00
bjorn 7ffd3fc25d Use more primitive getControllers signature; 2018-05-27 19:05:10 -07:00
bjorn 32668fc231 Fix C defines; 2018-05-27 19:05:10 -07:00
bjorn fd5ae4d124 webvrGetEyePose; 2018-05-27 19:05:10 -07:00
bjorn ab2594b204 WebVR velocity functions; 2018-05-27 19:05:10 -07:00
bjorn 065a5aa0dd Finish webvrGetPose; 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 7e5be11f74 Fix default shader; 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
3snow p7im 69cf13f4ae Only apply alignment fix when including openvr api 2018-04-22 18:22:40 -07:00
3snow p7im 2bfba10f81 Fix button controller button detection for linux and mac 2018-04-22 09:25:55 -07:00
bjorn 3e5e0f143b WebVR fixes; 2018-04-11 18:32:56 -07:00
bjorn c59c545198 Fix loading referenced textures for models at project root; 2018-04-11 18:32:56 -07:00
bjorn 8783d36183 luax_readvertices returns vertex count correctly; 2018-04-11 00:26:26 -07:00
bjorn 3528182919 openvr driver uses correct offset; 2018-04-11 00:26:16 -07:00
bjorn 7dc8f4ad58 rm lovrEventRemovePump in openvr driver; 2018-04-11 00:02:02 -07:00
bjorn b2e16fa87d Fix OpenGL crash on Windows;
glGetActiveAttrib doesn't like NULL pointers for its arguments on windows.
2018-04-10 23:56:41 -07:00
bjorn b3013704ca Initialize mutex before adding event pump; 2018-04-06 18:51:49 -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 a3a50e5ca7 Ensure arg gets passed to lovr.load; 2018-03-30 18:48:20 -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 426b907294 Release sources when audio module is destroyed; 2018-03-24 00:29:58 -07:00
bjorn bdc9b63b8a Fix lots of memory leaks;
Especially when restarting or using threads.
2018-03-23 19:31:45 -07:00
bjorn f94f0cd6c8 Add validation for texture creation; 2018-03-22 11:34:27 -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 8e5061f918 Disable depth test in lovr.graphics.fill; 2018-03-22 09:57:44 -07:00
bjorn be699aa132 Normal matrix is an array; 2018-03-22 09:57:44 -07:00
bjorn 334e218e4c Diff render target state better; 2018-03-22 09:57:44 -07:00
bjorn 988d8c7d23 Rename blit to fill; 2018-03-22 09:57:44 -07:00
bjorn db756f347f Add comment; 2018-03-22 09:57:44 -07:00
bjorn 3ed16a0a68 Work around driver bug to fix error screen; 2018-03-22 09:57:44 -07:00
bjorn 8a408cd45b Ignore uniform blocks when inspecting shader uniforms; 2018-03-22 09:57:44 -07:00
bjorn 20983c860b Send lovrEye to fragment shaders; 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 b266d0316c Update camera UBO when popping a layer; 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 8bcaacd63c Resolve MSAA properly; 2018-03-22 09:57:44 -07:00
bjorn 2cbd565522 Fix texture submit bounds; Fix layer canvas bug; 2018-03-22 09:57:44 -07:00
bjorn 4915ca41cc Make skyboxes really cool; 2018-03-22 09:57:44 -07:00
bjorn 8e0519058d Use quad for cube skyboxes; 2018-03-22 09:57:44 -07:00
bjorn e6a76e2a61 rm MatrixType; 2018-03-22 09:57:44 -07:00
bjorn d317502ffd Small UBO cleanup; 2018-03-22 09:57:44 -07:00
bjorn 2def650abd Refactor layers/displays; 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 1f1232505e Uniform buffer objects for matrices;
Still hacky.
2018-03-22 09:57:44 -07:00
bjorn 3064eff017 Hack everything but it mostly works; 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 4c2cd458ad calloc is cool; 2018-03-21 15:36:02 -07:00
bjorn 87d5cb6456 Cache shader attribute IDs; 2018-03-21 15:36:02 -07:00
bjorn d77b139d21 Make Mesh more lightweight; 2018-03-21 15:36:00 -07:00
bjorn d2e0642b59 Use calloc in lovrAlloc; 2018-03-21 12:56:16 -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 f6a9f8ee19 lovr.headset.setMirrored works with fake driver; 2018-03-19 12:05:04 -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 a83ecff838 Fix warning; 2018-03-11 16:28:39 -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 491fbcd2d8 Mapping the whole buffer doesn't mean we can invalidate it; 2018-03-11 11:24:50 -07:00
bjorn c0d4d33d47 lovr.graphics.newMesh accepts VertexData; 2018-03-11 11:24:11 -07:00
bjorn 10bed31ecf Fix VertexData allocation in Meshes; 2018-03-11 11:09:12 -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
bjorn e4618add55 Gamma correct background color correctly; 2018-03-10 20:59:36 -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 7e58e265d6 Fix cube winding; 2018-03-03 17:19:12 -08:00
bjorn 66836b4d3a Fix AABB; 2018-03-01 20:51:57 -08:00
bjorn 2a861b484d Fix edge case in quaternion slerp; 2018-02-28 20:32:28 -08:00
bjorn 4463bd00c8 Load tangents from models; 2018-02-26 02:54:35 -08: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 f54d1c1e03 rm containerof; 2018-02-25 23:19:39 -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 33c529dcd8 Update WebVR; 2018-02-24 00:59:11 -08:00
bjorn 8de0af397b Clean up headset WIP; 2018-02-23 20:01:13 -08:00
bjorn 9ca743dc1a Headset module can be restarted; 2018-02-23 18:38:53 -08:00
bjorn 8fb3421658 Fix everything on windows; 2018-02-23 18:38:53 -08:00
bjorn f5fa9a4e5c Make modules more restartable;
Except headset.  Screw you, headset.
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 640c4e715c rm extra lovr.h includes; 2018-02-23 18:38:34 -08:00
bjorn 583afc9f16 Reorganize main/lovr separation; 2018-02-23 18:38:34 -08:00
bjorn 72f718c241 Make vertex attribute sizes constant; 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 530667716c Add tinycthread; 2018-02-23 18:37:24 -08:00
bjorn d4b8274879 Push nil instead of 'unknown' for unknown buttons; 2018-02-21 22:12:38 -08:00