├── src ├── xrt │ ├── ipc │ │ ├── shared │ │ │ ├── ipcproto │ │ │ │ └── __init__.py │ │ │ ├── proto.json.license │ │ │ └── proto.schema.json.license │ │ ├── android │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── res │ │ │ │ │ └── values │ │ │ │ │ │ └── strings.xml │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ └── aidl │ │ │ │ │ └── org │ │ │ │ │ └── freedesktop │ │ │ │ │ └── monado │ │ │ │ │ └── ipc │ │ │ │ │ └── IMonado.aidl │ │ │ ├── proguard-rules.pro │ │ │ └── org.freedesktop.monado.ipc.cpp │ │ └── server │ │ │ └── ipc_server_mainloop_android.h │ ├── targets │ │ ├── steamvr_drv │ │ │ ├── steamvr.vrsettings.license │ │ │ ├── driver.vrdrivermanifest.license │ │ │ ├── resources │ │ │ │ ├── settings │ │ │ │ │ ├── default.vrsettings │ │ │ │ │ └── default.vrsettings.license │ │ │ │ ├── localization │ │ │ │ │ ├── localization.json.license │ │ │ │ │ └── localization.json │ │ │ │ ├── icons │ │ │ │ │ ├── controller_status_error.png.license │ │ │ │ │ ├── controller_status_off.png.license │ │ │ │ │ ├── controller_status_ready.png.license │ │ │ │ │ ├── controller_status_ready_low.png.license │ │ │ │ │ ├── controller_status_searching.gif.license │ │ │ │ │ ├── controller_status_standby.png.license │ │ │ │ │ ├── headset_monado_status_error.png.license │ │ │ │ │ ├── headset_monado_status_off.png.license │ │ │ │ │ ├── headset_monado_status_ready.png.license │ │ │ │ │ ├── controller_status_ready_alert.png.license │ │ │ │ │ ├── controller_status_searching_alert.gif.license │ │ │ │ │ ├── headset_monado_status_ready_alert.png.license │ │ │ │ │ ├── headset_monado_status_ready_low.png.license │ │ │ │ │ ├── headset_monado_status_searching.gif.license │ │ │ │ │ ├── headset_monado_status_standby.png.license │ │ │ │ │ ├── controller_status_error.png │ │ │ │ │ ├── controller_status_off.png │ │ │ │ │ ├── controller_status_ready.png │ │ │ │ │ ├── headset_monado_status_searching_alert.gif.license │ │ │ │ │ ├── controller_status_standby.png │ │ │ │ │ ├── headset_monado_status_off.png │ │ │ │ │ ├── controller_status_ready_low.png │ │ │ │ │ ├── controller_status_searching.gif │ │ │ │ │ ├── headset_monado_status_error.png │ │ │ │ │ ├── headset_monado_status_ready.png │ │ │ │ │ ├── controller_status_ready_alert.png │ │ │ │ │ ├── headset_monado_status_standby.png │ │ │ │ │ ├── controller_status_searching_alert.gif │ │ │ │ │ ├── headset_monado_status_ready_alert.png │ │ │ │ │ ├── headset_monado_status_ready_low.png │ │ │ │ │ ├── headset_monado_status_searching.gif │ │ │ │ │ └── headset_monado_status_searching_alert.gif │ │ │ │ └── driver.vrresources.license │ │ │ ├── driver.vrdrivermanifest │ │ │ ├── steamvr.vrsettings │ │ │ ├── copy_plugin.py │ │ │ ├── main.c │ │ │ └── copy_assets.py │ │ ├── openxr │ │ │ ├── openxr_monado.in.json.license │ │ │ ├── libopenxr.def │ │ │ ├── openxr_monado.in.json │ │ │ ├── libopenxr.version │ │ │ ├── install_active_runtime.sh │ │ │ └── active_runtime.cmake │ │ ├── openxr_android │ │ │ ├── config │ │ │ │ └── custom_license_mappings.prop │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── res │ │ │ │ │ ├── .gitignore │ │ │ │ │ └── values │ │ │ │ │ │ ├── strings.xml │ │ │ │ │ │ ├── colors.xml │ │ │ │ │ │ ├── styles.xml │ │ │ │ │ │ ├── license_cddl_1_0.xml │ │ │ │ │ │ ├── library_quatexpmap_strings.xml │ │ │ │ │ │ ├── library_openxrincludes_strings.xml │ │ │ │ │ │ ├── library_jnipp_strings.xml │ │ │ │ │ │ ├── library_eigen_strings.xml │ │ │ │ │ │ ├── library_monado_strings.xml │ │ │ │ │ │ ├── library_flexkalman_strings.xml │ │ │ │ │ │ └── library_openxrloaderinterfaces_strings.xml │ │ │ │ │ └── java │ │ │ │ │ └── org │ │ │ │ │ └── freedesktop │ │ │ │ │ └── monado │ │ │ │ │ └── openxr_runtime │ │ │ │ │ ├── MonadoOpenXrApplication.java │ │ │ │ │ └── AboutLibrariesNoticeFragmentProvider.kt │ │ │ └── proguard-rules.pro │ │ ├── android_common │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── restart_runtime_strings.xml │ │ │ │ │ ├── strings.xml │ │ │ │ │ ├── colors.xml │ │ │ │ │ ├── notification_strings.xml │ │ │ │ │ ├── styles.xml │ │ │ │ │ ├── display_over_other_apps_strings.xml │ │ │ │ │ └── vrmodestatus_strings.xml │ │ │ │ └── raw │ │ │ │ │ └── ic_feathericons_x.svg │ │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── freedesktop │ │ │ │ └── monado │ │ │ │ └── android_common │ │ │ │ ├── RuntimeService.kt │ │ │ │ ├── NoticeFragmentProvider.kt │ │ │ │ └── ShutdownProcess.kt │ │ ├── service-lib │ │ │ └── CMakeLists.txt │ │ ├── service │ │ │ ├── monado.in.socket │ │ │ ├── monado.in.service │ │ │ ├── main.c │ │ │ └── configure_and_install_units.cmake │ │ ├── ctl │ │ │ ├── meson.build │ │ │ └── CMakeLists.txt │ │ ├── common │ │ │ ├── target_lists.h │ │ │ └── meson.build │ │ ├── cli │ │ │ ├── cli_common.h │ │ │ ├── meson.build │ │ │ └── CMakeLists.txt │ │ ├── CMakeLists.txt │ │ └── gui │ │ │ ├── CMakeLists.txt │ │ │ └── meson.build │ ├── auxiliary │ │ ├── bindings │ │ │ ├── bindings.json.license │ │ │ └── meson.build │ │ ├── android │ │ │ ├── proguard-rules.pro │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ └── java │ │ │ │ │ └── org │ │ │ │ │ └── freedesktop │ │ │ │ │ └── monado │ │ │ │ │ └── auxiliary │ │ │ │ │ ├── NameAndLogoProvider.kt │ │ │ │ │ └── IServiceNotification.kt │ │ │ ├── android_ahardwarebuffer_allocator.h │ │ │ └── android_load_class.hpp │ │ ├── ogl │ │ │ ├── egl_api.c │ │ │ ├── ogl_api.c │ │ │ ├── egl_api.h │ │ │ ├── ogl_api.h │ │ │ ├── ogl_documentation.h │ │ │ └── ogl_helpers.h │ │ ├── util │ │ │ ├── u_misc.c │ │ │ ├── u_git_tag.c.in │ │ │ ├── u_git_tag.h │ │ │ ├── u_bitwise.h │ │ │ ├── u_frame.h │ │ │ ├── u_verify.h │ │ │ ├── u_file.h │ │ │ ├── u_bitwise.c │ │ │ └── u_process.h │ │ ├── tracking │ │ │ ├── t_kalman.cpp │ │ │ └── t_data_utils.c │ │ ├── math │ │ │ ├── m_documentation.hpp │ │ │ ├── m_hash.cpp │ │ │ ├── m_predict.h │ │ │ ├── m_mathinclude.h │ │ │ └── m_permutation.h │ │ ├── os │ │ │ └── os_documentation.h │ │ ├── vk │ │ │ └── vk_documentation.h │ │ └── gstreamer │ │ │ ├── gst_sink.h │ │ │ └── gst_pipeline.h │ ├── drivers │ │ ├── north_star │ │ │ ├── exampleconfigs │ │ │ │ ├── v1_deckx_50cm.json.license │ │ │ │ ├── v2_lonestar_50cm.json.license │ │ │ │ └── v2_deckx_50cm.json.license │ │ │ └── ns_interface.h │ │ ├── illixr │ │ │ ├── illixr_component.h │ │ │ └── illixr_interface.h │ │ ├── survive │ │ │ ├── survive_driver.h │ │ │ └── survive_interface.h │ │ ├── vive │ │ │ └── vive.h │ │ ├── ohmd │ │ │ ├── oh_interface.h │ │ │ └── oh_device.h │ │ ├── psvr │ │ │ └── psvr_interface.h │ │ ├── android │ │ │ └── android_prober.h │ │ ├── daydream │ │ │ └── daydream_interface.h │ │ ├── depthai │ │ │ └── depthai_interface.h │ │ ├── dummy │ │ │ └── dummy_interface.h │ │ ├── ultraleap_v2 │ │ │ └── ulv2_interface.h │ │ ├── realsense │ │ │ └── rs_interface.h │ │ ├── ht │ │ │ └── ht_interface.h │ │ ├── vf │ │ │ └── vf_interface.h │ │ ├── wmr │ │ │ ├── wmr_common.h │ │ │ └── wmr_interface.h │ │ ├── psmv │ │ │ └── psmv_interface.h │ │ ├── hydra │ │ │ └── hydra_interface.h │ │ ├── hdk │ │ │ └── hdk_interface.h │ │ ├── euroc │ │ │ └── euroc_interface.h │ │ └── arduino │ │ │ └── arduino_interface.h │ ├── include │ │ ├── meson.build │ │ ├── CMakeLists.txt │ │ └── xrt │ │ │ ├── xrt_config_drivers.h.cmake_in │ │ │ ├── xrt_config_android.h.cmake_in │ │ │ ├── xrt_config.h │ │ │ ├── xrt_config_vulkan.h.cmake_in │ │ │ ├── xrt_gfx_gl.h │ │ │ ├── xrt_gfx_gles.h │ │ │ ├── xrt_gfx_native.h │ │ │ ├── xrt_vulkan_includes.h │ │ │ ├── xrt_config_build.h.cmake_in │ │ │ ├── xrt_config_have.h.cmake_in │ │ │ ├── xrt_config_os.h │ │ │ └── xrt_windows.h │ ├── compositor │ │ ├── shaders │ │ │ ├── CMakeLists.txt │ │ │ ├── layer.frag │ │ │ ├── layer.vert │ │ │ ├── meson.build │ │ │ ├── mesh.frag │ │ │ ├── equirect1.vert │ │ │ ├── equirect2.vert │ │ │ └── mesh.vert │ │ ├── client │ │ │ ├── comp_gl_glue.c │ │ │ ├── comp_gles_glue.c │ │ │ ├── comp_gl_xlib_glue.c │ │ │ └── comp_egl_client.h │ │ ├── multi │ │ │ └── comp_multi_interface.h │ │ └── main │ │ │ └── comp_documentation.h │ ├── state_trackers │ │ ├── meson.build │ │ ├── CMakeLists.txt │ │ ├── gui │ │ │ ├── gui_stb.c │ │ │ └── gui_imgui.h │ │ ├── dev │ │ │ └── README.md │ │ ├── prober │ │ │ ├── p_documentation.h │ │ │ └── meson.build │ │ └── steamvr_drv │ │ │ ├── CMakeLists.txt │ │ │ ├── meson.build │ │ │ └── ovrd_interface.h │ ├── .editorconfig │ ├── meson.build │ └── CMakeLists.txt ├── external │ ├── openvr_includes │ │ └── CHANGELOG.md │ ├── stb │ │ └── stb_image_write.h.license │ ├── jnipp │ │ ├── dotest.sh │ │ ├── jnipp.vcxproj.filters │ │ ├── tests │ │ │ ├── tests.vcxproj.filters │ │ │ └── testing.h │ │ ├── android │ │ │ ├── AndroidManifest.xml │ │ │ └── CMakeLists.txt │ │ ├── Android.bp │ │ ├── makefile │ │ ├── build.gradle │ │ └── LICENSE │ ├── android-jni-wrap │ │ └── wrap │ │ │ ├── android.provider.cpp │ │ │ ├── android.graphics.cpp │ │ │ ├── android.provider.impl.h │ │ │ ├── java.util.cpp │ │ │ ├── android.util.cpp │ │ │ ├── android.service.vr.cpp │ │ │ ├── android.graphics.impl.h │ │ │ ├── java.util.impl.h │ │ │ ├── android.util.impl.h │ │ │ ├── android.service.vr.impl.h │ │ │ ├── android.app.cpp │ │ │ ├── android.widget.cpp │ │ │ ├── android.app.impl.h │ │ │ ├── android.database.cpp │ │ │ ├── android.view.cpp │ │ │ └── android.view.impl.h │ ├── meson.build │ ├── hungarian │ │ └── README.txt │ ├── imgui │ │ ├── imgui_monado │ │ │ └── cimgui_monado.h │ │ └── imgui │ │ │ └── cimgui_sdl.cpp │ └── cjson │ │ └── cjson │ │ └── LICENSE ├── meson.build └── CMakeLists.txt ├── doc ├── changes │ ├── xrt │ │ ├── mr.870.md │ │ ├── mr.715.md │ │ ├── mr.705.1.md │ │ ├── mr.810.md │ │ ├── mr.721.2.md │ │ ├── mr.704.md │ │ ├── mr.794.md │ │ ├── mr.721.1.md │ │ ├── mr.749.md │ │ ├── mr.867.md │ │ ├── mr.800.md │ │ ├── .gitignore │ │ ├── mr.705.2.md │ │ ├── mr.847.md │ │ ├── mr.768.md │ │ ├── mr.721.5.md │ │ ├── mr.721.3.md │ │ ├── mr.723.md │ │ ├── mr.697.md │ │ └── mr.721.4.md │ ├── drivers │ │ ├── mr.858.1.md │ │ ├── mr.858.2.md │ │ ├── mr.740.md │ │ ├── mr.860.md │ │ ├── mr.691.md │ │ ├── mr.715.md │ │ ├── mr.674.md │ │ ├── mr.774.md │ │ ├── mr.741.md │ │ ├── mr.742.md │ │ ├── mr.717.md │ │ ├── mr.836.md │ │ ├── .gitignore │ │ └── mr.839.md │ ├── auxiliary │ │ ├── mr.735.md │ │ ├── mr.721.2.md │ │ ├── mr.721.1.md │ │ ├── mr.841.3.md │ │ ├── mr.841.4.md │ │ ├── mr.717.md │ │ ├── mr.841.1.md │ │ ├── mr.841.5.md │ │ ├── mr.841.2.md │ │ ├── mr.810.md │ │ ├── mr.859.2.md │ │ ├── mr.839.2.md │ │ ├── mr.811.md │ │ ├── mr.859.1.md │ │ ├── .gitignore │ │ ├── mr.825.md │ │ ├── mr.721.3.md │ │ └── mr.839.1.md │ ├── state_trackers │ │ ├── mr.858.4.md │ │ ├── mr.715.md │ │ ├── mr.830.md │ │ ├── mr.847.3.md │ │ ├── mr.740.md │ │ ├── mr.886.md │ │ ├── mr.847.1.md │ │ ├── mr.847.2.md │ │ ├── mr.859.1.md │ │ ├── mr.688.md │ │ ├── mr.859.2.md │ │ ├── mr.735.md │ │ ├── mr.686.md │ │ ├── mr.705.md │ │ ├── .gitignore │ │ ├── mr.759.md │ │ └── mr.689.md │ ├── misc_features │ │ ├── mr.692.md │ │ ├── mr.858.1.md │ │ ├── mr.858.2.md │ │ ├── mr.858.3.md │ │ ├── mr.705.md │ │ ├── mr.785.md │ │ ├── mr.695.md │ │ ├── mr.739.md │ │ ├── mr.676.md │ │ ├── .gitignore │ │ ├── mr.697.2.md │ │ ├── mr.697.1.md │ │ ├── mr.715.md │ │ └── mr.809.md │ ├── compositor │ │ ├── mr.697.md │ │ ├── mr.841.3.md │ │ ├── mr.677.md │ │ ├── mr.841.1.md │ │ ├── mr.841.2.md │ │ ├── mr.864.md │ │ ├── mr.705.md │ │ ├── .gitignore │ │ ├── mr.827.md │ │ ├── mr.833.md │ │ ├── mr.767.md │ │ └── mr.721.md │ ├── misc_fixes │ │ ├── mr.785.md │ │ ├── mr.737.md │ │ ├── mr.735.md │ │ └── .gitignore │ ├── ipc │ │ ├── mr.712.md │ │ ├── mr.694.md │ │ ├── mr.685.md │ │ ├── mr.768.md │ │ ├── .gitignore │ │ ├── mr.721.md │ │ └── mr.565.md │ ├── big │ │ ├── mr.774.md │ │ └── .gitignore │ ├── .proclamation.json.license │ └── .markdownlint.yaml ├── images │ ├── in-process.drawio.svg.license │ ├── out-of-proc.drawio.svg.license │ └── monado-input-class-relationships.drawio.svg.license ├── example_configs │ ├── config_v0.schema.json.license │ ├── config_v0.northstar_lonestar.json.license │ └── config_v0.northstar_lonestar.json ├── meson.build ├── roadmap.md └── writing-a-new-driver.md ├── default.nix ├── nix └── rr │ ├── call.nix │ └── unstable.nix ├── vcpkg.json.license ├── .gitlab-ci ├── distributions.license ├── localhost.json.license ├── ubuntu_groovy_container_prep.sh ├── ndk_container_prep.sh ├── arch_container_prep.sh ├── ubuntu_focal_container_prep.sh ├── distributions ├── debian_container_prep.sh ├── localhost.json ├── install-ndk.sh ├── i386-cross.txt └── build-openxr-openhmd.sh ├── cmake ├── .cmake-format.json.license ├── .cmake-format.json └── PrefixListGlob.cmake ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.properties.license │ └── gradle-wrapper.properties ├── vcpkg.json ├── scripts ├── monado-codespell.exclude └── get-ht-models.sh ├── settings.gradle ├── tests ├── tests_main.cpp └── CMakeLists.txt ├── .editorconfig ├── .clang-tidy └── LICENSES ├── LicenseRef-Khronos-Free-Use-License-for-Software-and-Documentation.txt └── MIT.txt /src/xrt/ipc/shared/ipcproto/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.870.md: -------------------------------------------------------------------------------- 1 | Add xrt_vec3_f64 struct. 2 | -------------------------------------------------------------------------------- /doc/changes/drivers/mr.858.1.md: -------------------------------------------------------------------------------- 1 | v4l2: Add tracing support. 2 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | (import {}).callPackage ./monado.nix { } 2 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.735.md: -------------------------------------------------------------------------------- 1 | math: Fixes for M_PI on Windows. 2 | -------------------------------------------------------------------------------- /doc/changes/drivers/mr.858.2.md: -------------------------------------------------------------------------------- 1 | depthai: Add tracing support. 2 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.858.4.md: -------------------------------------------------------------------------------- 1 | gui: Add tracing support 2 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.721.2.md: -------------------------------------------------------------------------------- 1 | vulkan: Add fence import function. 2 | -------------------------------------------------------------------------------- /doc/changes/misc_features/mr.692.md: -------------------------------------------------------------------------------- 1 | imgui: Add ImPlot demo window. 2 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.721.1.md: -------------------------------------------------------------------------------- 1 | u/time: Add helper comparison functions. 2 | -------------------------------------------------------------------------------- /doc/changes/compositor/mr.697.md: -------------------------------------------------------------------------------- 1 | main: Integrate new frame timing code. 2 | -------------------------------------------------------------------------------- /doc/changes/compositor/mr.841.3.md: -------------------------------------------------------------------------------- 1 | main: Also resize on VK_SUBOPTIMAL_KHR. 2 | -------------------------------------------------------------------------------- /doc/changes/misc_features/mr.858.1.md: -------------------------------------------------------------------------------- 1 | u/trace_marker: Add sink categories. 2 | -------------------------------------------------------------------------------- /doc/changes/misc_fixes/mr.785.md: -------------------------------------------------------------------------------- 1 | Make config file reading more robust. 2 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.715.md: -------------------------------------------------------------------------------- 1 | Add small helper function for pushing frames. 2 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.841.3.md: -------------------------------------------------------------------------------- 1 | vulkan: Refactor and tidy extension handling. 2 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.841.4.md: -------------------------------------------------------------------------------- 1 | vulkan: Add support for VK_EXT_robustness2 2 | -------------------------------------------------------------------------------- /doc/changes/compositor/mr.677.md: -------------------------------------------------------------------------------- 1 | comp: Fix layer submission on nvidia tegra. 2 | -------------------------------------------------------------------------------- /doc/changes/drivers/mr.740.md: -------------------------------------------------------------------------------- 1 | vive: Setup the variable tracking for imu fusion. 2 | -------------------------------------------------------------------------------- /doc/changes/drivers/mr.860.md: -------------------------------------------------------------------------------- 1 | vf: Some tidy, frame fixes and tracing support. 2 | -------------------------------------------------------------------------------- /doc/changes/ipc/mr.712.md: -------------------------------------------------------------------------------- 1 | Support systemd socket activation with meson too. 2 | -------------------------------------------------------------------------------- /doc/changes/misc_fixes/mr.737.md: -------------------------------------------------------------------------------- 1 | Ensure we are always initializing our mutexes. 2 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.717.md: -------------------------------------------------------------------------------- 1 | m/3dof: Add assert to catch time traveling drivers. 2 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.841.1.md: -------------------------------------------------------------------------------- 1 | vulkan: Add more functions to vk_bundle struct. 2 | -------------------------------------------------------------------------------- /doc/changes/ipc/mr.694.md: -------------------------------------------------------------------------------- 1 | all: Transfer HMD blend mode, don't drop it on the floor. 2 | -------------------------------------------------------------------------------- /doc/changes/misc_features/mr.858.2.md: -------------------------------------------------------------------------------- 1 | u/sink: Add tracing support to sink functions. 2 | -------------------------------------------------------------------------------- /doc/changes/misc_features/mr.858.3.md: -------------------------------------------------------------------------------- 1 | t/hsv: Add tracing support for timing info. 2 | -------------------------------------------------------------------------------- /nix/rr/call.nix: -------------------------------------------------------------------------------- 1 | (import ../../pinned-nixpkgs.nix {}).callPackage ./unstable.nix {} 2 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.841.5.md: -------------------------------------------------------------------------------- 1 | vulkan: Add code to handle optional device features. 2 | -------------------------------------------------------------------------------- /doc/changes/drivers/mr.691.md: -------------------------------------------------------------------------------- 1 | vive: Add rotation pose prediction to HMD and Controllers 2 | -------------------------------------------------------------------------------- /doc/changes/drivers/mr.715.md: -------------------------------------------------------------------------------- 1 | vf: Show the time on the video test source video server. 2 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.705.1.md: -------------------------------------------------------------------------------- 1 | xrt: Return xrt_result_t from xrt_gfx_provider_create_gl_egl 2 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.810.md: -------------------------------------------------------------------------------- 1 | --- 2 | - issue.61 3 | --- 4 | Add a @ref conventions page. 5 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.841.2.md: -------------------------------------------------------------------------------- 1 | vulkan: Make it possible to create a compute only queue. 2 | -------------------------------------------------------------------------------- /doc/changes/compositor/mr.841.1.md: -------------------------------------------------------------------------------- 1 | render: Prepare for submitting work on the compute queue. 2 | -------------------------------------------------------------------------------- /doc/changes/compositor/mr.841.2.md: -------------------------------------------------------------------------------- 1 | main: Prepare for submitting work on the compute queue. 2 | -------------------------------------------------------------------------------- /doc/changes/ipc/mr.685.md: -------------------------------------------------------------------------------- 1 | Factor out the IPC server mainloop into a per-platform structure. 2 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.715.md: -------------------------------------------------------------------------------- 1 | gui: Add a GUI for recording videos from the Valve Index. 2 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.830.md: -------------------------------------------------------------------------------- 1 | gui: Show git description in `monado-gui` window title. 2 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.847.3.md: -------------------------------------------------------------------------------- 1 | OpenXR: Fill in normalised sub-image offsets and sizes. 2 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.810.md: -------------------------------------------------------------------------------- 1 | Move C++-only functionality into the newly-conventional namespaces. 2 | -------------------------------------------------------------------------------- /doc/changes/drivers/mr.674.md: -------------------------------------------------------------------------------- 1 | vive: Factor out json config parser and reuse it in survive driver. 2 | -------------------------------------------------------------------------------- /doc/changes/misc_features/mr.705.md: -------------------------------------------------------------------------------- 1 | external/glad: Add EGL extension EGL_KHR_no_config_context. 2 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.740.md: -------------------------------------------------------------------------------- 1 | OpenXR: Unreal Engine 4 depth buffer quirk no longer needed. 2 | -------------------------------------------------------------------------------- /vcpkg.json.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2021 Collabora, Ltd 2 | SPDX-License-Identifier: CC0-1.0 3 | -------------------------------------------------------------------------------- /.gitlab-ci/distributions.license: -------------------------------------------------------------------------------- 1 | Copyright 2020, Collabora, Ltd. 2 | 3 | SPDX-License-Identifier: BSL-1.0 -------------------------------------------------------------------------------- /.gitlab-ci/localhost.json.license: -------------------------------------------------------------------------------- 1 | Copyright 2020, Collabora, Ltd. 2 | 3 | SPDX-License-Identifier: BSL-1.0 -------------------------------------------------------------------------------- /doc/changes/drivers/mr.774.md: -------------------------------------------------------------------------------- 1 | --- 2 | - mr.803 3 | --- 4 | wmr: Initial commit of driver, 3DoF only. 5 | -------------------------------------------------------------------------------- /doc/changes/misc_features/mr.785.md: -------------------------------------------------------------------------------- 1 | --- 2 | - issue.82 3 | --- 4 | Add JSON Schema for config files. 5 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.721.2.md: -------------------------------------------------------------------------------- 1 | Add `XRT_ERROR_THREADING_INIT_FAILURE` a new threading related error code. 2 | -------------------------------------------------------------------------------- /cmake/.cmake-format.json.license: -------------------------------------------------------------------------------- 1 | Copyright 2019-2020, Collabora, Ltd. 2 | 3 | SPDX-License-Identifier: BSL-1.0 -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.859.2.md: -------------------------------------------------------------------------------- 1 | t/calibration: Make it possible to select number distortion parameters. 2 | -------------------------------------------------------------------------------- /doc/changes/drivers/mr.741.md: -------------------------------------------------------------------------------- 1 | multi: Enable specifying arbitrary xrt_input_name for querying tracker poses. 2 | -------------------------------------------------------------------------------- /doc/changes/drivers/mr.742.md: -------------------------------------------------------------------------------- 1 | ohmd: Support OpenHMD controllers and specifically the Oculus Touch controller. 2 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.886.md: -------------------------------------------------------------------------------- 1 | OpenXR: Add support for XR_KHR_swapchain_usage_input_attachment_bit. 2 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.704.md: -------------------------------------------------------------------------------- 1 | xrt: Add functionality to disable individual drivers in the configuration file. 2 | -------------------------------------------------------------------------------- /doc/images/in-process.drawio.svg.license: -------------------------------------------------------------------------------- 1 | Copyright 2020, Collabora, Ltd. 2 | 3 | SPDX-License-Identifier: BSL-1.0 -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.839.2.md: -------------------------------------------------------------------------------- 1 | math: Add `math_map_ranges` function, does the same thing as Arduino's `map`. 2 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.847.1.md: -------------------------------------------------------------------------------- 1 | OpenXR: Add prefix to gfx related session functions to improve sorting. 2 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.847.2.md: -------------------------------------------------------------------------------- 1 | OpenXR: Break out end frame handling to it's own file since it's so big. 2 | -------------------------------------------------------------------------------- /src/external/openvr_includes/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Current version 2 | 3 | * Synced on 2020-06-10 `OpenVR SDK 1.12.5` 4 | -------------------------------------------------------------------------------- /src/xrt/ipc/shared/proto.json.license: -------------------------------------------------------------------------------- 1 | Copyright 2018-2020, Collabora, Ltd. 2 | 3 | SPDX-License-Identifier: BSL-1.0 -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.859.1.md: -------------------------------------------------------------------------------- 1 | gui: Various fixes for video handling, null checking and wrong argument orders. 2 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.794.md: -------------------------------------------------------------------------------- 1 | Make eye_relation argument to xrt_device_get_view_pose const, more safety for 2 | everybody. 3 | -------------------------------------------------------------------------------- /doc/example_configs/config_v0.schema.json.license: -------------------------------------------------------------------------------- 1 | Copyright 2021, Collabora, Ltd. 2 | SPDX-License-Identifier: CC0-1.0 3 | -------------------------------------------------------------------------------- /doc/images/out-of-proc.drawio.svg.license: -------------------------------------------------------------------------------- 1 | Copyright 2020, Collabora, Ltd. 2 | 3 | SPDX-License-Identifier: BSL-1.0 4 | -------------------------------------------------------------------------------- /src/xrt/ipc/shared/proto.schema.json.license: -------------------------------------------------------------------------------- 1 | Copyright 2018-2020, Collabora, Ltd. 2 | 3 | SPDX-License-Identifier: BSL-1.0 -------------------------------------------------------------------------------- /doc/changes/big/mr.774.md: -------------------------------------------------------------------------------- 1 | New WinMR driver, the initial commit only adds simple 3DoF support and not 2 | distortion support. 3 | -------------------------------------------------------------------------------- /doc/changes/misc_fixes/mr.735.md: -------------------------------------------------------------------------------- 1 | logging: Fix the first message always getting printed due to un-initialized 2 | variable. 3 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.721.1.md: -------------------------------------------------------------------------------- 1 | Add `xrt_compositor_fence` interface to handle service and client render 2 | syncronisation. 3 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/steamvr.vrsettings.license: -------------------------------------------------------------------------------- 1 | Copyright 2020, Collabora, Ltd. 2 | SPDX-License-Identifier: BSL-1.0 3 | -------------------------------------------------------------------------------- /src/external/stb/stb_image_write.h.license: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Sean Barrett 2 | 3 | SPDX-License-Identifier: MIT OR Unlicense 4 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/bindings/bindings.json.license: -------------------------------------------------------------------------------- 1 | Copyright 2020-2021, Collabora, Ltd. 2 | 3 | SPDX-License-Identifier: BSL-1.0 4 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr/openxr_monado.in.json.license: -------------------------------------------------------------------------------- 1 | Copyright 2018-2020, Collabora, Ltd. 2 | SPDX-License-Identifier: BSL-1.0 3 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/driver.vrdrivermanifest.license: -------------------------------------------------------------------------------- 1 | Copyright 2020, Collabora, Ltd. 2 | SPDX-License-Identifier: BSL-1.0 3 | -------------------------------------------------------------------------------- /doc/changes/compositor/mr.864.md: -------------------------------------------------------------------------------- 1 | multi: Make sure there are at least some predicted data, to avoid asserts in 2 | non-service mode. 3 | -------------------------------------------------------------------------------- /doc/changes/ipc/mr.768.md: -------------------------------------------------------------------------------- 1 | Ensure that functions that require the compositor can't be called if a session 2 | has not been created yet. 3 | -------------------------------------------------------------------------------- /doc/changes/misc_features/mr.695.md: -------------------------------------------------------------------------------- 1 | Implement tracking overrides via wrapper devices and add a tracking override configuration gui. 2 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.688.md: -------------------------------------------------------------------------------- 1 | OpenXR: Ignore XrSystemHandTrackingPropertiesEXT when hand tracking extension 2 | is not enabled. 3 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.859.2.md: -------------------------------------------------------------------------------- 1 | gui: Add support to record from ELP 3D camera and select DepthAI camera 2 | to calibration. 3 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.749.md: -------------------------------------------------------------------------------- 1 | Make `enum xrt_blend_mode` an array instead of a bitfield, so that drivers can specify which one is preferred. -------------------------------------------------------------------------------- /doc/images/monado-input-class-relationships.drawio.svg.license: -------------------------------------------------------------------------------- 1 | Copyright 2020, Collabora, Ltd. 2 | 3 | SPDX-License-Identifier: BSL-1.0 -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | android.useAndroidX = true 5 | 6 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.811.md: -------------------------------------------------------------------------------- 1 | --- 2 | - mr.840 3 | --- 4 | u/trace_marker: Switch from homegrown tracing code to using Percetto/Perfetto. 5 | -------------------------------------------------------------------------------- /doc/changes/compositor/mr.705.md: -------------------------------------------------------------------------------- 1 | client: Handle EGL_NO_CONTEXT_KHR gracefully if the EGLDisplay supports 2 | EGL_KHR_no_config_context. 3 | -------------------------------------------------------------------------------- /doc/changes/drivers/mr.717.md: -------------------------------------------------------------------------------- 1 | psvr: Ensure that timestamps are always after each other, stopping any 2 | time-traveling sample packets. 3 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.735.md: -------------------------------------------------------------------------------- 1 | prober: Change the default logging level to info so that people can see what 2 | drivers are disabled. 3 | -------------------------------------------------------------------------------- /src/meson.build: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | subdir('external') 5 | subdir('xrt') 6 | -------------------------------------------------------------------------------- /src/xrt/drivers/north_star/exampleconfigs/v1_deckx_50cm.json.license: -------------------------------------------------------------------------------- 1 | Copyright 2021, CombineReality 2 | 3 | SPDX-License-Identifier: BSL-1.0 -------------------------------------------------------------------------------- /src/xrt/drivers/north_star/exampleconfigs/v2_lonestar_50cm.json.license: -------------------------------------------------------------------------------- 1 | Copyright 2021, Moses Turner 2 | 3 | SPDX-License-Identifier: BSL-1.0 -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/settings/default.vrsettings: -------------------------------------------------------------------------------- 1 | { 2 | "driver_monado" : { 3 | "enable" : true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.867.md: -------------------------------------------------------------------------------- 1 | Add `use_dedicated_allocation` field to `xrt_image_native` struct to track if 2 | dedicated allocation is required. 3 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/settings/default.vrsettings.license: -------------------------------------------------------------------------------- 1 | Copyright 2020, Collabora, Ltd. 2 | SPDX-License-Identifier: BSL-1.0 3 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.859.1.md: -------------------------------------------------------------------------------- 1 | t/calibration: Add support for RGB image streams, also add a special sink 2 | converter helper to handle this case. 3 | -------------------------------------------------------------------------------- /doc/changes/drivers/mr.836.md: -------------------------------------------------------------------------------- 1 | --- 2 | - mr.831 3 | - mr.837 4 | --- 5 | depthai: Add a new frameserver driver that uses supports the DepthAI cameras. 6 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.686.md: -------------------------------------------------------------------------------- 1 | prober: Minor fixes & tidy commits. Mostly around doc-comments and the string 2 | descriptor getter function. 3 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.705.md: -------------------------------------------------------------------------------- 1 | OpenXR: Support EGL clients sending in no EGLConfig if the EGLDisplay supports 2 | EGL_KHR_no_config_context. 3 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/localization/localization.json.license: -------------------------------------------------------------------------------- 1 | Copyright 2020, Collabora, Ltd. 2 | SPDX-License-Identifier: BSL-1.0 3 | -------------------------------------------------------------------------------- /doc/changes/misc_features/mr.739.md: -------------------------------------------------------------------------------- 1 | --- 2 | - mr.743 3 | --- 4 | More work on the Windows port: fix timing, waiting, sleeping, handling the message queue. 5 | -------------------------------------------------------------------------------- /doc/changes/.proclamation.json.license: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: CC0-1.0 2 | # SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Proclamation contributors 3 | -------------------------------------------------------------------------------- /doc/changes/misc_features/mr.676.md: -------------------------------------------------------------------------------- 1 | --- 2 | - mr.703 3 | - mr.783 4 | - mr.808 5 | - mr.820 6 | - mr.817 7 | --- 8 | More improvements to the Android port. 9 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.800.md: -------------------------------------------------------------------------------- 1 | Add XRT_ERROR_IPC_SESSION_ALREADY_CREATED error message to signal that a session 2 | has already been created on this connection. 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: Copyright 2010 the original author or authors. 2 | SPDX-License-Identifier: Apache-2.0 3 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | add_subdirectory(external) 5 | add_subdirectory(xrt) 6 | -------------------------------------------------------------------------------- /doc/changes/big/.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: CC0-1.0 2 | # SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Proclamation contributors 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /doc/changes/ipc/.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: CC0-1.0 2 | # SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Proclamation contributors 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /doc/changes/xrt/.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: CC0-1.0 2 | # SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Proclamation contributors 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /doc/example_configs/config_v0.northstar_lonestar.json.license: -------------------------------------------------------------------------------- 1 | Copyright 2021, Moses Turner 2 | Copyright 2021, Collabora, Ltd. 3 | SPDX-License-Identifier: CC0-1.0 4 | -------------------------------------------------------------------------------- /src/xrt/drivers/north_star/exampleconfigs/v2_deckx_50cm.json.license: -------------------------------------------------------------------------------- 1 | Copyright 2021, Moses Turner 2 | Copyright 2021, Nova King 3 | 4 | SPDX-License-Identifier: BSL-1.0 -------------------------------------------------------------------------------- /src/xrt/targets/openxr/libopenxr.def: -------------------------------------------------------------------------------- 1 | ; Copyright 2019, Collabora, Ltd. 2 | ; SPDX-License-Identifier: BSL-1.0 3 | EXPORTS 4 | xrNegotiateLoaderRuntimeInterface 5 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: CC0-1.0 2 | # SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Proclamation contributors 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /doc/changes/compositor/.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: CC0-1.0 2 | # SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Proclamation contributors 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /doc/changes/drivers/.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: CC0-1.0 2 | # SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Proclamation contributors 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /doc/changes/misc_fixes/.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: CC0-1.0 2 | # SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Proclamation contributors 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.705.2.md: -------------------------------------------------------------------------------- 1 | --- 2 | - mr.768 3 | --- 4 | xrt: Add XRT_ERROR_EGL_CONFIG_MISSING error, to handle missing config from 5 | EGL compositor creation call. 6 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.847.md: -------------------------------------------------------------------------------- 1 | Send down sub-image offsets and sizes in normalised form, this makes it so that 2 | compositor does not need to track the size of swapchains. 3 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr/openxr_monado.in.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_format_version": "1.0.0", 3 | "runtime": { 4 | "library_path": "@runtime_path@" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /doc/changes/misc_features/.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: CC0-1.0 2 | # SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Proclamation contributors 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /doc/changes/misc_features/mr.697.2.md: -------------------------------------------------------------------------------- 1 | util: Add frame timing helper code designed to use Vulkan display timing 2 | extensions to get proper frame timing in the compositor. 3 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: CC0-1.0 2 | # SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Proclamation contributors 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.768.md: -------------------------------------------------------------------------------- 1 | Add new IPC session not created error `XRT_ERROR_IPC_SESSION_NOT_CREATED`, as 2 | some functions can not be called without first creating a session. 3 | -------------------------------------------------------------------------------- /src/xrt/include/meson.build: -------------------------------------------------------------------------------- 1 | # Copyright 2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | xrt_include = include_directories('.') 5 | 6 | subdir('xrt') 7 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_error.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_off.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_ready.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.825.md: -------------------------------------------------------------------------------- 1 | t/fm: Add simple FrameMat that wraps a cv::Mat, this allows us to easily pass 2 | cv::Mat's around without the C code needing to know about OpenCV. 3 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.759.md: -------------------------------------------------------------------------------- 1 | OpenXR: Use new multi compositor controls to set visibility and z_order if 2 | available. This is needed for when we are not in service mode. 3 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_ready_low.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_searching.gif.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_standby.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_error.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_off.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_ready.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/localization/localization.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "language_tag": "en_US", 4 | "monado_controller" : "Monado Driver Controller" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr_android/config/custom_license_mappings.prop: -------------------------------------------------------------------------------- 1 | # Copyright 2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | javax_annotation__jsr250_api:cddl_1_0 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_ready_alert.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_searching_alert.gif.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_ready_alert.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_ready_low.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_searching.gif.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_standby.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /doc/changes/compositor/mr.827.md: -------------------------------------------------------------------------------- 1 | client: Use the EGL compositor's display in swapchain, previously it tried to 2 | use the current one, which when running on a new thread would explode. 3 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/controller_status_error.png -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/controller_status_off.png -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_ready.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/controller_status_ready.png -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_searching_alert.gif.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | -------------------------------------------------------------------------------- /.gitlab-ci/ubuntu_groovy_container_prep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2021, Collabora, Ltd. and the Monado contributors 3 | # SPDX-License-Identifier: BSL-1.0 4 | 5 | # Nothing really needed. 6 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_standby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/controller_status_standby.png -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_off.png -------------------------------------------------------------------------------- /doc/changes/.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: CC0-1.0 2 | # SPDX-FileCopyrightText: 2021 Collabora, Ltd. 3 | 4 | # Changelog fragments will never start with a header. 5 | MD041: false 6 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_ready_low.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/controller_status_ready_low.png -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_searching.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/controller_status_searching.gif -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_error.png -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_ready.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_ready.png -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_ready_alert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/controller_status_ready_alert.png -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_standby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_standby.png -------------------------------------------------------------------------------- /doc/changes/misc_features/mr.697.1.md: -------------------------------------------------------------------------------- 1 | util: Add trace marker support code, this code uses the Linux trace_marker 2 | kernel support to enable Monado to trace both function calls and other async 3 | events. 4 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr_android/src/main/res/.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: CC0-1.0 2 | # SPDX-FileCopyrightText: 2020 Collabora, Ltd. and the Monado contributors 3 | 4 | bsl_1_0.txt 5 | cddl_1_0.txt 6 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/driver.vrresources.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2015, Valve Corporation 2 | SPDX-FileCopyrightText: 2020, Collabora, Ltd. 3 | 4 | SPDX-License-Identifier: BSD-3-Clause 5 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/controller_status_searching_alert.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/controller_status_searching_alert.gif -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_ready_alert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_ready_alert.png -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_ready_low.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_ready_low.png -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_searching.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_searching.gif -------------------------------------------------------------------------------- /doc/changes/compositor/mr.833.md: -------------------------------------------------------------------------------- 1 | main: Do not list VK_FORMAT_A2B10G10R10_UNORM_PACK32 as a supported format, it's 2 | not enough to show linear colours without banding but isn't used that often so 3 | do not list it. 4 | -------------------------------------------------------------------------------- /doc/changes/drivers/mr.839.md: -------------------------------------------------------------------------------- 1 | north_star: 2 | - Upstreams Moses Turner's "VIPD" distortion. 3 | - Fixes the FOV calc on the v1/3D distortion. 4 | - General improvement of code organization. 5 | - Improved JSON parsing. 6 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_searching_alert.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/monado/HEAD/src/xrt/targets/steamvr_drv/resources/icons/headset_monado_status_searching_alert.gif -------------------------------------------------------------------------------- /doc/changes/compositor/mr.767.md: -------------------------------------------------------------------------------- 1 | --- 2 | - issue.120 3 | - mr.787 4 | --- 5 | main: Make it possible to create the swapchain later when actually needed, 6 | and have the swapchain be in a non-ready state that stops drawing. 7 | -------------------------------------------------------------------------------- /doc/changes/misc_features/mr.715.md: -------------------------------------------------------------------------------- 1 | a/gst: Add a small and fairly dumb framework for integrating gstreamer pipelines 2 | into Monado pipelines. Enough to be able to push frames into it and use various 3 | encoder elements. 4 | -------------------------------------------------------------------------------- /.gitlab-ci/ndk_container_prep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018-2020, Collabora, Ltd. and the Monado contributors 3 | # SPDX-License-Identifier: BSL-1.0 4 | 5 | ( 6 | cd $(dirname $0) 7 | bash ./install-ndk.sh 8 | ) 9 | -------------------------------------------------------------------------------- /.gitlab-ci/arch_container_prep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2018-2020, Collabora, Ltd. and the Monado contributors 3 | # SPDX-License-Identifier: BSL-1.0 4 | 5 | ( 6 | cd $(dirname $0) 7 | bash ./build-openxr-openhmd.sh 8 | ) 9 | -------------------------------------------------------------------------------- /doc/changes/ipc/mr.721.md: -------------------------------------------------------------------------------- 1 | --- 2 | - mr.754 3 | - mr.768 4 | - mr.800 5 | - mr.846 6 | --- 7 | Now that there is a interface that allows the compositor to support 8 | multi-client rendering use that instead of doing our own rendering. 9 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.721.5.md: -------------------------------------------------------------------------------- 1 | Pass `XrFrameEndInfo::displayTime` to `xrt_compositor::layer_begin` so that the 2 | compositor can correctly schedule frames, most importantly do not display them 3 | too early that might lead to stutter. 4 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/driver.vrdrivermanifest: -------------------------------------------------------------------------------- 1 | { 2 | "alwaysActivate": false, 3 | "name" : "monado", 4 | "directory" : "", 5 | "resourceOnly" : false, 6 | 7 | "hmd_presence" : 8 | [ 9 | "*.*" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /.gitlab-ci/ubuntu_focal_container_prep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018-2020, Collabora, Ltd. and the Monado contributors 3 | # SPDX-License-Identifier: BSL-1.0 4 | ( 5 | cd $(dirname $0) 6 | bash ./build-openxr-openhmd.sh 7 | ) 8 | -------------------------------------------------------------------------------- /src/external/jnipp/dotest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | ( 4 | cd $(dirname $0) 5 | export JAVA_HOME=/home/ryan/apps/android-studio/jre/ 6 | make "$@" 7 | if [ -x ./test ]; then 8 | ./test 9 | fi 10 | ) 11 | -------------------------------------------------------------------------------- /src/xrt/ipc/android/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "monado", 3 | "version-string": "21.0", 4 | "dependencies": [ 5 | "eigen3", 6 | "pthreads", 7 | "libusb", 8 | "hidapi", 9 | "zlib" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /.gitlab-ci/distributions: -------------------------------------------------------------------------------- 1 | Origin: monado.freedesktop.org 2 | Description: Monado CI apt repository 3 | Codename: ${DISTRO} 4 | Architectures: amd64 i386 source 5 | Components: main 6 | Tracking: minimal 7 | SignWith: ${MONADO_GPG_FINGERPRINT} 8 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.721.3.md: -------------------------------------------------------------------------------- 1 | Add alternative functions to `xrt_compositor::wait_frame` called 2 | `xrt_compositor::predict_frame` and `xrt_compositor::mark_frame` these allow one 3 | to do frame timing without having to block on the service side. 4 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.721.3.md: -------------------------------------------------------------------------------- 1 | u/timing: A rather large refactor that turns makes the rendering timing helper 2 | be more like the frame timing helper. This also makes the rendering timing 3 | adjust the frame timing of the app so that latency is reduced. 4 | -------------------------------------------------------------------------------- /src/xrt/compositor/shaders/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | # CMakeLists.txt required for CMake to create the shaders/ directory in the build tree. 5 | # Generated shaders will be placed there. 6 | -------------------------------------------------------------------------------- /scripts/monado-codespell.exclude: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2019-2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | * @author Simon Ser 5 | #include 6 | if (stream.parm.capture.capability & V4L2_CAP_TIMEPERFRAME) { 7 | -------------------------------------------------------------------------------- /src/xrt/ipc/android/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Copyright 2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | # see http://developer.android.com/guide/developing/tools/proguard.html 4 | # Trying to keep most of them in source code annotations and let Gradle do the work 5 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/android/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Copyright 2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | # see http://developer.android.com/guide/developing/tools/proguard.html 4 | # Trying to keep most of them in source code annotations and let Gradle do the work 5 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.723.md: -------------------------------------------------------------------------------- 1 | --- 2 | - mr.754 3 | - mr.807 4 | --- 5 | Make @ref xrt_swapchain be reference counted. This will greatly help with 6 | handling swapchains for multiple clients in the compositor rendering pipeline 7 | where a client might go away while the compositor is using it. 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed May 05 16:48:28 CDT 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/xrt/include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | add_subdirectory(xrt) 5 | 6 | add_library(xrt-interfaces INTERFACE) 7 | target_include_directories(xrt-interfaces INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 8 | -------------------------------------------------------------------------------- /doc/changes/ipc/mr.565.md: -------------------------------------------------------------------------------- 1 | ipc: Use libbsd pidfile to detect running Monado instances. 2 | Enables automatically deleting stale socket files. 3 | The socket file is now placed in $XDG_RUNTIME_DIR/monado_comp_ipc by default 4 | or falls back to /tmp/monado_comp_ipc again if $XDG_RUNTIME_DIR is not set. 5 | -------------------------------------------------------------------------------- /cmake/.cmake-format.json: -------------------------------------------------------------------------------- 1 | { 2 | "tab_size": 4, 3 | "dangle_parens": false, 4 | "line_ending": "unix", 5 | "command_case": "canonical", 6 | "keyword_case": "upper", 7 | "first_comment_is_literal": true, 8 | "literal_comment_pattern": "(^[.]rst)|(#+)", 9 | "enable_markup": false 10 | } 11 | -------------------------------------------------------------------------------- /doc/changes/auxiliary/mr.839.1.md: -------------------------------------------------------------------------------- 1 | util: added `u_device_2d_extents` and `u_setup_2d_extents_split_side_by_side` - 2 | this is hopefully to eliminate confusion: the FOV you had to give to 3 | `u_device_split_side_by_side` was just a dummy value, but some people thought 4 | it was the actual headset's FOV. 5 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.697.md: -------------------------------------------------------------------------------- 1 | Added frame timing code that when the underlying vulkan driver supports the 2 | VK_GOOGLE_display_timing extension greatly improves the timing accerecy of the 3 | compositor. Along with this tracing code was added to better help use understand 4 | what was happening during a frame. 5 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/ogl/egl_api.c: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief EGL API wrapper. 6 | * @author Ryan Pavlik 7 | * @ingroup aux_ogl 8 | */ 9 | 10 | #include "../../external/glad/src/egl.c" 11 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/ogl/ogl_api.c: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief OpenGL API wrapper. 6 | * @author Jakob Bornecrantz 7 | * @ingroup aux_ogl 8 | */ 9 | 10 | #include "../../external/glad/src/gl.c" 11 | -------------------------------------------------------------------------------- /src/xrt/state_trackers/meson.build: -------------------------------------------------------------------------------- 1 | # Copyright 2019, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | st_include = include_directories('.') 5 | 6 | subdir('gui') 7 | subdir('oxr') 8 | subdir('prober') 9 | 10 | if get_option('steamvr_plugin') 11 | subdir('steamvr_drv') 12 | endif 13 | -------------------------------------------------------------------------------- /src/xrt/targets/android_common/src/main/res/values/restart_runtime_strings.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | Restart 7 | 8 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr_android/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | Monado OpenXR 9 | 10 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | 4 | rootProject.name = 'monado' 5 | 6 | include ':src:xrt:auxiliary:android' 7 | include ':src:xrt:ipc:android' 8 | include ':src:xrt:targets:android_common' 9 | include ':src:xrt:targets:openxr_android' 10 | -------------------------------------------------------------------------------- /tests/tests_main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Translation unit to build Catch2 main. 6 | * @author Ryan Pavlik 7 | */ 8 | 9 | #define CATCH_CONFIG_MAIN 10 | #include "catch/catch.hpp" 11 | -------------------------------------------------------------------------------- /doc/changes/state_trackers/mr.689.md: -------------------------------------------------------------------------------- 1 | --- 2 | - mr.689 3 | - mr.690 4 | - mr.740 5 | --- 6 | OpenXR: ~~Add quirk for UnrealEngine4.27 to disable depth/stencil buffer to work 7 | around a bug where Unreal would forget to call acquire before wait image.~~ 8 | This has been fixed in UnrealEngine and is no longer needed. 9 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/ogl/egl_api.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief EGL API wrapper header. 6 | * @author Ryan Pavlik 7 | * @ingroup aux_ogl 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "glad/egl.h" 13 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr/libopenxr.version: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2020, Collabora, Ltd. 3 | * SPDX-License-Identifier: BSL-1.0 4 | */ 5 | 6 | OPENXR { 7 | global: xrNegotiateLoaderRuntimeInterface; # Only one exported symbol. 8 | local: *; # Hide everything else. 9 | }; 10 | -------------------------------------------------------------------------------- /.gitlab-ci/debian_container_prep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018-2020, Collabora, Ltd. and the Monado contributors 3 | # SPDX-License-Identifier: BSL-1.0 4 | 5 | ( 6 | cd $(dirname $0) 7 | bash ./install-cross.sh 8 | ) 9 | ( 10 | cd $(dirname $0) 11 | bash ./build-openxr-openhmd.sh 12 | ) 13 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/ogl/ogl_api.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief OpenGL API wrapper header. 6 | * @author Jakob Bornecrantz 7 | * @ingroup aux_ogl 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "glad/gl.h" 13 | -------------------------------------------------------------------------------- /doc/changes/misc_features/mr.809.md: -------------------------------------------------------------------------------- 1 | For code that is implemented in C++, note that the default standard mode is now C++17 across all platforms and modules, instead of a mix of 14 and 17 like before. The CI remains the decider of what functionality is available, as it contains the oldest distribution we support (Debian Buster). 2 | -------------------------------------------------------------------------------- /doc/changes/xrt/mr.721.4.md: -------------------------------------------------------------------------------- 1 | Add `xrt_multi_compositor_control` that allows the `xrt_system_compositor` to 2 | expose a interface that the IPC layer can use to manage multiple clients 3 | without having to do the rendering. This allows us to move a lot of the code 4 | out the IPC layer and make it more about just passing calls. 5 | -------------------------------------------------------------------------------- /.gitlab-ci/localhost.json: -------------------------------------------------------------------------------- 1 | { 2 | "+hooks": [ 3 | ], 4 | "-hooks": [ 5 | "gpg", 6 | "allowed-distribution", 7 | "suite-mismatch", 8 | "lintian" 9 | ], 10 | "incoming": "${INCOMING}", 11 | "meta": "debian", 12 | "method": "local", 13 | "run_lintian": false 14 | } 15 | -------------------------------------------------------------------------------- /src/xrt/state_trackers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | if(XRT_HAVE_OPENGL) 5 | add_subdirectory(gui) 6 | endif() 7 | add_subdirectory(oxr) 8 | add_subdirectory(prober) 9 | 10 | if(XRT_FEATURE_STEAMVR_PLUGIN) 11 | add_subdirectory(steamvr_drv) 12 | endif() 13 | -------------------------------------------------------------------------------- /.gitlab-ci/install-ndk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2018-2020, Collabora, Ltd. and the Monado contributors 3 | # SPDX-License-Identifier: BSL-1.0 4 | VERSION=r21 5 | FN=android-ndk-${VERSION}-linux-x86_64.zip 6 | wget https://dl.google.com/android/repository/$FN 7 | unzip $FN -d /opt 8 | mv /opt/android-ndk-${VERSION} /opt/android-ndk 9 | -------------------------------------------------------------------------------- /src/external/jnipp/jnipp.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/xrt/include/xrt/xrt_config_drivers.h.cmake_in: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief What drivers are we building. 6 | * @author Jakob Bornecrantz 7 | * @ingroup xrt_iface 8 | */ 9 | 10 | #pragma once 11 | 12 | @FILE_CONTENTS@ 13 | -------------------------------------------------------------------------------- /doc/changes/compositor/mr.721.md: -------------------------------------------------------------------------------- 1 | --- 2 | - mr.754 3 | - mr.759 4 | --- 5 | multi: Introduce a new multi client compositor layer, this allows rendering code 6 | to be moved from the IPC layer into the compositor, separating concerns. The 7 | main compositor always uses the multi client compositor, as it gives us a async 8 | render loop for free. 9 | -------------------------------------------------------------------------------- /src/external/jnipp/tests/tests.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/xrt/state_trackers/gui/gui_stb.c: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Compile the STB image write implementation. 6 | * @author Jakob Bornecrantz 7 | */ 8 | 9 | #define STB_IMAGE_WRITE_IMPLEMENTATION 10 | #include "stb_image_write.h" 11 | -------------------------------------------------------------------------------- /src/external/jnipp/android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/xrt/.editorconfig: -------------------------------------------------------------------------------- 1 | # To use this config on your editor, follow the instructions at: 2 | # http://editorconfig.org 3 | 4 | # SPDX-License-Identifier: CC0-1.0 5 | # SPDX-FileCopyrightText: 2018-2021 Collabora, Ltd. and the Monado contributors 6 | 7 | [*] 8 | charset = utf-8 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/steamvr.vrsettings: -------------------------------------------------------------------------------- 1 | { 2 | "jsonid" : "vrsettings", 3 | "driver_lighthouse": { 4 | "enable": false 5 | }, 6 | "driver_oculus": { 7 | "enable": false 8 | }, 9 | "driver_oculus_legacy": { 10 | "enable": false 11 | }, 12 | "driver_monado" : { 13 | "enable": true 14 | }, 15 | "version" : "1" 16 | } 17 | -------------------------------------------------------------------------------- /src/xrt/include/xrt/xrt_config_android.h.cmake_in: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Android defines. 6 | * @author Ryan Pavlik 7 | * @ingroup xrt_iface 8 | */ 9 | 10 | #pragma once 11 | 12 | #cmakedefine XRT_ANDROID_PACKAGE "@XRT_ANDROID_PACKAGE@" 13 | -------------------------------------------------------------------------------- /src/xrt/meson.build: -------------------------------------------------------------------------------- 1 | # Copyright 2019, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | xrt_include = include_directories('include') 5 | 6 | subdir('include') 7 | subdir('auxiliary') 8 | subdir('drivers') 9 | subdir('compositor') 10 | subdir('state_trackers') 11 | if get_option('service') 12 | subdir('ipc') 13 | endif 14 | subdir('targets') 15 | -------------------------------------------------------------------------------- /src/xrt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | add_subdirectory(include) 5 | add_subdirectory(auxiliary) 6 | add_subdirectory(drivers) 7 | add_subdirectory(compositor) 8 | add_subdirectory(state_trackers) 9 | add_subdirectory(targets) 10 | 11 | if(XRT_FEATURE_SERVICE) 12 | add_subdirectory(ipc) 13 | endif() 14 | -------------------------------------------------------------------------------- /src/xrt/state_trackers/dev/README.md: -------------------------------------------------------------------------------- 1 | # OpenXR device layer integrator 2 | 3 | ```txt 4 | Copyright 2019, Collabora, Ltd. 5 | SPDX-License-Identifier: BSL-1.0 6 | ``` 7 | 8 | This is where the device layer integrator code will go. It takes one or more 9 | xrt_device and plugs that into the OpenXR device layer interface, once the 10 | device layer has been finalized. 11 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/util/u_misc.c: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Very small misc utils. 6 | * @author Jakob Bornecrantz 7 | * @ingroup aux_util 8 | */ 9 | 10 | #include "util/u_misc.h" 11 | 12 | 13 | int 14 | u_silence_pedantic_warning() 15 | { 16 | return 42; 17 | } 18 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/util/u_git_tag.c.in: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Holds the git hash of Monado. 6 | * @author Jakob Bornecrantz 7 | * @ingroup aux_util 8 | */ 9 | 10 | #include "util/u_git_tag.h" 11 | 12 | #define GIT_DESC "@GIT_DESC@" 13 | const char u_git_tag[] = GIT_DESC; 14 | -------------------------------------------------------------------------------- /src/xrt/targets/android_common/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | An XR Runtime, powered by Monado 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/xrt/targets/service-lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | 5 | add_library(monado-service MODULE 6 | service_target.cpp 7 | ) 8 | 9 | target_link_libraries(monado-service PRIVATE 10 | aux_util 11 | st_prober 12 | ipc_server 13 | comp_main 14 | target_lists 15 | target_instance 16 | xrt-external-jni-wrap 17 | ) 18 | -------------------------------------------------------------------------------- /src/xrt/targets/android_common/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | #2196F3 7 | #3F51B5 8 | #FF9800 9 | 10 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr_android/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | #2196F3 8 | #3F51B5 9 | #FF9800 10 | 11 | -------------------------------------------------------------------------------- /src/xrt/targets/service/monado.in.socket: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSL-1.0 2 | # SPDX-FileCopyrightText: 2020, Collabora, Ltd. 3 | 4 | [Unit] 5 | Description=Monado XR service module connection socket @extra_desc@ 6 | ConditionUser=!root 7 | Conflicts=@conflicts@.socket 8 | 9 | [Socket] 10 | ListenStream=%t/monado_comp_ipc 11 | RemoveOnStop=true 12 | 13 | [Install] 14 | WantedBy=sockets.target 15 | -------------------------------------------------------------------------------- /scripts/get-ht-models.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2021, Collabora, Ltd. 3 | # SPDX-License-Identifier: BSL-1.0 4 | # Author: Moses Turner 5 | 6 | if ! type "git-lfs" > /dev/null; then 7 | echo "Install git-lfs!" 8 | exit 9 | fi 10 | 11 | mkdir -p ~/.local/share/monado 12 | cd ~/.local/share/monado 13 | git clone https://gitlab.freedesktop.org/monado/utilities/hand-tracking-models -------------------------------------------------------------------------------- /src/xrt/auxiliary/tracking/t_kalman.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Single compiled file for all kalman filter using source. 6 | * 7 | * Centralizes the build cost in one place. 8 | * @author Ryan Pavlik 9 | * @ingroup aux_tracking 10 | */ 11 | 12 | #include "tracking/t_tracker_psmv_fusion.cpp" 13 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr_android/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Copyright 2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | # see http://developer.android.com/guide/developing/tools/proguard.html 4 | # Trying to keep most of them in source code annotations and let Gradle do the work 5 | 6 | # For library auto-detection in AboutLibraries 7 | -keep class .R 8 | -keep class **.R$* { 9 | ; 10 | } 11 | -------------------------------------------------------------------------------- /src/xrt/state_trackers/prober/p_documentation.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Documentation. 6 | * @author Jakob Bornecrantz 7 | * @ingroup st_prober 8 | */ 9 | 10 | #pragma once 11 | 12 | 13 | /*! 14 | * @defgroup st_prober Prober and device management code 15 | * 16 | * Probing code. 17 | * 18 | * @ingroup xrt 19 | */ 20 | -------------------------------------------------------------------------------- /src/xrt/targets/ctl/meson.build: -------------------------------------------------------------------------------- 1 | # Copyright 2019, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | ctl = executable( 5 | 'monado-ctl', 6 | files( 7 | 'main.c', 8 | ) + [ ipc_generated_client_header_target ], 9 | link_whole: [ 10 | lib_ipc_client, 11 | ], 12 | include_directories: [ 13 | xrt_include, 14 | aux_include, 15 | ipc_include, 16 | ], 17 | dependencies: [ 18 | ], 19 | install: true, 20 | ) 21 | -------------------------------------------------------------------------------- /src/xrt/state_trackers/gui/gui_imgui.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Imgui integration for gui. 6 | * @author Jakob Bornecrantz 7 | * @ingroup gui 8 | */ 9 | 10 | #pragma once 11 | 12 | #define CIMGUI_DEFINE_ENUMS_AND_STRUCTS 13 | #include "imgui/cimgui.h" 14 | #include "imgui/cimplot.h" 15 | #include "imgui_monado/cimgui_monado.h" 16 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr/install_active_runtime.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | # Copyright 2019, Drew DeVault 3 | # SPDX-License-Identifier: BSL-1.0 4 | # 5 | # Used by the Meson build only. 6 | 7 | sysconfdir="${DESTDIR-}"/"$1" 8 | manifest="$2" 9 | xrversion="$3" 10 | 11 | runtime_path="$sysconfdir"/xdg/openxr/"$xrversion"/active_runtime.json 12 | 13 | mkdir -p "$sysconfdir"/xdg/openxr/"$xrversion" 14 | ln -sf "$manifest" "$runtime_path" 15 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/util/u_git_tag.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Holds the git hash of Monado. 6 | * @author Jakob Bornecrantz 7 | * @ingroup aux_util 8 | */ 9 | 10 | #pragma once 11 | 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | 18 | extern const char u_git_tag[]; 19 | 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | -------------------------------------------------------------------------------- /src/xrt/targets/ctl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2020-2021, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | 5 | add_executable(monado-ctl 6 | main.c 7 | ) 8 | add_sanitizers(monado-ctl) 9 | 10 | target_include_directories(monado-ctl PRIVATE 11 | ipc 12 | ) 13 | 14 | target_link_libraries(monado-ctl PRIVATE 15 | aux_util 16 | ipc_client 17 | ) 18 | 19 | install(TARGETS monado-ctl 20 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 21 | ) 22 | 23 | -------------------------------------------------------------------------------- /src/external/jnipp/android/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 3.4.1) 2 | 3 | GET_FILENAME_COMPONENT(root_dir "../.." ABSOLUTE) 4 | 5 | LINK_DIRECTORIES("${root_dir}/${ANDROID_ABI}") 6 | 7 | SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${root_dir}/${ANDROID_ABI}") 8 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DANDROID_STL=c++_static -std=gnu++11 -fexceptions") 9 | 10 | FILE(GLOB sources ../*.cpp ../common/*.cpp ../android/*.cpp) 11 | 12 | ADD_LIBRARY(jnipp SHARED ${sources}) 13 | -------------------------------------------------------------------------------- /src/xrt/include/xrt/xrt_config.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Includes all config headers, use separate headers instead. 6 | * @author Jakob Bornecrantz 7 | * @ingroup xrt_iface 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "xrt/xrt_config_os.h" 13 | #include "xrt/xrt_config_drivers.h" 14 | #include "xrt/xrt_config_have.h" 15 | #include "xrt/xrt_config_vulkan.h" 16 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/math/m_documentation.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Header with just documentation. 6 | * @author Ryan Pavlik 7 | * @ingroup aux_math 8 | */ 9 | 10 | #pragma once 11 | 12 | 13 | namespace xrt::auxiliary { 14 | //! C++-only functionality in the Math helper library 15 | namespace math { 16 | 17 | } // namespace math 18 | } // namespace xrt::auxiliary 19 | -------------------------------------------------------------------------------- /src/xrt/state_trackers/steamvr_drv/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | set(OVRD_SOURCE_FILES 5 | ovrd_driver.cpp 6 | ovrd_interface.h 7 | ) 8 | 9 | add_library(st_ovrd STATIC 10 | ${OVRD_SOURCE_FILES} 11 | ) 12 | target_include_directories(st_ovrd INTERFACE 13 | ${CMAKE_CURRENT_SOURCE_DIR} 14 | ) 15 | target_link_libraries(st_ovrd PRIVATE 16 | xrt-interfaces 17 | xrt-external-openvr 18 | aux_math 19 | aux_generated_bindings 20 | ) 21 | -------------------------------------------------------------------------------- /src/xrt/targets/android_common/src/main/res/values/notification_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | %1$s Runtime 7 | An application is currently running that is using the %1$s service. 8 | Exit Runtime 9 | Settings 10 | 11 | -------------------------------------------------------------------------------- /src/external/android-jni-wrap/wrap/android.provider.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | // Author: Ryan Pavlik 4 | 5 | #include "android.provider.h" 6 | 7 | namespace wrap { 8 | namespace android::provider { 9 | Settings::Meta::Meta() 10 | : MetaBase(Settings::getTypeName()), 11 | ACTION_VR_LISTENER_SETTINGS(classRef(), "ACTION_VR_LISTENER_SETTINGS") {} 12 | } // namespace android::provider 13 | } // namespace wrap 14 | -------------------------------------------------------------------------------- /src/external/jnipp/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_headers { 3 | name: "libjnipp-headers", 4 | export_include_dirs: ["."], 5 | vendor_available: true, 6 | } 7 | 8 | cc_library_static { 9 | name: "libjnipp", 10 | 11 | srcs: [ 12 | "jnipp.cpp", 13 | ], 14 | 15 | cppflags: [ "-fexceptions" ], 16 | header_libs: [ 17 | "libjnipp-headers", 18 | ], 19 | export_header_lib_headers: [ 20 | "libjnipp-headers" 21 | ], 22 | vendor_available: true, 23 | } 24 | -------------------------------------------------------------------------------- /src/external/android-jni-wrap/wrap/android.graphics.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | // Author: Ryan Pavlik 4 | 5 | #include "android.graphics.h" 6 | 7 | namespace wrap { 8 | namespace android::graphics { 9 | Point::Meta::Meta() 10 | : MetaBaseDroppable(Point::getTypeName()), x(classRef(), "x"), 11 | y(classRef(), "y") { 12 | MetaBaseDroppable::dropClassRef(); 13 | } 14 | } // namespace android::graphics 15 | } // namespace wrap 16 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/math/m_hash.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Hashing function. 6 | * @author Jakob Bornecrantz 7 | * @ingroup aux_math 8 | */ 9 | 10 | #include "math/m_api.h" 11 | #include 12 | 13 | 14 | extern "C" size_t 15 | math_hash_string(const char *str_c, size_t length) 16 | { 17 | std::string str = std::string(str_c, length); 18 | std::hash str_hash; 19 | return str_hash(str); 20 | } 21 | -------------------------------------------------------------------------------- /src/xrt/drivers/illixr/illixr_component.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, The Board of Trustees of the University of Illinois. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief ILLIXR plugin 6 | * @author RSIM Group 7 | * @ingroup drv_illixr 8 | */ 9 | 10 | #pragma once 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | void * 17 | illixr_monado_create_plugin(void *pb); 18 | struct xrt_pose 19 | illixr_read_pose(); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # To use this config on your editor, follow the instructions at: 2 | # http://editorconfig.org 3 | 4 | # SPDX-License-Identifier: CC0-1.0 5 | # SPDX-FileCopyrightText: 2018-2021 Collabora, Ltd. and the Monado contributors 6 | 7 | root = true 8 | 9 | [*] 10 | charset = utf-8 11 | insert_final_newline = true 12 | 13 | [*.{c,h,cpp}] 14 | indent_style = tab 15 | indent_size = 8 16 | max_line_length = 120 17 | 18 | [*.py] 19 | indent_size = 4 20 | 21 | [*.html] 22 | indent_size = 2 23 | 24 | [*.json] 25 | indent_size = 4 26 | -------------------------------------------------------------------------------- /src/xrt/targets/common/target_lists.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Common things to pull into a target. 6 | * @author Jakob Bornecrantz 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "xrt/xrt_prober.h" 12 | 13 | extern struct xrt_prober_entry target_entry_list[]; 14 | extern struct xrt_prober_entry *target_entry_lists[]; 15 | extern xrt_auto_prober_creator target_auto_list[]; 16 | extern struct xrt_prober_entry_lists target_lists; 17 | -------------------------------------------------------------------------------- /src/xrt/state_trackers/steamvr_drv/meson.build: -------------------------------------------------------------------------------- 1 | # Copyright 2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | st_ovrd_include = include_directories('.') 5 | 6 | lib_st_ovrd = static_library( 7 | 'st_ovrd', 8 | files( 9 | 'ovrd_driver.cpp', 10 | 'ovrd_interface.h' 11 | ), 12 | include_directories: [ 13 | openvr_include, 14 | st_include, # Sigh debian meson requires this. 15 | xrt_include, 16 | ], 17 | dependencies: [aux_util, aux_generated_bindings], 18 | c_args: compile_args, 19 | cpp_args: compile_args, 20 | ) 21 | -------------------------------------------------------------------------------- /src/external/android-jni-wrap/wrap/android.provider.impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | // Author: Ryan Pavlik 4 | // Inline implementations: do not include on its own! 5 | 6 | #pragma once 7 | 8 | namespace wrap { 9 | namespace android::provider { 10 | inline std::string Settings::ACTION_VR_LISTENER_SETTINGS() { 11 | return get(Meta::data().ACTION_VR_LISTENER_SETTINGS, Meta::data().clazz()); 12 | } 13 | 14 | } // namespace android::provider 15 | } // namespace wrap 16 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/os/os_documentation.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Documentation. 6 | * @author Jakob Bornecrantz 7 | * @ingroup aux_os 8 | */ 9 | 10 | #pragma once 11 | 12 | 13 | /*! 14 | * @defgroup aux_os OS-Wrappers 15 | * @ingroup aux 16 | * 17 | * @brief Wrapper around OS functions and structs. 18 | */ 19 | 20 | /*! 21 | * @dir auxiliary/os 22 | * @ingroup aux 23 | * 24 | * @brief Wrapper around OS functions and structs. 25 | */ 26 | -------------------------------------------------------------------------------- /src/xrt/drivers/survive/survive_driver.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: Apache-2.0 3 | /*! 4 | * @file 5 | * @brief Adapter to Libsurvive. 6 | * @author Christoph Haag 7 | * @ingroup drv_survive 8 | */ 9 | 10 | 11 | int 12 | survive_device_autoprobe(struct xrt_auto_prober *xap, 13 | cJSON *attached_data, 14 | bool no_hmds, 15 | struct xrt_prober *xp, 16 | struct xrt_device **out_xdevs); 17 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/ogl/ogl_documentation.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Header with just documentation. 6 | * @author Jakob Bornecrantz 7 | * @ingroup aux_ogl 8 | */ 9 | 10 | #pragma once 11 | 12 | 13 | /*! 14 | * @defgroup aux_ogl OpenGL bindings 15 | * @ingroup aux 16 | * 17 | * @brief OpenGL bindings helper library. 18 | */ 19 | 20 | /*! 21 | * @dir auxiliary/ogl 22 | * @ingroup aux 23 | * 24 | * @brief OpenGL bindings helper library. 25 | */ 26 | -------------------------------------------------------------------------------- /src/xrt/targets/service/monado.in.service: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSL-1.0 2 | # SPDX-FileCopyrightText: 2020, Collabora, Ltd. 3 | 4 | [Unit] 5 | Description=Monado XR runtime service module @extra_desc@ 6 | Requires=%N.socket 7 | ConditionUser=!root 8 | Conflicts=@conflicts@.service 9 | 10 | [Service] 11 | ExecStart=@service_path@ 12 | Environment="XRT_COMPOSITOR_LOG=debug" "XRT_PRINT_OPTIONS=on" "IPC_EXIT_ON_DISCONNECT=@exit_on_disconnect@" 13 | # MemoryDenyWriteExecute=yes 14 | # NoNewPrivileges=yes 15 | Restart=no 16 | 17 | [Install] 18 | Also=%N.socket 19 | -------------------------------------------------------------------------------- /src/external/android-jni-wrap/wrap/java.util.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | // Author: Ryan Pavlik 4 | 5 | #include "java.util.h" 6 | 7 | namespace wrap { 8 | namespace java::util { 9 | List::Meta::Meta() 10 | : MetaBaseDroppable(List::getTypeName()), 11 | size(classRef().getMethod("size", "()I")), 12 | get(classRef().getMethod("get", "(I)Ljava/lang/Object;")) { 13 | MetaBaseDroppable::dropClassRef(); 14 | } 15 | } // namespace java::util 16 | } // namespace wrap 17 | -------------------------------------------------------------------------------- /src/xrt/include/xrt/xrt_config_vulkan.h.cmake_in: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Vulkan defines. 6 | * @author Jakob Bornecrantz 7 | * @ingroup xrt_iface 8 | */ 9 | 10 | #pragma once 11 | 12 | #cmakedefine VK_USE_PLATFORM_ANDROID_KHR 13 | #cmakedefine VK_USE_PLATFORM_WAYLAND_KHR 14 | #cmakedefine VK_USE_PLATFORM_XCB_KHR 15 | #cmakedefine VK_USE_PLATFORM_XLIB_XRANDR_EXT 16 | #cmakedefine VK_USE_PLATFORM_WIN32_KHR 17 | #cmakedefine VK_USE_PLATFORM_DISPLAY_KHR 18 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/vk/vk_documentation.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Header with just documentation. 6 | * @author Jakob Bornecrantz 7 | * @ingroup aux_vk 8 | */ 9 | 10 | #pragma once 11 | 12 | 13 | /*! 14 | * @defgroup aux_vk Vulkan helper code 15 | * @ingroup aux 16 | * 17 | * @brief Vulkan helper structs and functions. 18 | */ 19 | 20 | /*! 21 | * @dir auxiliary/vk 22 | * @ingroup aux 23 | * 24 | * @brief Vulkan helper structs and functions. 25 | */ 26 | -------------------------------------------------------------------------------- /src/xrt/compositor/client/comp_gl_glue.c: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Glue code to OpenGL client side code. 6 | * @author Jakob Bornecrantz 7 | * @ingroup comp_client 8 | */ 9 | 10 | #include "xrt/xrt_gfx_gl.h" 11 | 12 | 13 | void 14 | xrt_gfx_gl_get_versions(struct xrt_api_requirements *ver) 15 | { 16 | ver->min_major = 4; 17 | ver->min_minor = 5; 18 | ver->min_patch = 0; 19 | ver->max_major = 4; 20 | ver->max_minor = 6; 21 | ver->max_patch = (1024 - 1); 22 | } 23 | -------------------------------------------------------------------------------- /src/xrt/compositor/client/comp_gles_glue.c: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Glue code to OpenGL ES client side code. 6 | * @author Simon Ser 7 | * @ingroup comp_client 8 | */ 9 | 10 | #include "xrt/xrt_gfx_gles.h" 11 | 12 | 13 | void 14 | xrt_gfx_gles_get_versions(struct xrt_api_requirements *ver) 15 | { 16 | ver->min_major = 2; 17 | ver->min_minor = 0; 18 | ver->min_patch = 0; 19 | ver->max_major = 3; 20 | ver->max_minor = 2; 21 | ver->max_patch = 1024 - 1; 22 | } 23 | -------------------------------------------------------------------------------- /src/external/android-jni-wrap/wrap/android.util.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | // Author: Ryan Pavlik 4 | 5 | #include "android.util.h" 6 | 7 | namespace wrap { 8 | namespace android::util { 9 | DisplayMetrics::Meta::Meta() 10 | : MetaBaseDroppable(DisplayMetrics::getTypeName()), 11 | heightPixels(classRef(), "heightPixels"), 12 | widthPixels(classRef(), "widthPixels") { 13 | MetaBaseDroppable::dropClassRef(); 14 | } 15 | } // namespace android::util 16 | } // namespace wrap 17 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/copy_plugin.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright 2020, Collabora, Ltd. 4 | # SPDX-License-Identifier: BSL-1.0 5 | 6 | import os, sys, shutil 7 | 8 | # get absolute input and output paths 9 | input_path = os.path.join( 10 | sys.argv[1]) 11 | 12 | output_path = os.path.join( 13 | sys.argv[2]) 14 | 15 | # make sure destination directory exists 16 | os.makedirs(os.path.dirname(output_path), exist_ok=True) 17 | 18 | shutil.copyfile(input_path, output_path) 19 | 20 | print("Copying plugin " + str(input_path) + " to " + str(output_path)) 21 | -------------------------------------------------------------------------------- /src/xrt/include/xrt/xrt_gfx_gl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Header for misc OpenGL code, not a complete graphics provider. 6 | * @author Jakob Bornecrantz 7 | * @ingroup xrt_iface 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "xrt/xrt_defines.h" 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | 19 | /*! 20 | * @ingroup xrt_iface 21 | */ 22 | void 23 | xrt_gfx_gl_get_versions(struct xrt_api_requirements *ver); 24 | 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /src/xrt/include/xrt/xrt_gfx_gles.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Header for misc OpenGL ES code, not a complete graphics provider. 6 | * @author Simon Ser 7 | * @ingroup xrt_iface 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "xrt/xrt_defines.h" 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | 19 | /*! 20 | * @ingroup xrt_iface 21 | */ 22 | void 23 | xrt_gfx_gles_get_versions(struct xrt_api_requirements *ver); 24 | 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /src/xrt/targets/android_common/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 14 | 15 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr_android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 14 | 15 | -------------------------------------------------------------------------------- /src/external/meson.build: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | openvr_include = include_directories('openvr_includes', is_system: true) 5 | cjson_include = include_directories('cjson') 6 | flexkalman_include = include_directories('flexkalman') 7 | glad_include = include_directories('glad/include') 8 | hungarian_include = include_directories('hungarian') 9 | imgui_include = include_directories('imgui') 10 | openxr_include = include_directories('openxr_includes') 11 | catch2_include = include_directories('Catch2') 12 | stb_include = include_directories('stb') 13 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr_android/src/main/java/org/freedesktop/monado/openxr_runtime/MonadoOpenXrApplication.java: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Simple Application subclass. 6 | * @author Ryan Pavlik 7 | */ 8 | package org.freedesktop.monado.openxr_runtime; 9 | 10 | import android.app.Application; 11 | 12 | import dagger.hilt.android.HiltAndroidApp; 13 | 14 | /** 15 | * Subclass required for Hilt usage. 16 | */ 17 | @HiltAndroidApp 18 | public class MonadoOpenXrApplication extends Application { 19 | } 20 | -------------------------------------------------------------------------------- /src/xrt/targets/android_common/src/main/java/org/freedesktop/monado/android_common/RuntimeService.kt: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Simple service for Android to just expose metadata. 6 | * @author Ryan Pavlik 7 | */ 8 | 9 | package org.freedesktop.monado.android_common 10 | 11 | import android.app.Service 12 | import android.content.Intent 13 | import android.os.IBinder 14 | 15 | class RuntimeService : Service() { 16 | override fun onBind(intent: Intent?): IBinder? { 17 | return null 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr_android/src/main/res/values/license_cddl_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | Common Development and Distribution License 1.0 9 | 10 | 11 | raw:cddl_1_0 12 | 13 | -------------------------------------------------------------------------------- /src/external/android-jni-wrap/wrap/android.service.vr.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | // Author: Ryan Pavlik 4 | 5 | #include "android.service.vr.h" 6 | 7 | namespace wrap { 8 | namespace android::service::vr { 9 | VrListenerService::Meta::Meta() 10 | : MetaBase(VrListenerService::getTypeName()), 11 | isVrModePackageEnabled(classRef().getStaticMethod( 12 | "isVrModePackageEnabled", 13 | "(Landroid/content/Context;Landroid/content/ComponentName;)Z")) {} 14 | } // namespace android::service::vr 15 | } // namespace wrap 16 | -------------------------------------------------------------------------------- /src/external/android-jni-wrap/wrap/android.graphics.impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | // Author: Ryan Pavlik 4 | // Inline implementations: do not include on its own! 5 | 6 | #pragma once 7 | 8 | namespace wrap { 9 | namespace android::graphics { 10 | inline int32_t Point::getX() const { 11 | assert(!isNull()); 12 | return get(Meta::data().x, object()); 13 | } 14 | 15 | inline int32_t Point::getY() const { 16 | assert(!isNull()); 17 | return get(Meta::data().y, object()); 18 | } 19 | 20 | } // namespace android::graphics 21 | } // namespace wrap 22 | -------------------------------------------------------------------------------- /src/external/jnipp/makefile: -------------------------------------------------------------------------------- 1 | CC=g++ 2 | 3 | OS_NAME := linux 4 | 5 | ifeq ($(OS),Windows_NT) 6 | OS_NAME := win32 7 | RM := del 8 | else 9 | RM := rm -f 10 | UNAME_S := $(shell uname -s) 11 | ifeq ($(UNAME_S),Darwin) 12 | OS_NAME := darwin 13 | endif 14 | endif 15 | 16 | JAVA_HOME ?= /usr/lib/jvm/default-java 17 | 18 | CXXFLAGS=-I. -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/$(OS_NAME) -ldl -std=c++11 19 | 20 | SRC=jnipp.o main.o 21 | VPATH=tests 22 | 23 | %.o: %.cpp 24 | $(CC) -c -o $@ $< $(CXXFLAGS) 25 | 26 | test: $(SRC) 27 | $(CC) -o test $(SRC) $(CXXFLAGS) 28 | 29 | clean: 30 | -$(RM) $(SRC) test 31 | 32 | .PHONY: clean 33 | -------------------------------------------------------------------------------- /.gitlab-ci/i386-cross.txt: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2018-2020, Collabora, Ltd. and the Monado contributors 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | [binaries] 5 | c = '/usr/bin/i686-linux-gnu-gcc' 6 | cpp = '/usr/bin/i686-linux-gnu-g++' 7 | ar = '/usr/bin/i686-linux-gnu-ar' 8 | strip = '/usr/bin/i686-linux-gnu-strip' 9 | objcopy = '/usr/bin/i686-linux-gnu-objcopy' 10 | ld= '/usr/bin/i686-linux-gnu-ld' 11 | pkgconfig = '/usr/bin/i686-linux-gnu-pkg-config' 12 | sdl2-config = '/bin/false' 13 | 14 | [properties] 15 | needs_exe_wrapper = False 16 | 17 | [host_machine] 18 | system = 'linux' 19 | cpu_family = 'x86' 20 | cpu = 'i386' 21 | endian = 'little' 22 | -------------------------------------------------------------------------------- /src/external/hungarian/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Hungarian algorithm, also known as Munkres algorithm or Kuhn-Munkres algorithm, is a method for solving the assignment problem, for example assigning workers to jobs, which goal is to compute the optimal assignment that minimizes the total cost, and the like. 3 | 4 | This is a C++ wrapper with slight modification of a hungarian algorithm implementation by Markus Buehren. 5 | The original code is a few mex-functions for use in MATLAB, found here: 6 | http://www.mathworks.com/matlabcentral/fileexchange/6543-functions-for-the-rectangular-assignment-problem 7 | 8 | Upstream source: https://github.com/mcximing/hungarian-algorithm-cpp 9 | -------------------------------------------------------------------------------- /src/external/android-jni-wrap/wrap/java.util.impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | // Author: Ryan Pavlik 4 | // Inline implementations: do not include on its own! 5 | 6 | #pragma once 7 | 8 | namespace wrap { 9 | namespace java::util { 10 | inline int32_t List::size() const { 11 | assert(!isNull()); 12 | return object().call(Meta::data().size); 13 | } 14 | 15 | inline jni::Object List::get(int32_t index) const { 16 | assert(!isNull()); 17 | return object().call(Meta::data().get, index); 18 | } 19 | 20 | } // namespace java::util 21 | } // namespace wrap 22 | -------------------------------------------------------------------------------- /src/xrt/compositor/shaders/layer.frag: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Collabora Ltd. 2 | // Author: Lubosz Sarnecki 3 | // SPDX-License-Identifier: BSL-1.0 4 | 5 | #version 460 6 | 7 | layout (location = 0) in vec2 uv; 8 | 9 | layout (binding = 0, std140) uniform Transformation { 10 | mat4 mvp; 11 | ivec2 offset; 12 | ivec2 extent; 13 | bool flip_y; 14 | } ubo; 15 | layout (binding = 1) uniform sampler2D image; 16 | 17 | layout (location = 0) out vec4 out_color; 18 | 19 | void main () 20 | { 21 | vec2 uv_sub = vec2(ubo.offset) + uv * vec2(ubo.extent); 22 | uv_sub /= textureSize(image, 0); 23 | out_color = texture(image, uv_sub); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr/active_runtime.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2019, Benjamin Saunders 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | include(GNUInstallDirs) 5 | 6 | set(MANIFEST_RELATIVE_DIR @MANIFEST_RELATIVE_DIR@) 7 | set(XR_API_MAJOR @XR_API_MAJOR@) 8 | set(RUNTIME_TARGET @RUNTIME_TARGET@) 9 | 10 | execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink 11 | ${CMAKE_INSTALL_PREFIX}/${MANIFEST_RELATIVE_DIR}/${RUNTIME_TARGET}.json 12 | ${CMAKE_BINARY_DIR}/active_runtime.json) 13 | file( 14 | INSTALL 15 | DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/xdg/openxr/${XR_API_MAJOR}" 16 | TYPE FILE 17 | FILES "${CMAKE_BINARY_DIR}/active_runtime.json" 18 | ) 19 | -------------------------------------------------------------------------------- /src/external/android-jni-wrap/wrap/android.util.impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | // Author: Ryan Pavlik 4 | // Inline implementations: do not include on its own! 5 | 6 | #pragma once 7 | 8 | namespace wrap { 9 | namespace android::util { 10 | inline int32_t DisplayMetrics::getHeightPixels() const { 11 | assert(!isNull()); 12 | return get(Meta::data().heightPixels, object()); 13 | } 14 | 15 | inline int32_t DisplayMetrics::getWidthPixels() const { 16 | assert(!isNull()); 17 | return get(Meta::data().widthPixels, object()); 18 | } 19 | 20 | } // namespace android::util 21 | } // namespace wrap 22 | -------------------------------------------------------------------------------- /src/xrt/drivers/vive/vive.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016-2019, Philipp Zabel 2 | // Copyright 2019, Collabora, Ltd. 3 | // SPDX-License-Identifier: BSL-1.0 4 | /*! 5 | * @file 6 | * @brief Common vive header 7 | * @author Lubosz Sarnecki 8 | * @ingroup drv_vive 9 | */ 10 | 11 | #pragma once 12 | 13 | /* 14 | * 15 | * Printing functions. 16 | * 17 | */ 18 | 19 | #define VIVE_TRACE(d, ...) U_LOG_IFL_T(d->ll, __VA_ARGS__) 20 | #define VIVE_DEBUG(d, ...) U_LOG_IFL_D(d->ll, __VA_ARGS__) 21 | #define VIVE_INFO(d, ...) U_LOG_IFL_I(d->ll, __VA_ARGS__) 22 | #define VIVE_WARN(d, ...) U_LOG_IFL_W(d->ll, __VA_ARGS__) 23 | #define VIVE_ERROR(d, ...) U_LOG_IFL_E(d->ll, __VA_ARGS__) 24 | -------------------------------------------------------------------------------- /src/xrt/targets/service/main.c: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Main file for Monado service. 6 | * @author Pete Black 7 | * @author Jakob Bornecrantz 8 | * @ingroup ipc 9 | */ 10 | 11 | #include "util/u_trace_marker.h" 12 | 13 | #include "target_lists.h" 14 | 15 | 16 | // Insert the on load constructor to init trace marker. 17 | U_TRACE_TARGET_SETUP(U_TRACE_WHICH_SERVICE) 18 | 19 | int 20 | ipc_server_main(int argc, char *argv[]); 21 | 22 | 23 | int 24 | main(int argc, char *argv[]) 25 | { 26 | u_trace_marker_init(); 27 | 28 | return ipc_server_main(argc, argv); 29 | } 30 | -------------------------------------------------------------------------------- /src/xrt/targets/cli/cli_common.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Common file for the CLI program. 6 | * @author Jakob Bornecrantz 7 | */ 8 | 9 | #pragma once 10 | 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | 17 | int 18 | cli_cmd_calibrate(int argc, const char **argv); 19 | 20 | int 21 | cli_cmd_lighthouse(int argc, const char **argv); 22 | 23 | int 24 | cli_cmd_probe(int argc, const char **argv); 25 | 26 | int 27 | cli_cmd_test(int argc, const char **argv); 28 | 29 | int 30 | cli_cmd_trace(int argc, const char **argv); 31 | 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /src/external/jnipp/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 26 5 | buildToolsVersion '28.0.3' 6 | 7 | defaultConfig { 8 | minSdkVersion 15 9 | targetSdkVersion 26 10 | } 11 | 12 | buildTypes { 13 | release { 14 | minifyEnabled = false 15 | proguardFiles getDefaultProguardFile('proguard-android.txt') 16 | } 17 | } 18 | 19 | sourceSets { 20 | main { 21 | manifest.srcFile 'android/AndroidManifest.xml' 22 | } 23 | } 24 | 25 | externalNativeBuild { 26 | cmake { 27 | path 'android/CMakeLists.txt' 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/xrt/ipc/server/ipc_server_mainloop_android.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Additional server entry points needed for Android. 6 | * @author Ryan Pavlik 7 | * @ingroup ipc_server 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "ipc_server.h" 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /*! 19 | * Pass an fd for a new client to the mainloop. 20 | * 21 | * @see ipc_design 22 | * @public @memberof ipc_server_mainloop 23 | */ 24 | int 25 | ipc_server_mainloop_add_fd(struct ipc_server *vs, struct ipc_server_mainloop *ml, int newfd); 26 | 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | -------------------------------------------------------------------------------- /src/xrt/targets/cli/meson.build: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2021, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | cli = executable( 5 | 'monado-cli', 6 | files( 7 | 'cli_cmd_calibrate.c', 8 | 'cli_cmd_lighthouse.c', 9 | 'cli_cmd_probe.c', 10 | 'cli_cmd_test.c', 11 | 'cli_common.h', 12 | 'cli_main.c', 13 | ), 14 | link_whole: [ 15 | lib_aux_os, 16 | lib_aux_util, 17 | lib_aux_math, 18 | lib_st_prober, 19 | lib_target_instance_no_comp, 20 | ] + driver_libs, 21 | include_directories: [ 22 | aux_include, 23 | common_include, 24 | drv_include, 25 | xrt_include, 26 | ], 27 | dependencies: [ 28 | libusb, 29 | libuvc, 30 | pthreads, 31 | udev, 32 | ] + driver_deps, 33 | install: true, 34 | ) 35 | -------------------------------------------------------------------------------- /src/xrt/compositor/multi/comp_multi_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Interface for the multi-client layer code. 6 | * @author Jakob Bornecrantz 7 | * @ingroup comp_main 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "xrt/xrt_compositor.h" 13 | 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | 20 | xrt_result_t 21 | comp_multi_create_system_compositor(struct xrt_compositor_native *xcn, 22 | const struct xrt_system_compositor_info *xsci, 23 | struct xrt_system_compositor **out_xsysc); 24 | 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /src/xrt/drivers/survive/survive_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: Apache-2.0 3 | /*! 4 | * @file 5 | * @brief Interface to Libsurvive adapter. 6 | * @author Christoph Haag 7 | * @author Jakob Bornecrantz 8 | * @ingroup drv_survive 9 | */ 10 | 11 | #pragma once 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /*! 18 | * @defgroup drv_survive Lighthouse tracking using libsurvive 19 | * @ingroup drv 20 | * 21 | * @brief 22 | */ 23 | 24 | /*! 25 | * Create a probe for libsurvive 26 | * 27 | * @ingroup drv_survive 28 | */ 29 | struct xrt_auto_prober * 30 | survive_create_auto_prober(); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/math/m_predict.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Simple function to predict a new pose from a given pose. 6 | * @author Jakob Bornecrantz 7 | * @ingroup aux_math 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "xrt/xrt_defines.h" 13 | 14 | 15 | /*! 16 | * Using the given @p xrt_space_relation predicts a new @p xrt_space_relation 17 | * @p delta_s into the future. 18 | * 19 | * Assumes that angular velocity is relative to the space the relation is in, 20 | * not relative to relation::pose. 21 | * 22 | * @ingroup aux_math 23 | */ 24 | void 25 | m_predict_relation(const struct xrt_space_relation *rel, double delta_s, struct xrt_space_relation *out_rel); 26 | -------------------------------------------------------------------------------- /src/xrt/include/xrt/xrt_gfx_native.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Header defining a XRT graphics provider. 6 | * @author Jakob Bornecrantz 7 | * @ingroup xrt_iface 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "xrt/xrt_device.h" 13 | #include "xrt/xrt_compositor.h" 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | 20 | struct time_state; 21 | 22 | /*! 23 | * Creates the main system compositor. 24 | * 25 | * @ingroup xrt_iface 26 | * @relates xrt_system_compositor 27 | */ 28 | xrt_result_t 29 | xrt_gfx_provider_create_system(struct xrt_device *xdev, struct xrt_system_compositor **out_xsysc); 30 | 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | -------------------------------------------------------------------------------- /nix/rr/unstable.nix: -------------------------------------------------------------------------------- 1 | # This is a temporary copy of the default.nix in this folder, with the version 2 | # updated to the current tip of rr's master branch. This exists because rr has 3 | # not had a release in a long time. Upstream has stated that it should be fine 4 | # to use master. This file, and its attribute in all-packages, can be removed 5 | # once rr makes a release. 6 | 7 | { callPackage, fetchFromGitHub }: 8 | 9 | let 10 | rr = callPackage ./. {}; 11 | in 12 | 13 | rr.overrideAttrs (old: { 14 | version = "unstable-2022-05-12"; 15 | 16 | src = fetchFromGitHub { 17 | owner = "mozilla"; 18 | repo = "rr"; 19 | rev = "c96cb688106634ad09af6214aa91252c3a4f74b1"; 20 | sha256 = "sha256-K4cEQnvBXr/j9qXCgIHLqMrRzm96ushTO5STivRj+Mk="; 21 | }; 22 | }) 23 | -------------------------------------------------------------------------------- /src/xrt/include/xrt/xrt_vulkan_includes.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018-2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Include all of the Vulkan headers in one place. 6 | * @author Jakob Bornecrantz 7 | * @ingroup xrt_iface 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "xrt/xrt_config_vulkan.h" 13 | #include "xrt/xrt_config_have.h" 14 | 15 | #ifdef XRT_HAVE_VULKAN 16 | #include "xrt/xrt_windows.h" 17 | 18 | #define VK_NO_PROTOTYPES 19 | #include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL 26 | vkGetInstanceProcAddr(VkInstance instance, const char *pName); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif // XRT_HAVE_VULKAN 33 | -------------------------------------------------------------------------------- /src/xrt/state_trackers/steamvr_drv/ovrd_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Interface to the Monado SteamVR Driver exporter. 6 | * @author Jakob Bornecrantz 7 | * @ingroup st_ovrd 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "xrt/xrt_defines.h" 13 | 14 | /*! 15 | * @defgroup st_ovrd SteamVR driver provider 16 | * 17 | * Wraps a @ref xrt_instance and one or more @ref xrt_device and exposes those 18 | * to SteamVR via the OpenVR driver interface. 19 | * 20 | * @ingroup xrt 21 | */ 22 | 23 | /*! 24 | * Implementation of the HmdDriverFactory function. 25 | * 26 | * @ingroup st_ovrd 27 | */ 28 | void * 29 | ovrd_hmd_driver_impl(const char *pInterfaceName, int *pReturnCode); 30 | -------------------------------------------------------------------------------- /src/xrt/compositor/shaders/layer.vert: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Collabora Ltd. 2 | // Author: Lubosz Sarnecki 3 | // SPDX-License-Identifier: BSL-1.0 4 | 5 | #version 460 6 | 7 | layout (binding = 0, std140) uniform Transformation { 8 | mat4 mvp; 9 | ivec2 offset; 10 | ivec2 extent; 11 | bool flip_y; 12 | } transformation; 13 | 14 | layout (location = 0) in vec3 position; 15 | layout (location = 1) in vec2 uv; 16 | 17 | layout (location = 0) out vec2 out_uv; 18 | 19 | 20 | out gl_PerVertex { 21 | vec4 gl_Position; 22 | }; 23 | 24 | void main() { 25 | gl_Position = transformation.mvp * vec4 (position, 1.0f); 26 | gl_Position.y = -gl_Position.y; 27 | out_uv = uv; 28 | 29 | if (transformation.flip_y) { 30 | out_uv.y = 1.0 - out_uv.y; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/xrt/drivers/ohmd/oh_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Interface to OpenHMD driver code. 6 | * @author Jakob Bornecrantz 7 | * @ingroup drv_ohmd 8 | */ 9 | 10 | #pragma once 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /*! 17 | * @defgroup drv_ohmd OpenHMD wrapper 18 | * @ingroup drv 19 | * 20 | * @brief Wrapper driver around OpenHMD. 21 | */ 22 | 23 | /*! 24 | * Create a probe for OpenHMD supported devices. 25 | * 26 | * @ingroup drv_ohmd 27 | */ 28 | struct xrt_auto_prober * 29 | oh_create_auto_prober(); 30 | 31 | /*! 32 | * @dir drivers/ohmd 33 | * 34 | * @brief @ref drv_ohmd files. 35 | */ 36 | 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | -------------------------------------------------------------------------------- /src/xrt/targets/android_common/src/main/res/values/display_over_other_apps_strings.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | Display over other apps is <b>%1$s</b> for this runtime. 8 | Open Display over other apps Settings 9 | enabled 10 | disabled 11 | Display over other apps settings have been changed, restart is required. 12 | 13 | -------------------------------------------------------------------------------- /src/xrt/include/xrt/xrt_config_build.h.cmake_in: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief What internal components we are building. 6 | * @author Jakob Bornecrantz 7 | * @ingroup xrt_iface 8 | */ 9 | 10 | #pragma once 11 | 12 | #cmakedefine XRT_FEATURE_COMPOSITOR_MAIN 13 | 14 | #cmakedefine XRT_FEATURE_SERVICE 15 | 16 | #cmakedefine XRT_FEATURE_OPENXR 17 | 18 | #cmakedefine XRT_FEATURE_OPENXR_LAYER_CUBE 19 | 20 | #cmakedefine XRT_FEATURE_OPENXR_LAYER_CYLINDER 21 | 22 | #cmakedefine XRT_FEATURE_OPENXR_LAYER_DEPTH 23 | 24 | #cmakedefine XRT_FEATURE_OPENXR_LAYER_EQUIRECT2 25 | 26 | #cmakedefine XRT_FEATURE_OPENXR_LAYER_EQUIRECT1 27 | 28 | #cmakedefine XRT_FEATURE_COLOR_LOG 29 | 30 | #cmakedefine XRT_FEATURE_TRACING 31 | -------------------------------------------------------------------------------- /src/xrt/drivers/psvr/psvr_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Interface to @ref drv_psvr. 6 | * @author Jakob Bornecrantz 7 | * @ingroup drv_psvr 8 | */ 9 | 10 | #pragma once 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /*! 17 | * @defgroup drv_psvr PSVR driver 18 | * @ingroup drv 19 | * 20 | * @brief Driver for the Sony PSVR HMD. 21 | */ 22 | 23 | /*! 24 | * Create a probe for PSVR devices. 25 | * 26 | * @ingroup drv_psvr 27 | * @relates xrt_auto_prober 28 | */ 29 | struct xrt_auto_prober * 30 | psvr_create_auto_prober(void); 31 | 32 | /*! 33 | * @dir drivers/psvr 34 | * 35 | * @brief @ref drv_psvr files. 36 | */ 37 | 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | -------------------------------------------------------------------------------- /src/external/android-jni-wrap/wrap/android.service.vr.impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | // Author: Ryan Pavlik 4 | // Inline implementations: do not include on its own! 5 | 6 | #pragma once 7 | 8 | #include "android.content.h" 9 | 10 | namespace wrap { 11 | namespace android::service::vr { 12 | inline bool VrListenerService::isVrModePackageEnabled( 13 | content::Context const &context, 14 | content::ComponentName const &componentName) { 15 | return Meta::data().clazz().call(Meta::data().isVrModePackageEnabled, 16 | context.object(), 17 | componentName.object()); 18 | } 19 | 20 | } // namespace android::service::vr 21 | } // namespace wrap 22 | -------------------------------------------------------------------------------- /src/xrt/compositor/shaders/meson.build: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | shader_srcs = [ 5 | 'mesh.frag', 6 | 'mesh.vert', 7 | 'layer.vert', 8 | 'layer.frag', 9 | 'equirect1.vert', 10 | 'equirect1.frag', 11 | 'equirect2.vert', 12 | 'equirect2.frag' 13 | ] 14 | 15 | shader_headers = [] 16 | foreach shader : shader_srcs 17 | header_out = shader + '.h' 18 | shader_headers += custom_target( 19 | header_out, 20 | command: [ 21 | glslangValidator, 22 | '-V', '@INPUT@', 23 | '-o', '@OUTPUT@', 24 | '--vn', 'shaders_' + shader.underscorify(), 25 | ], 26 | input: shader, 27 | output: header_out, 28 | ) 29 | endforeach 30 | 31 | shaders = declare_dependency( 32 | include_directories: include_directories('..'), 33 | sources: shader_headers, 34 | ) 35 | -------------------------------------------------------------------------------- /src/xrt/targets/android_common/src/main/java/org/freedesktop/monado/android_common/NoticeFragmentProvider.kt: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Interface for target-specific . 6 | * @author Ryan Pavlik 7 | */ 8 | 9 | package org.freedesktop.monado.android_common 10 | 11 | import androidx.fragment.app.Fragment 12 | 13 | /** 14 | * Provides a fragment with open-source license notices and attribution that we can put in our 15 | * "About" activity. 16 | * 17 | * Provided by dependency injection from the final target: e.g. AboutLibraries must come from there 18 | * to be sure to collect all dependencies to credit. 19 | */ 20 | interface NoticeFragmentProvider { 21 | 22 | fun makeNoticeFragment(): Fragment 23 | } 24 | -------------------------------------------------------------------------------- /src/external/android-jni-wrap/wrap/android.app.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | // Author: Ryan Pavlik 4 | 5 | #include "android.app.h" 6 | 7 | namespace wrap { 8 | namespace android::app { 9 | Service::Meta::Meta() : MetaBaseDroppable(Service::getTypeName()) { 10 | MetaBaseDroppable::dropClassRef(); 11 | } 12 | Activity::Meta::Meta() 13 | : MetaBaseDroppable(Activity::getTypeName()), 14 | getSystemService(classRef().getMethod( 15 | "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;")), 16 | setVrModeEnabled(classRef().getMethod( 17 | "setVrModeEnabled", "(ZLandroid/content/ComponentName;)V")) { 18 | MetaBaseDroppable::dropClassRef(); 19 | } 20 | } // namespace android::app 21 | } // namespace wrap 22 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/util/u_bitwise.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Functions for manipulating tightly packed data as bits. 6 | * @author Jakob Bornecrantz 7 | * @author Pete Black 8 | * @ingroup aux_util 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | int 20 | get_bit(const unsigned char *b, int num); 21 | 22 | int 23 | get_bits(const unsigned char *b, int start, int num); 24 | 25 | /*! 26 | * Interpret the least-significant 13 bits as a signed 13-bit integer, and cast 27 | * it to a signed int for normal usage. 28 | */ 29 | int 30 | sign_extend_13(uint32_t i); 31 | 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /src/xrt/targets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | ###### 5 | # This is where we collect all of the pieces from the different parts of 6 | # the source tree and build a complete driver or integration part. 7 | 8 | 9 | add_subdirectory(common) 10 | 11 | if(XRT_FEATURE_OPENXR) 12 | add_subdirectory(openxr) 13 | endif() 14 | 15 | add_subdirectory(cli) 16 | 17 | if(XRT_HAVE_SDL2) 18 | add_subdirectory(gui) 19 | endif() 20 | 21 | if(XRT_FEATURE_SERVICE) 22 | add_subdirectory(ctl) 23 | endif() 24 | 25 | if(XRT_FEATURE_SERVICE AND XRT_FEATURE_OPENXR) 26 | if(ANDROID) 27 | add_subdirectory(service-lib) 28 | else() 29 | add_subdirectory(service) 30 | endif() 31 | endif() 32 | 33 | if(XRT_FEATURE_STEAMVR_PLUGIN) 34 | add_subdirectory(steamvr_drv) 35 | endif() 36 | -------------------------------------------------------------------------------- /src/xrt/targets/android_common/src/main/res/raw/ic_feathericons_x.svg: -------------------------------------------------------------------------------- 1 | 9 | 10 | 20 | 25 | 30 | 31 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/ogl/ogl_helpers.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Common OpenGL code header. 6 | * @author Ryan Pavlik 7 | * @ingroup aux_ogl 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "xrt/xrt_compositor.h" 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /*! 19 | * Determine the texture target and the texture binding parameter to 20 | * save/restore for creation/use of an OpenGL texture from the given info. 21 | */ 22 | void 23 | ogl_texture_target_for_swapchain_info(const struct xrt_swapchain_create_info *info, 24 | uint32_t *out_tex_target, 25 | uint32_t *out_tex_param_name); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xrt/drivers/android/android_prober.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Interface to Android sensors driver. 6 | * @author Lubosz Sarnecki 7 | * @ingroup drv_android 8 | */ 9 | 10 | #pragma once 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /*! 17 | * @defgroup drv_android Android sensors driver 18 | * @ingroup drv 19 | * 20 | * @brief Generic driver for phone sensors. 21 | */ 22 | 23 | /*! 24 | * Probing function for Android sensors. 25 | * 26 | * @ingroup drv_android 27 | */ 28 | struct xrt_auto_prober * 29 | android_create_auto_prober(); 30 | 31 | 32 | /*! 33 | * @dir drivers/android 34 | * 35 | * @brief @ref drv_android files. 36 | */ 37 | 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | -------------------------------------------------------------------------------- /.gitlab-ci/build-openxr-openhmd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2018-2020, Collabora, Ltd. and the Monado contributors 3 | # SPDX-License-Identifier: BSL-1.0 4 | 5 | # Install the OpenXR SDK, whatever version, installed system-wide. 6 | git clone https://github.com/KhronosGroup/OpenXR-SDK 7 | pushd OpenXR-SDK 8 | mkdir build 9 | pushd build 10 | cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=Off -DPRESENTATION_BACKEND=xlib -DDYNAMIC_LOADER=ON -DOpenGL_GL_PREFERENCE=GLVND -GNinja .. 11 | ninja install 12 | popd 13 | popd 14 | 15 | # Install OpenHMD from git master, as released versions are not sufficient 16 | # for us to build. 17 | git clone https://github.com/OpenHMD/OpenHMD 18 | pushd OpenHMD 19 | mkdir build 20 | meson --prefix=/usr/local --libdir=lib build 21 | ninja -C build install 22 | popd 23 | -------------------------------------------------------------------------------- /src/external/android-jni-wrap/wrap/android.widget.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | // Author: Ryan Pavlik 4 | 5 | #include "android.widget.h" 6 | 7 | namespace wrap { 8 | namespace android::widget { 9 | Toast::Meta::Meta() 10 | : MetaBase(Toast::getTypeName()), LENGTH_LONG(classRef(), "LENGTH_LONG"), 11 | LENGTH_SHORT(classRef(), "LENGTH_SHORT"), 12 | show(classRef().getMethod("show", "()V")), 13 | makeText(classRef().getStaticMethod( 14 | "makeText", "(Landroid/content/Context;Ljava/lang/" 15 | "CharSequence;I)Landroid/widget/Toast;")), 16 | makeText1(classRef().getStaticMethod( 17 | "makeText", "(Landroid/content/Context;II)Landroid/widget/Toast;")) {} 18 | } // namespace android::widget 19 | } // namespace wrap 20 | -------------------------------------------------------------------------------- /src/xrt/state_trackers/prober/meson.build: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | prober_sources = [ 5 | 'p_documentation.h', 6 | 'p_dump.c', 7 | 'p_prober.c', 8 | 'p_prober.h', 9 | 'p_tracking.c', 10 | ] 11 | 12 | prober_deps = [aux, xrt_config_drivers, xrt_config_have] 13 | 14 | if udev.found() 15 | prober_sources += ['p_udev.c'] 16 | prober_deps += [udev] 17 | endif 18 | 19 | if libusb.found() 20 | prober_sources += ['p_libusb.c'] 21 | prober_deps += [libusb] 22 | endif 23 | 24 | if libuvc.found() 25 | prober_sources += ['p_libuvc.c'] 26 | prober_deps += [libuvc] 27 | endif 28 | 29 | lib_st_prober = static_library( 30 | 'st_prober', 31 | files(prober_sources), 32 | include_directories: [ 33 | xrt_include, 34 | drv_include, 35 | cjson_include, 36 | ], 37 | dependencies: prober_deps, 38 | ) 39 | -------------------------------------------------------------------------------- /src/xrt/drivers/daydream/daydream_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Interface to @ref drv_daydream. 6 | * @author Pete Black 7 | * @ingroup drv_daydream 8 | */ 9 | 10 | #pragma once 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /*! 17 | * @defgroup drv_daydream Daydream Controller driver 18 | * @ingroup drv 19 | * 20 | * @brief Driver for the Google Daydream Controller. 21 | */ 22 | 23 | /*! 24 | * Probing function for the Daydream controller. 25 | * 26 | * @ingroup drv_daydream 27 | */ 28 | struct xrt_auto_prober * 29 | daydream_create_auto_prober(); 30 | 31 | 32 | /*! 33 | * @dir drivers/daydream 34 | * 35 | * @brief @ref drv_daydream files. 36 | */ 37 | 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | -------------------------------------------------------------------------------- /src/xrt/include/xrt/xrt_config_have.h.cmake_in: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief What external components we have. 6 | * @author Jakob Bornecrantz 7 | * @ingroup xrt_iface 8 | */ 9 | 10 | #pragma once 11 | 12 | #cmakedefine XRT_HAVE_DBUS 13 | #cmakedefine XRT_HAVE_LIBBSD 14 | #cmakedefine XRT_HAVE_EGL 15 | #cmakedefine XRT_HAVE_FFMPEG 16 | #cmakedefine XRT_HAVE_GST 17 | #cmakedefine XRT_HAVE_JPEG 18 | #cmakedefine XRT_HAVE_LIBUDEV 19 | #cmakedefine XRT_HAVE_LIBUSB 20 | #cmakedefine XRT_HAVE_LIBUVC 21 | #cmakedefine XRT_HAVE_OPENCV 22 | #cmakedefine XRT_HAVE_OPENGL 23 | #cmakedefine XRT_HAVE_OPENGLES 24 | #cmakedefine XRT_HAVE_SDL2 25 | #cmakedefine XRT_HAVE_SYSTEMD 26 | #cmakedefine XRT_HAVE_V4L2 27 | #cmakedefine XRT_HAVE_VULKAN 28 | #cmakedefine XRT_HAVE_PERCETTO 29 | -------------------------------------------------------------------------------- /src/xrt/targets/cli/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2021, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | ###### 5 | # Create a cli interface for Monado. 6 | 7 | 8 | set(SOURCE_FILES 9 | cli_cmd_lighthouse.c 10 | cli_cmd_probe.c 11 | cli_cmd_test.c 12 | cli_common.h 13 | cli_main.c 14 | ) 15 | 16 | if(NOT WIN32) 17 | # No getline on Windows, so until we have a portable impl 18 | list(APPEND SOURCE_FILES 19 | cli_cmd_calibrate.c 20 | ) 21 | endif() 22 | 23 | add_executable(cli 24 | ${SOURCE_FILES} 25 | ) 26 | add_sanitizers(cli) 27 | 28 | set_target_properties(cli PROPERTIES 29 | OUTPUT_NAME monado-cli 30 | PREFIX "" 31 | ) 32 | 33 | target_link_libraries(cli PRIVATE 34 | aux_os 35 | aux_util 36 | aux_math 37 | target_instance_no_comp 38 | ) 39 | 40 | install(TARGETS cli 41 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 42 | ) 43 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr_android/src/main/res/values/library_quatexpmap_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | type 8 | Sensics, Inc., Collabora, Ltd. 9 | Quaternion Exponential Map 10 | apache_2_0 11 | true 12 | https://gitlab.freedesktop.org/monado/monado/-/blob/master/src/xrt/auxiliary/math/m_quatexpmap.cpp 13 | native 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/xrt/drivers/depthai/depthai_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Interface header for DepthAI camera. 6 | * @author Moses Turner 7 | * @author Jakob Bornecrantz 8 | * @ingroup drv_depthai 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "xrt/xrt_frameserver.h" 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | 20 | /*! 21 | * @defgroup drv_depthai DepthAI frameserver driver 22 | * @ingroup drv 23 | * 24 | * @brief Frameserver for the DepthAI camera module. 25 | */ 26 | 27 | /*! 28 | * Create a DepthAI frameserver using a single RGB camera. 29 | * 30 | * @ingroup drv_depthai 31 | */ 32 | struct xrt_fs * 33 | depthai_fs_single_rgb(struct xrt_frame_context *xfctx); 34 | 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /src/xrt/ipc/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/xrt/targets/android_common/src/main/res/values/vrmodestatus_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | Built-in Android VR Mode features are enabled for this runtime. 10 | Built-in Android VR Mode features are available on this device, but are not enabled for this runtime. You can enable them below. 11 | No built-in Android VR Mode features are available on this device, but %1$s does not require them. 12 | Open Android VR Settings 13 | Logo 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/xrt/compositor/shaders/mesh.frag: -------------------------------------------------------------------------------- 1 | // Copyright 2017, James Sarrett. 2 | // Copyright 2017, Bastiaan Olij. 3 | // Copyright 2019, Collabora, Ltd. 4 | // SPDX-License-Identifier: BSL-1.0 5 | // Author: James Sarrett 6 | // Author: Bastiaan Olij 7 | // Author: Lubosz Sarnecki 8 | // Author: Pete Black 9 | 10 | #version 450 11 | 12 | layout (binding = 0) uniform sampler2D tex_sampler; 13 | 14 | layout (location = 0) in vec2 in_ruv; 15 | layout (location = 1) in vec2 in_guv; 16 | layout (location = 2) in vec2 in_buv; 17 | layout (location = 0) out vec4 out_color; 18 | 19 | 20 | void main() 21 | { 22 | float r = texture(tex_sampler, in_ruv).x; 23 | float g = texture(tex_sampler, in_guv).y; 24 | float b = texture(tex_sampler, in_buv).z; 25 | 26 | out_color = vec4(r, g, b, 1.0); 27 | } 28 | -------------------------------------------------------------------------------- /src/xrt/targets/common/meson.build: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | common_include = include_directories('.') 5 | 6 | lib_target_lists = static_library( 7 | 'target_lists', 8 | files( 9 | 'target_lists.c', 10 | ), 11 | include_directories: [drv_include, xrt_include], 12 | dependencies: [aux, xrt_config_drivers], 13 | ) 14 | 15 | lib_target_instance = static_library( 16 | 'target_instance', 17 | files( 18 | 'target_instance.c', 19 | ), 20 | include_directories: [xrt_include], 21 | link_with: [lib_target_lists, lib_st_prober], 22 | dependencies: [aux], 23 | ) 24 | 25 | lib_target_instance_no_comp = static_library( 26 | 'target_instance_no_comp', 27 | files( 28 | 'target_instance_no_comp.c', 29 | ), 30 | include_directories: [xrt_include], 31 | link_with: [lib_target_lists, lib_st_prober], 32 | dependencies: [aux], 33 | ) 34 | -------------------------------------------------------------------------------- /src/external/imgui/imgui_monado/cimgui_monado.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Custom imgui elements. 6 | * @author Christoph Haag 7 | */ 8 | 9 | #pragma once 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | void igPlotTimings(const char *label, 16 | float (*values_getter)(void *data, int idx), void *data, 17 | int values_count, int values_offset, 18 | const char *overlay_text, float scale_min, float scale_max, 19 | ImVec2 frame_size, float reference_timing, 20 | bool center_reference_timing, float range, const char *unit, 21 | bool dynamic_rescale); 22 | 23 | void igToggleButton(const char *str_id, bool *v); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /src/xrt/compositor/shaders/equirect1.vert: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Collabora Ltd. 2 | // Author: Lubosz Sarnecki 3 | // SPDX-License-Identifier: BSL-1.0 4 | 5 | #version 460 6 | 7 | layout (binding = 0, std140) uniform Transformation { 8 | mat4 mvp; 9 | ivec2 offset; 10 | ivec2 extent; 11 | bool flip_y; 12 | } transformation; 13 | 14 | layout (location = 0) in vec3 position; 15 | layout (location = 1) in vec2 uv; 16 | 17 | layout (location = 0) out vec2 out_uv; 18 | 19 | 20 | out gl_PerVertex { 21 | vec4 gl_Position; 22 | }; 23 | 24 | const mat4 mvp = mat4( 25 | 2, 0, 0, 0, 26 | 0, 2, 0, 0, 27 | 0, 0, 1, 0, 28 | 0, 0, 0, 1 29 | ); 30 | 31 | void main() { 32 | gl_Position = mvp * vec4 (position, 1.0f); 33 | gl_Position.y = -gl_Position.y; 34 | out_uv = uv; 35 | 36 | if (transformation.flip_y) { 37 | out_uv.y = 1.0 - out_uv.y; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/xrt/compositor/shaders/equirect2.vert: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Collabora Ltd. 2 | // Author: Lubosz Sarnecki 3 | // SPDX-License-Identifier: BSL-1.0 4 | 5 | #version 460 6 | 7 | layout (binding = 0, std140) uniform Transformation { 8 | mat4 mvp; 9 | ivec2 offset; 10 | ivec2 extent; 11 | bool flip_y; 12 | } transformation; 13 | 14 | layout (location = 0) in vec3 position; 15 | layout (location = 1) in vec2 uv; 16 | 17 | layout (location = 0) out vec2 out_uv; 18 | 19 | 20 | out gl_PerVertex { 21 | vec4 gl_Position; 22 | }; 23 | 24 | const mat4 mvp = mat4( 25 | 2, 0, 0, 0, 26 | 0, 2, 0, 0, 27 | 0, 0, 1, 0, 28 | 0, 0, 0, 1 29 | ); 30 | 31 | void main() { 32 | gl_Position = mvp * vec4 (position, 1.0f); 33 | gl_Position.y = -gl_Position.y; 34 | out_uv = uv; 35 | 36 | if (transformation.flip_y) { 37 | out_uv.y = 1.0 - out_uv.y; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/android/android_ahardwarebuffer_allocator.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Header exposing factory function for AHardwareBuffer backed image 6 | buffer allocator. 7 | * @author Ryan Pavlik 8 | * @ingroup aux_android 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "xrt/xrt_compositor.h" 14 | #include "xrt/xrt_handles.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | #ifdef XRT_GRAPHICS_BUFFER_HANDLE_IS_AHARDWAREBUFFER 21 | 22 | struct xrt_image_native_allocator * 23 | android_ahardwarebuffer_allocator_create(); 24 | 25 | xrt_result_t 26 | ahardwarebuffer_image_allocate(const struct xrt_swapchain_create_info *xsci, xrt_graphics_buffer_handle_t *out_image); 27 | 28 | #endif // XRT_GRAPHICS_BUFFER_HANDLE_IS_AHARDWAREBUFFER 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/main.c: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Very simple target main file to export the right symbol. 6 | * @author Jakob Bornecrantz 7 | * @author Christoph Haag 8 | * @ingroup st_ovrd 9 | */ 10 | 11 | #include "ovrd_interface.h" 12 | 13 | #if defined(_WIN32) 14 | #define HMD_DLL_EXPORT __declspec(dllexport) 15 | #define HMD_DLL_IMPORT __declspec(dllimport) 16 | #elif defined(__GNUC__) || defined(COMPILER_GCC) || defined(__APPLE__) 17 | #define HMD_DLL_EXPORT __attribute__((visibility("default"))) 18 | #define HMD_DLL_IMPORT 19 | #else 20 | #error "Unsupported Platform." 21 | #endif 22 | 23 | 24 | HMD_DLL_EXPORT void * 25 | HmdDriverFactory(const char *pInterfaceName, int *pReturnCode) 26 | { 27 | return ovrd_hmd_driver_impl(pInterfaceName, pReturnCode); 28 | } 29 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/math/m_mathinclude.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Wrapper header for to ensure pi-related math constants are 6 | * defined. 7 | * 8 | * Use this instead of directly including in headers and when 9 | * you need M_PI and its friends. 10 | * @author Ryan Pavlik 11 | * 12 | * @ingroup aux_math 13 | */ 14 | 15 | #pragma once 16 | 17 | #define _USE_MATH_DEFINES // for M_PI 18 | #ifdef __cplusplus 19 | #include 20 | #else 21 | #include 22 | #endif 23 | 24 | 25 | // Might be missing on Windows. 26 | #ifndef M_PI 27 | #define M_PI (3.14159265358979323846) 28 | #endif 29 | 30 | // Might be missing on Windows. 31 | #ifndef M_PIl 32 | #define M_PIl (3.14159265358979323846264338327950288) 33 | #endif 34 | 35 | #ifndef M_1_PI 36 | #define M_1_PI (1. / M_PI) 37 | #endif 38 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr_android/src/main/res/values/library_openxrincludes_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | type 8 | The Khronos Group Inc. 9 | https://khronos.org/openxr 10 | OpenXR Headers 11 | apache_2_0,mit 12 | true 13 | https://github.com/KhronosGroup/OpenXR-SDK 14 | native 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/xrt/targets/steamvr_drv/copy_assets.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright 2020, Collabora, Ltd. 4 | # SPDX-License-Identifier: BSL-1.0 5 | 6 | import os 7 | import sys 8 | from distutils.dir_util import copy_tree 9 | from distutils.file_util import copy_file 10 | 11 | print(sys.argv[1], sys.argv[2], sys.argv[3]) 12 | 13 | is_file = sys.argv[1] == "FILE" 14 | is_dir = sys.argv[1] == "DIRECTORY" 15 | 16 | # get absolute input and output paths 17 | input_path = sys.argv[2] 18 | 19 | output_path = sys.argv[3] 20 | 21 | # make sure destination directory exists 22 | os.makedirs(os.path.dirname(output_path), exist_ok=True) 23 | 24 | if is_file: 25 | copy_file(input_path, output_path) 26 | elif is_dir: 27 | copy_tree(input_path, output_path) 28 | else: 29 | print(sys.argv[1], "must be FILE or DIRECTORY") 30 | sys.exit(1) 31 | 32 | print("Copying asset " + str(input_path) + " to " + str(output_path)) 33 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/android/android_load_class.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Function for loading Java code from a package. 6 | * @author Ryan Pavlik 7 | * @ingroup aux_android 8 | */ 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | #include "wrap/android.app.h" 15 | 16 | #ifdef XRT_OS_ANDROID 17 | 18 | //! C++-only functionality in the Android auxiliary library 19 | namespace xrt::auxiliary::android { 20 | 21 | using wrap::android::content::pm::ApplicationInfo; 22 | 23 | ApplicationInfo 24 | getAppInfo(std::string const &packageName, jobject application_context); 25 | 26 | wrap::java::lang::Class 27 | loadClassFromPackage(ApplicationInfo applicationInfo, jobject application_context, const char *clazz_name); 28 | 29 | } // namespace xrt::auxiliary::android 30 | 31 | #endif // XRT_OS_ANDROID 32 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/util/u_frame.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief @ref xrt_frame helpers. 6 | * @author Jakob Bornecrantz 7 | * @ingroup aux_util 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "xrt/xrt_frame.h" 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | 19 | /*! 20 | * Creates a single non-pooled frame, when the reference reaches zero it is 21 | * freed. 22 | */ 23 | void 24 | u_frame_create_one_off(enum xrt_format f, uint32_t width, uint32_t height, struct xrt_frame **out_frame); 25 | 26 | /*! 27 | * Clones a frame. The cloned frame is not freed when the original frame is freed; instead the cloned frame is freed 28 | * when its reference reaches zero. 29 | */ 30 | void 31 | u_frame_clone(struct xrt_frame *to_copy, struct xrt_frame **out_frame); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /src/xrt/targets/gui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2021, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | ###### 5 | # Create a small SDL2 based GUI for Monado. 6 | 7 | set(SOURCE_FILES 8 | gui_sdl2.c 9 | gui_sdl2_imgui.c 10 | gui_sdl2_main.c 11 | ) 12 | 13 | add_executable(gui 14 | ${SOURCE_FILES} 15 | ) 16 | 17 | set_target_properties(gui PROPERTIES 18 | OUTPUT_NAME monado-gui 19 | PREFIX "" 20 | ) 21 | add_sanitizers(gui) 22 | 23 | target_link_libraries(gui PRIVATE 24 | aux_os 25 | aux_ogl 26 | aux_util 27 | aux_math 28 | st_gui 29 | target_instance_no_comp 30 | imgui_impl_sdl 31 | ${SDL2_LIBRARIES} 32 | ) 33 | if(WIN32) 34 | target_link_libraries(gui PRIVATE SDL2::SDL2main) 35 | endif() 36 | 37 | target_include_directories(gui PRIVATE 38 | ${CMAKE_CURRENT_SOURCE_DIR}/.. 39 | ${SDL2_INCLUDE_DIRS} 40 | ) 41 | 42 | install(TARGETS gui 43 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 44 | ) 45 | -------------------------------------------------------------------------------- /src/xrt/include/xrt/xrt_config_os.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Auto detect OS and certain features. 6 | * @author Jakob Bornecrantz 7 | * @ingroup xrt_iface 8 | */ 9 | 10 | #pragma once 11 | 12 | 13 | /* 14 | * 15 | * Auto detect OS. 16 | * 17 | */ 18 | 19 | #if defined(__ANDROID__) 20 | #define XRT_OS_ANDROID 21 | #define XRT_OS_LINUX 22 | #define XRT_OS_UNIX 23 | #define XRT_OS_WAS_AUTODETECTED 24 | #endif 25 | 26 | #if defined(__linux__) && !defined(XRT_OS_WAS_AUTODETECTED) 27 | #define XRT_OS_LINUX 28 | #define XRT_OS_UNIX 29 | #define XRT_OS_WAS_AUTODETECTED 30 | #endif 31 | 32 | #if defined(_WIN32) 33 | #define XRT_OS_WINDOWS 34 | #define XRT_OS_WAS_AUTODETECTED 35 | #endif 36 | 37 | 38 | #ifndef XRT_OS_WAS_AUTODETECTED 39 | #error "OS type not found during compile" 40 | #endif 41 | #undef XRT_OS_WAS_AUTODETECTED 42 | -------------------------------------------------------------------------------- /src/xrt/targets/openxr_android/src/main/res/values/library_jnipp_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | type 8 | Mitchell Dowd, Ryan Pavlik 9 | https://github.com/rpavlik/jnipp 10 | JNIPP 11 | C++ wrapper for the Java Native Interface 12 | mit 13 | true 14 | https://github.com/rpavlik/jnipp 15 | native 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/xrt/drivers/dummy/dummy_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Interface to dummy driver. 6 | * @author Jakob Bornecrantz 7 | * @ingroup drv_dummy 8 | */ 9 | 10 | #pragma once 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /*! 17 | * @defgroup drv_dummy Dummy driver 18 | * @ingroup drv 19 | * 20 | * @brief Simple do-nothing dummy driver. 21 | */ 22 | 23 | /*! 24 | * Create a auto prober for dummy devices. 25 | * 26 | * @ingroup drv_dummy 27 | */ 28 | struct xrt_auto_prober * 29 | dummy_create_auto_prober(void); 30 | 31 | /*! 32 | * Create a dummy hmd. 33 | * 34 | * @ingroup drv_dummy 35 | */ 36 | struct xrt_device * 37 | dummy_hmd_create(void); 38 | 39 | /*! 40 | * @dir drivers/dummy 41 | * 42 | * @brief @ref drv_dummy files. 43 | */ 44 | 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | -------------------------------------------------------------------------------- /src/external/imgui/imgui/cimgui_sdl.cpp: -------------------------------------------------------------------------------- 1 | #include "imgui.h" 2 | #include "imgui_internal.h" 3 | #include "cimgui.h" 4 | #include "imgui_impl_sdl.h" 5 | 6 | 7 | CIMGUI_API bool igImGui_ImplSDL2_InitForOpenGL(SDL_Window* window, void* sdl_gl_context) 8 | { 9 | return ImGui_ImplSDL2_InitForOpenGL(window, sdl_gl_context); 10 | } 11 | #if 0 12 | CIMGUI_API bool igImGui_ImplSDL2_InitForVulkan(SDL_Window* window) 13 | { 14 | return ImGui_ImplSDL2_InitForVulkan(window); 15 | } 16 | CIMGUI_API bool igImGui_ImplSDL2_InitForD3D(SDL_Window* window) 17 | { 18 | return ImGui_ImplSDL2_InitForD3D(window); 19 | } 20 | #endif 21 | CIMGUI_API void igImGui_ImplSDL2_Shutdown() 22 | { 23 | ImGui_ImplSDL2_Shutdown(); 24 | } 25 | CIMGUI_API void igImGui_ImplSDL2_NewFrame(SDL_Window* window) 26 | { 27 | ImGui_ImplSDL2_NewFrame(window); 28 | } 29 | CIMGUI_API bool igImGui_ImplSDL2_ProcessEvent(const SDL_Event* event) 30 | { 31 | return ImGui_ImplSDL2_ProcessEvent(event); 32 | } 33 | -------------------------------------------------------------------------------- /src/xrt/drivers/ohmd/oh_device.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Interface to OpenHMD driver code. 6 | * @author Jakob Bornecrantz 7 | * @ingroup drv_ohmd 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "math/m_api.h" 13 | #include "xrt/xrt_device.h" 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | int 20 | oh_device_create(ohmd_context *ctx, bool no_hmds, struct xrt_device **out_xdevs); 21 | 22 | #define OHMD_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->ll, __VA_ARGS__) 23 | #define OHMD_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->ll, __VA_ARGS__) 24 | #define OHMD_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->ll, __VA_ARGS__) 25 | #define OHMD_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->ll, __VA_ARGS__) 26 | #define OHMD_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->ll, __VA_ARGS__) 27 | 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | -------------------------------------------------------------------------------- /src/xrt/drivers/ultraleap_v2/ulv2_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // Copyright 2020-2021, Moses Turner. 3 | // SPDX-License-Identifier: BSL-1.0 4 | /*! 5 | * @file 6 | * @brief Driver for Ultraleap's V2 API for the Leap Motion Controller. 7 | * @author Moses Turner 8 | * @author Christoph Haag 9 | * @ingroup drv_ulv2 10 | */ 11 | 12 | #pragma once 13 | 14 | #include "math/m_api.h" 15 | #include "xrt/xrt_device.h" 16 | #include "xrt/xrt_prober.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #define ULV2_VID 0xf182 23 | #define ULV2_PID 0x0003 24 | 25 | int 26 | ulv2_found(struct xrt_prober *xp, 27 | struct xrt_prober_device **devices, 28 | size_t num_devices, 29 | size_t index, 30 | cJSON *attached_data, 31 | struct xrt_device **out_xdev); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /src/external/android-jni-wrap/wrap/android.app.impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | // Author: Ryan Pavlik 4 | // Inline implementations: do not include on its own! 5 | 6 | #pragma once 7 | 8 | #include "android.content.h" 9 | #include 10 | 11 | namespace wrap { 12 | namespace android::app { 13 | 14 | inline jni::Object Activity::getSystemService(std::string const &name) { 15 | assert(!isNull()); 16 | return object().call(Meta::data().getSystemService, name); 17 | } 18 | 19 | inline void 20 | Activity::setVrModeEnabled(bool enabled, 21 | content::ComponentName const &requestedComponent) { 22 | assert(!isNull()); 23 | return object().call(Meta::data().setVrModeEnabled, enabled, 24 | requestedComponent.object()); 25 | } 26 | 27 | } // namespace android::app 28 | } // namespace wrap 29 | -------------------------------------------------------------------------------- /src/external/android-jni-wrap/wrap/android.database.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | // Author: Ryan Pavlik 4 | 5 | #include "android.database.h" 6 | 7 | namespace wrap { 8 | namespace android::database { 9 | Cursor::Meta::Meta() 10 | : MetaBaseDroppable(Cursor::getTypeName()), 11 | getCount(classRef().getMethod("getCount", "()I")), 12 | moveToFirst(classRef().getMethod("moveToFirst", "()Z")), 13 | moveToNext(classRef().getMethod("moveToNext", "()Z")), 14 | getColumnIndex( 15 | classRef().getMethod("getColumnIndex", "(Ljava/lang/String;)I")), 16 | getString(classRef().getMethod("getString", "(I)Ljava/lang/String;")), 17 | getInt(classRef().getMethod("getInt", "(I)I")), 18 | close(classRef().getMethod("close", "()V")) { 19 | MetaBaseDroppable::dropClassRef(); 20 | } 21 | } // namespace android::database 22 | } // namespace wrap 23 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/tracking/t_data_utils.c: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2021, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Small data helpers for calibration. 6 | * @author Jakob Bornecrantz 7 | * @ingroup aux_tracking 8 | */ 9 | 10 | #include "tracking/t_tracking.h" 11 | #include "util/u_misc.h" 12 | 13 | #include 14 | #include 15 | 16 | 17 | void 18 | t_stereo_camera_calibration_alloc(struct t_stereo_camera_calibration **out_c, uint32_t distortion_num) 19 | { 20 | assert(distortion_num == 5 || distortion_num == 14); 21 | 22 | struct t_stereo_camera_calibration *c = U_TYPED_CALLOC(struct t_stereo_camera_calibration); 23 | c->view[0].distortion_num = distortion_num; 24 | c->view[1].distortion_num = distortion_num; 25 | t_stereo_camera_calibration_reference(out_c, c); 26 | } 27 | 28 | void 29 | t_stereo_camera_calibration_destroy(struct t_stereo_camera_calibration *c) 30 | { 31 | free(c); 32 | } 33 | -------------------------------------------------------------------------------- /src/xrt/drivers/realsense/rs_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Interface to RealSense devices. 6 | * @author Jakob Bornecrantz 7 | * @ingroup drv_rs 8 | */ 9 | 10 | #pragma once 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | 17 | /*! 18 | * @defgroup drv_rs Intel RealSense driver 19 | * @ingroup drv 20 | * 21 | * @brief Driver for the SLAM-capable Intel Realsense devices. 22 | */ 23 | 24 | /*! 25 | * Create a RelaseSense 6DOF tracker device. 26 | * 27 | * @ingroup drv_rs 28 | */ 29 | struct xrt_device * 30 | rs_6dof_create(void); 31 | 32 | /*! 33 | * Create a auto prober for rs devices. 34 | * 35 | * @ingroup drv_rs 36 | */ 37 | struct xrt_auto_prober * 38 | rs_create_auto_prober(void); 39 | 40 | /*! 41 | * @dir drivers/realsense 42 | * 43 | * @brief @ref drv_rs files. 44 | */ 45 | 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | -------------------------------------------------------------------------------- /src/xrt/targets/service/configure_and_install_units.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2020, Collabora, Ltd. 2 | # SPDX-License-Identifier: BSL-1.0 3 | 4 | set(XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_FILES @XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_FILES@) 5 | 6 | # Set up variables to use when configuring files 7 | set(conflicts @conflicts@) 8 | set(exit_on_disconnect @exit_on_disconnect@) 9 | set(service_path "monado-service") 10 | if(XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_FILES) 11 | set(service_path 12 | "${CMAKE_INSTALL_PREFIX}/@CMAKE_INSTALL_BINDIR@/${service_path}") 13 | endif() 14 | 15 | # Create unit files 16 | configure_file(@SOCKET_INPUT@ "@CMAKE_CURRENT_BINARY_DIR@/@UNIT_NAME@.socket") 17 | configure_file(@SERVICE_INPUT@ "@CMAKE_CURRENT_BINARY_DIR@/@UNIT_NAME@.service") 18 | 19 | # Install them 20 | file( 21 | INSTALL 22 | DESTINATION "@UNIT_DIR@" 23 | TYPE FILE 24 | FILES 25 | "@CMAKE_CURRENT_BINARY_DIR@/@UNIT_NAME@.socket" 26 | "@CMAKE_CURRENT_BINARY_DIR@/@UNIT_NAME@.service") 27 | -------------------------------------------------------------------------------- /src/xrt/drivers/north_star/ns_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2020, Collabora, Ltd. 2 | // Copyright 2020, Nova King. 3 | // SPDX-License-Identifier: BSL-1.0 4 | /*! 5 | * @file 6 | * @brief Interface to North Star driver code. 7 | * @author Nova King 8 | * @ingroup drv_ns 9 | */ 10 | 11 | #pragma once 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | 18 | /*! 19 | * @defgroup drv_ns North Star driver 20 | * @ingroup drv 21 | * 22 | * @brief Driver for the North Star HMD. 23 | */ 24 | 25 | /*! 26 | * Create a probe for NS devices. 27 | * 28 | * @ingroup drv_ns 29 | */ 30 | struct xrt_auto_prober * 31 | ns_create_auto_prober(void); 32 | 33 | /*! 34 | * Create a North Star hmd. 35 | * 36 | * @ingroup drv_ns 37 | */ 38 | struct xrt_device * 39 | ns_hmd_create(const char *config_path); 40 | 41 | /*! 42 | * @dir drivers/north_star 43 | * 44 | * @brief @ref drv_ns files. 45 | */ 46 | 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | -------------------------------------------------------------------------------- /src/xrt/drivers/illixr/illixr_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021, The Board of Trustees of the University of Illinois. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief ILLIXR driver interface 6 | * @author RSIM Group 7 | * @ingroup drv_illixr 8 | */ 9 | 10 | #pragma once 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /*! 17 | * @defgroup drv_illixr illixr driver. 18 | * @ingroup drv 19 | * 20 | * @brief illixr driver. 21 | */ 22 | 23 | /*! 24 | * Create a auto prober for illixr devices. 25 | * 26 | * @ingroup drv_illixr 27 | */ 28 | struct xrt_auto_prober * 29 | illixr_create_auto_prober(void); 30 | 31 | /*! 32 | * Create a illixr hmd. 33 | * 34 | * @ingroup drv_illixr 35 | */ 36 | struct xrt_device * 37 | illixr_hmd_create(const char *path, const char *comp); 38 | 39 | /*! 40 | * @dir drivers/illixr 41 | * 42 | * @brief @ref drv_illixr files. 43 | */ 44 | 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | -------------------------------------------------------------------------------- /src/xrt/auxiliary/util/u_verify.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021, Collabora, Ltd. 2 | // Copyright 2021, Moses Turner. 3 | // SPDX-License-Identifier: BSL-1.0 4 | /*! 5 | * @file 6 | * @brief Tiny file to verify things 7 | * @author Moses Turner 8 | * @author Jakob Bornecrantz 9 | * @ingroup aux_util 10 | */ 11 | 12 | #pragma once 13 | #include "xrt/xrt_defines.h" 14 | #include "xrt/xrt_device.h" 15 | 16 | static inline bool 17 | u_verify_blend_mode_valid(enum xrt_blend_mode blend_mode) 18 | { 19 | return ((blend_mode == XRT_BLEND_MODE_OPAQUE) || (blend_mode == XRT_BLEND_MODE_ADDITIVE) || 20 | (blend_mode == XRT_BLEND_MODE_ALPHA_BLEND)); 21 | } 22 | 23 | static inline bool 24 | u_verify_blend_mode_supported(struct xrt_device *xdev, enum xrt_blend_mode blend_mode) 25 | { 26 | for (size_t i = 0; i < xdev->hmd->num_blend_modes; i++) { 27 | if (xdev->hmd->blend_modes[i] == blend_mode) { 28 | return true; 29 | } 30 | } 31 | return false; 32 | } 33 | -------------------------------------------------------------------------------- /src/xrt/targets/android_common/src/main/java/org/freedesktop/monado/android_common/ShutdownProcess.kt: -------------------------------------------------------------------------------- 1 | // Copyright 2020, Collabora, Ltd. 2 | // SPDX-License-Identifier: BSL-1.0 3 | /*! 4 | * @file 5 | * @brief Helper providing a shutdown button in the about activity. 6 | * @author Ryan Pavlik 7 | */ 8 | 9 | package org.freedesktop.monado.android_common 10 | 11 | import android.os.Process 12 | import android.view.View 13 | import android.widget.Button 14 | 15 | class ShutdownProcess { 16 | companion object { 17 | /** 18 | * Show and handle the shutdown runtime button. 19 | */ 20 | fun setupRuntimeShutdownButton(activity: AboutActivity) { 21 | val button = 22 | activity.findViewById