Skyscraper 2.0
xr Namespace Reference

The xr::DispatchTable struct contains all available PFN pointers to xr functions including those in all extensions. The application should call dispatchTable.Initialize() once creating a new XrInstance to initialize all function pointers. The application should reset the dispatch table by = {} when destroying the instance handle. More...

Namespaces

namespace  detail
 
namespace  math
 
namespace  Side
 
namespace  StereoView
 
namespace  su
 

Classes

class  ActionHandle
 
class  ActionSetHandle
 
struct  DispatchTable
 
struct  ExtensionContext
 
class  HandTrackerHandle
 
class  InstanceHandle
 
struct  NameVersion
 
struct  SceneBounds
 
class  SceneHandle
 
class  SceneObserverHandle
 
class  SessionHandle
 
class  SpaceHandle
 
class  SpatialAnchorHandle
 
class  SpatialGraphNodeBindingHandle
 
class  SwapchainHandle
 
struct  TypedUuid
 
class  UniqueXrHandle
 
struct  ViewConfigurationState
 
struct  ViewProperties
 

Typedefs

typedef uint32_t side_t
 

Functions

template<typename TArray , typename TValue >
bool Contains (const TArray &array, const TValue &value)
 
std::vector< XrExtensionProperties > EnumerateInstanceExtensionProperties (const char *layerName=nullptr)
 
std::vector< XrViewConfigurationType > EnumerateViewConfigurations (XrInstance instance, XrSystemId systemId)
 
std::vector< XrViewConfigurationView > EnumerateViewConfigurationViews (XrInstance instance, XrSystemId systemId, XrViewConfigurationType viewConfigurationType)
 
std::vector< XrEnvironmentBlendMode > EnumerateEnvironmentBlendModes (XrInstance instance, XrSystemId systemId, XrViewConfigurationType viewConfigType)
 
XrEnvironmentBlendMode PickEnvironmentBlendMode (const std::vector< XrEnvironmentBlendMode > &systemSupportedBlendModes, const std::vector< XrEnvironmentBlendMode > &appSupportedBlendModes)
 
std::vector< int64_t > EnumerateSwapchainFormats (XrSession session)
 
template<typename TSystemPixelFormat , typename TAppPixelFormat >
TAppPixelFormat PickSwapchainFormat (const std::vector< TSystemPixelFormat > &systemSupportedFormats, const std::vector< TAppPixelFormat > &appSupportedFormats)
 
std::vector< XrReferenceSpaceType > EnumerateReferenceSpaceTypes (XrSession session)
 
std::set< std::string > QueryActionLocalizedName (XrSession session, XrAction action, XrInputSourceLocalizedNameFlags flags)
 
ExtensionContext CreateExtensionContext (const std::vector< const char * > &requestedExtensions)
 
std::vector< XrSceneComputeFeatureMSFT > EnumerateSceneComputeFeatures (XrInstance instance, XrSystemId systemId)
 
xr::SceneObserverHandle CreateSceneObserver (XrSession session)
 
xr::SceneHandle CreateScene (XrSceneObserverMSFT sceneObserver)
 
void ComputeNewScene (XrSceneObserverMSFT sceneObserver, const std::vector< XrSceneComputeFeatureMSFT > &requestedFeatures, const SceneBounds &bounds, XrSceneComputeConsistencyMSFT consistency=XR_SCENE_COMPUTE_CONSISTENCY_SNAPSHOT_COMPLETE_MSFT, std::optional< XrMeshComputeLodMSFT > visualMeshLevelOfDetail={})
 
void ReadMeshBuffers (XrSceneMSFT scene, uint64_t meshBufferId, std::vector< XrVector3f > &vertexBuffer, std::vector< uint32_t > &indexBuffer)
 
void ReadMeshBuffers (XrSceneMSFT scene, uint64_t meshBufferId, std::vector< XrVector3f > &vertexBuffer, std::vector< uint16_t > &indexBuffer)
 
XrPath StringToPath (XrInstance instance, const char *str)
 
std::string PathToString (XrInstance instance, XrPath path)
 
std::vector< XrPath > StringsToPaths (XrInstance instance, const std::vector< std::string > &strings)
 
void SetApplicationInfo (XrApplicationInfo &appInfo, const xr::NameVersion &appNameVersion, const xr::NameVersion &engineNameVersion, XrVersion apiVersion=XR_CURRENT_API_VERSION)
 
template<typename T >
void SetEnabledExtensions (XrInstanceCreateInfo &info, T &extensions)
 
template<typename T >
void SetEnabledExtensions (XrInstanceCreateInfo &info, T &&extensions)=delete
 
