Skip to content

(WARNING WIP PROBABLY UB) A simple example rendering a triangle through either OpenXR or through a desktop window. Cross-platform, has been tested on Monado and SteamVR

Notifications You must be signed in to change notification settings

ChatImproVR/rust-opengl-openxr-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust OpenGL OpenXR example

Minimal example code to display a triangle on both desktop and in OpenXR using OpenGL in Rust. Also provides session_create_info() to perform appropriate platform-specific magic to get SessionCreateInfo. One should use caution when using this library, as it was really just hacked together using guesswork and std::mem::transmute(). PRs welcome!

Installing dependencies

Windows

SteamVR

  • Install SteamVR through Steam

Linux

Monado

  • On Ubuntu: sudo apt install libopenxr-loader1 libopenxr-dev libopenxr1-monado
  • On Arch: yay -S monado openxr

SteamVR (currently not working on Linux)

  • NOTE: The following currently only compiles the program. This does not work yet
  • Install SteamVR through Steam
  • On Ubuntu: sudo apt install libopenxr-loader1 libopenxr-dev

Running

cargo run --release --example triangle Run with the --vr flag to use OpenXR

TODO

  • Create a library abstracting away the platform-dependent parts of this
  • Use multiview rendering
  • Display a floating cube (on a new branch cube)

About

(WARNING WIP PROBABLY UB) A simple example rendering a triangle through either OpenXR or through a desktop window. Cross-platform, has been tested on Monado and SteamVR

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages