1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-02 12:33:52 +00:00
Commit graph

2747 commits

Author SHA1 Message Date
bjorn b77276fd1f Android: make printf and print work; 2020-06-25 16:42:19 -06:00
bjorn 27b04b2bde vrapi: Add support for focus awareness; 2020-06-25 15:00:12 -06:00
bjorn 6819a04f31 Bugfixes/cleanup for octupus go; 2020-06-25 14:29:44 -06:00
bjorn 2042010b5b Move core/fs paths to core/os;
Usually these are more of a platform-specific concept, and they
don't really interact with files or do any io.

There is a little bit of duplication among the *nix platforms since
they're similar, but overall this organization feels a bit better.
2020-06-25 13:28:40 -06:00
bjorn 8b281d56e3 Android: Organize tup rules; Fix manifest; 2020-06-25 13:27:18 -06:00
Josip Miskovic 66d7e887c7 Config parameter for save directory precedence 2020-06-21 18:02:36 +03:00
mcc cf05249b8b Oculus: Fix bug where vibration never stops
(because of a sign error)
2020-06-11 12:33:42 -04:00
bjorn a1aa3c8ae8 Finish vrapi driver; 2020-06-09 18:02:03 -06:00
bjorn b34c03bcc8 Tup build system for android; 2020-06-09 18:02:03 -06:00
bjorn 6bce095660 Fix newComputeShader(nil); 2020-06-07 15:47:53 -06:00
bjorn f58c7075b1 OpenVR: Emit quit event when exiting from SteamVR dashboard; 2020-06-07 00:42:44 -06:00
Bjorn 27b2c0abad
Merge pull request #263 from jmiskovic/world-settings
Physics simulation access to global ERP and CFM
2020-06-04 10:06:51 -07:00
Bjorn f800fc64ed
Merge pull request #264 from alloverse/fix/mic-overrun
lovrMicrophoneGetData: fix potential buffer overrun
2020-06-04 10:04:03 -07:00
mcc 0dcf86bc3d Check shaderblock offset exists before reading. Prevents a segfault 2020-06-04 12:10:56 -04:00
Nevyn Bengtsson e34953f064 lovrMicrophoneGetData: fix potential buffer overrun
With the check for samples==0 being done BELOW the assert for offset+samples<soundData->samples,
setting samples to 0 and then having more samples available in the mic than present in
the created buffer would cause buffer overrun
2020-06-04 14:31:24 +02:00
Josip Miskovic 5d18933411 Limit simulation parameters to positive values 2020-06-03 20:13:13 +03:00
Josip Miskovic 139808cab0 Get/set World and Joint simulation parameters
Tightness parameter is amount of force is exerted on collider to resolve
collisions and enforce joint operation. Low values make joints loose,
high values make it tight and can cause collider to overshot the joint
target. With tightness set to 0 the joint loses its function. Going
above 1 puts even more energy into joint oscillations. Tightness
parameter is called ERP in ODE manual.

The responseTime affects the time constant of physics simulation, both
for collisions and for joint inertia. Low responseTime values make
simulation tight and fast, higher values make it sluggish. For
collisions it affects how fast penetration is resolved, with higher
values resulting in spongy objects with more surface penetration and
slower collision resolving. For joints the responseTime is similar to
inertia, with higher responseTime values resulting in slow oscillations.
The oscillation frequency is also affected by collider mass, so
responseTime can be used to tweak the joint to get desired frequency
with specific collider mass. Values higher than 1 are often desirable,
especially for very light objects. Unlike tightness, responseTime is
tweaked in orders of magnitude with useful values (depending on mass)
being between 10^-8 and 10^8.

