HI David,
On 6/15/06, david callu <[EMAIL PROTECTED]> wrote:
I work on an editor using osgIntrospection and i have a trouble with
osg::StateAttribute::GLMode.
I don't understant why the osg::StateAttribute::GLMode is not an enum with
all GL_* flag that can be past to glEnable/glDisable.
This method is restrictive but a restriction is already do with the enum
osg::StateAttribute::Type, so why not do an enum for non-texture GL_* flags
(GL_LIGHTING, ...) and another for the Texture flag (GL_TEXTURE_1D, ... ).
With this enum, the osg::StateSet::getTextureMode(unsigned
int unit, StateAttibute::GLMode mode) don't have to test the validity of the
mode parameter,
I'm a bit confused where the problem lies for you. The
StateAttribute::Type existings to differentiate between
StateAttributes in a way that is efficient for StateSet to manage in a
map. StateAttributes can be associated with multiple OpenGL modes, so
its not possible to just replace the type by the modes associated with
them.
Implementing an enum for all the OpenGL modes simply isn't practical,
maintainable or extensibile - this is why its left up to use OpenGL
modes directly, as new modes are added to OpenGL then they all can
work natively without needing core OSG headers to be modified.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/