VTK  9.3.20241002
XrGraphicsExtensions.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
21#ifndef XrGraphicsExtensions_h
22#define XrGraphicsExtensions_h
23
24#ifdef XR_USE_PLATFORM_WIN32
25#define FOR_EACH_WIN32_EXTENSION_FUNCTION(_) _(xrConvertWin32PerformanceCounterToTimeKHR)
26#else
27#define FOR_EACH_WIN32_EXTENSION_FUNCTION(_)
28#endif
29
30#ifdef XR_USE_GRAPHICS_API_D3D11
31#define FOR_EACH_D3D11_EXTENSION_FUNCTION(_) _(xrGetD3D11GraphicsRequirementsKHR)
32#else
33#define FOR_EACH_D3D11_EXTENSION_FUNCTION(_)
34#endif
35
36#ifdef XR_USE_GRAPHICS_API_OPENGL
37#define FOR_EACH_OPENGL_EXTENSION_FUNCTION(_) _(xrGetOpenGLGraphicsRequirementsKHR)
38#else
39#define FOR_EACH_OPENGL_EXTENSION_FUNCTION(_)
40#endif
41
42#define FOR_EACH_EXTENSION_FUNCTION(_) \
43 FOR_EACH_WIN32_EXTENSION_FUNCTION(_) \
44 FOR_EACH_OPENGL_EXTENSION_FUNCTION(_) \
45 FOR_EACH_D3D11_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
52namespace xr
53{
54VTK_ABI_NAMESPACE_BEGIN
56{
58
60 void PopulateDispatchTable(XrInstance instance)
61 {
63 }
64};
65VTK_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 DEFINE_PROC_MEMBER(name)
#define FOR_EACH_EXTENSION_FUNCTION(_)
#define GET_INSTANCE_PROC_ADDRESS(name)
FOR_EACH_EXTENSION_FUNCTION(DEFINE_PROC_MEMBER)
void PopulateDispatchTable(XrInstance instance)