From 6227aa62517fe4deae35aea2b7a0c431f49b7080 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 13 Aug 2004 10:46:04 +0000 Subject: [PATCH] Fixes for OSX. --- include/osgFX/Registry | 13 +++---------- include/osgGL2/Extensions | 3 +-- src/osgFX/Registry.cpp | 7 ++++++- 3 files changed, 10 insertions(+), 13 deletions(-) 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() { }