From de283b315bb8287efc37ddf27531a9394ad9f7d7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 8 Oct 2004 09:18:40 +0000 Subject: [PATCH] Changed StaetAttribute::Type so it is an enum list rather than a unsigned int. --- include/osg/PointSprite | 2 +- include/osg/StateAttribute | 14 +++++++++++--- include/osgFX/Validator | 3 --- src/osgFX/AnisotropicLighting.cpp | 2 +- src/osgFX/BumpMapping.cpp | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/include/osg/PointSprite b/include/osg/PointSprite index dfe877402..5a805e290 100644 --- a/include/osg/PointSprite +++ b/include/osg/PointSprite @@ -35,7 +35,7 @@ public: StateAttribute(texenv,copyop) {} - META_StateAttribute(osg, PointSprite, GL_POINT_SPRITE_ARB); + META_StateAttribute(osg, PointSprite, POINTSPRITE); /** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/ virtual int compare(const StateAttribute& sa) const; diff --git a/include/osg/StateAttribute b/include/osg/StateAttribute index 2c35b088e..63b239f5b 100644 --- a/include/osg/StateAttribute +++ b/include/osg/StateAttribute @@ -103,7 +103,7 @@ class SG_EXPORT StateAttribute : public Object }; /** Type identifier to differentiate between different state types. */ - typedef unsigned int Type; + // typedef unsigned int Type; /** Values of StateAttribute::Type used to aid identification * of different StateAttribute subclasses. Each subclass defines @@ -113,7 +113,7 @@ class SG_EXPORT StateAttribute : public Object * enum as a guide of what values to use. If your new subclass * needs to override a standard StateAttriubte then simply use * that type's value. */ - enum Types + enum Type { TEXTURE, @@ -168,7 +168,15 @@ class SG_EXPORT StateAttribute : public Object VERTEXPROGRAM, FRAGMENTPROGRAM, - PROGRAMOBJECT // utilised in osgGL2/ProgramObject + + POINTSPRITE, + + /// osgGL2 namespace + PROGRAMOBJECT, + + /// osgFX namespace + VALIDATOR, + VIEWMATRIXEXTRACTOR, }; diff --git a/include/osgFX/Validator b/include/osgFX/Validator index e5672ca33..01391bdce 100644 --- a/include/osgFX/Validator +++ b/include/osgFX/Validator @@ -34,9 +34,6 @@ namespace osgFX */ class OSGFX_EXPORT Validator: public osg::StateAttribute { public: - enum { - VALIDATOR = 0x56616C69 - }; Validator(); Validator(Effect *effect); diff --git a/src/osgFX/AnisotropicLighting.cpp b/src/osgFX/AnisotropicLighting.cpp index 1bdee6037..99f3cbaae 100644 --- a/src/osgFX/AnisotropicLighting.cpp +++ b/src/osgFX/AnisotropicLighting.cpp @@ -46,7 +46,7 @@ namespace { } - META_StateAttribute(osgFX, ViewMatrixExtractor, 0x564d4548); + META_StateAttribute(osgFX, ViewMatrixExtractor, VIEWMATRIXEXTRACTOR); int compare(const osg::StateAttribute &sa) const { diff --git a/src/osgFX/BumpMapping.cpp b/src/osgFX/BumpMapping.cpp index 166e1a5f5..2e7b94c3e 100644 --- a/src/osgFX/BumpMapping.cpp +++ b/src/osgFX/BumpMapping.cpp @@ -157,7 +157,7 @@ namespace { } - META_StateAttribute(osgFX, ViewMatrixExtractor, 0x564d4548); + META_StateAttribute(osgFX, ViewMatrixExtractor, VIEWMATRIXEXTRACTOR); int compare(const osg::StateAttribute &sa) const {