Geometries now automatically use per-vertex colors when drawing if any vertex has a custom color set, otherwise the constant color is used.

Still not a perfect solution, but it works better than before
This commit is contained in:
Alex Szpakowski
2013-04-23 23:25:45 -07:00
parent a5eaffe625
commit 3b05ec0635
7 changed files with 78 additions and 41 deletions
+15
View File
@@ -86,6 +86,19 @@ public:
return vertexCount;
}
/**
* Sets whether this Geometry will use custom per-vertex colors.
**/
void setVertexColors(bool on);
/**
* Returns whether this Geometry is using custom per-vertex colors.
**/
bool hasVertexColors() const
{
return vertexColors;
};
private:
void triangulate();
@@ -99,6 +112,8 @@ private:
float y_min;
float y_max;
bool vertexColors;
};
} // graphics