KlassischeKeplerKriege/game/renderer.cpp
Andreas Ortmann 3c716decdd renamed
2016-09-27 19:01:21 +02:00

18 lines
514 B
C++

#include "renderer.hpp"
endofthejedi::Renderer::Renderer() {
}
endofthejedi::Renderer::~Renderer() {}
void endofthejedi::Renderer::drawCircle(float x, float y, float radius, float r,
float g, float b, int numSides) {
glBegin(GL_TRIANGLE_FAN);
glVertex2f(x, y); // center of circle
for (int i = 0; i <= numSides; i++) {
glColor3f(r,g,b);
glVertex2f(x + (radius * cos(i * 2 * M_PI / numSides)), y + (radius * sin(i * 2 * M_PI / numSides)));
}
glEnd();
}