From Eduardo Poyart, "The attached patch fixes a race condition that caused OSG to try to render the scene before the window is realized. It works ok in my osgviewerWX-derived application under Linux."

This commit is contained in:
Robert Osfield 2010-12-13 10:46:18 +00:00
parent ea5d88e54f
commit 14a12afb6c
2 changed files with 4 additions and 1 deletions

View File

@ -106,6 +106,9 @@ void MainFrame::SetViewer(osgViewer::Viewer *viewer)
void MainFrame::OnIdle(wxIdleEvent &event) void MainFrame::OnIdle(wxIdleEvent &event)
{ {
if (!_viewer->isRealized())
return;
_viewer->frame(); _viewer->frame();
event.RequestMore(); event.RequestMore();

View File

@ -67,7 +67,7 @@ public:
// not implemented yet...just use dummy implementation to get working. // not implemented yet...just use dummy implementation to get working.
virtual bool valid() const { return true; } virtual bool valid() const { return true; }
virtual bool realizeImplementation() { return true; } virtual bool realizeImplementation() { return true; }
virtual bool isRealizedImplementation() const { return true; } virtual bool isRealizedImplementation() const { return _canvas->IsShownOnScreen(); }
virtual void closeImplementation() {} virtual void closeImplementation() {}
virtual bool releaseContextImplementation() { return true; } virtual bool releaseContextImplementation() { return true; }