Both parameters can be applied to World for simulation-wide usage, or
specified per-joint in case of distance and ball joints. Other joints
don't allow customizing these parameters, and will use World settings
instead..
2020-06-03 19:03:38 +03:00
bjorn 90e985c45b Fix MSAA Canvas readback; 2020-05-26 09:53:26 -06:00
bjorn 6d2fdac89f Prefix headset implementation files with headset_; 2020-05-24 13:32:13 -06:00
bjorn d6abcdfb0e Fix 2 memory leaks; 2020-05-23 13:03:16 -06:00
bjorn 86ad4f654c Fix bug with Mesh:setVertices; 2020-05-21 00:31:50 -06:00
bjorn 1185fcf6e1 Autodetect integer attribute types;
Fixes inability to use integer attributes with Mesh.
2020-05-21 00:31:49 -06:00
mcc 89cdeb1e4f shaderBlock:send(blob) did not work due to typo 2020-05-20 16:34:19 -04:00
bjorn 75e26f0051 Move core/hash to core/util; 2020-05-19 13:49:40 -06:00
bjorn 92ac93e6b8 Improve image uniform errors; 2020-05-18 15:14:17 -06:00
bjorn f7dddfe3fd Fix PNG IDAT CRC; 2020-05-18 12:41:49 -06:00
bjorn 680dc00b5b rm menu button from oculus touch bindings;
Saw an error about this in logs, let's see if it fixes touch controllers.
2020-05-11 18:04:37 -06:00
bjorn ebc69c6c93 win32: AllocConsole if AttachConsole fails;
This may help retrieve stdout when running lovr outside of cmd.
2020-05-11 15:23:35 -06:00
bjorn dab0be7055 World:getColliders; 2020-05-11 12:05:30 -06:00
bjorn 95635b4b02 Support loading 16 bit images;
With 1, 2, or 4 channels;
2020-05-10 02:35:45 -06:00
bjorn 6539bc1bd2 Make physics orientation getters more consistent; 2020-05-10 02:08:36 -06:00
Bjorn 62fbf7e0e3
Merge pull request #257 from jmiskovic/physics-vectors
Physics API support for vectors
2020-05-10 01:04:23 -07:00
bjorn 1e78ac8669 Add r16, rg16, rgba16 texture formats; 2020-05-10 01:59:58 -06:00
Josip Miskovic e2d1b33eed Shapes API accepts both vec3 and number coords 2020-05-10 01:12:45 +03:00
Josip Miskovic 2d6f7802f1 Joints API accepts both vec3 and number coords 2020-05-10 01:12:45 +03:00
Josip Miskovic f2fcc4e5c4 Collider API accepts both vec3 and number coords 2020-05-10 01:12:45 +03:00
Josip Miskovic add346519a Physics API accepts both vec3 and number coords
When creating shapes and joints, arguments accept either coordinate
numbers as before, or vec3 objects. For functions that receive more than
one set of coordinates, any combination of coordinates and vectors is
accepted.
2020-05-10 01:12:45 +03:00
bjorn 0be36da334 Add beacon devices;
There are 4 new devices: beacon/1 through beacon/4.  They represent
tracking reference like StemaVR base stations or Oculus cameras.
There are 4 because that's how many base stations you can have in
a single tracking setup.

Right now only OpenVR exposes poses for them.
2020-05-07 17:11:25 -06:00
Bjorn 195966b964
Merge pull request #251 from jmiskovic/world-vectors
Physics world accepts both vec3 and number coords
2020-05-07 09:32:36 -07:00
Josip Miskovic 2463737722 Physics world accepts both vec3 and number coords
When creating colliders, setting gravity or casting rays on world,
arguments accept either coordinate numbers as before, or vec3 objects.
For functions that receive more than one set of coordinates, any
combination of coordinates and vectors is accepted.
2020-05-07 19:01:30 +03:00
bjorn 9ba814fe3f omg; 2020-05-04 17:30:41 -06:00
bjorn ed4b8d1f3d rm unneeded internal Source functions;
Now that things are in the same file, setters for internal source
fields are unnecessary, making things a bit simpler.
2020-05-03 13:02:19 -06:00
bjorn c455b0750e rm unused Source functions from header; 2020-05-03 13:00:02 -06:00
bjorn d847dd663a rm unused audio headers; 2020-05-03 12:57:50 -06:00
bjorn b9a2bddd25 Put all the audio stuff in one file;
If there was ever some sort of hypothetical switch to a different
audio library, this would make such a switch easier.
2020-05-03 12:54:35 -06:00
bjorn b0289de9a6 Error instead of crashing when skin has too many joints;
ModelData is still allowed to load skins with more joints, since
the limitation is in the graphics side of things (Model).

