Commit Graph

427 Commits

Author SHA1 Message Date
bjorn 07074a39a8 mv os_web os_wasm;
Gotta pick a consistent name.
2022-01-06 22:23:21 +02:00
bjorn 20e4567bd6 Merge branch 'master' into dev 2021-12-20 17:12:39 +02:00
Nevyn Bengtsson 06dd81f6d7 Use d8 instead of dx
dx was deprecated years ago, and d8 replaces it. dx is
removed in build-tools 31, so it's best not to depend on it.

In addition, d8 now supports Java 11 (class version 55), which
is required to use the javac bundled with Android Studio.
2021-12-07 08:17:56 -08:00
mcc db28be591a Fix incomplete LOVR_ENABLE PHONON/OCULUS define change 2021-07-23 09:55:16 -07:00
bjorn bb78d266b4 DESKTOP_HEADSET -> DESKTOP; 2021-07-18 22:24:00 -07:00
bjorn fdb8a2423c Merge branch 'master' into dev 2021-07-10 09:44:03 -07:00
mcc d7d28eaba0 Fix copy so that plugins can work on mac 2021-06-24 21:04:58 -06:00
kokokoshka 7e52ffe956 MinGW support 2021-06-18 15:45:26 -06:00
brainrom 3d1775e468 Lua links properly
mlib required to build Lua, dl lib used to load compiled plugins from shared libraries.
2021-06-10 10:37:30 -06:00
Nevyn Bengtsson 28abb7270d Omit main() function if requested 2021-05-31 09:07:38 -06:00
Nevyn Bengtsson 4a3d979925 remove redundant link_directories 2021-05-31 09:07:38 -06:00
Nevyn Bengtsson 88de9a41af LOVR_BUILD_WITH_EXPORTED_INTERNALS --> LOVR_SYMBOL_VISIBILITY 2021-05-31 09:07:38 -06:00
Nevyn Bengtsson 7b70fac0bb mic permissions code for macos 2021-05-31 09:07:38 -06:00
Nevyn Bengtsson 9c37a6cdc8 don't include main/winmain in dll build
otherwise the parent app can't define a main of its own
2021-05-31 09:07:38 -06:00
Nevyn Bengtsson 9f697de402 allow plugins from parent project
So that projects that use lovr as a submodule can
inject their own plugins.

By picking them up from the _root_ project, whatever project that
is embedding lovr can decide for itself what plugins to use. This
is cleaner than using a separate glob and a variable in the case
where lovr will never come bundled with a standard set of plugins.
2021-05-31 09:07:38 -06:00
Nevyn Bengtsson 361c6a1356 Allow brave/foolish souls to use internal private C API 2021-05-31 09:07:38 -06:00
Nevyn Bengtsson ac3d873311 use generator expression for --ks-pass 2021-05-31 09:07:38 -06:00
Nevyn Bengtsson 5ab7bebf45 Android: Allow having a key pass (not just a keystore pass) 2021-05-31 09:07:38 -06:00
Nevyn Bengtsson 1756983eb3 Embed submo's to VR SDKs 2021-05-31 09:07:38 -06:00
bjorn 87bf9c7b27 Merge branch 'master' into dev 2021-04-27 22:20:38 -06:00
mcc 0209e75137 Pass -DLOVR_SANITIZE to CMake config for AddressSanitizer+ubsan 2021-04-27 21:30:31 -06:00
mcc 2a30a7f38d Get SteamAudio and OculusAudio working on mac. Also add the Phonon target as a dependency when LOVR_USE_STEAM_AUDIO (all platforms), which has no effect but could be useful later if SteamAudio acquires any build steps while still being a runtime-linked library. 2021-04-27 00:02:44 -06:00
mcc fc87bffbe0 Fix Android CMake build. 2021-04-20 07:45:39 -06:00
Jakob Bornecrantz b02c30a0e4 Make bin directory AppImage ready 2021-04-13 11:03:57 -06:00
bjorn f565a7b69b rm linking to OpenSLES; 2021-04-03 18:42:34 -06:00
bjorn bbc868b2ea CMake: Only strip android libraries in release mode; 2021-04-03 01:18:58 -06:00
bjorn 4b1cca50bc CMake: msdfgen is always shared; 2021-04-03 01:18:40 -06:00
bjorn 618fb2ed2f CMake: macOS builds into bin dir and moves libraries there;
A previous change modified the rpath to always be @executable_path.

This patch moves all libraries next to the executable, so that they can
load properly with the new rpath.  For better organization, everything
is nested into a bin directory.  This is congruent with how linux works.

Bundled builds remain the same -- they are using @executable_path like
before, and libraries get moved next to the executable inside the .app.
2021-04-02 22:17:58 -06:00
bjorn 245fed5e39 CMake: macOS always builds with @executable_path rpath; 2021-04-02 01:07:37 -06:00
bjorn 7e003032b5 Add favicon to wasm build;
Totally useless, but totally awesome.
2021-03-31 14:28:05 -06:00
mcc 896ebf0181 Phonon/SteamAudio support in CMake build 2021-03-30 18:38:14 -06:00
mcc 3619626710 CMake build fix for Oculus Audio on Quest 2021-03-23 14:37:30 -06:00
bjorn 121e0fde4c Add vanilla Lua submodule;
This needs testing on other platforms.
2021-03-23 14:31:04 -06:00
bjorn 49f02c65d8 rm lua submodule; 2021-03-23 14:31:04 -06:00
mcc e3c2b5b865 Fix Android build
- Fix typos after refactor
- Fix CMake when using ANDROID_PACKAGE
2021-03-22 14:09:16 -06:00
bjorn f9f4907a50 phonon fixes; 2021-03-07 22:42:54 -07:00
bjorn 30a0556f1d Fix oculus spatializer; 2021-03-07 21:19:24 -07:00
bjorn f65f4c4075 Switch OpenVR back to non-imported library;
Building it from source results in a 7-8x smaller binary.
2021-03-04 18:40:58 -07:00
bjorn 746735259c Windows: Always use WinMain for UTF8 command line arguments;
This fixes problems with paths containing special characters on windows.
2021-03-02 11:49:08 -07:00
bjorn 1c3a01de2a Add windows icon; 2021-03-01 17:45:12 -07:00
bjorn f3a12f2af9 Turn openvr into an imported library;
It uses a deprecated version of CMake, creates weird directories,
is slow to compile, and causes tup to rely on CMake more.  Instead,
just use its binary artifacts directly.
2021-02-28 15:49:06 -07:00
bjorn 8a29c9c1f5 CMake: whitespace; 2021-02-25 16:31:14 -07:00
bjorn 4f5adbc64c lovr.system; 2021-02-25 09:00:12 -07:00
bjorn 8bbb092497 Start phonon spatializer; 2021-02-24 17:43:42 -07:00
bjorn bff86e6add CMake: Add modelData_stl.c file; 2021-02-24 13:22:46 -07:00
bjorn 72284c2c5b Merge branch 'master' into dev 2021-02-12 08:16:36 -07:00
bjorn b21fd987ca CMake: change msdfgen binary dir; tup: fix msdfgen path; 2021-02-11 16:19:35 -07:00
mcc 126ff0d8ba Fix build when LOVR_ENABLE_AUDIO is off
(Build miniaudio if LOVR_ENABLE_DATA is on)
2021-02-11 15:58:37 -07:00
bjorn 28e88d7598 Reorganize spatializer files/CMake; Oculus Audio tup support; 2021-02-10 12:41:15 -07:00
bjorn 6eb6ab221f CMake: Fix msdfgen target name; 2021-02-10 16:52:15 -07:00
bjorn e630cabdac CMake: Fix weird linux opengl warning; 2021-02-10 04:03:18 -07:00
bjorn 51485f613c Add the ability to override Android package id; 2021-02-09 21:19:29 -07:00
bjorn 84f65c26e4 Move utf8 back into util; 2021-02-08 20:55:51 -07:00
bjorn 8164e0b6e8 TextureData is now named Image!;
The existing Image construct was renamed StorageImage.
2021-02-08 20:17:47 -07:00
bjorn dca79f83f0 SoundData is now named Sound!; 2021-02-08 19:52:56 -07:00
bjorn 6d92d54079 Try having arr_t in util; 2021-02-08 18:25:05 -07:00
bjorn 3ded60948f rm core/ref; rm lovrAlloc; util does refcounting; 2021-02-08 17:26:44 -07:00
bjorn 1db661f257 Add stdatomic shim to include path; 2021-02-08 16:50:43 -07:00
bjorn ccc53a10aa Cleanup; 2021-02-08 16:08:29 -07:00
bjorn 8bf0acd2eb Add minimp3; 2021-02-08 16:08:29 -07:00
bjorn 03f167c4c1 rm reference to openal; 2021-02-08 16:08:29 -07:00
bjorn 177a94738d 48khz sample rate; fixes; 2021-02-08 16:08:29 -07:00
mcc 9ba4037e74 LOVR_USE_OCULUS_AUDIO
This is a large patch which adds a new Oculus Audio spatializer. Oculus Audio is slightly different from the dummy spatializer in a few ways:

    - It *must* receive fixed-size input buffers, every time, always.
    - It can only handle a fixed number of spatialized sound sources at a time.
    - It has a concept of "tails"; the spatialization of a sound can continue after the sound itself ends (eg echo).

