43 m_dev.initAsync(ctx,
"MyAsyncDevice");
46 m_dev.registerUpdateCallback(
this);
52 OSVR_ReturnCode update() {
55 const char mydata[] =
"something";
56 m_dev.sendData(dummyMessage, mydata);
64 class HardwareDetection {
66 HardwareDetection() : m_found(false) {}
69 std::cout <<
"PLUGIN: Got a hardware detection request" << std::endl;
71 std::cout <<
"PLUGIN: We have detected our fake device! Doing "
72 "setup stuff!" << std::endl;
77 new DummyDevice(ctx));
Wrapper class for OSVR_DeviceToken.
C++ wrapper class for the opaque plugin context.
Base class for connection-specific message type registration.
void registerHardwareDetectCallback(T functor)
Register a hardware detect callback.
T * registerObjectForDeletion(OSVR_PluginRegContext ctx, T *obj)
Registers an object to be destroyed with delete when the plugin is unloaded.
#define OSVR_RETURN_SUCCESS
The "success" value for an OSVR_ReturnCode.
Header including the full PluginKit C++ 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...
OSVR_ReturnCode osvrDeviceRegisterMessageType(OSVR_PluginRegContext ctx, const char *name, OSVR_MessageType *msgtype)
Register (or recall) a message type by name.
OSVR_PLUGIN(com_osvr_example_DummyDetectAndCreateAsync)