Hi JS, On Fri, Sep 10, 2010 at 1:04 PM, Jean-Sébastien Guay <[email protected]> wrote: >>> Note, there's a nasty const_cast in there. Why isn't >>> osgText::Font::getGlyph() declared const? > > I don't see why getGlyph() couldn't be declared const, or have another > const-version. That would allow me to remove the const_cast in this > submission, which would make me happier :-)
Font::getGlyph() right now can result in a load of the glyph and modication of internal data structures which is why it's not const. A const version of getGlyph() would need to just check the internal glyph list and return any one that is available but couldn't load a new one. Perhaps if one made the access serialized by a mutex then perhaps one could allow a const version to modify the Font/FontImplementation. There is already some mutex protection of the internal structures so this probably isn't too difficult to achieve. Robert. _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
