OSVR-Core
|
How to start writing a plugin and advertise your capabilities to the core library. More...
Namespaces | |
osvr::pluginkit::detail | |
Internal implementation-only namespace. | |
Functions | |
template<typename T > | |
T * | osvr::pluginkit::registerObjectForDeletion (OSVR_PluginRegContext ctx, T *obj) |
Registers an object to be destroyed with delete when the plugin is unloaded. More... | |
template<typename T > | |
void | osvr::pluginkit::registerHardwareDetectCallback (OSVR_PluginRegContext ctx, T functor) |
Registers a function object to be called when the core requests a hardware detection. More... | |
template<typename T > | |
void | osvr::pluginkit::registerDriverInstantiationCallback (OSVR_PluginRegContext ctx, const char driverName[], T functor) |
Registers a function object to be called when the server is told to instantiate a driver by name with parameters. More... | |
How to start writing a plugin and advertise your capabilities to the core library.
|
inline |
Registers a function object to be called when the server is told to instantiate a driver by name with parameters.
Your callback should take a parameter of type OSVR_PluginRegContext and a parameter of type const char * (the JSON parameters as a string) and return a value of type ::OSVR_ReturnCode
Also provides for deletion of the function object.
ctx | The registration context passed to your entry point. |
driverName | The driver name you're advertising. |
functor | An function object (with operator() defined). Pass either a pointer, which will transfer ownership, or an object by value, which will result in a copy being made. |
|
inline |
Registers a function object to be called when the core requests a hardware detection.
Your callback should take one parameter of type OSVR_PluginRegContext and return a value of type ::OSVR_ReturnCode
Also provides for deletion of the function object.
ctx | The registration context passed to your entry point. |
functor | An function object (with operator() defined). Pass either a pointer, which will transfer ownership, or an object by value, which will result in a copy being made. |
|
inline |
Registers an object to be destroyed with delete when the plugin is unloaded.
The template parameter does not need to be specified - it is deduced automatically.
The plugin remains nominally the owner of the object, but your code should no longer concern itself with the destruction of this object. Thus, if you have it in a smart pointer of any kind, release it from that pointer when you pass it to your function.
ctx | The registration context passed to your entry point. |
obj | A pointer to your object to register for deletion. |
Internally uses osvrPluginRegisterDataWithDeleteCallback()