OVRFW::XrApp base class for OpenXR lifecycle, render loop, and input managementGetExtensions(), loading function pointers, and handling extension eventsadb shell setprop debug.oculus.experimentalEnabled 1 (resets on reboot)Samples/build.gradle in Android Studio, or work with individual samples by opening a specific sample’s build.gradle file (e.g., Samples/XrSamples/XrInput/Projects/Android/build.gradle). Each sample includes a Gradle wrapper and can be built independently. Connect your Quest device via USB, ensure developer mode is enabled, and build/run directly from Android Studio to deploy to your headset.| Sample | What it demonstrates | Key concepts |
|---|---|---|
Input & Interaction | ||
XrInput | OpenXR action system with controller bindings | Actions, action sets, interaction profiles, suggested bindings |
XrControllers | Controller input values and haptic feedback | Haptic amplitude envelope, PCM haptics |
XrMicrogestures | Thumb tap and swipe microgestures | Hand-based D-pad input without controllers |
Hand Tracking | ||
XrHandsFB | Hand joint positions with mesh and capsule visualization | XR_EXT_hand_tracking, XR_FB_hand_tracking_mesh, XR_FB_hand_tracking_capsules |
XrHandDataSource | Hybrid hand tracking using both camera and controller data | XR_EXT_hand_tracking_data_source for fusing data sources |
XrHandsAndControllers | Simultaneous hand and controller tracking | XR_META_simultaneous_hands_and_controllers, XR_META_detached_controllers |
XrHandTrackingWideMotionMode | Extended hand tracking range beyond camera FOV | XR_META_hand_tracking_wide_motion_mode |
Body, Face, & Eye Tracking | ||
XrBodyFaceEyeSocial | Combined body, face, and eye tracking for avatars | XR_FB_body_tracking, XR_FB_eye_tracking_social, XR_FB_face_tracking2 |
Passthrough & Mixed Reality | ||
XrPassthrough | Passthrough compositing with styles, selective and projected modes | XR_FB_passthrough compositor layers |
XrPassthroughOcclusion | Depth-based occlusion of virtual objects behind real ones | XR_META_environment_depth for MR rendering |
Scene Understanding | ||
XrSceneModel | Room setup, querying scene entities (floors, walls, furniture, meshes) | XR_FB_scene_capture, XR_FB_scene, XR_META_spatial_entity_mesh |
XrSceneSharing | Share captured scene data between host and guest devices | XR_META_spatial_entity_group_sharing, XR_META_spatial_entity_sharing |
Spatial Anchors & Persistence | ||
XrSpatialAnchor | Create, persist, discover, query, and share spatial anchors | XR_FB_spatial_entity |
XrColocationDiscovery | Discover colocated devices and share anchor groups | XR_META_colocation_discovery, anchor group sharing |
Dynamic Object Tracking | ||
XrDynamicObjects | Detect and track physical keyboards via passthrough window | XR_META_dynamic_object_tracker, XR_META_dynamic_object_keyboard |
Keyboard Input | ||
XrVirtualKeyboard | Virtual keyboard with hand/controller input and render model | XR_META_virtual_keyboard, XR_FB_render_model, swipe typing |
Rendering & Performance | ||
XrCompositor_NativeActivity | Compositor layer types (cube, cylinder, equirect, quad) | Single-file C sample demonstrating all compositor layers |
XrSpaceWarp | Application space warp for half-framerate rendering | XR_FB_space_warp for performance optimization |
XrColorSpaceFB | Color space enumeration and selection | XR_FB_color_space for color management |
OVRFW::XrApp, a base class in the SampleXrFramework library that handles OpenXR instance creation, session management, the render loop, swapchain setup, and default controller input. The sample overrides virtual methods to add extension-specific behavior without reimplementing the OpenXR lifecycle:std::vector<const char*> GetExtensions() override {
auto exts = XrApp::GetExtensions();
exts.push_back(XR_FB_COLOR_SPACE_EXTENSION_NAME);
return exts;
}
GetExtensions() and passes them to xrCreateInstance(), then handles xrWaitFrame(), xrBeginFrame(), and xrEndFrame() automatically. Samples override AppInit() for setup, AppRenderFrame() for rendering, and AppHandleEvent() for custom event processing.SampleXrFramework/Src/XrApp.h.xrGetInstanceProcAddr(). The framework handles this for common extensions, but samples that use newer or experimental extensions load additional function pointers in AppInit():xrGetInstanceProcAddr(
instance,
"xrCreateDynamicObjectTrackerMETA",
reinterpret_cast<PFN_xrVoidFunction*>(&xrCreateDynamicObjectTrackerMETA_));
XrDynamicObjects/Src/main.cpp.OVRFW::XrApp and override virtual methods. The framework handles lifecycle, rendering, and input. Use this pattern when you want to focus on extension logic rather than OpenXR lifecycle management.xrCreateInstance(), xrCreateSession(), and implementing your own render loop. Samples like XrPassthrough, XrSpatialAnchor, and XrSceneModel use this pattern to demonstrate complete OpenXR usage without framework dependencies.native_activity_framework, providing minimal examples without C++ abstractions. These samples show OpenXR usage at its simplest and serve as reference implementations for developers working in C.XrPassthrough/Src/XrPassthrough.cpp. For the single-file C pattern, see XrCompositor_NativeActivity/Src/XrCompositor_NativeActivity.c.PreProjectionAddLayer() and PostProjectionAddLayer(). This allows passthrough samples to add passthrough layers behind rendered content, or UI samples to add quad layers in front.XrApp.h layer methods.XrApp virtual methods like PreProjectionAddLayer() for custom compositor layers, GetSuggestedBindings() for custom input bindings, or AppHandleEvent() for extension-specific event handling.