https://github.com/khronosgroup/openxr-hpp
Open-Source OpenXR C++ language projection
https://github.com/khronosgroup/openxr-hpp
cplusplus-14 openxr virtual-reality vr
Last synced: 2 days ago
JSON representation
Open-Source OpenXR C++ language projection
- Host: GitHub
- URL: https://github.com/khronosgroup/openxr-hpp
- Owner: KhronosGroup
- License: apache-2.0
- Created: 2019-09-20T18:04:13.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-05T19:08:38.000Z (8 months ago)
- Last Synced: 2025-05-07T10:18:59.274Z (2 days ago)
- Topics: cplusplus-14, openxr, virtual-reality, vr
- Language: C++
- Homepage:
- Size: 6.54 MB
- Stars: 44
- Watchers: 13
- Forks: 17
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# OpenXR-Hpp project
This repository contains build scripts and test files for the `openxr*.hpp`
headers, providing a C++-friendly projection of the OpenXR API.The authoritative public repository is located at
. It hosts the public Issue
tracker, and accepts patches (Pull Requests) from the general public.If you want to simply write an application using OpenXR (the headers and
loader), with minimum dependencies, see
. That project will likely contain
the `openxr*.hpp` artifact when it is ready for widespread production usage.To build this project, you must have `OpenXR-SDK-Source` cloned in a peer
directory of this one.## Directory Structure
- `README.md` - This file
- `COPYING.md` - Copyright and licensing information
- `CODE_OF_CONDUCT.md` - Code of Conduct
- `OPENXR-HPP.md` - Some basic introductory documentation
- `include/` - Build system to generate the `openxr*.hpp` files
- `scripts/` - Python source code and Jinja2 templates for generating the
headers.
- `tests/` - some simple files that ensures the header is always compilable.## Building
### Install clang-format
Requires clang-format, preferably 6.0.
### Download OpenXR-Hpp
```shell
git clone https://github.com/KhronosGroup/OpenXR-Hpp.git
```### Download OpenXR-SDK-Source
```shell
git clone https://github.com/KhronosGroup/OpenXR-SDK-Source.git
```We need to place the OpenXR-SDK-Source in the same directory
of OpenXR-Hpp as it uses Python script of OpenXR-SDK-Source.If your OpenXR-SDK-Source (or internal gitlab) repo
isn't in a directory named that parallel to OpenXR-Hpp, you can set `OPENXR_REPO`
environment variable before running.### Run script to generate hpp files
Run un `./generate-openxr-hpp.sh` or `./generate-openxr-hpp.ps1`.
### Run tests
If you'd like to build the tests (making sure the headers can compile),
use CMake to generate a build system, like:```sh
mkdir build
cd build
cmake ..
make
```## Development
To improve/maintain consistent code style and code quality, we strongly
recommend setting up the pre-commit hooks, which check/correct:- large file additions
- byte-order marker
- case conflicts
- unresolved merge conflicts
- broken symlinks
- file endings
- line endings
- trailing whitespace
- autopep8
- [cmake-format][]Using these hooks involves the following steps:
**Install** [pre-commit][] - available thru pip or your
preferred package manager.```sh
python3 -m pip install --user pre-commit
```**Setup** the git hook scripts by running this script. This will configure the
current git repo working directory to run the hooks, as well as cloning and
building (if required) the various tools used by the hooks.```sh
pre-commit install
```Optionally, you can **run** the hooks over all files manually, before a commit:
```sh
pre-commit run --all-files
```[cmake-format]: https://cmake-format.readthedocs.io
[pre-commit]: https://pre-commit.com/