38 void myAnalogCallback(
void *userdata,
const OSVR_TimeValue *timestamp,
40 printf(
"Got report: channel is %f\n", report->
state);
58 for (i = 0; i < 1000000; ++i) {
62 osvrClientLog(ctx, OSVR_LOGLEVEL_NOTICE,
"Library shut down, exiting.");
OSVR_ReturnCode osvrRegisterAnalogCallback(OSVR_ClientInterface iface, OSVR_AnalogCallback cb, void *userdata)
Register a callback for Analog reports on an interface.
OSVR_ReturnCode osvrClientGetInterface(OSVR_ClientContext ctx, const char path[], OSVR_ClientInterface *iface)
Get the interface associated with the given path.
OSVR_ClientContext osvrClientInit(const char applicationIdentifier[], uint32_t flags=0)
Initialize the library.
OSVR_ReturnCode osvrClientShutdown(OSVR_ClientContext ctx)
Shutdown the library.
OSVR_AnalogState state
The analog state.
struct OSVR_ClientContextObject * OSVR_ClientContext
Opaque handle that should be retained by your application. You need only and exactly one...
OSVR_ReturnCode osvrClientUpdate(OSVR_ClientContext ctx)
Updates the state of the context - call regularly in your mainloop.
void osvrClientLog(OSVR_ClientContext ctx, OSVR_LogLevel severity, const char *message)
Log a message from the client.
struct OSVR_ClientInterfaceObject * OSVR_ClientInterface
Opaque handle to an interface used for registering callbacks and getting status.
Report type for a callback on an analog interface.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...