st/oxr: Add XR_MNDX_xdev_space extension header

This commit is contained in:
Jakob Bornecrantz 2023-09-10 14:25:14 +01:00 committed by Christoph Haag
parent 889dc32f67
commit 158f420748
3 changed files with 100 additions and 1 deletions

View file

@ -0,0 +1,80 @@
// Copyright 2023-2024, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief Preview header for XR_MNDX_xdev_space extension.
* @author Jakob Bornecrantz <jakob@collabora.com>
* @ingroup external_openxr
*/
#ifndef XR_MNDX_XDEV_SPACE_H
#define XR_MNDX_XDEV_SPACE_H 1
#include "openxr_extension_helpers.h"
#ifdef __cplusplus
extern "C" {
#endif
// Extension number 445 (444 prefix)
#define XR_MNDX_xdev_space 1
#define XR_MNDX_xdev_space_SPEC_VERSION 1
#define XR_MNDX_XDEV_SPACE_EXTENSION_NAME "XR_MNDX_xdev_space"
XR_DEFINE_ATOM(XrXDevIdMNDX)
XR_DEFINE_HANDLE(XrXDevListMNDX)
XR_STRUCT_ENUM(XR_TYPE_SYSTEM_XDEV_SPACE_PROPERTIES_MNDX, 1000444001);
// XrSystemXDevSpacePropertiesMNDX extends XrSystemProperties
typedef struct XrSystemXDevSpacePropertiesMNDX {
XrStructureType type;
void* XR_MAY_ALIAS next;
XrBool32 supportsXDevSpace;
} XrSystemXDevSpacePropertiesMNDX;
XR_STRUCT_ENUM(XR_TYPE_CREATE_XDEV_LIST_INFO_MNDX, 1000444002);
typedef struct XrCreateXDevListInfoMNDX {
XrStructureType type;
const void* XR_MAY_ALIAS next;
} XrCreateXDevListInfoMNDX;
XR_STRUCT_ENUM(XR_TYPE_GET_XDEV_INFO_MNDX, 1000444003);
typedef struct XrGetXDevInfoMNDX {
XrStructureType type;
const void* XR_MAY_ALIAS next;
XrXDevIdMNDX id;
} XrGetXDevInfoMNDX;
XR_STRUCT_ENUM(XR_TYPE_XDEV_PROPERTIES_MNDX, 1000444004);
typedef struct XrXDevPropertiesMNDX {
XrStructureType type;
void* XR_MAY_ALIAS next;
char name[256];
char serial[256];
XrBool32 canCreateSpace;
} XrXDevPropertiesMNDX;
XR_STRUCT_ENUM(XR_TYPE_CREATE_XDEV_SPACE_INFO_MNDX, 1000444005);
typedef struct XrCreateXDevSpaceInfoMNDX {
XrStructureType type;
const void* XR_MAY_ALIAS next;
XrXDevListMNDX xdevList;
XrXDevIdMNDX id;
XrPosef offset;
} XrCreateXDevSpaceInfoMNDX;
typedef XrResult (XRAPI_PTR *PFN_xrCreateXDevListMNDX)(XrSession session, const XrCreateXDevListInfoMNDX *info, XrXDevListMNDX *xdevList);
typedef XrResult (XRAPI_PTR *PFN_xrGetXDevListGenerationNumberMNDX)(XrXDevListMNDX xdevList, uint64_t *outGeneration);
typedef XrResult (XRAPI_PTR *PFN_xrEnumerateXDevsMNDX)(XrXDevListMNDX xdevList, uint32_t xdevCapacityInput, uint32_t* xdevCountOutput, XrXDevIdMNDX* xdevs);
typedef XrResult (XRAPI_PTR *PFN_xrGetXDevPropertiesMNDX)(XrXDevListMNDX xdevList, const XrGetXDevInfoMNDX *info, XrXDevPropertiesMNDX *properties);
typedef XrResult (XRAPI_PTR *PFN_xrDestroyXDevListMNDX)(XrXDevListMNDX xdevList);
typedef XrResult (XRAPI_PTR *PFN_xrCreateXDevSpaceMNDX)(XrSession session, const XrCreateXDevSpaceInfoMNDX *createInfo, XrSpace *space);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,18 @@
/*
** Copyright (c) 2017-2022, The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <openxr/openxr.h>
// These are just convenience macros for defining enums that would
// normally be declared in the body of the enum, but can't be declared
// that way easily for experimental extensions.
#define XR_ENUM(type, enm, constant) static const type enm = (type)constant
#define XR_STRUCT_ENUM(enm, constant) XR_ENUM(XrStructureType, enm, constant)
#define XR_RESULT_ENUM(enm, constant) XR_ENUM(XrResult, enm, constant)
#define XR_REFSPACE_ENUM(enm, constant) XR_ENUM(XrReferenceSpaceType, enm, constant)

View file

@ -1,4 +1,4 @@
// Copyright 2018-2023, Collabora, Ltd. // Copyright 2018-2024, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0 // SPDX-License-Identifier: BSL-1.0
/*! /*!
* @file * @file
@ -62,5 +62,6 @@ typedef __eglMustCastToProperFunctionPointerType (*PFNEGLGETPROCADDRESSPROC)(con
#include "openxr/openxr_loader_negotiation.h" // IWYU pragma: export #include "openxr/openxr_loader_negotiation.h" // IWYU pragma: export
#include "openxr/XR_MNDX_hydra.h" #include "openxr/XR_MNDX_hydra.h"
#include "openxr/XR_MNDX_xdev_space.h"
#include "openxr/XR_MNDX_system_buttons.h" #include "openxr/XR_MNDX_system_buttons.h"
#include "openxr/XR_MNDX_ball_on_a_stick_controller.h" #include "openxr/XR_MNDX_ball_on_a_stick_controller.h"