From Stephan Huber, introduction of message id scheme were osc messages are sent with an unique id, and can be dispatched multiple times to workaround network packet losses.

This commit is contained in:
Robert Osfield
2013-01-31 11:09:03 +00:00
parent 5339864c17
commit 9bc3b3316a
6 changed files with 150 additions and 26 deletions

View File

@@ -402,6 +402,9 @@ int main( int argc, char **argv )
osg::ArgumentParser arguments(&argc,argv);
arguments.getApplicationUsage()->addCommandLineOption("--zeroconf","uses zeroconf to advertise the osc-plugin and to discover it");
arguments.getApplicationUsage()->addCommandLineOption("--sender","create a view which sends its events via osc");
arguments.getApplicationUsage()->addCommandLineOption("--recevier","create a view which receive its events via osc");
// read the scene from the list of file specified commandline args.
@@ -414,13 +417,16 @@ int main( int argc, char **argv )
}
bool use_zeroconf(false);
bool use_sender(false);
bool use_receiver(false);
if(arguments.find("--zeroconf") > 0) { use_zeroconf = true; }
if(arguments.find("--sender") > 0) { use_sender = true; }
if(arguments.find("--receiver") > 0) { use_receiver = true; }
// construct the viewer.
osgViewer::CompositeViewer viewer(arguments);
// receiver view
{
if (use_receiver) {
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
traits->x = 600;
traits->y = 100;
@@ -480,7 +486,7 @@ int main( int argc, char **argv )
}
// sender view
{
if(use_sender) {
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
traits->x = 100;
traits->y = 100;