diff --git a/examples/osgbrowser/osgbrowser.cpp b/examples/osgbrowser/osgbrowser.cpp index 703a0b5b8..70664c4e0 100644 --- a/examples/osgbrowser/osgbrowser.cpp +++ b/examples/osgbrowser/osgbrowser.cpp @@ -95,6 +95,9 @@ class UBrowserImage : public osg::Image, public LLEmbeddedBrowserWindowObserver UBrowserImage(const std::string& homeURL, int width, int height); + + const std::string& getHomeURL() const { return _homeURL; } + virtual void sendPointerEvent(int x, int y, int buttonMask); virtual void sendKeyEvent(int key, bool keyDown); @@ -152,8 +155,7 @@ class UBrowserImage : public osg::Image, public LLEmbeddedBrowserWindowObserver osg::notify(osg::NOTICE) << "Event: clicked on link to " << eventIn.getStringValue() << std::endl; }; - void update(); - + void setBrowserWindowId(int id) { _browserWindowId = id; } int getBrowserWindowId() const { return _browserWindowId; } protected: @@ -270,11 +272,11 @@ struct UpdateOperation : public osg::Operation { UBrowserManager* ubrowserManager = dynamic_cast(object); - osg::notify(osg::NOTICE)<<"Update"<_ubrowserImageList.empty()) { - osg::notify(osg::NOTICE)<<"Nothing to do"<valid()) (*itr)->update(); + update(itr->get()); } - osg::notify(osg::NOTICE)<<"complted Update"<getBrowserWindowId(); + + if (id==0) + { + int width = image->s(); + int height = image->t(); + + osg::notify(osg::NOTICE)<<"Contructing browser window for first time, width = "< browserImage= new UBrowserImage(arguments[i], 768, 1024); - images.push_back(browserImage.get()); + images.push_back(new UBrowserImage(arguments[i], 768, 1024)); } }