Developing with OpenXR and Monado
The OpenXR SDK.
On Archlinux, the OpenXR loader installs these files
Other distributions may use different paths like /usr/lib/x86_64-linux-gnu/....
The OpenXR headers
To start developing for OpenXR only those components are necessary. Similar to how Vulkan applications are developed by including Khronos’ Vulkan headers and linking to Khronos’ Vulkan loader, OpenXR applications include Khronos’ OpenXR headers and link to Khronos’ OpenXR loader. Just like compiling a Vulkan application does not require any Vulkan driver to be installed, compiling an OpenXR application does not require any OpenXR runtime to be installed.
Khronos has not released a reference implementation for OpenXR, so for actually running an OpenXR application some vendor’s OpenXR runtime (for example Monado) has to be installed.
Setting up the project
CMake
Here is a minimal cmake example to compile an example executable that can include OpenXR headers and links to the OpenXR loader.
As an alternative you can use OpenXR’s pkg-config file with CMake’s FindPkgConfig module.
Application.
With this project setup you can start including the <openxr/openx.h>
header and start calling OpenXR functions.
As a starting point, here is a minimal C example for starting an OpenGL application on Linux with the xlib graphics binding.