38 void myButtonCallback(
void *userdata,
const OSVR_TimeValue *timestamp,
40 printf(
"Got report: button is %s\n",
41 (report->
state ?
"pressed" :
"released"));
59 for (i = 0; i < 1000000; ++i) {
64 printf(
"Library shut down, exiting.\n");
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_ReturnCode osvrClientUpdate(OSVR_ClientContext ctx)
Updates the state of the context - call regularly in your mainloop.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
OSVR_ReturnCode osvrRegisterButtonCallback(OSVR_ClientInterface iface, OSVR_ButtonCallback cb, void *userdata)
Register a callback for Button reports on an interface.