Commit Graph

409 Commits

Author SHA1 Message Date
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 fae7786c8d Simplify Pipeline; 2019-01-04 18:01:01 -08:00
bjorn 1c5d73e3da Make more GPU functions static; 2019-01-04 18:01:01 -08:00
bjorn ffd7a1202c rm lovrCanvasIsDirty; 2019-01-04 18:01:01 -08:00
bjorn 709a91ac56 rm Shader.dirty; 2019-01-04 18:01:01 -08:00
bjorn 09832dab8f rm Mesh.dirty; 2019-01-04 18:01:01 -08:00
bjorn c87645e8ef Put non-opengl-specific stuff in their own files; 2019-01-04 18:01:01 -08:00
bjorn 55e889824f lovrGpuSubmit; 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 561805450d rm Pipeline.dirty; 2019-01-04 18:01:01 -08:00
bjorn 498c25a544 Move Shader out of Pipeline; 2019-01-04 18:01:01 -08:00
bjorn c99527ec2e Move pointSize out of Pipeline; 2019-01-04 18:01:01 -08:00
bjorn 9f79dd95f4 Move font out of Pipeline; 2019-01-04 18:01:01 -08:00
bjorn 29748dc0db Move color out of Pipeline; 2019-01-04 18:01:01 -08:00
bjorn dffcc8c295 Move Canvas out of Pipeline; 2019-01-04 18:01:01 -08:00
bjorn 030c765c6b Move backgroundColor out of Pipeline; 2019-01-04 18:01:01 -08:00
bjorn 2ceb474b04 DrawCommand -> DrawRequest; 2019-01-04 18:01:01 -08:00
bjorn 4c9b02a6ff Release builtin ShaderBlock; 2018-12-19 01:32:54 -08:00
bjorn e6b7c41860 Improve lovrDrawData uniform names; 2018-12-14 16:02:25 -08:00
bjorn 68a69eec2b Fix sphere and cylinder; 2018-12-13 23:05:56 -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 28ab5377c8 Fix Mesh batching stuff; 2018-12-11 22:23:38 -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 c531852932 Refactor rendering; 2018-12-10 23:05:02 -08:00
bjorn 40454d1380 Use ShaderBlock for transforms/colors; 2018-12-07 18:19:03 -08:00
bjorn e2886d3bb5 Mesh uses Buffer; 2018-12-07 15:57:45 -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 c7934b3b13 Update API to work with vectors; 2018-12-02 12:08:07 -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 b7deda3758 lovrPlatform: Keyboard/mouse;
Update fake.c
2018-11-16 03:18:08 -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 a06734ae97 Use alpha to coverage and alpha test for text; 2018-11-08 11:58:43 -08:00
bjorn bfeb3d2d51 lovr.graphics.discard; 2018-11-08 11:58:31 -08:00
mcc 8301bd7dd8 Remerge oculus-mobile branch with master 2018-11-02 18:10:08 -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 5ad8fdd3e3 Fixes as far as running without crashes, no display yet 2018-10-24 23:40:11 -04:00
mcc 56f8f1e26b Untested merge of Oculus Mobile branch and Oct 2018 lovr master 2018-10-22 10:44:04 -04:00
mcc 1b7942e02f First pass oculus mobile support
First of several commits, this is the state of hg:6b437880cc01 in my private repo. A version of shakesoda's Oculus-desktop support is tied up in this commit.

The oculus mobile version builds lovr as a library. To run it, you need to use a separate repo which includes this one and which builds an Android app.
2018-10-20 15:22:24 -04:00
bjorn 28c56f959d Use MAT4_IDENTITY macro; 2018-10-06 21:58:40 -07:00
bjorn 8d076f31c1 Fill accepts UV subrect to use; 2018-09-30 18:58:51 -07:00
bjorn 40e6f6a81c Handle window resizes properly;
Fix for the web where the window actually resizes.
2018-09-05 11:11:57 -07:00
bjorn ea331a12be Fix bugs; 2018-08-31 23:24:59 -07:00
bjorn a5256aaa27 Happy little graphics refactors; 2018-08-31 06:03:35 -07:00
bjorn 017066d45e More emscripten stuff;
SwapInterval was removed to ensure RAF timing is used.
2018-08-30 21:58:00 -07:00
bjorn 7222d1fa26 Use same window hints for webgl and desktop;
It doesn't seem like this causes any problems anymore.
2018-08-30 21:43:30 -07:00
bjorn 7055875cfa rm unnecessary emscripten ifdef for glfw context;
Now that the bug is fixed!
2018-08-30 21:40:31 -07:00
bjorn 7c21d77a6e rm singlepass conf flag; Viewports; getSupported.singlepass; 2018-08-30 04:02:58 -07:00
bjorn ce2dfb523e Make window mono by default;
The window is now mono by default to make the error screen better and better enable non-stereo uses.  The Camera can now request that the window be treated as stereo.
2018-08-29 21:22:13 -07:00
bjorn a5f6ff506b MSAA resolve; 2018-08-29 21:22:12 -07:00
bjorn 590668a8d6 lovrGraphicsBlit; 2018-08-29 21:21:38 -07:00
bjorn 8bb45f4de4 Clean up viewports; 2018-08-29 21:21:07 -07:00
bjorn 21a869cc8b Clean up; 2018-08-29 21:19:41 -07:00
bjorn 1ea3c84be9 Ugly viewport stuff; 2018-08-29 21:19:07 -07:00
bjorn 3bf76e3497 Fix clear and canvas texture refcounts; 2018-08-29 21:18:33 -07:00
bjorn 7e74441afd getCanvas; setCanvas; Canvas attachments; 2018-08-29 21:18:33 -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 6f72166f59 Only use 1 texture for skybox; 2018-08-22 12:09:51 -07:00
bjorn 3eca158025 ty compiler; 2018-08-16 17:54:48 -07:00
bjorn 3d691ed087 Use defines to shrink stb_image footprint; 2018-08-16 14:21:24 -07:00
bjorn 5c65fc811f Change "drawing" to "rendering" in comments; 2018-08-11 00:08:33 -07:00
bjorn 3dabe0cf34 setShader errors on compute shaders; 2018-08-11 00:08:33 -07:00
bjorn b8faff6986 Add writable and usage flags to ShaderBlock; 2018-08-02 05:04:40 -07:00
bjorn d7bb4321d0 Add parentheses around braced initializer lists; 2018-08-01 21:06:16 -07:00
bjorn 156c0cde5d Condense event code a bit; 2018-07-26 19:38:01 -07:00
bjorn 2dc79a48a8 Use single pass stereo rendering when supported; 2018-07-21 05:30:13 -07:00
bjorn 5641afee13 Remove isDefault flag from Material; 2018-07-18 00:34:21 -07:00
bjorn 317fa98bdd Fix sphere; 2018-07-17 19:20:40 -07:00
bjorn ea551203c0 Refcount pipeline objects properly; 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 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 89c8ee3d06 Begin OpenGL quarantine; 2018-07-17 17:21:14 -07:00
bjorn f903b6014c Use arrays for enums instead of maps; 2018-07-04 20:11:52 -07:00
bjorn 57c8dfe146 Clean up includes; 2018-07-04 13:51:35 -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