Reverted erronous check-in (which was r10454)
This commit is contained in:
parent
6e6a7c960e
commit
554a6da56d
@ -1,12 +1,12 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This application is open source and may be redistributed and/or modified
|
||||
* freely and without restriction, both in commericial and non commericial applications,
|
||||
* as long as this copyright notice is maintained.
|
||||
*
|
||||
* This application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* This application is open source and may be redistributed and/or modified
|
||||
* freely and without restriction, both in commericial and non commericial applications,
|
||||
* as long as this copyright notice is maintained.
|
||||
*
|
||||
* This application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
#include <osgDB/ReadFile>
|
||||
@ -15,7 +15,6 @@
|
||||
|
||||
#include <osg/Switch>
|
||||
#include <osgText/Text>
|
||||
#include <osg/Group>
|
||||
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osgViewer/ViewerEventHandlers>
|
||||
@ -27,16 +26,10 @@
|
||||
#include <osgGA/StateSetManipulator>
|
||||
#include <osgGA/AnimationPathManipulator>
|
||||
#include <osgGA/TerrainManipulator>
|
||||
#include <osgGA/SphericalManipulator>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include <Windows.h>
|
||||
#include <GL/glext.h>
|
||||
#include <GL/wglext.h>
|
||||
#include "vsynctoggle_custom.h"
|
||||
#endif
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
// use an ArgumentParser object to manage the program arguments.
|
||||
@ -92,9 +85,10 @@ int main(int argc, char** argv)
|
||||
keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() );
|
||||
keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() );
|
||||
keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() );
|
||||
keyswitchManipulator->addMatrixManipulator( '5', "Spherical", new osgGA::SphericalManipulator() );
|
||||
|
||||
std::string pathfile;
|
||||
char keyForAnimationPath = '5';
|
||||
char keyForAnimationPath = '6';
|
||||
while (arguments.read("-p",pathfile))
|
||||
{
|
||||
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
|
||||
@ -157,34 +151,7 @@ int main(int argc, char** argv)
|
||||
osgUtil::Optimizer optimizer;
|
||||
optimizer.optimize(loadedModel.get());
|
||||
|
||||
osg::ref_ptr<osg::Group> group = new osg::Group();
|
||||
group->addChild(loadedModel.get());
|
||||
|
||||
viewer.setSceneData( group.get() );
|
||||
|
||||
{
|
||||
char tmp[256];
|
||||
tmp[sizeof(tmp) - 1] = 0;
|
||||
getcwd(tmp, sizeof(tmp) - 1);
|
||||
|
||||
std::string path(tmp);
|
||||
path += "\\system\\cache\\planet";
|
||||
|
||||
tmp[sizeof(tmp) - 1] = 0;
|
||||
snprintf(tmp, sizeof(tmp) - 1, "%s", path.c_str());
|
||||
//_putenv(tmp);
|
||||
// osgDB::Registry::instance()->setFileCache(new osgDB::FileCache( tmp ) );
|
||||
viewer.getDatabasePager()->setTargetMaximumNumberOfPageLOD(500);
|
||||
|
||||
#ifdef _WINDOWS
|
||||
osg::ref_ptr<baronvsync::CVsyncDrawable> vsync = new baronvsync::CVsyncDrawable();
|
||||
osg::ref_ptr<osg::Geode> vsyncGeode = new osg::Geode();
|
||||
vsyncGeode->addDrawable(vsync.get());
|
||||
vsync->SetVSync(false);
|
||||
group->addChild(vsyncGeode.get());
|
||||
#endif
|
||||
|
||||
}
|
||||
viewer.setSceneData( loadedModel.get() );
|
||||
|
||||
viewer.realize();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user