Eventually we will use a buffer for joints to alleviate this.
2020-05-02 14:14:29 -06:00
bjorn c0d73ab541 Add resize event; lovr.resize callback; 2020-05-02 13:09:10 -06:00
bjorn b035f8e4dc core/fs: Use DWORD instead of uint32_t in fs_read and fs_write;
Fixes a warning.
2020-04-30 16:53:10 -06:00
bjorn ce2a28360d Unconditionally cast ref to volatile long on win32;
This was originally a C++-only contribution, but clang also warns
about it on windows when compiling as C.

It's nice to have one less thing specific to C++.
2020-04-30 16:49:53 -06:00
bjorn eea73792a6 Minor formatting; 2020-04-30 14:15:36 -06:00
Josip Miskovic 097d39628a Initialize inertia information for new colliders
Inertia matrix has to be calculated with algorithm specific for each
shape. Without calculated matrix the physics behaves very floaty and
slowed down.
2020-04-29 23:05:11 +03:00
Josip Miskovic a4b0d004a1 Fix collider setOrientation() and setPose()
The conversion from angle,ax,ay,az to quaternion is already done in
physics module.
2020-04-28 20:15:09 +03:00
bjorn 7d316d6218 Add internal filesystem module comment; 2020-04-22 01:47:16 -06:00
pendingchaos 28a2e5fd4c Fix when depth test is disabled but depth write is enabled
GL_DEPTH_TEST controls both whether depth testing and depth writes are
enabled. So if depth testing is disabled and depth writes are enabled,
GL_DEPTH_TEST has to be enabled and the compare mode should be GL_ALWAYS.
2020-04-21 23:39:16 +01:00
mcc b5e72d8bd9 Restart cookie minor changes for PR review 2020-04-16 10:57:13 -04:00
mcc c32fbdd8fc oculus mobile driver now supports restart cookie 2020-04-16 00:33:35 -04:00
mcc fbcce7fc59 Reworked quit/restart events (compatibility break)
Based on Slack conversation, the following changes:
- lovr.event.quit("restart") no longer supported
- lovr.event.quit no longer takes restart "cookie"
- When lovr.event.restart() called, lovr.quit() is not called, instead lovr.restart() is called
- Value returned from lovr.restart(), when called, becomes the cookie
- lovr.event.quit takes the lovr.event.quit() return code as an argument

lovr.run() is unchanged, it still returns (exit code | "restart", cookie).
2020-04-16 00:32:54 -04:00
mcc 334077c9f8 Fix crash on lovr.event.quit("restart") 2020-04-15 17:59:25 -04:00
mcc 9f5fd60545 The Quest has thumbsticks, not touchpads. Fix constants. 2020-04-15 16:44:39 -04:00
Colby Klein 34cef2673c
use clamp/max macros 2020-04-12 16:17:01 -07:00
Colby Klein 809d9b7385
ignore haptics for non-hands
seems a little strange that vibrating head or something would affect the right controller.
2020-04-12 16:12:06 -07:00
Colby Klein 14e79bf8ef
implement haptics on oculus 2020-04-12 16:02:59 -07:00
Bjorn 89e2e6df8e
Merge pull request #236 from mcclure/no-mat4-project
Kill mat4_transform_project
2020-04-05 18:07:56 -06:00
mcc d8abfcfae3 Remove mat4_transform_project, it not only duplicates mat4_transform, it is buggy 2020-04-05 19:51:37 -04:00
Colby Klein 077d90bc79
update ovr driver to newer frame submission api
as mentioned on slack.

there are some situations you can get into (high load in some place or other) where the newer frame submission api will behave much more consistently, and I've noticed no negative effects.

