42 class MultipleAsyncDevice {
45 : m_myVal(0), m_buttonPressed(false) {
59 m_dev.initSync(ctx,
"MyAsyncDevice", opts);
62 m_dev.registerUpdateCallback(
this);
65 OSVR_ReturnCode update() {
68 std::this_thread::sleep_for(std::chrono::seconds(1));
71 m_myVal = (m_myVal + 0.1);
80 m_buttonPressed = !m_buttonPressed;
106 new MultipleAsyncDevice(ctx));
Wrapper class for OSVR_DeviceToken.
OSVR_PLUGIN(com_osvr_example_MultipleAsync)
struct OSVR_TrackerDeviceInterfaceObject * OSVR_TrackerDeviceInterface
Opaque type used in conjunction with a device token to send data on a tracker interface.
OSVR_ReturnCode osvrDeviceAnalogSetValue(OSVR_DeviceToken dev, OSVR_AnalogDeviceInterface iface, OSVR_AnalogState val, OSVR_ChannelCount chan)
Report the value of a single channel.
OSVR_ReturnCode osvrDeviceTrackerSendPose(OSVR_DeviceToken dev, OSVR_TrackerDeviceInterface iface, OSVR_PoseState const *val, OSVR_ChannelCount sensor)
Report the full rigid body pose of a sensor, automatically generating a timestamp.
T * registerObjectForDeletion(OSVR_PluginRegContext ctx, T *obj)
Registers an object to be destroyed with delete when the plugin is unloaded.
struct OSVR_DeviceInitObject * OSVR_DeviceInitOptions
Opaque type of a device initialization object.
#define OSVR_RETURN_SUCCESS
The "success" value for an OSVR_ReturnCode.
OSVR_DeviceInitOptions osvrDeviceCreateInitOptions(OSVR_PluginRegContext ctx)
Create a OSVR_DeviceInitOptions object.
#define OSVR_BUTTON_NOT_PRESSED
OSVR_ButtonState value indicating "button up".
Header including the full PluginKit C++ interface.
#define OSVR_BUTTON_PRESSED
OSVR_ButtonState value indicating "button down".
A structure defining a 3D (6DOF) rigid body pose: translation and rotation.
struct OSVR_AnalogDeviceInterfaceObject * OSVR_AnalogDeviceInterface
Opaque type used in conjunction with a device token to send data on an analog interface.
OSVR_ReturnCode osvrDeviceTrackerConfigure(OSVR_DeviceInitOptions opts, OSVR_TrackerDeviceInterface *iface)
Specify that your device will implement the Tracker interface.
OSVR_EXTERN_C_BEGIN typedef void * OSVR_PluginRegContext
A context pointer passed in to your plugin's entry point and other locations of control flow transfer...
void osvrPose3SetIdentity(OSVR_Pose3 *pose)
Set a pose to identity.
OSVR_ReturnCode osvrDeviceAnalogConfigure(OSVR_DeviceInitOptions opts, OSVR_AnalogDeviceInterface *iface, OSVR_ChannelCount numChan)
Specify that your device will implement the Analog interface.