Hello everyone, I've recently discovered a weird problem with my renderer.
I have the following code
void Surface::DrawFilledCircle( int x, int y, int radius, color32 color )
{
constexpr int segments = 64;
std::vector< fxVertex > v;
for ( int i = 0; i <= segments; ++i )
{
float theta = ( ( 2.f * M_PI ) / ( float )segments ) * i;
v.emplace_back
(
static_cast< float >( x + radius * cosf( theta ) ),
static_cast< float >( y + radius * sinf( theta ) ),
0.f,
color
);
}
m_pRenderer->PushVertices( m_renderList, v.data(), v.size(), fxPrimitiveType::kTriangleFan );
}
The problem begins after the first circle is drawn, as you can see in the link below, it draws fine for the first circle, but after, the rest of the circles become deformed. I'm pretty confused on why this happens in all honesty and would appreciate any advice or if anyone knows whats going on. I thought that I was passing the wrong number of vertices to PushVertices but that is not the case.
EDIT: I think it's worth noting that outlined circles that use D3DPT_LINESTRIP are working perfectly using the same code, so is this an issue with D3DPT_TRIANGLEFAN?
Thanks.