besides, the other one is deprecated as best i can tell.
2020-04-02 22:35:12 -07:00
bjorn aed0499c5f Add oculus_touch to action manifest; 2020-04-02 22:47:36 -06:00
bjorn 37d8df4784 Allow initializing empty TextureData with Blob; 2020-03-29 13:47:57 -06:00
bjorn e553672b5a Fix sampler uniform error message enum;
Surprisingly, this appears to be the only place reading out of enum
arrays like this, so there shouldn't be any other places to fix.
2020-03-14 16:46:35 -07:00
bjorn 6d0369d365 Convert some collider functions to use vectors; 2020-03-07 16:35:32 -08:00
bjorn a01cc5a376 Fix lovr.graphics.getDefaultFilter; 2020-03-05 19:27:08 -08:00
bjorn c02839f5c2 Allow anisotropy to be used with any TextureFilter;
Instead of anisotropic being its own filter, it is now removed and
anisotropy settings can be used with any of the other filter modes.
2020-03-05 09:46:49 -08:00
bjorn 6f6de92d19 Add preliminary WebXR backend; 2020-03-04 22:47:24 -08:00
bjorn 8dcc97745e Tup: emscripten support; LuaJIT flag; 2020-03-02 23:06:42 -08:00
bjorn 45648baa1c Scope a variable better; 2020-03-02 22:23:59 -08:00
bjorn 1d6b7619ea oculus_mobile: Add handModels to bridge; 2020-03-01 18:08:59 -08:00
bjorn 0d098410b3 Shader:send doesn't error on unknown uniform;
Instead it returns a boolean indicating if the send worked.
2020-02-27 20:20:02 -08:00
bjorn 90b605f012 Add restart cookie; lovr.event.restart; arg.restart; 2020-02-26 14:40:40 -08:00
bjorn 69dd0d4674 audio: rm paused and stopped states; rm rewind;
- There is now just one "playing" state.
- Instead of rewind, use :seek(0).

