Monado OpenXR Runtime
Macros
oxr_extension_support.h File Reference

Macros for generating extension-related tables and code and inspecting Monado's extension support. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OXR_HAVE_EXT_debug_utils
 
#define OXR_EXTENSION_SUPPORT_EXT_debug_utils(_)   _(EXT_debug_utils, EXT_DEBUG_UTILS)
 
#define OXR_HAVE_KHR_convert_timespec_time
 
#define OXR_EXTENSION_SUPPORT_KHR_convert_timespec_time(_)   _(KHR_convert_timespec_time, KHR_CONVERT_TIMESPEC_TIME)
 
#define OXR_HAVE_KHR_opengl_enable
 
#define OXR_EXTENSION_SUPPORT_KHR_opengl_enable(_)   _(KHR_opengl_enable, KHR_OPENGL_ENABLE)
 
#define OXR_EXTENSION_SUPPORT_KHR_opengl_es_enable(_)
 
#define OXR_HAVE_KHR_vulkan_enable
 
#define OXR_EXTENSION_SUPPORT_KHR_vulkan_enable(_)   _(KHR_vulkan_enable, KHR_VULKAN_ENABLE)
 
#define OXR_EXTENSION_SUPPORT_MND_egl_enable(_)
 
#define OXR_HAVE_MND_headless
 
#define OXR_EXTENSION_SUPPORT_MND_headless(_)   _(MND_headless, MND_HEADLESS)
 
#define OXR_EXTENSION_SUPPORT_GENERATE(_)
 Call this, passing a macro taking two parameters, to generate tables, code, etc. More...
 

Detailed Description

Macros for generating extension-related tables and code and inspecting Monado's extension support.

MOSTLY GENERATED CODE - see below!

To add support for a new extension, edit and run generate_oxr_ext_support.py, then run clang-format on this file. Two entire chunks of this file get replaced by that script: comments indicate where they are.

Author
Ryan Pavlik ryan..nosp@m.pavl.nosp@m.ik@co.nosp@m.llab.nosp@m.ora.c.nosp@m.om

Macro Definition Documentation

◆ OXR_EXTENSION_SUPPORT_GENERATE

#define OXR_EXTENSION_SUPPORT_GENERATE (   _)
Value:
OXR_EXTENSION_SUPPORT_EXT_debug_utils(_) \
OXR_EXTENSION_SUPPORT_KHR_convert_timespec_time(_) \
OXR_EXTENSION_SUPPORT_KHR_opengl_enable(_) \
OXR_EXTENSION_SUPPORT_KHR_opengl_es_enable(_) \
OXR_EXTENSION_SUPPORT_KHR_vulkan_enable(_) \
OXR_EXTENSION_SUPPORT_MND_egl_enable(_) \
OXR_EXTENSION_SUPPORT_MND_headless(_)

Call this, passing a macro taking two parameters, to generate tables, code, etc.

related to OpenXR extensions. Upon including invoking OXR_EXTENSION_SUPPORT_GENERATE() with some MY_HANDLE_EXTENSION(mixed_case, all_caps), MY_HANDLE_EXTENSION will be called for each extension implemented in Monado and supported in this build:

  • The first parameter is the name of the extension without the leading XR_ prefix: e.g. KHR_opengl_enable
  • The second parameter is the same text as the first, but in all uppercase, since this transform cannot be done in the C preprocessor, and some extension-related entities use this instead of the exact extension name.

Implementation note: This macro calls another macro for each extension: that macro is either defined to call your provided macro, or defined to nothing, depending on if the extension is supported in this build.

Note
Do not edit anything between clang-format off and clang-format on - it will be replaced next time this file is generated!