Commit Graph

309 Commits

Author SHA1 Message Date
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
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
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
Nevyn Bengtsson 27384ac62c Fix Pico build
* lovrPlatformGetBundlePath was missing the root argument
* ANDROID_SDK can't be assumed to be the parent of the ndk folder, in case it's a side-by-side installation of the NDK. Instead, ANDROID_SDK should be provided with -D
* One more thing we could mention in the docs that I ran into: Installing java with apt gave me an incompatible version. It worked better to just -DJAVA_HOME= to the java that comes with Android studio (/snap/android-studio/91/android-studio/jre on ubuntu).
2020-08-04 10:42:04 +02:00
bjorn 91fb120dcc tup: pico rules; 2020-07-27 17:20:58 -06:00
bjorn ac58a1aeba Pico: Draw the rest of the owl;
Add entrypoints, headset backend code, fill in the Activity, and
add various special cases to account for the asynchronous render loop,
lack of sRGB support, and OpenGL state resets.
2020-07-27 14:56:21 -06:00
bjorn 58ab637465 Custom os implementation for pico; 2020-07-27 14:28:40 -06:00
bjorn b0b9e38da6 Pico: add pico jar and missing DRIVER_PICO enumerant; 2020-07-27 14:25:57 -06:00
bjorn a59c7fee40 Fix AndroidManifest.xml path;
The file has to literally be named AndroidManifest.xml so it has
to be copied to that name.
2020-07-27 14:18:28 -06:00
bjorn e7d4e6cf7b Start pico headset backend; 2020-07-27 13:58:52 -06:00
bjorn d25e20fb9d mv AndroidManifest.xml AndroidManifest_vrapi.xml; 2020-07-27 13:47:32 -06:00
bjorn 92bd4f60cf CMake: Clean up more android files; 2020-07-27 13:16:22 -06:00
bjorn dc2774f136 CMake: Make vrapi an imported target; 2020-07-27 13:16:07 -06:00
bjorn 87b979f51c mv Activity.java Activity_vrapi.java; 2020-07-27 12:50:27 -06:00
bjorn 4a7557b0d1 Clean up Android CMake stuff; 2020-07-27 12:48:01 -06:00
bjorn 9777306b70 rm oculus mobile; 2020-07-02 10:46:10 -06:00
bjorn 0a27a0b17b Fix ANDROID_ASSETS option; 2020-06-29 17:51:15 -06:00
bjorn 6c6c5fd360 CMake android support; 2020-06-29 17:20:26 -06:00
bjorn b34c03bcc8 Tup build system for android; 2020-06-09 18:02:03 -06:00
bjorn 6d2fdac89f Prefix headset implementation files with headset_; 2020-05-24 13:32:13 -06:00
l. coues 61e53f09ff Add webxr to CMake
Default to off unless build with emscripten
2020-05-06 23:07:59 +02:00