Replaced hardwired glDrawArrays calls with use of osg::DrawElementsUshort.

This commit is contained in:
Robert Osfield
2017-03-01 11:51:27 +00:00
parent 256441906f
commit f4966a96d4
5 changed files with 150 additions and 114 deletions

View File

@@ -295,10 +295,6 @@ public:
public:
typedef osg::ref_ptr<osg::Vec3Array> Coords;
typedef osg::ref_ptr<osg::Vec2Array> TexCoords;
typedef osg::ref_ptr<osg::Vec4Array> ColorCoords;
Coords _coords;
ColorCoords _colorCoords;
TexCoords _texcoords;
@@ -318,7 +314,6 @@ public:
struct OSGTEXT_EXPORT GlyphQuads
{
typedef std::vector<Glyph*> Glyphs;
typedef std::vector< osg::ref_ptr<osg::DrawElementsUShort> > Primitives;
Glyphs _glyphs;
Primitives _primitives;

View File

@@ -279,6 +279,10 @@ protected:
virtual void computeGlyphRepresentation() = 0;
typedef osg::ref_ptr<osg::Vec3Array> Coords;
typedef osg::ref_ptr<osg::Vec2Array> TexCoords;
typedef osg::ref_ptr<osg::Vec4Array> ColorCoords;
typedef std::vector< osg::ref_ptr<osg::DrawElementsUShort> > Primitives;
// members which have public access.
osg::Vec4 _color;
@@ -311,9 +315,13 @@ protected:
mutable osg::Matrix _matrix;
Coords _decorationVertices;
Primitives _decorationPrimitives;
void setupDecoration();
osg::ref_ptr<osg::Vec3Array> _decorationVertices;
};