Skip to main content
Version: 14 May 2024

Application Development Overview

For developers familiar with C++ but new to OpenXR, check out the OpenXR Tutorial by Khronos, the organization behind the OpenXR standard. This tutorial serves as a step-by-step guide, introducing you to essential OpenXR APIs and concepts. You will learn how to set up your development environment, initialize OpenXR, render graphics, handle input, and explore the OpenXR features and extensions. Learn More


The Magic Leap 2 OpenXR runtime has been certified as conformant as of the 1.1.0 release.

MLSDK Interoperability

Using OpenXR on the Magic Leap 2 is similar to using OpenXR on any other Android device. Since not all Magic Leap 2 features are supported as extensions in OpenXR, you can mix functionality from the Magic Leap C-API with OpenXR functionality. For example, you can use ml_audio.h in OpenXR applications. Just make sure you install the MLSDK when doing so.

OpenXR sample source code is available in the Magic Leap Hub. OpenXR Samples

OpenXR Runtime Limitations

  • One XrCompositionLayerProjection is supported.
  • A maximum of 16 composition layers at one time.
  • Each layer imposes a performance penalty, if you are seeing performance issues consider refraining from using more than one layer.
  • The Magic Leap 2 OS lets users set the Display Zone near boundary (also known as the near clipping plane distance) for their device while running apps, but the XR_EXT_view_configuration_depth_range extension updates its values only when a new instance of OpenXR starts. This means the device's Display Zone near boundary won't change until the user restarts an app.

Loading the Runtime

We recommend you use the standard OpenXR loader.

If you cannot use the standard loader, the runtime binary name can be found using the Android Content Provider mechanism described in the OpenXR loader specification. Do not hardcode the path as the name might change.

Android Manifest

See Android Manifest Setup for information regarding how to configure the Android manifest when building a native immersive application for MagicLeap2.