template<typename XrStruct , typename XrExtension >
void InsertExtensionStruct (XrStruct &xrStruct, XrExtension &xrExtension)
 
template<typename XrEventData >
const XrEventData * event_cast (const XrEventDataBuffer *eventData)=delete
 
 DEFINE_EVENT_TYPE (XrEventDataEventsLost, XR_TYPE_EVENT_DATA_EVENTS_LOST)
 
 DEFINE_EVENT_TYPE (XrEventDataInteractionProfileChanged, XR_TYPE_EVENT_DATA_INTERACTION_PROFILE_CHANGED)
 
 DEFINE_EVENT_TYPE (XrEventDataInstanceLossPending, XR_TYPE_EVENT_DATA_INSTANCE_LOSS_PENDING)
 
 DEFINE_EVENT_TYPE (XrEventDataReferenceSpaceChangePending, XR_TYPE_EVENT_DATA_REFERENCE_SPACE_CHANGE_PENDING)
 
 DEFINE_EVENT_TYPE (XrEventDataPerfSettingsEXT, XR_TYPE_EVENT_DATA_PERF_SETTINGS_EXT)
 
 DEFINE_EVENT_TYPE (XrEventDataSessionStateChanged, XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED)
 
 DEFINE_EVENT_TYPE (XrEventDataVisibilityMaskChangedKHR, XR_TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR)
 
 MAKE_TO_STRING_FUNCS (XrReferenceSpaceType)
 
 MAKE_TO_STRING_FUNCS (XrViewConfigurationType)
 
 MAKE_TO_STRING_FUNCS (XrEnvironmentBlendMode)
 
 MAKE_TO_STRING_FUNCS (XrSessionState)
 
 MAKE_TO_STRING_FUNCS (XrResult)
 
 MAKE_TO_STRING_FUNCS (XrStructureType)
 
 MAKE_TO_STRING_FUNCS (XrFormFactor)
 
 MAKE_TO_STRING_FUNCS (XrEyeVisibility)
 
 MAKE_TO_STRING_FUNCS (XrObjectType)
 
 MAKE_TO_STRING_FUNCS (XrActionType)
 
 MAKE_TO_STRING_FUNCS (XrHandEXT)
 
 MAKE_TO_STRING_FUNCS (XrHandPoseTypeMSFT)
 
 MAKE_TO_CSTRING_FUNC (XrHandJointEXT)
 
 MAKE_TO_STRING_FUNCS (XrVisibilityMaskTypeKHR)
 
 MAKE_TO_STRING_FUNCS (XrReprojectionModeMSFT)
 
 MAKE_TO_STRING_FUNCS (XrSceneComponentTypeMSFT)
 
 MAKE_TO_STRING_FUNCS (XrSceneComputeStateMSFT)
 
 MAKE_TO_STRING_FUNCS (XrSceneComputeFeatureMSFT)
 
 MAKE_TO_STRING_FUNCS (XrSpatialGraphNodeTypeMSFT)
 
 MAKE_TO_STRING_FUNCS (XrSceneComputeConsistencyMSFT)
 
 MAKE_TO_STRING_FUNCS (XrMeshComputeLodMSFT)
 
constexpr bool IsPrimaryViewConfigurationType (XrViewConfigurationType type)
 
ViewProperties CreateViewProperties (XrInstance instance, XrSystemId systemId, XrViewConfigurationType viewConfigurationType, const std::vector< XrEnvironmentBlendMode > &appSupportedEnvironmentBlendModes)
 
ViewConfigurationState CreateViewConfigurationState (XrViewConfigurationType viewConfigurationType, XrInstance instance, XrSystemId systemId)
 
bool IsRecommendedSwapchainSizeChanged (const std::vector< XrViewConfigurationView > &oldConfigs, const std::vector< XrViewConfigurationView > &newConfigs)
 

Detailed Description

The xr::DispatchTable struct contains all available PFN pointers to xr functions including those in all extensions. The application should call dispatchTable.Initialize() once creating a new XrInstance to initialize all function pointers. The application should reset the dispatch table by = {} when destroying the instance handle.

#define ENABLE_GLOBAL_XR_DISPATCH_TABLE before #include "XrDispatchTable.h" will add the xrFunctions to the global namespace, so that the application can simply call xr functions as if they are normal C functions. Extension functions can also be used as C functions, e.g. xrCreateSpatialAnchorMSFT();

Typedef Documentation

◆ side_t

typedef uint32_t xr::side_t

Definition at line 8 of file XrSide.h.

Function Documentation

◆ ComputeNewScene()

