Monado OpenXR Runtime
Modules | Directories | Macros
OpenXR state tracker

Client application facing code. More...

Collaboration diagram for OpenXR state tracker:

Modules

 OpenXR entrypoints
 Gets called from the client application, does most verification and routes calls into OpenXR main code functions.
 
 OpenXR main code
 Gets called from OpenXR entrypoints functions and talks to devices and Compositor using XRT interfaces.
 

Directories

directory oxr
 OpenXR state tracker files.
 

Macros

#define XRT_CAST_PTR_TO_OXR_HANDLE(HANDLE_TYPE, PTR)   ((HANDLE_TYPE)(uint64_t)(uintptr_t)(PTR))
 Cast a pointer to an OpenXR handle in such a way as to avoid warnings. More...
 
#define XRT_CAST_OXR_HANDLE_TO_PTR(PTR_TYPE, HANDLE)   ((PTR_TYPE)(uintptr_t)(uint64_t)(HANDLE))
 Cast an OpenXR handle to a pointer in such a way as to avoid warnings. More...
 

Detailed Description

Client application facing code.

Macro Definition Documentation

◆ XRT_CAST_OXR_HANDLE_TO_PTR

#define XRT_CAST_OXR_HANDLE_TO_PTR (   PTR_TYPE,
  HANDLE 
)    ((PTR_TYPE)(uintptr_t)(uint64_t)(HANDLE))

#include <state_trackers/oxr/oxr_objects.h>

Cast an OpenXR handle to a pointer in such a way as to avoid warnings.

Avoids -Wint-to-pointer-cast by first casting to a 64-bit int, then to a pointer-sized int, then to the desired pointer type. That's a lot of no-ops on 64-bit, but a narrowing (!) conversion on 32-bit.

Referenced by oxr_action_bind_io(), oxr_action_suggest_interaction_profile_bindings(), oxr_session_attach_action_sets(), oxr_session_hand_joints(), oxr_session_locate_views(), submit_cylinder_layer(), submit_equirect1_layer(), submit_equirect2_layer(), submit_projection_layer(), submit_quad_layer(), verify_cube_layer(), verify_cylinder_layer(), verify_depth_layer(), verify_equirect1_layer(), verify_equirect2_layer(), verify_projection_layer(), and verify_quad_layer().

◆ XRT_CAST_PTR_TO_OXR_HANDLE

#define XRT_CAST_PTR_TO_OXR_HANDLE (   HANDLE_TYPE,
  PTR 
)    ((HANDLE_TYPE)(uint64_t)(uintptr_t)(PTR))

#include <state_trackers/oxr/oxr_objects.h>

Cast a pointer to an OpenXR handle in such a way as to avoid warnings.

Avoids -Wpointer-to-int-cast by first casting to the same size int, then promoting to the 64-bit int, then casting to the handle type. That's a lot of no-ops on 64-bit, but a widening conversion on 32-bit.

Referenced by oxr_action_set::oxr_action_set_to_openxr(), oxr_action::oxr_action_to_openxr(), oxr_hand_tracker::oxr_hand_tracker_to_openxr(), oxr_instance::oxr_instance_to_openxr(), oxr_messenger_to_openxr(), oxr_session::oxr_session_to_openxr(), oxr_space_to_openxr(), and oxr_swapchain_to_openxr().