diff options
author | Yuri Sizov <yuris@humnom.net> | 2023-07-12 17:15:25 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-07-12 17:15:25 +0200 |
commit | 661c3954a6f76aa58ecce5dc2e0e476a7c8ec6b1 (patch) | |
tree | 7164b32813df5c6455ffd267f4b3f8a8b0bca862 /modules/openxr/openxr_util.h | |
parent | f25233cbc9386d35baa4c5a9aa8bbe998c999440 (diff) | |
parent | 34a07b81ae640dc877a47091ca9a63d1a2cba07b (diff) | |
download | redot-engine-661c3954a6f76aa58ecce5dc2e0e476a7c8ec6b1.tar.gz |
Merge pull request #73443 from akien-mga/unbundle-openxr
Allow unbundling OpenXR (for Linux distros)
Diffstat (limited to 'modules/openxr/openxr_util.h')
-rw-r--r-- | modules/openxr/openxr_util.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/openxr/openxr_util.h b/modules/openxr/openxr_util.h index 8ad68c0b02..3f36ab9fca 100644 --- a/modules/openxr/openxr_util.h +++ b/modules/openxr/openxr_util.h @@ -44,6 +44,27 @@ public: static String get_action_type_name(XrActionType p_action_type); static String get_environment_blend_mode_name(XrEnvironmentBlendMode p_blend_mode); static String make_xr_version_string(XrVersion p_version); + + // Copied from OpenXR xr_linear.h private header, so we can still link against + // system-provided packages without relying on our `thirdparty` code. + + // Column-major, pre-multiplied. This type does not exist in the OpenXR API and is provided for convenience. + typedef struct XrMatrix4x4f { + float m[16]; + } XrMatrix4x4f; + + typedef enum GraphicsAPI { + GRAPHICS_VULKAN, + GRAPHICS_OPENGL, + GRAPHICS_OPENGL_ES, + GRAPHICS_D3D + } GraphicsAPI; + + static void XrMatrix4x4f_CreateProjection(XrMatrix4x4f *result, GraphicsAPI graphicsApi, const float tanAngleLeft, + const float tanAngleRight, const float tanAngleUp, float const tanAngleDown, + const float nearZ, const float farZ); + static void XrMatrix4x4f_CreateProjectionFov(XrMatrix4x4f *result, GraphicsAPI graphicsApi, const XrFovf fov, + const float nearZ, const float farZ); }; #endif // OPENXR_UTIL_H |