Moved the ArrayDispatchers management so that osg::State now has a ArrayDispatchers object that any osg::Geometry can reuse,

and optimized the implementation to reduce the CPU overhead.
This commit is contained in:
Robert Osfield
2009-10-21 11:18:13 +00:00
parent b7ffae25ce
commit 9499b19b43
6 changed files with 162 additions and 132 deletions

View File

@@ -26,6 +26,7 @@
#include <osg/Polytope>
#include <osg/Viewport>
#include <osg/GLBeginEndAdapter>
#include <osg/ArrayDispatchers>
#include <vector>
#include <map>
@@ -1246,6 +1247,8 @@ class OSG_EXPORT State : public Referenced, public Observer
/** get the GL adapter object used to map OpenGL 1.0 glBegin/glEnd usage to vertex arrays.*/
inline GLBeginEndAdapter& getGLBeginEndAdapter() { return _glBeginEndAdapter; }
/** get the helper class for dispatching osg::Arrays as OpenGL attribute data.*/
inline ArrayDispatchers& getArrayDispatchers() { return _arrayDispatchers; }
protected:
@@ -1558,6 +1561,7 @@ class OSG_EXPORT State : public Referenced, public Observer
osg::ref_ptr<DynamicObjectRenderingCompletedCallback> _completeDynamicObjectRenderingCallback;
GLBeginEndAdapter _glBeginEndAdapter;
ArrayDispatchers _arrayDispatchers;
};