2019-03-18 05:52:32 +00:00
|
|
|
// Copyright 2019, Collabora, Ltd.
|
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
|
|
/*!
|
|
|
|
* @file
|
|
|
|
* @brief Interface to OpenHMD driver code.
|
|
|
|
* @author Jakob Bornecrantz <jakob@collabora.com>
|
2019-04-12 13:08:46 +00:00
|
|
|
* @ingroup drv_ohmd
|
2019-03-18 05:52:32 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-03-22 16:02:57 +00:00
|
|
|
#include "math/m_api.h"
|
|
|
|
#include "xrt/xrt_device.h"
|
2019-03-21 20:36:26 +00:00
|
|
|
|
2019-03-18 05:52:32 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2020-09-29 23:34:10 +00:00
|
|
|
struct xrt_device *
|
2019-03-18 05:52:32 +00:00
|
|
|
oh_device_create(ohmd_context *ctx,
|
|
|
|
ohmd_device *dev,
|
|
|
|
const char *prod,
|
|
|
|
bool print_spew,
|
|
|
|
bool print_debug);
|
|
|
|
|
|
|
|
#define OH_SPEW(c, ...) \
|
|
|
|
do { \
|
|
|
|
if (c->print_spew) { \
|
|
|
|
fprintf(stderr, "%s - ", __func__); \
|
|
|
|
fprintf(stderr, __VA_ARGS__); \
|
|
|
|
fprintf(stderr, "\n"); \
|
|
|
|
} \
|
|
|
|
} while (false)
|
|
|
|
|
|
|
|
#define OH_DEBUG(c, ...) \
|
|
|
|
do { \
|
|
|
|
if (c->print_debug) { \
|
|
|
|
fprintf(stderr, "%s - ", __func__); \
|
|
|
|
fprintf(stderr, __VA_ARGS__); \
|
|
|
|
fprintf(stderr, "\n"); \
|
|
|
|
} \
|
|
|
|
} while (false)
|
|
|
|
|
|
|
|
#define OH_ERROR(c, ...) \
|
|
|
|
do { \
|
|
|
|
fprintf(stderr, "%s - ", __func__); \
|
|
|
|
fprintf(stderr, __VA_ARGS__); \
|
|
|
|
fprintf(stderr, "\n"); \
|
|
|
|
} while (false)
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|