void xr::ComputeNewScene ( XrSceneObserverMSFT sceneObserver,
const std::vector< XrSceneComputeFeatureMSFT > & requestedFeatures,
const SceneBounds & bounds,
XrSceneComputeConsistencyMSFT consistency = XR_SCENE_COMPUTE_CONSISTENCY_SNAPSHOT_COMPLETE_MSFT,
std::optional< XrMeshComputeLodMSFT > visualMeshLevelOfDetail = {} )
inline

Definition at line 48 of file XrSceneUnderstanding.h.

◆ Contains()

template<typename TArray , typename TValue >
bool xr::Contains ( const TArray & array,
const TValue & value )
inline

Definition at line 13 of file XrEnumerate.h.

◆ CreateExtensionContext()

ExtensionContext xr::CreateExtensionContext ( const std::vector< const char * > & requestedExtensions)
inline

Definition at line 43 of file XrExtensionContext.h.

References xr::ExtensionContext::EnabledExtensions, and EnumerateInstanceExtensionProperties().

Here is the call graph for this function:

◆ CreateScene()

xr::SceneHandle xr::CreateScene ( XrSceneObserverMSFT sceneObserver)
inline

Definition at line 31 of file XrSceneUnderstanding.h.

References CHECK_XRCMD, and xr::UniqueXrHandle< HandleType >::Put().

Here is the call graph for this function:

◆ CreateSceneObserver()

xr::SceneObserverHandle xr::CreateSceneObserver ( XrSession session)
inline

Definition at line 24 of file XrSceneUnderstanding.h.

References CHECK_XRCMD, and xr::UniqueXrHandle< HandleType >::Put().

Here is the call graph for this function:

◆ CreateViewConfigurationState()

ViewConfigurationState xr::CreateViewConfigurationState ( XrViewConfigurationType viewConfigurationType,
XrInstance instance,
XrSystemId systemId )
inline

Definition at line 44 of file XrViewConfiguration.h.

References EnumerateViewConfigurationViews(), and xr::ViewConfigurationState::Type.

Here is the call graph for this function:

◆ CreateViewProperties()

ViewProperties xr::CreateViewProperties ( XrInstance instance,
XrSystemId systemId,
XrViewConfigurationType viewConfigurationType,
const std::vector< XrEnvironmentBlendMode > & appSupportedEnvironmentBlendModes )
inline

Definition at line 28 of file XrViewConfiguration.h.

References CHECK_XRCMD, EnumerateEnvironmentBlendModes(), PickEnvironmentBlendMode(), and xr::ViewProperties::Type.

Here is the call graph for this function:

◆ DEFINE_EVENT_TYPE() [1/7]

xr::DEFINE_EVENT_TYPE ( XrEventDataEventsLost ,
XR_TYPE_EVENT_DATA_EVENTS_LOST  )

◆ DEFINE_EVENT_TYPE() [2/7]

xr::DEFINE_EVENT_TYPE ( XrEventDataInstanceLossPending ,
XR_TYPE_EVENT_DATA_INSTANCE_LOSS_PENDING  )

◆ DEFINE_EVENT_TYPE() [3/7]

xr::DEFINE_EVENT_TYPE ( XrEventDataInteractionProfileChanged ,
XR_TYPE_EVENT_DATA_INTERACTION_PROFILE_CHANGED  )

◆ DEFINE_EVENT_TYPE() [4/7]

xr::DEFINE_EVENT_TYPE ( XrEventDataPerfSettingsEXT ,
XR_TYPE_EVENT_DATA_PERF_SETTINGS_EXT  )

◆ DEFINE_EVENT_TYPE() [5/7]

xr::DEFINE_EVENT_TYPE ( XrEventDataReferenceSpaceChangePending ,
XR_TYPE_EVENT_DATA_REFERENCE_SPACE_CHANGE_PENDING  )

◆ DEFINE_EVENT_TYPE() [6/7]

xr::DEFINE_EVENT_TYPE ( XrEventDataSessionStateChanged ,
XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED  )

◆ DEFINE_EVENT_TYPE() [7/7]

xr::DEFINE_EVENT_TYPE ( XrEventDataVisibilityMaskChangedKHR ,
XR_TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR  )

◆ EnumerateEnvironmentBlendModes()

std::vector< XrEnvironmentBlendMode > xr::EnumerateEnvironmentBlendModes ( XrInstance instance,
XrSystemId systemId,
XrViewConfigurationType viewConfigType )
inline

Definition at line 48 of file XrEnumerate.h.

References CHECK_XRCMD.

Referenced by CreateViewProperties().

◆ EnumerateInstanceExtensionProperties()