Note that now there is no way to resume or rewind all tracked sources.
This can be improved in the future if there's a need for it, probably
using variadic or table-based variants of the audio module functions.
2020-02-26 00:25:49 -08:00
bjorn fa771b04bd Fix CMake; 2020-02-23 01:01:34 -08:00
bjorn ef7ebaef85 core/gpu: vulkan feature detection; rm stats; 2020-02-23 00:47:59 -08:00
bjorn f8b8d427d7 Opaque Mesh; Opaque OpenGL; 2020-02-23 00:29:21 -08:00
bjorn aabb8cb830 Opaque Shader; 2020-02-23 00:29:21 -08:00
bjorn d034e8c01b Opaque Canvas; 2020-02-23 00:29:21 -08:00
bjorn 52d4f7e520 Opaque Texture; 2020-02-23 00:29:21 -08:00
bjorn b045d42782 Opaque Buffer; 2020-02-23 00:29:21 -08:00
bjorn 5d8bf1d45a Fix Source:setLooping assert; 2020-02-22 01:01:17 -08:00
bjorn 2cf6d7b109 Improve lovr.filesystem.load errors;
Lua was happily compiling nil chunks and making them return empty
strings, which was not a good error experience in situations where
your file couldn't be loaded properly.  Now we return nil plus an
error message, which matches LOVE and other Lua conventions.
2020-02-22 00:30:30 -08:00
bjorn 3d3fb71a98 core/gpu: start shader stuff; coherent buffer mapping; 2020-02-21 18:38:33 -08:00
bjorn 93d556b603 zip: read compressed size from central directory;
Some zip writers do not write the compressed size to the local file
headers.
2020-02-21 15:44:48 -08:00
bjorn b9b8062c18 core/gpu: texture views; 2020-02-21 01:48:58 -08:00
bjorn f428ceacaf core/gpu: gl backend compiles; 2020-02-20 15:52:41 -08:00
bjorn 7d2bec7283 core/gpu: add vulkan backend; 2020-02-20 12:23:31 -08:00
bjorn 6452f51680 core/gpu: attribute formats; 2020-02-19 20:28:30 -08:00
bjorn a658da78ad core/gpu: Add all uncompressed texture formats; 2020-02-19 19:36:30 -08:00
bjorn aadadb968b core/gpu: will it blend; 2020-02-19 18:33:59 -08:00
bjorn 0620cade9e core/gpu: gpu_set_vertex_buffers; fixes; 2020-02-19 18:02:37 -08:00
bjorn cb4a7a5a43 core/gpu: indirect drawing commands; 2020-02-19 17:42:33 -08:00
bjorn 238496de29 Start core/gpu; 2020-02-19 17:21:40 -08:00
bjorn 81f4232da5 opengl: Init compareMode for native textures; 2020-02-19 15:34:32 -08:00
Bjorn 98d2cc6cd4
Merge pull request #227 from mcclure/no-post-distortion
Instead of showing post-distortion in Oculus mirror, show the left eye (no stereo)
2020-02-17 18:02:47 -08:00
Bjorn 2f78c29c07
Merge pull request #128 from mcclure/jun28-upside-down-mirror
Y-flip mirror texture on Oculus
2020-02-17 18:02:37 -08:00
Bjorn c17af6c798
Merge pull request #225 from mcclure/msvc-2019-cpp
Fix ref.h in recent MSVC when compiled as C++
2020-02-17 17:54:44 -08:00
bjorn aa0e01ddab Cleanup; 2020-02-17 17:27:57 -08:00
bjorn bfdebffb34 Fix volume textures; 2020-02-17 17:27:57 -08:00
Bjorn 74b9258671
Merge pull request #228 from mcclure/skybox-uv
Fix lovr.graphics.skybox()
2020-02-17 16:48:32 -08:00
mcc 6536216aa2 Fix lovr.graphics.skybox() 2020-02-17 18:19:05 -05:00
mcc c22c55865a Instead of showing post-distortion in Oculus mirror, show the left eye (no stereo) 2020-02-17 17:43:47 -05:00
mcc 7db4e4976b Fix compile warnings (MSVC2019) 2020-02-17 17:42:13 -05:00
mcc e7938fe514 Fix ref.h in recent MSVC when compiled as C++
A cast is required at this point in MSVC 2019 when ref.h is included from a C++ file. This change has no effect on Lovr compiled normally (which compiles only as C), what this change does is make it possible for forks to extend Lovr with C++ files.
2020-02-17 14:47:08 -05:00
bjorn 18dcb07b98 Convert stuff over to use new enum system; 2020-02-16 18:31:02 -08:00
bjorn d5487cbd40 Better luax_checkoption error messages; 2020-02-16 18:06:06 -08:00
bjorn c20a6507d2 Add StringEntry for faster enums; 2020-02-16 17:50:51 -08:00
bjorn 47f4319ba8 core/png; rm stb_image_write; 2020-02-16 04:11:55 -08:00
bjorn 7f205d2fb1 WebGL shader fix; 2020-02-16 01:32:07 -08:00
bjorn 2db1f2b743 Fix erroneous GLES enables;
None of these exist in OpenGL ES.  These were throwing seemingly
innocuous GL errors, so this is mostly just a matter of correctness.
2020-02-16 01:23:27 -08:00
bjorn 8477638fad Fix warning; 2020-02-15 23:27:25 -08:00
bjorn d2f4628791 Add pointer devices; 2020-02-14 19:10:37 -08:00
Bjorn cce7fa8581
Merge pull request #197 from bjornbytes/hand-devices
More Hand Stuff
2020-02-13 16:35:14 -08:00
bjorn 409c2ad0c6 Fix projection matrices; 2020-02-13 16:33:17 -08:00
Bjorn f048f6d6f0
Merge pull request #218 from bjornbytes/android-bounds-size
oculus_mobile: Expose bounds dimensions;
2020-02-13 15:53:25 -08:00
Bjorn 56dad769dd
Merge pull request #217 from bjornbytes/android-button-changed
oculus_mobile: Expose button changed states;
2020-02-13 15:53:11 -08:00
Bjorn 4b041820aa
Merge pull request #216 from bjornbytes/android-display-frequency
oculus_mobile: lovr.headset.getDisplayFrequency;
2020-02-13 15:52:56 -08:00
bjorn e218733ee2 Make splay axis 1D; 2020-02-13 15:18:12 -08:00
bjorn a0c7d0235f leap: rm curl/splay emulation; 2020-02-13 15:13:08 -08:00
bjorn 5197d30b94 Add getSkeleton; 2020-02-13 15:08:59 -08:00
bjorn 0e4c42c8b0 Add pinch axis; 2020-02-13 15:08:58 -08:00
bjorn 81e3119321 leap: curl/splay emulation; openvr fixes; 2020-02-13 15:08:58 -08:00
bjorn 7e34c7adcc leap: getPose for finger devices; 2020-02-13 15:08:58 -08:00
bjorn 71e63ddac2 openvr: add curl/splay axes for finger devices; 2020-02-13 15:08:58 -08:00
bjorn d448bdc95c Finger devices/axes; OpenVR finger poses; 2020-02-13 15:08:58 -08:00
Nevyn Bengtsson f2d5824a2b desktop: fix wasPressed/wasReleased 2020-02-13 18:28:02 +01:00
bjorn 443376efde ModelData: Use union for transform fields;
Nodes can have either a transform matrix, or decomposed transform
properties, but never both.  Using a union means we can store both
of those variants in the same piece of memory, using the existing
matrix boolean to figure out which one to use.

