doc: Update Implementing OpenXR extensions

Mention that oxr_xr* function prototypes go into
src/xrt/state_trackers/oxr/oxr_api_funcs.h
and move all other details after the bullet points about functions.
This commit is contained in:
Christoph Haag 2021-10-05 17:53:29 +02:00
parent 45466e419b
commit a641ce8955

View file

@ -16,16 +16,18 @@ The general steps to implement an OpenXR extension in Monado are as follows.
`clang-format -i src/xrt/state_trackers/oxr/oxr_extension_support.h`. `clang-format -i src/xrt/state_trackers/oxr/oxr_extension_support.h`.
* Add entry points for each new function in * Add entry points for each new function in
`src/xrt/state_trackers/oxr/oxr_api_negotiate.c`. `src/xrt/state_trackers/oxr/oxr_api_negotiate.c`.
* Monado internal implementations of "objects" (think XrSession or * Add Monado internal prototypes for the new functions in
XrHandTracker) go into `src/xrt/state_trackers/oxr/oxr_objects.h`. `src/xrt/state_trackers/oxr/oxr_api_funcs.h`. The Monado implementations of
* Enums, defines and types go into `src/xrt/include/xrt/xrt_defines.h`. OpenXR OpenXR functions are prefixed with `oxr_` and use the `XRAPI_ATTR` and
types are not used outside of the `oxr_api_*` files, instead equivalents with `XRAPI_CALL` macros to satisfy calling conventions for all platforms.
the prefix `XRT_` are defined here. * Implement the `oxr_` Monado internal functions in an appropriate source file
* Add Monado specific prototypes for the new functions in
`src/xrt/state_trackers/oxr/oxr_objects.h`. The Monado implementations of
OpenXR functions are prefixed with `oxr_`.
* Implement the Monado specific functions in an appropriate source file
`src/state_trackers/oxr/oxr_api_*.c`. Trivial functions can be implemented `src/state_trackers/oxr/oxr_api_*.c`. Trivial functions can be implemented
right there along with the usual parameter checks. More complex functions that right there along with the usual parameter checks. More complex functions that
access more internal monado state should call functions implemented in the access more internal monado state should call functions implemented in the
relevant `oxr_*.c` file (without `_api_`). relevant `oxr_*.c` file (without `_api_`). The definitions for those functions
go into `src/xrt/state_trackers/oxr/oxr_objects.h`.
* Monado internal implementations of "objects" (think XrSession or
XrHandTracker) go into `src/xrt/state_trackers/oxr/oxr_objects.h`.
* Enums, defines and types go into `src/xrt/include/xrt/xrt_defines.h`. OpenXR
types are typically not used outside of the `oxr_api_*` files, instead
equivalents with the prefix `XRT_` are defined here.