Skip to content

S-Dafarra/OpenXR-Hpp-BasicExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenXR-Hpp Basic Example

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 image.

It is based on the sdl2_gl_single_file_example.cpp example from https://github.com/jherico/OpenXR-Samples.

Dependencies

  • CMake (minimum version 3.10)
  • OpenXR
  • OpenXR-Hpp ⚠️ You need to run the generate-openxr-hpp script in order to generate the files. Then, set the OpenXR-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.

Installation

Linux/macOS

git clone https://github.com/S-Dafarra/OpenXR-Hpp-BasicExample
cd OpenXR-Hpp-BasicExample
mkdir build && cd build
cmake ../
make

Windows

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

Testing

Linux

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

Windows

TBD. At the moment, this has been tested only on Ubuntu 20.04.

About

Basic usage example of OpenXR-HPP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published