Skip to content

Latest commit

 

History

History
58 lines (39 loc) · 1.77 KB

README.md

File metadata and controls

58 lines (39 loc) · 1.77 KB

WebXR library for Emscripten

Goal of this project is to expose the WebXR Device API for use with C++ through emscripten.

Getting Started

Clone this repository as a submodule to your emscripten-based C++ project.

git submodule add https://github.com/vhiterabbit/emscripten-webxr

CMake

If you use CMake, you can use emscripten-webxr as CMake subproject and link to the webxr target.

To link your own executable against emscripten-webxr, add this project as a subproject and see the following example for linking the webxr target:

add_executable(your-own-executable main.cpp)

add_subdirectory(emscripten-webxr)
target_link_libraries(your-own-executable webxr)

No CMake

Link to library_webxr.js to resolve symbols defined in the webxr.h header with the following argument to your emscripten linking step:

--js-library emscripten-webxr/library_webxr.js

Make sure webxr.h is on your include path during compilation.

Usage Example

For example usage see the Magnum WebXR example.

Projects using Escmripten WebXR

  • Magnum WebXR example - WebXR example in the Magnum open source C++11/14 OpenGL graphics framework.
  • Wonderland Engine - Accessible development platform for building highly performant WebXR applications.

LICENSE

emscripten-webxr is licensed under the MIT/Expat license, see the COPYING file for details.