The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

d/qwerty: Add helper create function

+43 -2
+11
src/xrt/drivers/qwerty/qwerty_interface.h
··· 55 55 void 56 56 qwerty_process_event(struct xrt_device **xdevs, size_t xdev_count, SDL_Event event); 57 57 58 + /*! 59 + * Create all qwerty devices. 60 + * 61 + * @ingroup drv_qwerty 62 + */ 63 + xrt_result_t 64 + qwerty_create_devices(enum u_logging_level log_level, 65 + struct xrt_device **out_hmd, 66 + struct xrt_device **out_left, 67 + struct xrt_device **out_right); 68 + 58 69 59 70 #ifdef __cplusplus 60 71 }
+32 -2
src/xrt/drivers/qwerty/qwerty_prober.c
··· 7 7 * @ingroup drv_qwerty 8 8 */ 9 9 10 - #include "qwerty_device.h" 10 + #include "xrt/xrt_prober.h" 11 + 11 12 #include "util/u_misc.h" 12 13 #include "util/u_debug.h" 13 14 #include "util/u_logging.h" 14 - #include "xrt/xrt_prober.h" 15 + 16 + #include "qwerty_device.h" 17 + #include "qwerty_interface.h" 18 + 15 19 16 20 // Using INFO as default to inform events real devices could report physically 17 21 DEBUG_GET_ONCE_LOG_OPTION(qwerty_log, "QWERTY_LOG", U_LOGGING_INFO) ··· 72 76 return num_qwerty_devices; 73 77 } 74 78 79 + 80 + /* 81 + * 82 + * 'Exported' functions. 83 + * 84 + */ 85 + 75 86 struct xrt_auto_prober * 76 87 qwerty_create_auto_prober(void) 77 88 { ··· 82 93 83 94 return &qp->base; 84 95 } 96 + 97 + xrt_result_t 98 + qwerty_create_devices(enum u_logging_level log_level, 99 + struct xrt_device **out_hmd, 100 + struct xrt_device **out_left, 101 + struct xrt_device **out_right) 102 + { 103 + struct qwerty_hmd *qhmd = qwerty_hmd_create(); 104 + struct qwerty_controller *qleft = qwerty_controller_create(true, qhmd); 105 + struct qwerty_controller *qright = qwerty_controller_create(false, qhmd); 106 + 107 + qwerty_system_create(qhmd, qleft, qright, log_level); 108 + 109 + *out_hmd = &qhmd->base.base; 110 + *out_left = &qleft->base.base; 111 + *out_right = &qright->base.base; 112 + 113 + return XRT_SUCCESS; 114 + }