KlassischeKeplerKriege/KKK/game/src/renderer.cpp

19 lines
488 B
C++
Raw Normal View History

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