2016-09-27 17:01:21 +00:00
|
|
|
#include "renderer.hpp"
|
2016-09-15 15:23:02 +00:00
|
|
|
|
2016-09-27 15:57:41 +00:00
|
|
|
endofthejedi::Renderer::Renderer() {
|
|
|
|
|
|
|
|
}
|
2016-09-25 21:05:27 +00:00
|
|
|
|
|
|
|
endofthejedi::Renderer::~Renderer() {}
|
|
|
|
|
2016-09-27 18:23:33 +00:00
|
|
|
void endofthejedi::Renderer::drawCircle(float x, float y, float radius, float r, float g, float b, int numSides)
|
|
|
|
{
|
|
|
|
glBegin(GL_TRIANGLE_FAN);
|
2016-09-25 21:05:27 +00:00
|
|
|
glColor3f(r,g,b);
|
2016-09-27 18:23:33 +00:00
|
|
|
glVertex2f(x, y); // center of circle
|
|
|
|
for (int i = 0; i <= numSides; i++) {
|
|
|
|
glVertex2f(x + (radius * cos(i * 2 * M_PI / numSides)), y + (radius * sin(i * 2 * M_PI / numSides)));
|
|
|
|
}
|
|
|
|
glEnd();
|
2016-09-15 15:23:02 +00:00
|
|
|
}
|