This project contains a simple OpenXR
example exploiting the OpenXR-Hpp
language projection. It is a single file, CMake
based, application that simply displays the following
.
It is based on the sdl2_gl_single_file_example.cpp
example from https://github.com/jherico/OpenXR-Samples.
CMake
(minimum version 3.10)OpenXR
OpenXR-Hpp
⚠️ You need to run thegenerate-openxr-hpp
script in order to generate the files. Then, set theOpenXR-Hpp_DIR
environmental variable with the path to the generated files.OpenGL
SDL2
glfw3
All these dependencies, except OpenXR-Hpp
, are available through apt
and vcpkg
.
git clone https://github.com/S-Dafarra/OpenXR-Hpp-BasicExample
cd OpenXR-Hpp-BasicExample
mkdir build && cd build
cmake ../
make
With IDE build tool facilities, such as Visual Studio:
git clone https://github.com/S-Dafarra/OpenXR-Hpp-BasicExample
cd OpenXR-Hpp-BasicExample
mkdir build && cd build
cmake ..
cmake --build . --target ALL_BUILD --config Release
This project can be compiled and tested even without a VR device on Windows through monado
.
Install monado
with
# Install monado packages with monado ppa ( https://monado.freedesktop.org/packages-ubuntu.html )
sudo add-apt-repository ppa:monado-xr/monado
sudo apt-get update
sudo apt install libopenxr1-monado
Then, in a terminal launch monado-service
. This will open a window with a grey background. If you are having issues in launching monado-service
, please check https://monado.freedesktop.org/getting-started.html#running-openxr-applications.
In a second terminal, assuming to be in the OpenXR-Hpp-BasicExample
folder, simply run
./build/bin/OpenXR-Hpp-BasicExample
TBD. At the moment, this has been tested only on Ubuntu 20.04.