Changes to audio.c were needed to support Oculus Audio's quirks:

    - audio.c now supports a "fixedBuffer" mode which invokes the generator/spatializer in fixed size chunks
    - Each source now has an intptr_t "memo" field that the spatializer may use to store whatever (Oculus spatializer uses this to handle the sound source limit).
    - The spatializer interface got a couple new methods: A "tail" method which returns a sound buffer after all sources are processed; and "create" and "destroy" methods that are called when a sound source is created or destroyed (Oculus spatializer uses this to populate/clear the "memo" field).

Along the way some other miscellaneous changes got made:

    - lovr.audio.getSpatializerName() returns the current spatializer
    - Spatializer init now takes in "config in" and "config out" structs (Spatializer changes fields in config out to request things, currently fixed buffer mode).
    - lovr.conf now takes t.audio.spatializer (string name of desired spatializer) and t.audio.spatializerMaxSourcesHint (Spatializers with max sources limits like Oculus will use this as the limit).
    - audio.c went back to tracking position/orientation as vectors rather than a matrix
    - A file oculus_spatializer_math_shim.h was added containing a minimal copypaste of OVR_CAPI.h from Oculus SDK to support a ovrPoseStatef the spatializer API needs. This may have license consequences but we are probably OK via a combination of fair use and the fact that a user cannot use this header file without accepting Oculus's license through other means.

Some work remains to be done, in particular there is an entire reverb feature I did not touch and LOVR_USE_OCULUS_AUDIO cannot be activated from tup. Oculus Spatializer works better when it has velocity and time information but this patch does not supply it.
2021-02-08 16:08:29 -07:00
Nevyn Bengtsson f7d027a3ce Audio permissions seem to work without AppCompat 2021-02-08 16:08:29 -07:00
Nevyn Bengtsson bb429829f6 Android: Link OpenSLES so miniaudio works 2021-02-08 16:08:29 -07:00
Nevyn Bengtsson e54629dfb0 Android: Link appcompat so we can ask for audio capture permissions 2021-02-08 16:08:29 -07:00
Nevyn Bengtsson 8403c9bd70 just a super dummy spatializer 2021-02-08 16:08:29 -07:00
bjorn c738ae9993 Update CMake/deps; 2021-02-08 16:08:29 -07:00
bjorn 47ec05d385 CMake: strip android libraries; 2021-02-07 16:53:54 -07:00
bjorn 4cf89fa6db Fix CMakeLists; 2021-02-07 16:48:25 -07:00
bjorn d2ff6c29ac Change inclusive module defines to exclusive;
This reduces the number of flags needed to get a regular build.
2021-02-07 16:45:03 -07:00
bjorn 32000bfb63 Ensure buildAPK builds after lovr; 2021-02-04 22:27:06 -07:00
bjorn 2b1bb31b4c CMake: Linux plugin/rpath/bin;
- Linux rpath is changed to $ORIGIN
- Libraries (shared libraries and plugins) are copied to executable.
- Executable is output to bin dir for easier packaging.

