Hi,
How is one supposed to use a custom StateAttribute?
The docs say that:
"When extending the osg's StateAttribute's simply define your own Type value
which is unique, using the StateAttribute::Type enum as a guide of what values
to use"
As it is, returning a unique value simply isn't possible because the getType()
function returns an enum:
/** Return the Type identifier of the attribute's class type.*/
virtual Type getType() const = 0;
Type is the enum defined here containing the default types, with no room for
user types:
Code:
enum Type
{
TEXTURE,
POLYGONMODE,
....
FRAME_BUFFER_OBJECT
};
I suppose that you could choose some integer, static_cast it back to enum Type
and then hope that will work. (it will most likely work if the enum has a large
enough bit size, but it's technically undefined behaviour, so I can't imagine
that's how Robert intended it to be used).
To me it seems the feature advertised in docs of creating your own
StateAttributes simply isn't possible, just because of this one function
returning enum instead of int, which would be an easy fix. Am I missing
something here?
Cheers,
Jannik
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65369#65369
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org