Hi John and Mathias, I haven't discounted or approve of any one option yet, but have done a little more thinking. Mathias's suggestion of a flag whether the realize should invoke all the initialization steps or leave it to lazy initialization would be sensible if we wish to avoid the cost of initializing all extensions sounds reasonable compromise. Although this might leave application developers need to support both lazy and realize initializations in their applications yet in case.
For a registry of objects to initialize my inclination would be to have a registry of all OpenGL objects types, which is essentially osg::Drawable and osg::StateAttribute's, perhaps one could just have a registry of osg::Object and then cast these to Drawable or StateAttribute then call a function to do the initialize. I would also be inclined to have a initializeExtensions(State&) method that Drawable and StateAttribute have that is called. This approach would mean you wouldn't need to worry about the specifics of the various extension classes. However, this might not be ideal subdivision for this feature. I do also wonder about formalizing the extension set up. In essence we are initializing bool relating to feature supported yes/no, and the function pointers. Currently it's all rather adhoc how this is all done. The whole area could do with a major refactor to make things more coherent. More widely I do also wonder whether we should split up the scene graph data from the OpenGL implementation, so that the scene graph data object would have a list of implementations, these implementations might contain handles to extensions or OpenGL object id's a handle to the extension. Robert.
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

