diff --git a/include/osgFX/Registry b/include/osgFX/Registry index 8b9844184..e36d632c4 100644 --- a/include/osgFX/Registry +++ b/include/osgFX/Registry @@ -26,7 +26,7 @@ namespace osgFX { - class OSGFX_EXPORT Registry { + class OSGFX_EXPORT Registry : public osg::Referenced{ public: struct Proxy { @@ -38,7 +38,7 @@ namespace osgFX typedef std::map > Effect_map; - inline static Registry *instance(); + static Registry *instance(); inline void registerEffect(const Effect *effect); @@ -51,19 +51,12 @@ namespace osgFX ~Registry() {} private: - static Registry *instance_; Effect_map effects_; }; // INLINE METHODS - inline Registry *Registry::instance() - { - if (!instance_) { - instance_ = new Registry; - } - return instance_; - } + inline const Registry::Effect_map &Registry::getEffectMap() const { diff --git a/include/osgGL2/Extensions b/include/osgGL2/Extensions index c87860cfd..cae6ac2cd 100644 --- a/include/osgGL2/Extensions +++ b/include/osgGL2/Extensions @@ -139,8 +139,7 @@ class OSGGL2_EXPORT Extensions : public osg::Referenced /** are all the extensions required for GLSL supported? */ bool isGlslSupported() const { return ( _isShaderObjectsSupported && _isVertexShaderSupported && - _isFragmentShaderSupported && - _isLanguage100Supported ); } + _isFragmentShaderSupported ); } void setShaderObjectsSupported(bool flag) { _isShaderObjectsSupported = flag; } bool isShaderObjectsSupported() const { return _isShaderObjectsSupported; } diff --git a/src/osgFX/Registry.cpp b/src/osgFX/Registry.cpp index f5dbb3fdd..68f719fc4 100644 --- a/src/osgFX/Registry.cpp +++ b/src/osgFX/Registry.cpp @@ -2,8 +2,13 @@ using namespace osgFX; -Registry *Registry::instance_ = 0; +Registry *Registry::instance() +{ + static osg::ref_ptr s_instance = new Registry; + return s_instance.get(); +} + Registry::Registry() { }