title: C++: Drawing a 2D disk in OpenGL
body: <p>I've tried to write a proper function for drawing a 2D disk on the screen with OpenGL for a few days now, and I simply can't seem to get it right :(</p>
  
  <p>This is my current code:</p>
  
  <pre><code>void Disk( Float x, Float y, Float r, const Color&amp; vColor )
  {
      glBegin( GL_TRIANGLE_FAN );
          glVertex2f( x, y );
          for( Float i = 0; i &lt;= 2 * PI + 0.1; i += 0.1 )
          {
              glVertex2f( x + sin( i ) * r, y + cos( i ) * r );
          }
      glEnd();
  }
  </code></pre>
  
  <p>When zooming in, the resulting disk shows spikes, not as in edges but really spikes pointing out.</p>
  
  <p>Also the function doesn't draw one disk only, but always a bit more than one - which means that if alpha is enabled, the results look wrong.</p>
  
  <ul>
  <li>What do I need to change in my function so it properly draws a disk?</li>
  </ul>