The open source OpenXR runtime
at prediction-2 66 lines 1.6 kB view raw
1// Copyright 2020-2024, Collabora, Ltd. 2// SPDX-License-Identifier: BSL-1.0 3/*! 4 * @file 5 * @brief Interface to Sample HMD driver. 6 * @author Jakob Bornecrantz <jakob@collabora.com> 7 * @author Rylie Pavlik <rylie.pavlik@collabora.com> 8 * @ingroup drv_sample 9 */ 10 11#pragma once 12 13#ifdef __cplusplus 14extern "C" { 15#endif 16 17/*! 18 * @defgroup drv_sample Sample HMD driver 19 * @ingroup drv 20 * 21 * @brief Driver for a Sample HMD. 22 * 23 * Does no actual work. 24 * Assumed to not be detectable by USB VID/PID, 25 * and thus exposes an "auto-prober" to explicitly discover the device. 26 * 27 * See @ref writing-driver for additional information. 28 * 29 * This device has an implementation of @ref xrt_auto_prober to perform hardware 30 * detection, as well as an implementation of @ref xrt_device for the actual device. 31 * 32 * If your device is or has USB HID that **can** be detected based on USB VID/PID, 33 * you can skip the @ref xrt_auto_prober implementation, and instead implement a 34 * "found" function that matches the signature expected by xrt_prober_entry::found. 35 * See for example @ref hdk_found. 36 * Alternately, you might create a builder or an instance implementation directly. 37 */ 38 39/*! 40 * Create a auto prober for a Sample HMD. 41 * 42 * @ingroup drv_sample 43 */ 44struct xrt_auto_prober * 45sample_create_auto_prober(void); 46 47/*! 48 * Create a Sample HMD. 49 * 50 * This is only exposed so that the prober (in one source file) 51 * can call the construction function (in another) 52 * @ingroup drv_sample 53 */ 54struct xrt_device * 55sample_hmd_create(void); 56 57/*! 58 * @dir drivers/sample 59 * 60 * @brief @ref drv_sample files. 61 */ 62 63 64#ifdef __cplusplus 65} 66#endif