This reduces the size of the struct by 48 bytes (152 -> 104), which
ends up speeding up some model operations, I'm guessing due to the
CPU cache.
2020-02-11 16:38:31 -08:00
bjorn 155718d161 shaders: Change abstract parameters to named parameters; 2020-02-11 16:17:54 -08:00
bjorn 7edb562732 Add lovr.headset.getTime;
Unlike lovr.timer.getTime, this is the predicted time at which the
current frame will be displayed.  It can be used in place of
lovr.timer.getTime for smoother animations.  It's unclear if this
could be used for a suitable replacement for dt though.
2020-02-09 11:26:23 -08:00
bjorn e8fdd5d7f0 Support KTX textures containing ASTC data; 2020-02-08 03:57:59 -08:00
bjorn 2097241596 Improve ASTC loading;
Just a little more reliable and easier to read.
2020-02-08 03:57:59 -08:00
bjorn c1e231e756 oculus_mobile: Expose bounds dimensions; 2020-02-08 03:32:50 -08:00
bjorn adcbe6d707 oculus_mobile: Expose button changed states; 2020-02-07 23:01:01 -08:00
bjorn 8d22935c60 oculus_mobile: lovr.headset.getDisplayFrequency; 2020-02-07 22:21:32 -08:00
bjorn 02a73f333e oculus_mobile: respect t.headset.msaa; 2020-02-07 22:09:47 -08:00
bjorn c502f5b62a Add highp shader flag that sets default fragment precision to highp;
Also, precision qualifier is required to work on desktop GL, so
we don't need ifdefs for it!
2020-02-07 19:44:51 -08:00
bjorn cae8bba522 Remove lovrMain macro;
We want lovrMain to be the entrypoint but we can't figure out how
to do this in a way that wouldn't break things, on all platforms.
2020-02-07 19:25:55 -08:00
bjorn 723f5684cf Fix mat4_fov and desktop driver projection;
OpenVR may need updating now, but at least we know what the correct
approach is now.
2020-02-06 17:32:44 -08:00
bjorn 4a545e4d04 EGL context creation fixes; 2020-02-04 16:48:03 -08:00
bjorn 67ba5f3a82 Add more graphics stats; 2020-01-31 03:43:52 -08:00
Cassie Jones 9845fee2b6 Use different compute #version with OpenGL ES
GLES doesn't like #version 430 for compute, it wants #version 310 es.
We can conditionally compile that.
2020-01-31 06:24:08 -05:00
bjorn be4db58fa3 "Fix" compute blocks on GLES;
There can only be one compute block.
2020-01-30 19:14:25 -08:00
bjorn c9c5d43829 Shader:hasBlock; Shader:sendBlock errors on missing block; 2020-01-30 18:26:05 -08:00
bjorn a1a53b4bed sampler2DMultiview; textureMultiview; 2020-01-30 17:48:15 -08:00
bjorn 78f272247b newCanvas creates array textures when multiview; 2020-01-30 17:48:01 -08:00
bjorn d971749b85 oculus_mobile: Fix vrapi_getView* signatures; 2020-01-30 17:09:06 -08:00
bjorn f8d3172868 opengl: Prefer state.features.compute to ARB_compute_shader; 2020-01-29 18:22:16 -08:00
bjorn f89998b21f Add eye/left and eye/right devices;
Currently nobody returns data for them, though headset drivers could
start to provide poses estimated from the head pose and IPD info.