std::vector< XrExtensionProperties > xr::EnumerateInstanceExtensionProperties ( const char * layerName = nullptr)
inline

Definition at line 17 of file XrEnumerate.h.

References CHECK_XRCMD.

Referenced by CreateExtensionContext().

◆ EnumerateReferenceSpaceTypes()

std::vector< XrReferenceSpaceType > xr::EnumerateReferenceSpaceTypes ( XrSession session)
inline

Definition at line 99 of file XrEnumerate.h.

References CHECK_XRCMD.

◆ EnumerateSceneComputeFeatures()

std::vector< XrSceneComputeFeatureMSFT > xr::EnumerateSceneComputeFeatures ( XrInstance instance,
XrSystemId systemId )
inline

Definition at line 14 of file XrSceneUnderstanding.h.

References CHECK_XRCMD.

◆ EnumerateSwapchainFormats()

std::vector< int64_t > xr::EnumerateSwapchainFormats ( XrSession session)
inline

Definition at line 75 of file XrEnumerate.h.

References CHECK_XRCMD.

◆ EnumerateViewConfigurations()

std::vector< XrViewConfigurationType > xr::EnumerateViewConfigurations ( XrInstance instance,
XrSystemId systemId )
inline

Definition at line 26 of file XrEnumerate.h.

References CHECK_XRCMD.

◆ EnumerateViewConfigurationViews()

std::vector< XrViewConfigurationView > xr::EnumerateViewConfigurationViews ( XrInstance instance,
XrSystemId systemId,
XrViewConfigurationType viewConfigurationType )
inline

Definition at line 35 of file XrEnumerate.h.

References CHECK_XRCMD.

Referenced by CreateViewConfigurationState().

◆ event_cast()

template<typename XrEventData >
const XrEventData * xr::event_cast ( const XrEventDataBuffer * eventData)
delete

◆ InsertExtensionStruct()

template<typename XrStruct , typename XrExtension >
void xr::InsertExtensionStruct ( XrStruct & xrStruct,
XrExtension & xrExtension )

Definition at line 43 of file XrStruct.h.

Referenced by ReadMeshBuffers(), and ReadMeshBuffers().

◆ IsPrimaryViewConfigurationType()

bool xr::IsPrimaryViewConfigurationType ( XrViewConfigurationType type)
constexpr

Definition at line 23 of file XrViewConfiguration.h.

◆ IsRecommendedSwapchainSizeChanged()

bool xr::IsRecommendedSwapchainSizeChanged ( const std::vector< XrViewConfigurationView > & oldConfigs,
const std::vector< XrViewConfigurationView > & newConfigs )
inline

Definition at line 55 of file XrViewConfiguration.h.

◆ MAKE_TO_CSTRING_FUNC()

xr::MAKE_TO_CSTRING_FUNC ( XrHandJointEXT )

◆ MAKE_TO_STRING_FUNCS() [1/20]

xr::MAKE_TO_STRING_FUNCS ( XrActionType )

◆ MAKE_TO_STRING_FUNCS() [2/20]

xr::MAKE_TO_STRING_FUNCS ( XrEnvironmentBlendMode )

◆ MAKE_TO_STRING_FUNCS() [3/20]

xr::MAKE_TO_STRING_FUNCS ( XrEyeVisibility )

◆ MAKE_TO_STRING_FUNCS() [4/20]

xr::MAKE_TO_STRING_FUNCS ( XrFormFactor )

◆ MAKE_TO_STRING_FUNCS() [5/20]

xr::MAKE_TO_STRING_FUNCS ( XrHandEXT )

◆ MAKE_TO_STRING_FUNCS() [6/20]

xr::MAKE_TO_STRING_FUNCS ( XrHandPoseTypeMSFT )

◆ MAKE_TO_STRING_FUNCS() [7/20]

xr::MAKE_TO_STRING_FUNCS ( XrMeshComputeLodMSFT )

◆ MAKE_TO_STRING_FUNCS() [8/20]

xr::MAKE_TO_STRING_FUNCS ( XrObjectType )

◆ MAKE_TO_STRING_FUNCS() [9/20]

xr::MAKE_TO_STRING_FUNCS ( XrReferenceSpaceType )

◆ MAKE_TO_STRING_FUNCS() [10/20]

xr::MAKE_TO_STRING_FUNCS ( XrReprojectionModeMSFT )

◆ MAKE_TO_STRING_FUNCS() [11/20]

xr::MAKE_TO_STRING_FUNCS ( XrResult )

◆ MAKE_TO_STRING_FUNCS() [12/20]

xr::MAKE_TO_STRING_FUNCS ( XrSceneComponentTypeMSFT )

