VTK: Rendering/OpenXRRemoting/XrConnectionExtensions.h Source File

| VTK 9.3.1

XrConnectionExtensions.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Microsoft
3 // SPDX-License-Identifier: BSD-3-Clause AND Apache-2.0
24 #ifndef XrConnectionExtensions_h
25 #define XrConnectionExtensions_h
26
27 #if XR_MSFT_holographic_remoting
28 #define FOR_EACH_HAR_EXPERIMENTAL_EXTENSION_FUNCTION(_) \
29 _(xrRemotingSetContextPropertiesMSFT) \
30 _(xrRemotingConnectMSFT) \
31 _(xrRemotingListenMSFT) \
32 _(xrRemotingDisconnectMSFT) \
33 _(xrRemotingGetConnectionStateMSFT) \
34 _(xrRemotingSetSecureConnectionClientCallbacksMSFT) \
35 _(xrRemotingSetSecureConnectionServerCallbacksMSFT) \
36 _(xrCreateRemotingDataChannelMSFT) \
37 _(xrDestroyRemotingDataChannelMSFT) \
38 _(xrGetRemotingDataChannelStateMSFT) \
39 _(xrSendRemotingDataMSFT) \
40 _(xrRetrieveRemotingDataMSFT)
41 #else
42 #define FOR_EACH_HAR_EXPERIMENTAL_EXTENSION_FUNCTION(_)
43 #endif
44
45 #define FOR_EACH_EXTENSION_FUNCTION(_) FOR_EACH_HAR_EXPERIMENTAL_EXTENSION_FUNCTION(_)
46
47 #define GET_INSTANCE_PROC_ADDRESS(name) \
48 (void)xrGetInstanceProcAddr( \
49 instance, #name, reinterpret_cast<PFN_xrVoidFunction*>(const_cast<PFN_##name*>(&name)));
50 #define DEFINE_PROC_MEMBER(name) PFN_##name name{ nullptr };
51
52 namespace xr
53 {
54 VTK_ABI_NAMESPACE_BEGIN
55 struct ConnectionExtensionDispatchTable
56 {
57 FOR_EACH_EXTENSION_FUNCTION(DEFINE_PROC_MEMBER);
58
59 ConnectionExtensionDispatchTable() = default;
60 void PopulateDispatchTable(XrInstance instance)
61 {
62 FOR_EACH_EXTENSION_FUNCTION(GET_INSTANCE_PROC_ADDRESS);
63 }
64 };
65 VTK_ABI_NAMESPACE_END
66 } // namespace xr
67
68 #undef DEFINE_PROC_MEMBER
69 #undef GET_INSTANCE_PROC_ADDRESS
70 #undef FOR_EACH_EXTENSION_FUNCTION
71
72 #endif
DEFINE_PROC_MEMBER
#define DEFINE_PROC_MEMBER(name)
Definition: XrConnectionExtensions.h:50
GET_INSTANCE_PROC_ADDRESS
#define GET_INSTANCE_PROC_ADDRESS(name)
Definition: XrConnectionExtensions.h:47
xr
Definition: XrExtensions.h:119
xr::ConnectionExtensionDispatchTable
Definition: XrConnectionExtensions.h:56
xr::ConnectionExtensionDispatchTable::PopulateDispatchTable
void PopulateDispatchTable(XrInstance instance)
Definition: XrConnectionExtensions.h:60
xr::ConnectionExtensionDispatchTable::FOR_EACH_EXTENSION_FUNCTION
FOR_EACH_EXTENSION_FUNCTION(DEFINE_PROC_MEMBER)
xr::ConnectionExtensionDispatchTable::ConnectionExtensionDispatchTable
ConnectionExtensionDispatchTable()=default