Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void RenderBitmapCircle(int Texture, float x, float y, float Radius)
- {
- float tx, ty;
- float xcos, ysin;
- float Angle, Radian;
- BindTexture(Texture);
- glBegin(GL_POLYGON);
- for(Angle=0.0;Angle<=360.0;Angle+=2.0)
- {
- Radian = Angle * (Q_PI/180.0f);
- xcos = cosf(Radian);
- ysin = sinf(Radian);
- x = xcos * Radius + x;
- y = ysin * Radius + y;
- tx = xcos * 0.5f + 0.5f;
- ty = ysin * 0.5f + 0.5f;
- glTexCoord2f(tx, ty);
- glVertex2f(x, y);
- }
- glEnd();
- }
Add Comment
Please, Sign In to add comment