The vertex array used to draw the patch has all of it's colour members defaulting to (0,0,0,0), so the patch is fully transparent (ie. invisible).
After making the patch, call this:
nine9sprite.Color = Color.White;
However this won't work yet, because there's a bug in the Color property setter. This is the current code:
public Color Color
{
get
{
return m_vertices[0].Color;
}
set
{
foreach (Vertex vertex in m_vertices)
{
Vertex tempvex = vertex;
tempvex.Color = value;
}
}
}
The foreach loop goes over every vertex, but assigns the colour to a temp vertex, not the actual vertex array.
C# doesn't like foreach loops that modify values (if Vertex was a class, it would be ok, but as a struct, the foreach variable "vertex" is read only). So we need to change it to a normal loop like this:
public Color Color
{
get
{
return m_vertices[0].Color;
}
set
{
for(int i=0;i<m_vertices.Length;++i)
{
m_vertices[i].Color = value;
}
}
}
After both of those changes, it's rendering.