Monado OpenXR Runtime
sample_hmd.c File Reference

Sample HMD device, use as a starting point to make your own device driver. More...

#include "os/os_time.h"
#include "xrt/xrt_defines.h"
#include "xrt/xrt_device.h"
#include "math/m_relation_history.h"
#include "math/m_api.h"
#include "math/m_mathinclude.h"
#include "util/u_debug.h"
#include "util/u_device.h"
#include "util/u_distortion_mesh.h"
#include "util/u_logging.h"
#include "util/u_misc.h"
#include "util/u_time.h"
#include "util/u_var.h"
#include "util/u_visibility_mask.h"
#include "xrt/xrt_results.h"
#include <stdio.h>
Include dependency graph for sample_hmd.c:

Data Structures

struct  sample_hmd
 A sample HMD device. More...
 

Macros

#define HMD_TRACE(hmd, ...)   U_LOG_XDEV_IFL_T(&hmd->base, hmd->log_level, __VA_ARGS__)
 
#define HMD_DEBUG(hmd, ...)   U_LOG_XDEV_IFL_D(&hmd->base, hmd->log_level, __VA_ARGS__)
 
#define HMD_INFO(hmd, ...)   U_LOG_XDEV_IFL_I(&hmd->base, hmd->log_level, __VA_ARGS__)
 
#define HMD_ERROR(hmd, ...)   U_LOG_XDEV_IFL_E(&hmd->base, hmd->log_level, __VA_ARGS__)
 

Functions

static struct sample_hmdsample_hmd (struct xrt_device *xdev)
 Casting helper function. More...
 
static void sample_hmd_destroy (struct xrt_device *xdev)
 
static void sample_hmd_update_inputs (struct xrt_device *xdev)
 
static void sample_hmd_get_tracked_pose (struct xrt_device *xdev, enum xrt_input_name name, uint64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
 
static void sample_hmd_get_view_poses (struct xrt_device *xdev, const struct xrt_vec3 *default_eye_relation, uint64_t at_timestamp_ns, uint32_t view_count, struct xrt_space_relation *out_head_relation, struct xrt_fov *out_fovs, struct xrt_pose *out_poses)
 
xrt_result_t sample_hmd_get_visibility_mask (struct xrt_device *xdev, enum xrt_visibility_mask_type type, uint32_t view_index, struct xrt_visibility_mask **out_mask)
 
struct xrt_devicesample_hmd_create (void)
 Create a Sample HMD. More...
 

Detailed Description

Sample HMD device, use as a starting point to make your own device driver.

Based largely on simulated_hmd.c

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m
Rylie Pavlik rylie.nosp@m..pav.nosp@m.lik@c.nosp@m.olla.nosp@m.bora..nosp@m.com

Function Documentation

◆ sample_hmd()

static struct sample_hmd * sample_hmd ( struct xrt_device xdev)
inlinestatic

Casting helper function.