Need to look into consolidating the move_lib functions for each platform.
2021-02-02 03:19:55 -07:00
Nevyn Bengtsson 8108b6aa5a Switch luajit GC and remove image_base settings
to fix dyld shared cache errors on macOS 11
2021-01-11 15:29:05 +01:00
bjorn 3f975bcc8f Android plugin support;
- Link against dl (this was probably why ffi.load didn't work)
- Store shared libraries in the apk uncompressed
  - Libraries are added during the "package" aapt call instead of "add".
    - Because -0 (used to store uncompressed) only works during package.
    - classes.dex is added here too now.
    - There's only one aapt invocation now, which is kinda nice.
  - The lib folder needs to be in a subfolder now ("raw" was chosen).
    - Because "package" and "add" subcommands work differently.
  - Store shared libraries in the apk page aligned
    - Required passing -p to the zipalign invocation.
    - This is needed because dlopen("zip!path") needs it.
  - android:extractNativeLibs="false" is added to the XML manifest.
  - apk sizes are bigger, but disk usage and install time should improve.
- Fix a bug with moving plugin libraries into the lib folder with CMake.
- Use lovrFilesystemGetSource instead of lovrFilesystemGetExecutablePath
  to get the proper path to the apk.
2020-12-28 14:45:56 -07:00
bjorn bc5ed02d7d Plugins autolink against Lua; 2020-12-28 12:37:35 -07:00
bjorn b356ce2546 Plugins;
- The plugins folder can contain native plugins.
- CMake will build plugins with CMakeLists in them
  - They can check the LOVR variable to see if they are being built inside LOVR.
  - They can set the LOVR_PLUGIN_TARGETS variable to a list of targets they build.
    - If blank, all non-imported targets added in the folder will be used.
  - The libraries built by their targets will be moved next to the executable or into the apk.
- The library loader now tries to load libraries next to the executable or in the APK.
  - It is "fixed function" now, this may be improved in the future.
- The lovr.filesystem C require path has been removed.
- enet and cjson have been removed.  Use plugins.
2020-12-28 12:37:35 -07:00
bjorn 30e01f94a3 Upgrade stb_image; rm stb_image threadlocal patch;
stb_image's vertical flip flag was not thread safe in the version
of stb_image we were using.  We patched stb_image to use a thread
local variable for the flag.  stb_image has since been upgraded to
expose a thread local version of the flag, so our patch is no longer
necessary after upgrading.

The CMake flag to enable the thread local patch did not make very much
sense because thread local stuff is unconditionally used elsewhere.
2020-12-25 16:43:25 -07:00
bjorn 4ded7ef37a CMake: fix duplicated os_linux source; 2020-12-25 16:19:09 -07:00
bjorn e16719c946 CMake: Set luajit EXCLUDE_FROM_ALL;
This prints a warning but it's nice to not build the luajit executable.

Ideally the target would not be created at all but the CMakeLists we
are using does not expose this as an option.

This is congruent with the vanilla Lua build options.
2020-12-25 16:17:59 -07:00
bjorn 6690ce9171 CMake: no GLFW_INSTALL; 2020-12-25 16:08:51 -07:00
bjorn 80062941dc CMake: Use target_compile_definitions more;
- Prefer PRIVATE
- Omit redundant -D
2020-12-25 16:06:40 -07:00
bjorn efc963d8f8 CMake hides symbols by default;
This is more consistent with tup.
2020-12-25 15:50:08 -07:00
bjornbytes 842efe36c7 Handle openvr-specific warnings more precisely;
Instead of disabling a warning for the entire project, it is only
disabled while processing the OpenVR header.
2020-11-21 14:09:51 -07:00
Jakob Bornecrantz ca04882093 OpenXR: Add support for X11 and EGL on Linux 2020-11-16 17:02:51 -07:00
bjornbytes 40c403dfb6 CMake: Add LOVR_SYSTEM_OPENXR;
Searches for the system-installed OpenXR loader using pkg-config.
2020-11-16 17:02:51 -07:00
Bjorn 8a3d365268
Merge pull request #299 from Wallbraker/linux-openxr
Linux OpenXR support
2020-11-16 13:51:41 -07:00
Jakob Bornecrantz 1400cd201a OpenXR: Add support for X11 and EGL on Linux 2020-11-15 22:51:20 +00:00
bjornbytes dda1f6f3b0 CMake: Add LOVR_SYSTEM_OPENXR;
Searches for the system-installed OpenXR loader using pkg-config.
2020-11-15 22:49:00 +00:00
bjorn 64f9a310c3 Disable enet on emscripten;
UDP doesn't work properly.
2020-11-12 18:08:05 -07:00
bjorn 827dfda748 TextureData:encode returns Blob; rm core/png; 2020-11-12 18:08:05 -07:00
bjornbytes 13fe2411a3 CMake: Add LOVR_SYSTEM_OPENXR;
Searches for the system-installed OpenXR loader using pkg-config.
2020-11-12 18:08:04 -07:00
bjornbytes a68320c66a Always rebuild APK; 2020-11-02 11:47:44 -07:00
mcc 2be1c777d7 Add a check so that if ANDROID_KEYSTORE_PASS is not given, apksigner can still be invoked.
This is done by omitting the --ks-pass argument completely
2020-10-27 23:27:02 -04:00
bjorn f1447fd69a lovr.graphics.get/setViewPose; lovr.graphics.get/setProjection; 2020-09-24 19:03:37 -07:00
bjorn 28144c8143 OpenXR Android stuff; 2020-08-29 19:45:52 -06:00
bjorn 3cb291c866 rm leap motion driver;
Planning on using the new Ultraleap OpenXR API layer.  It's possible
that this will be added back if that doesn't work out.
2020-08-22 14:05:40 -06:00
bjorn 6cadcea65d WebXR updates;
- Make the renderloop synchronous by hijacking the RAF to run on the
  XRSession when active.
- Convert os_web to use emscripten's native HTML5 interface instead
  of going through GLFW.
- Stop using preinitialized GL context -- lovrPlatformCreateWindow
  now creates the context.
- GLES2/3 emulation is not necessary.
- Remove inline sessions.  The VR simulator is used to render to the
  Canvas instead.  webxr_attach and webxr_detach are used to replace
  replace the active headset driver with the webxr driver when an
  immersive session starts.
- Add noop desktop_getSkeleton.
2020-08-20 13:28:07 -06:00
bjorn 65470f1e0e Update webxr driver; rm webvr; 2020-08-16 00:31:20 -06:00
Nevyn Bengtsson 4dcca11a78 fix case problem in VrApi include path
in the sdk, 'Include' folder is capital I. With lowercase in
cmake, build fails on case sensitive file systems.
2020-08-04 14:59:23 +02:00