Use ref-ptr in canvas adapter getImage

Adjusted while investigating missing tooltip texture with recent
OSG versions.
This commit is contained in:
James Turner
2016-03-26 19:55:37 +00:00
parent 27baafab0d
commit 2e1f01a86a
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ namespace canvas
virtual FontPtr getFont(const std::string& name) const = 0; virtual FontPtr getFont(const std::string& name) const = 0;
virtual void addCamera(osg::Camera* camera) const = 0; virtual void addCamera(osg::Camera* camera) const = 0;
virtual void removeCamera(osg::Camera* camera) const = 0; virtual void removeCamera(osg::Camera* camera) const = 0;
virtual osg::Image* getImage(const std::string& path) const = 0; virtual osg::ref_ptr<osg::Image> getImage(const std::string& path) const = 0;
virtual SGSubsystem* getSubsystem(const std::string& name) const = 0; virtual SGSubsystem* getSubsystem(const std::string& name) const = 0;
virtual HTTP::Client* getHTTPClient() const = 0; virtual HTTP::Client* getHTTPClient() const = 0;
}; };
+1 -1
View File
@@ -463,7 +463,7 @@ namespace canvas
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void Image::setImage(osg::Image *img) void Image::setImage(osg::ref_ptr<osg::Image> img)
{ {
// remove canvas... // remove canvas...
setSrcCanvas( CanvasPtr() ); setSrcCanvas( CanvasPtr() );
+1 -1
View File
@@ -59,7 +59,7 @@ namespace canvas
void setSrcCanvas(CanvasPtr canvas); void setSrcCanvas(CanvasPtr canvas);
CanvasWeakPtr getSrcCanvas() const; CanvasWeakPtr getSrcCanvas() const;
void setImage(osg::Image *img); void setImage(osg::ref_ptr<osg::Image> img);
void setFill(const std::string& fill); void setFill(const std::string& fill);
/** /**