Fixes for OSX.

This commit is contained in:
Robert Osfield
2004-08-13 10:46:04 +00:00
parent 821b0991d9
commit 6227aa6251
3 changed files with 10 additions and 13 deletions

View File

@@ -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<std::string, osg::ref_ptr<const Effect> > 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
{

View File

@@ -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; }

View File

@@ -2,8 +2,13 @@
using namespace osgFX;
Registry *Registry::instance_ = 0;
Registry *Registry::instance()
{
static osg::ref_ptr<Registry> s_instance = new Registry;
return s_instance.get();
}
Registry::Registry()
{
}