This example shows how to create an observer.
To create an observer, you must first create an observer configuration.
makVrv::DtObserverConfiguration observerConfig("Example Observer");
The configuration is then added to the DtInputDriver, which will realize the observer immediately if the application is running, or realize it on start up.
vantageApp.de().driverManager().inputDriver().addObserverConfiguration(
observerConfig );
Building the Example
VR-Vantage includes pre-built versions of the example application. To build it yourself, follow the instructions at Building VR-Vantage Examples, Applications, and Plug-ins.
Running the Example
This example is an application. You can run it by running ./bin/exampleCreateObserver.exe (on Windows) or ./bin/exampleCreateObserver (on Linux). For more information about running examples, please see Running Applications and Examples.
exampleCreateObserver.cxx
#include <vrvCore/DtVantageIgConfiguration.h>
#include <vrvCore/DtVantageIgCommandLineProcessor.h>
#include <vrvCore/DtDe.h>
#include <vrvCore/DtInputDriver.h>
#include <vrvCore/DtDriverManager.h>
#include <vrvUtil/DtObserverConfiguration.h>
#include <boost/bind.hpp>
int main(int argc, char** argv)
{
makVrv::DtVantageIgConfiguration config;
makVrv::DtVrvApplication vantageApp(config);
makVrv::DtVantageIgCommandLineProcessor vantageCommandLineParser;
vantageApp.installCommandLineProcessor(&vantageCommandLineParser);
vantageApp.initialize(argc,argv);
makVrv::DtObserverConfiguration observerConfig("Example Observer");
vantageApp.de().driverManager().inputDriver().addObserverConfiguration(
observerConfig );
vantageApp.run();
}