//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield //Distributed under the terms of the GNU Library General Public License (LGPL) //as published by the Free Software Foundation. #ifndef OSG_TRIANGLEFUNCTOR #define OSG_TRIANGLEFUNCTOR 1 #include namespace osg { template class TriangleFunctor : public Drawable::PrimitiveFunctor, public T { public: TriangleFunctor() { _vertexArraySize=0; _vertexArrayPtr=0; _modeCache=0; } virtual ~TriangleFunctor() {} virtual void setVertexArray(unsigned int count,const Vec3* vertices) { _vertexArraySize = count; _vertexArrayPtr = vertices; } virtual void drawArrays(GLenum mode,GLint first,GLsizei count) { if (_vertexArrayPtr==0 && count==0) return; switch(mode) { case(GL_TRIANGLES): { const Vec3* vlast = &_vertexArrayPtr[first+count]; for(const Vec3* vptr=&_vertexArrayPtr[first];vptr _vertexCache; }; } #endif