This also makes it easier to integrate eye tracking later.
2020-01-29 17:53:03 -08:00
Bjorn 12d2e32903
Merge pull request #206 from bjornbytes/headset-views
Headset views;
2020-01-29 17:24:34 -08:00
bjorn 9ea76fac7b rm placeholder getFov code; 2020-01-29 17:09:23 -08:00
bjorn c73fadf5a3 Mark compute shaders as available on ES3.2; 2020-01-29 14:08:09 -08:00
bjorn 3c2154c824 Add unused EGL context creation; 2020-01-28 21:42:44 -08:00
bjorn c9a06a37cb Refactor main; Add unused android entrypoint; 2020-01-28 21:38:44 -08:00
bjorn 0aa724116e Headset views;
- lovr.headset.getViewCount
- lovr.headset.getViewPose
- lovr.headset.getViewAngles
2020-01-27 22:11:58 -08:00
bjorn b19a391c32 desktop: emit focus events; 2020-01-27 21:10:27 -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
bjorn 7ca23bc58a lovr.headset.getDisplayFrequency; 2020-01-24 23:06:30 -08:00
bjorn 4f7bb9e53e lovr.headset.wasPressed; lovr.headset.wasReleased; 2020-01-24 22:48:36 -08:00
bjorn c7f5406ce2 Make clipping planes consistent across most headset drivers;
The default far clipping plane was changed from 30 to 100 for openvr
and oculus.  oculus_mobile clipping planes can't be changed easily.
2020-01-23 11:25:38 -08:00
bjorn 8c429e89ac Fix -Wshadow; 2020-01-23 11:18:04 -08:00
bjorn 08577ee91b Fix cast-qual warning; 2020-01-23 11:01:27 -08:00
bjorn 4c1917f6ce Fix some prototypes; 2020-01-23 10:55:46 -08:00
bjorn 0f338c3ebd Fix getDirectoryItems on windows; 2020-01-22 16:09:35 -08:00
bjorn ddcdce25dc Minor style stuff; 2020-01-22 15:41:48 -08:00
bjorn 96d3288dae Update header; 2020-01-22 15:38:57 -08:00
bjorn a5424a1932 Microphone:getData supports sampleCount/destination; 2020-01-22 15:36:41 -08:00
Bjorn 3c65d238bc
Merge pull request #193 from alloverse/allo/mic
Sound adjustments: SoundData has-a blob, and mic sample size getter
2020-01-22 14:10:26 -08:00
bjorn f207c4d9a4 zip: Only call munmap if zip file was actually mapped; 2020-01-20 15:59:53 -08:00
mcc ea06f8d7dc Filesystem fixes: Use normalize() in lovrFilesystemMount and dir_resolve; ensure enough room for zero terminator in zip_lookup 2020-01-20 17:12:37 -05:00
Nevyn Bengtsson e10799b8c8 microphone: less throwy, more MAX()y 2020-01-20 08:52:58 +01:00
Nevyn Bengtsson a5c59e2d12 Fixes from review 2020-01-20 08:49:11 +01:00
Nevyn Bengtsson 0bdb7c7c80 More has-a-ification of texturedata
I forgot to stage this yesterday??
2020-01-20 08:48:59 +01: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
Nevyn Bengtsson 91cc385340 Remove redundant SoundData:getPointer() 2020-01-19 22:43:13 +01:00
Nevyn Bengtsson 9127dd823c Fix bugs in sounddata-has-blob 2020-01-19 21:22:23 +01:00
Nevyn Bengtsson 7107ecd235 SoundData:getBlob() 2020-01-19 17:50:04 +01:00
Nevyn Bengtsson 790629bc3e SoundData: has-a blob instead of is-a blob 2020-01-19 17:50:04 +01:00
Nevyn Bengtsson 8515cd98fe Add destination buffer size to microphone:getData()
So that we can use OpenAL's internal ring buffer and only dequeue
exactly the amount we need at the moment.
2020-01-19 17:03:35 +01:00
Bjorn c5edc6dedb
Merge pull request #190 from bjornbytes/android-canvas
Android Canvas
2020-01-17 12:19:49 -08:00
bjorn b1eeda96cb Small safety fix; 2020-01-16 09:32:12 -08:00
bjorn 0ecd8f6b49 Fix lovr.filesystem.getExecutablePath on macOS; 2020-01-16 09:21:21 -08:00
Bjorn 3a5c3ca97c
Merge pull request #189 from bjornbytes/channel-mutex
Channel ownership stuff
2020-01-15 17:54:00 -08:00
bjorn 2a52796c6f Commenting; 2020-01-15 17:56:09 -08:00
bjorn c0d1e28deb Fix ifdef for glTexStorage;
It's always present on GLES.
2020-01-14 19:39:10 -08:00
bjorn da88766e5a oculus_mobile: Discard depth/stencil buffers after rendering;
This was present in lovr-oculus-mobile.
2020-01-14 18:46:00 -08:00
bjorn 541400e0fe oculus_mobile: Create framebuffers from bridged swapchain textures;
This is a change that shifts the responsibility regarding the creation
of OpenGL framebuffers from vrapi-provided swapchain texture handles.
Previously, the LovrApp component of lovr-oculus-mobile was creating
framebuffers and passing native framebuffer IDs to lovr.  With this
change, lovr-oculus-mobile passes vrapi's swapchain textures to lovr
unmodified.  This allows lovr to create canvases using its conventional
method and also means that the properties of the canvases are no longer
hardcoded, so things like resolution and multisampling can be
customized.

