Skip to content
Snippets Groups Projects
Commit b27fd880 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Rely on OSG built-in for sample buffers

parent 976c603c
No related branches found
No related tags found
No related merge requests found
......@@ -9,15 +9,42 @@
// See the COPYING file for more information.
#include <iostream>
#include <osg/DisplaySettings>
#include <osg/ArgumentParser>
#include "gepetto/viewer/corba/server.hh"
using graphics::corbaServer::Server;
int
main (int argc, const char* argv[])
main (int argc, char* argv[])
{
osg::ArgumentParser arguments(&argc, argv);
osg::DisplaySettings* ds = osg::DisplaySettings::instance().get();
// This should not be done here. Two osg built-in way:
// - Environment variable OSG_MULTI_SAMPLES : a bit tedious
// - Command line option --samples : slight better with an alias
#ifndef DISABLE_SAMPLING
ds->setNumMultiSamples(4);
#else
ds->setNumMultiSamples(0);
#endif
// set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
// arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is an OpenSceneGraph example that shows how to use the accumulation buffer to achieve a simple motion blur effect.");
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options]");
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
ds->readCommandLine (arguments); // populate the help message.
// if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help")) {
arguments.getApplicationUsage()->write(std::cout);
return 1;
}
graphics::WindowsManagerPtr_t wm = graphics::WindowsManager::create ();
Server server (wm, argc, argv, false); // dernier arg : autorise ou non multithread (original = true)
Server server (wm, argc, (const char**)argv, false); // dernier arg : autorise ou non multithread (original = true)
server.startCorbaServer ();
server.processRequest(true);
......
......@@ -91,7 +91,7 @@ namespace gepetto {
, infoBox_ (this)
{
osg::DisplaySettings* ds = osg::DisplaySettings::instance().get();
osg::ref_ptr <osg::GraphicsContext::Traits> traits_ptr (new osg::GraphicsContext::Traits);
osg::ref_ptr <osg::GraphicsContext::Traits> traits_ptr (new osg::GraphicsContext::Traits(ds));
traits_ptr->windowName = "Gepetto Viewer";
traits_ptr->x = this->x();
traits_ptr->y = this->y();
......@@ -102,13 +102,6 @@ namespace gepetto {
traits_ptr->vsync = true;
// traits_ptr->sharedContext = 0;
traits_ptr->alpha = ds->getMinimumNumAlphaBits();
traits_ptr->stencil = ds->getMinimumNumStencilBits();
traits_ptr->sampleBuffers = ds->getMultiSamples();
traits_ptr->samples = ds->getNumMultiSamples();
traits_ptr->sampleBuffers = 4;
traits_ptr->samples = 4;
graphicsWindow_ = new osgQt::GraphicsWindowQt ( traits_ptr );
osg::Camera* camera = viewer_->getCamera();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment