2006-11-27 22:52:07 +08:00
|
|
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
|
|
|
*
|
|
|
|
* This library is open source and may be redistributed and/or modified under
|
|
|
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
|
|
|
* (at your option) any later version. The full license is in LICENSE file
|
|
|
|
* included with this distribution, and on the openscenegraph.org website.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
2006-11-29 19:00:02 +08:00
|
|
|
* but WITHOUT ANY WARRANTY
|
|
|
|
{
|
|
|
|
}
|
|
|
|
without even the implied warranty of
|
2006-11-27 22:52:07 +08:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* OpenSceneGraph Public License for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <osgViewer/Viewer>
|
2006-12-23 01:46:21 +08:00
|
|
|
#include <osgUtil/GLObjectsVisitor>
|
|
|
|
#include <osg/GLExtensions>
|
2006-11-27 22:52:07 +08:00
|
|
|
|
|
|
|
using namespace osgViewer;
|
|
|
|
|
2006-12-21 05:13:29 +08:00
|
|
|
class ActionAdapter : public osgGA::GUIActionAdapter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~ActionAdapter() {}
|
|
|
|
|
|
|
|
virtual void requestRedraw() { /*osg::notify(osg::NOTICE)<<"requestRedraw()"<<std::endl;*/ }
|
2006-12-23 01:46:21 +08:00
|
|
|
virtual void requestContinuousUpdate(bool =true) { /*osg::notify(osg::NOTICE)<<"requestContinuousUpdate("<<needed<<")"<<std::endl;*/ }
|
2006-12-21 05:13:29 +08:00
|
|
|
virtual void requestWarpPointer(float x,float y) { osg::notify(osg::NOTICE)<<"requestWarpPointer("<<x<<","<<y<<")"<<std::endl; }
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
Viewer::Viewer():
|
2006-12-22 00:56:20 +08:00
|
|
|
_firstFrame(true),
|
|
|
|
_done(false)
|
2006-11-27 22:52:07 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Viewer::~Viewer()
|
|
|
|
{
|
2006-12-23 01:46:21 +08:00
|
|
|
#if 0
|
|
|
|
Contexts contexts;
|
|
|
|
getContexts(contexts);
|
|
|
|
|
|
|
|
// cancel any graphics threads.
|
|
|
|
for(Contexts::iterator citr = contexts.begin();
|
|
|
|
citr != contexts.end();
|
|
|
|
++citr)
|
|
|
|
{
|
|
|
|
osg::GraphicsContext* gc = (*citr);
|
|
|
|
gc->setGraphicsThread(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_scene.valid() && _scene->getDatabasePager())
|
|
|
|
{
|
|
|
|
_scene->getDatabasePager()->cancel();
|
|
|
|
_scene->setDatabasePager(0);
|
|
|
|
}
|
|
|
|
#endif
|
2006-11-27 22:52:07 +08:00
|
|
|
}
|
2006-11-29 19:00:02 +08:00
|
|
|
|
2006-12-21 05:13:29 +08:00
|
|
|
void Viewer::init()
|
|
|
|
{
|
2006-12-22 00:56:20 +08:00
|
|
|
osg::notify(osg::INFO)<<"Viewer::init()"<<std::endl;
|
2006-12-21 05:13:29 +08:00
|
|
|
|
|
|
|
osg::ref_ptr<osgGA::GUIEventAdapter> initEvent = _eventQueue->createEvent();
|
|
|
|
initEvent->setEventType(osgGA::GUIEventAdapter::FRAME);
|
|
|
|
|
|
|
|
if (_cameraManipulator.valid())
|
|
|
|
{
|
|
|
|
ActionAdapter aa;
|
|
|
|
_cameraManipulator->init(*initEvent, aa);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-12-23 01:46:21 +08:00
|
|
|
void Viewer::getContexts(Contexts& contexts)
|
2006-12-20 00:00:51 +08:00
|
|
|
{
|
2006-12-23 01:46:21 +08:00
|
|
|
typedef std::set<osg::GraphicsContext*> ContextSet;
|
|
|
|
ContextSet contextSet;
|
2006-12-20 00:00:51 +08:00
|
|
|
|
|
|
|
if (_camera.valid() && _camera->getGraphicsContext())
|
|
|
|
{
|
2006-12-23 01:46:21 +08:00
|
|
|
contextSet.insert(_camera->getGraphicsContext());
|
2006-12-20 00:00:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
for(unsigned int i=0; i<getNumSlaves(); ++i)
|
|
|
|
{
|
|
|
|
Slave& slave = getSlave(i);
|
|
|
|
if (slave._camera.valid() && slave._camera->getGraphicsContext())
|
|
|
|
{
|
2006-12-23 01:46:21 +08:00
|
|
|
contextSet.insert(slave._camera->getGraphicsContext());
|
2006-12-20 00:00:51 +08:00
|
|
|
}
|
|
|
|
}
|
2006-12-21 19:20:42 +08:00
|
|
|
|
2006-12-23 01:46:21 +08:00
|
|
|
contexts.clear();
|
|
|
|
contexts.reserve(contextSet.size());
|
|
|
|
|
|
|
|
for(ContextSet::iterator itr = contextSet.begin();
|
|
|
|
itr != contextSet.end();
|
|
|
|
++itr)
|
|
|
|
{
|
|
|
|
contexts.push_back(const_cast<osg::GraphicsContext*>(*itr));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
OpenThreads::Mutex mutex;
|
|
|
|
|
|
|
|
// Compile operation, that compile OpenGL objects.
|
2006-12-25 00:40:19 +08:00
|
|
|
struct CompileOperation : public osg::GraphicsOperation
|
2006-12-23 01:46:21 +08:00
|
|
|
{
|
|
|
|
CompileOperation(osg::Node* scene):
|
2006-12-25 00:40:19 +08:00
|
|
|
osg::GraphicsOperation("Compile",false),
|
2006-12-23 01:46:21 +08:00
|
|
|
_scene(scene)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void operator () (osg::GraphicsContext* context)
|
|
|
|
{
|
|
|
|
// OpenThreads::ScopedLock<OpenThreads::Mutex> lock(mutex);
|
|
|
|
// osg::notify(osg::NOTICE)<<"Compile "<<context<<" "<<OpenThreads::Thread::CurrentThread()<<std::endl;
|
|
|
|
|
|
|
|
// context->makeCurrentImplementation();
|
|
|
|
|
|
|
|
osgUtil::GLObjectsVisitor compileVisitor;
|
|
|
|
compileVisitor.setState(context->getState());
|
|
|
|
|
|
|
|
// do the compile traversal
|
|
|
|
_scene->accept(compileVisitor);
|
|
|
|
|
|
|
|
// osg::notify(osg::NOTICE)<<"Done Compile "<<context<<" "<<OpenThreads::Thread::CurrentThread()<<std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::Node> _scene;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Draw operation, that does a draw on the scene graph.
|
2006-12-25 00:40:19 +08:00
|
|
|
struct RunOperations : public osg::GraphicsOperation
|
2006-12-23 01:46:21 +08:00
|
|
|
{
|
|
|
|
RunOperations(osg::GraphicsContext* gc):
|
2006-12-25 00:40:19 +08:00
|
|
|
osg::GraphicsOperation("RunOperation",true),
|
2006-12-23 01:46:21 +08:00
|
|
|
_originalContext(gc)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void operator () (osg::GraphicsContext* gc)
|
|
|
|
{
|
|
|
|
gc->runOperations();
|
|
|
|
}
|
|
|
|
|
|
|
|
osg::GraphicsContext* _originalContext;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void Viewer::realize()
|
|
|
|
{
|
|
|
|
osg::notify(osg::INFO)<<"Viewer::realize()"<<std::endl;
|
|
|
|
|
|
|
|
Contexts::iterator citr;
|
|
|
|
|
|
|
|
Contexts contexts;
|
|
|
|
getContexts(contexts);
|
|
|
|
|
|
|
|
bool multiThreaded = getNumSlaves() > 1;
|
|
|
|
|
|
|
|
if (multiThreaded)
|
|
|
|
{
|
|
|
|
_startRenderingBarrier = new osg::BarrierOperation(contexts.size()+1, osg::BarrierOperation::NO_OPERATION);
|
|
|
|
_endRenderingDispatchBarrier = new osg::BarrierOperation(contexts.size()+1, osg::BarrierOperation::NO_OPERATION);
|
|
|
|
osg::ref_ptr<osg::SwapBuffersOperation> swapOp = new osg::SwapBuffersOperation();
|
|
|
|
|
|
|
|
for(citr = contexts.begin();
|
|
|
|
citr != contexts.end();
|
|
|
|
++citr)
|
|
|
|
{
|
|
|
|
osg::GraphicsContext* gc = (*citr);
|
|
|
|
|
|
|
|
// create the a graphics thread for this context
|
|
|
|
gc->createGraphicsThread();
|
|
|
|
|
|
|
|
gc->getGraphicsThread()->add(new CompileOperation(getSceneData()));
|
|
|
|
|
|
|
|
// add the startRenderingBarrier
|
|
|
|
gc->getGraphicsThread()->add(_startRenderingBarrier.get());
|
|
|
|
|
|
|
|
// add the rendering operation itself.
|
|
|
|
gc->getGraphicsThread()->add(new RunOperations(gc));
|
|
|
|
|
|
|
|
// add the endRenderingDispatchBarrier
|
|
|
|
gc->getGraphicsThread()->add(_endRenderingDispatchBarrier.get());
|
|
|
|
|
|
|
|
// add the swap buffers
|
|
|
|
gc->getGraphicsThread()->add(swapOp.get());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for(citr = contexts.begin();
|
|
|
|
citr != contexts.end();
|
|
|
|
++citr)
|
|
|
|
{
|
|
|
|
(*citr)->realize();
|
|
|
|
}
|
|
|
|
|
|
|
|
OpenThreads::Thread::YieldCurrentThread();
|
|
|
|
|
2006-12-21 19:20:42 +08:00
|
|
|
bool grabFocus = true;
|
|
|
|
if (grabFocus)
|
|
|
|
{
|
2006-12-23 01:46:21 +08:00
|
|
|
for(citr = contexts.begin();
|
|
|
|
citr != contexts.end();
|
|
|
|
++citr)
|
2006-12-21 19:20:42 +08:00
|
|
|
{
|
2006-12-23 01:46:21 +08:00
|
|
|
osgViewer::GraphicsWindow* gw = dynamic_cast<osgViewer::GraphicsWindow*>(*citr);
|
|
|
|
if (gw)
|
|
|
|
{
|
|
|
|
gw->grabFocusIfPointerInWindow();
|
|
|
|
}
|
2006-12-21 19:20:42 +08:00
|
|
|
}
|
2006-12-23 01:46:21 +08:00
|
|
|
}
|
|
|
|
|
2006-12-21 19:20:42 +08:00
|
|
|
|
2006-12-23 01:46:21 +08:00
|
|
|
if (multiThreaded)
|
|
|
|
{
|
|
|
|
for(citr = contexts.begin();
|
|
|
|
citr != contexts.end();
|
|
|
|
++citr)
|
2006-12-21 19:20:42 +08:00
|
|
|
{
|
2006-12-23 01:46:21 +08:00
|
|
|
osg::GraphicsContext* gc = (*citr);
|
|
|
|
if (!gc->getGraphicsThread()->isRunning())
|
2006-12-21 19:20:42 +08:00
|
|
|
{
|
2006-12-23 01:46:21 +08:00
|
|
|
gc->getGraphicsThread()->startThread();
|
2006-12-21 19:20:42 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-12-23 01:46:21 +08:00
|
|
|
|
2006-12-20 00:00:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-11-29 19:00:02 +08:00
|
|
|
void Viewer::frame()
|
|
|
|
{
|
2006-12-22 00:56:20 +08:00
|
|
|
if (_done) return;
|
|
|
|
|
2006-12-21 05:13:29 +08:00
|
|
|
if (_firstFrame)
|
|
|
|
{
|
|
|
|
init();
|
|
|
|
_firstFrame = false;
|
|
|
|
}
|
2006-12-22 00:56:20 +08:00
|
|
|
frameAdvance();
|
2006-12-21 05:13:29 +08:00
|
|
|
|
|
|
|
frameEventTraversal();
|
|
|
|
frameUpdateTraversal();
|
2006-12-22 00:56:20 +08:00
|
|
|
frameRenderingTraversals();
|
2006-11-29 19:00:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void Viewer::frameAdvance()
|
|
|
|
{
|
2006-12-22 00:56:20 +08:00
|
|
|
if (_done) return;
|
|
|
|
|
2006-12-21 05:13:29 +08:00
|
|
|
// osg::notify(osg::NOTICE)<<"Viewer::frameAdvance()."<<std::endl;
|
|
|
|
|
|
|
|
_scene->frameAdvance();
|
2006-11-29 19:00:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void Viewer::frameEventTraversal()
|
|
|
|
{
|
2006-12-22 00:56:20 +08:00
|
|
|
if (_done) return;
|
|
|
|
|
2006-12-21 05:13:29 +08:00
|
|
|
// osg::notify(osg::NOTICE)<<"Viewer::frameEventTraversal()."<<std::endl;
|
|
|
|
|
|
|
|
// need to copy events from the GraphicsWindow's into local EventQueue;
|
|
|
|
osgGA::EventQueue::Events events;
|
|
|
|
|
2006-12-23 01:46:21 +08:00
|
|
|
Contexts contexts;
|
|
|
|
getContexts(contexts);
|
|
|
|
|
|
|
|
for(Contexts::iterator citr = contexts.begin();
|
|
|
|
citr != contexts.end();
|
|
|
|
++citr)
|
2006-12-21 05:13:29 +08:00
|
|
|
{
|
2006-12-23 01:46:21 +08:00
|
|
|
osgViewer::GraphicsWindow* gw = dynamic_cast<osgViewer::GraphicsWindow*>(*citr);
|
2006-12-21 05:13:29 +08:00
|
|
|
if (gw)
|
|
|
|
{
|
|
|
|
gw->checkEvents();
|
|
|
|
gw->getEventQueue()->takeEvents(events);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_eventQueue->frame( _scene->getFrameStamp()->getReferenceTime() );
|
|
|
|
|
|
|
|
_eventQueue->takeEvents(events);
|
|
|
|
|
|
|
|
osgGA::GUIEventAdapter* eventState = getEventQueue()->getCurrentEventState();
|
|
|
|
for(osgGA::EventQueue::Events::iterator itr = events.begin();
|
|
|
|
itr != events.end();
|
|
|
|
++itr)
|
|
|
|
{
|
|
|
|
osgGA::GUIEventAdapter* event = itr->get();
|
|
|
|
event->setInputRange(eventState->getXmin(), eventState->getYmin(), eventState->getXmax(), eventState->getYmax());
|
|
|
|
}
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
// osg::notify(osg::NOTICE)<<"Events "<<events.size()<<std::endl;
|
|
|
|
for(osgGA::EventQueue::Events::iterator itr = events.begin();
|
|
|
|
itr != events.end();
|
|
|
|
++itr)
|
|
|
|
{
|
|
|
|
osgGA::GUIEventAdapter* event = itr->get();
|
|
|
|
switch(event->getEventType())
|
|
|
|
{
|
|
|
|
case(osgGA::GUIEventAdapter::PUSH):
|
|
|
|
osg::notify(osg::NOTICE)<<" PUSH "<<event->getButton()<<" x="<<event->getX()<<" y="<<event->getY()<<std::endl;
|
|
|
|
break;
|
|
|
|
case(osgGA::GUIEventAdapter::RELEASE):
|
|
|
|
osg::notify(osg::NOTICE)<<" RELEASE "<<event->getButton()<<" x="<<event->getX()<<" y="<<event->getY()<<std::endl;
|
|
|
|
break;
|
|
|
|
case(osgGA::GUIEventAdapter::DRAG):
|
|
|
|
osg::notify(osg::NOTICE)<<" DRAG "<<event->getButtonMask()<<" x="<<event->getX()<<" y="<<event->getY()<<std::endl;
|
|
|
|
break;
|
|
|
|
case(osgGA::GUIEventAdapter::MOVE):
|
|
|
|
osg::notify(osg::NOTICE)<<" MOVE "<<event->getButtonMask()<<" x="<<event->getX()<<" y="<<event->getY()<<std::endl;
|
|
|
|
break;
|
|
|
|
case(osgGA::GUIEventAdapter::SCROLL):
|
|
|
|
osg::notify(osg::NOTICE)<<" SCROLL "<<event->getScrollingMotion()<<std::endl;
|
|
|
|
break;
|
|
|
|
case(osgGA::GUIEventAdapter::KEYDOWN):
|
|
|
|
osg::notify(osg::NOTICE)<<" KEYDOWN '"<<(char)event->getKey()<<"'"<<std::endl;
|
|
|
|
break;
|
|
|
|
case(osgGA::GUIEventAdapter::KEYUP):
|
|
|
|
osg::notify(osg::NOTICE)<<" KEYUP '"<<(char)event->getKey()<<"'"<<std::endl;
|
|
|
|
break;
|
|
|
|
case(osgGA::GUIEventAdapter::FRAME):
|
|
|
|
// osg::notify(osg::NOTICE)<<" FRAME "<<std::endl;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
// osg::notify(osg::NOTICE)<<" Event not handled"<<std::endl;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2006-12-22 00:56:20 +08:00
|
|
|
// osg::notify(osg::NOTICE)<<"Events "<<events.size()<<std::endl;
|
|
|
|
for(osgGA::EventQueue::Events::iterator itr = events.begin();
|
|
|
|
itr != events.end();
|
|
|
|
++itr)
|
|
|
|
{
|
|
|
|
osgGA::GUIEventAdapter* event = itr->get();
|
|
|
|
switch(event->getEventType())
|
|
|
|
{
|
|
|
|
case(osgGA::GUIEventAdapter::KEYUP):
|
|
|
|
if (event->getKey()=='q') _done = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_done) return;
|
|
|
|
|
2006-12-21 05:13:29 +08:00
|
|
|
ActionAdapter aa;
|
|
|
|
|
|
|
|
for(osgGA::EventQueue::Events::iterator itr = events.begin();
|
|
|
|
itr != events.end();
|
|
|
|
++itr)
|
|
|
|
{
|
|
|
|
osgGA::GUIEventAdapter* event = itr->get();
|
|
|
|
|
|
|
|
bool handled = false;
|
|
|
|
|
|
|
|
if (_cameraManipulator.valid())
|
|
|
|
{
|
|
|
|
_cameraManipulator->handle( *event, aa);
|
|
|
|
}
|
|
|
|
|
|
|
|
for(EventHandlers::iterator hitr = _eventHandlers.begin();
|
|
|
|
hitr != _eventHandlers.end() && !handled;
|
|
|
|
++hitr)
|
|
|
|
{
|
|
|
|
handled = (*hitr)->handle( *event, aa, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
2006-11-29 19:00:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void Viewer::frameUpdateTraversal()
|
|
|
|
{
|
2006-12-22 00:56:20 +08:00
|
|
|
if (_done) return;
|
|
|
|
|
|
|
|
if (_scene.valid()) _scene->frameUpdateTraversal();
|
|
|
|
|
2006-12-21 05:13:29 +08:00
|
|
|
if (_cameraManipulator.valid())
|
|
|
|
{
|
|
|
|
_camera->setViewMatrix(_cameraManipulator->getInverseMatrix());
|
|
|
|
}
|
|
|
|
|
|
|
|
updateSlaves();
|
2006-11-29 19:00:02 +08:00
|
|
|
}
|
|
|
|
|
2006-12-22 00:56:20 +08:00
|
|
|
void Viewer::frameRenderingTraversals()
|
2006-11-29 19:00:02 +08:00
|
|
|
{
|
2006-12-22 01:23:07 +08:00
|
|
|
if (_done) return;
|
|
|
|
|
|
|
|
osgDB::DatabasePager* dp = _scene->getDatabasePager();
|
|
|
|
if (dp)
|
|
|
|
{
|
|
|
|
dp->signalBeginFrame(_scene->getFrameStamp());
|
|
|
|
}
|
|
|
|
|
2006-12-23 01:46:21 +08:00
|
|
|
bool multiThreaded = _startRenderingBarrier.valid();
|
|
|
|
|
|
|
|
if (multiThreaded)
|
|
|
|
{
|
|
|
|
// sleep(1);
|
|
|
|
|
|
|
|
// osg::notify(osg::NOTICE)<<std::endl<<"Joing _startRenderingBarrier block"<<std::endl;
|
|
|
|
|
|
|
|
// dispatch the the rendering threads
|
|
|
|
_startRenderingBarrier->block();
|
|
|
|
|
|
|
|
// osg::notify(osg::NOTICE)<<"Joing _endRenderingDispatchBarrier block"<<std::endl;
|
2006-11-29 19:00:02 +08:00
|
|
|
|
2006-12-23 01:46:21 +08:00
|
|
|
// wait till the rendering dispatch is done.
|
|
|
|
_endRenderingDispatchBarrier->block();
|
|
|
|
|
|
|
|
// osg::notify(osg::NOTICE)<<"Leaving _endRenderingDispatchBarrier block"<<std::endl<<std::endl;
|
2006-12-22 00:56:20 +08:00
|
|
|
|
|
|
|
}
|
2006-12-23 01:46:21 +08:00
|
|
|
else
|
2006-12-22 00:56:20 +08:00
|
|
|
{
|
2006-12-23 01:46:21 +08:00
|
|
|
Contexts contexts;
|
|
|
|
getContexts(contexts);
|
|
|
|
|
|
|
|
Contexts::iterator itr;
|
|
|
|
for(itr = contexts.begin();
|
|
|
|
itr != contexts.end();
|
|
|
|
++itr)
|
2006-12-22 00:56:20 +08:00
|
|
|
{
|
2006-12-23 01:46:21 +08:00
|
|
|
if (_done) return;
|
|
|
|
(*itr)->makeCurrent();
|
|
|
|
(*itr)->runOperations();
|
2006-12-22 00:56:20 +08:00
|
|
|
}
|
2006-12-22 01:23:07 +08:00
|
|
|
|
|
|
|
|
2006-12-23 01:46:21 +08:00
|
|
|
for(itr = contexts.begin();
|
|
|
|
itr != contexts.end();
|
|
|
|
++itr)
|
|
|
|
{
|
|
|
|
(*itr)->makeCurrent();
|
|
|
|
(*itr)->swapBuffers();
|
|
|
|
}
|
2006-12-22 01:23:07 +08:00
|
|
|
|
2006-12-22 00:56:20 +08:00
|
|
|
}
|
2006-12-22 01:23:07 +08:00
|
|
|
|
|
|
|
if (dp)
|
|
|
|
{
|
|
|
|
dp->signalEndFrame();
|
|
|
|
}
|
2006-11-29 19:00:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void Viewer::releaseAllGLObjects()
|
|
|
|
{
|
|
|
|
osg::notify(osg::NOTICE)<<"Viewer::releaseAllGLObjects() not implemented yet."<<std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Viewer::cleanup()
|
|
|
|
{
|
|
|
|
osg::notify(osg::NOTICE)<<"Viewer::cleanup() not implemented yet."<<std::endl;
|
|
|
|
}
|
|
|
|
|