There were also some issues with multiview canvases in LÖVR due to some
misconceptions about how multisampled multiview rendering works.  These
issues have also been fixed in this commit.
2020-01-14 18:26:01 -08:00
bjorn afa5523773 Curve:render always returns 2 points if it's a line; 2020-01-14 01:08:57 -08:00
bjorn f728496608 Make math module work better in threads;
conf doesn't work in threads.  While this seems problematic, it can
kinda be considered the right thing.  Right now the math module can't
be required at all in threads which seems bad, so we'll make it work
and just ignore the "globals" flag for now.
2020-01-14 00:39:38 -08:00
bjorn 0841268d45 Fix garbled text when printing out spaces;
Apparently requesting/rendering zero vertices was clogging stuff
somewhere.  It seems good enough to just explicitly not render
anything if we weren't gonna do it anyway.
2020-01-14 00:37:09 -08:00
bjorn 3b8d485fe9 Mesh:setVertices(Blob); 2020-01-14 00:22:35 -08:00
bjorn bd6d45cd30 Add comment; 2020-01-13 23:51:59 -08:00
bjorn 056c1e7fe4 Simplify Channel cleanup; 2020-01-13 23:49:52 -08:00
bjorn 46c685bd27 Make channel creation threadsafe; 2020-01-13 23:49:52 -08:00