◆ MAKE_TO_STRING_FUNCS() [13/20]

xr::MAKE_TO_STRING_FUNCS ( XrSceneComputeConsistencyMSFT )

◆ MAKE_TO_STRING_FUNCS() [14/20]

xr::MAKE_TO_STRING_FUNCS ( XrSceneComputeFeatureMSFT )

◆ MAKE_TO_STRING_FUNCS() [15/20]

xr::MAKE_TO_STRING_FUNCS ( XrSceneComputeStateMSFT )

◆ MAKE_TO_STRING_FUNCS() [16/20]

xr::MAKE_TO_STRING_FUNCS ( XrSessionState )

◆ MAKE_TO_STRING_FUNCS() [17/20]

xr::MAKE_TO_STRING_FUNCS ( XrSpatialGraphNodeTypeMSFT )

◆ MAKE_TO_STRING_FUNCS() [18/20]

xr::MAKE_TO_STRING_FUNCS ( XrStructureType )

◆ MAKE_TO_STRING_FUNCS() [19/20]

xr::MAKE_TO_STRING_FUNCS ( XrViewConfigurationType )

◆ MAKE_TO_STRING_FUNCS() [20/20]

xr::MAKE_TO_STRING_FUNCS ( XrVisibilityMaskTypeKHR )

◆ PathToString()

std::string xr::PathToString ( XrInstance instance,
XrPath path )
inline

Definition at line 25 of file XrString.h.

References CHECK_XRCMD.

◆ PickEnvironmentBlendMode()

XrEnvironmentBlendMode xr::PickEnvironmentBlendMode ( const std::vector< XrEnvironmentBlendMode > & systemSupportedBlendModes,
const std::vector< XrEnvironmentBlendMode > & appSupportedBlendModes )
inline

Definition at line 62 of file XrEnumerate.h.

Referenced by CreateViewProperties().

◆ PickSwapchainFormat()

template<typename TSystemPixelFormat , typename TAppPixelFormat >
TAppPixelFormat xr::PickSwapchainFormat ( const std::vector< TSystemPixelFormat > & systemSupportedFormats,
const std::vector< TAppPixelFormat > & appSupportedFormats )
inline

Definition at line 86 of file XrEnumerate.h.

◆ QueryActionLocalizedName()

std::set< std::string > xr::QueryActionLocalizedName ( XrSession session,
XrAction action,
XrInputSourceLocalizedNameFlags flags )
inline

Definition at line 109 of file XrEnumerate.h.

References CHECK_XRCMD.

◆ ReadMeshBuffers() [1/2]

void xr::ReadMeshBuffers ( XrSceneMSFT scene,
uint64_t meshBufferId,
std::vector< XrVector3f > & vertexBuffer,
std::vector< uint16_t > & indexBuffer )
inline

Definition at line 100 of file XrSceneUnderstanding.h.

References CHECK_XRCMD, and InsertExtensionStruct().

Here is the call graph for this function:

◆ ReadMeshBuffers() [2/2]

void xr::ReadMeshBuffers ( XrSceneMSFT scene,
uint64_t meshBufferId,
std::vector< XrVector3f > & vertexBuffer,
std::vector< uint32_t > & indexBuffer )
inline

Definition at line 76 of file XrSceneUnderstanding.h.

References CHECK_XRCMD, and InsertExtensionStruct().

Here is the call graph for this function:

◆ SetApplicationInfo()

void xr::SetApplicationInfo ( XrApplicationInfo & appInfo,
const xr::NameVersion & appNameVersion,
const xr::NameVersion & engineNameVersion,
XrVersion apiVersion = XR_CURRENT_API_VERSION )
inline

Definition at line 18 of file XrStruct.h.

References xr::NameVersion::Name, and xr::NameVersion::Version.

◆ SetEnabledExtensions() [1/2]

template<typename T >
void xr::SetEnabledExtensions ( XrInstanceCreateInfo & info,
T && extensions )
delete

◆ SetEnabledExtensions() [2/2]

template<typename T >
void xr::SetEnabledExtensions ( XrInstanceCreateInfo & info,
T & extensions )

Definition at line 31 of file XrStruct.h.

◆ StringsToPaths()

std::vector< XrPath > xr::StringsToPaths ( XrInstance instance,
const std::vector< std::string > & strings )
inline

Definition at line 36 of file XrString.h.

References StringToPath().

Here is the call graph for this function:

◆ StringToPath()

XrPath xr::StringToPath ( XrInstance instance,
const char * str )
inline

Definition at line 19 of file XrString.h.

References CHECK_XRCMD.

Referenced by StringsToPaths().