But for glPrograms, in order to get all osg's uniform management system to work, I had to subclass osg::program::PerContextProgram. Here is a modified version of this class, which add some "virtual" method to allow easy subclassing."