Added ability to populate a local vertex cache for when one computes final vertex position in a vertex shader but still want to the Primitive functors to work with the transformed positions.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14655 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
parent
d409ffcb91
commit
ed57c8718c
@ -119,6 +119,14 @@ public:
|
||||
|
||||
/// Mimics the OpenGL \c glEnd() function.
|
||||
virtual void end() = 0;
|
||||
|
||||
void useVertexCacheAsVertexArray()
|
||||
{
|
||||
setVertexArray(_vertexCache.size(),&_vertexCache.front());
|
||||
}
|
||||
|
||||
std::vector<Vec3> _vertexCache;
|
||||
bool _treatVertexDataAsTemporary;
|
||||
};
|
||||
|
||||
class PrimitiveIndexFunctor
|
||||
@ -143,6 +151,14 @@ public:
|
||||
virtual void begin(GLenum mode) = 0;
|
||||
virtual void vertex(unsigned int pos) = 0;
|
||||
virtual void end() = 0;
|
||||
|
||||
void useVertexCacheAsVertexArray()
|
||||
{
|
||||
setVertexArray(_vertexCache.size(),&_vertexCache.front());
|
||||
}
|
||||
|
||||
std::vector<Vec3> _vertexCache;
|
||||
bool _treatVertexDataAsTemporary;
|
||||
};
|
||||
|
||||
class DrawElements;
|
||||
|
@ -307,8 +307,6 @@ namespace osg {
|
||||
const Vec3* _vertexArrayPtr;
|
||||
|
||||
GLenum _modeCache;
|
||||
std::vector<Vec3> _vertexCache;
|
||||
bool _treatVertexDataAsTemporary;
|
||||
};
|
||||
|
||||
|
||||
|
@ -387,8 +387,6 @@ protected:
|
||||
const Vec3* _vertexArrayPtr;
|
||||
|
||||
GLenum _modeCache;
|
||||
std::vector<Vec3> _vertexCache;
|
||||
bool _treatVertexDataAsTemporary;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user