+ added drawCircle in renderer
This commit is contained in:
parent
c482a3f779
commit
a4557a2762
3 changed files with 23 additions and 2 deletions
|
|
@ -1,5 +1,16 @@
|
|||
#include <include/renderer.h>
|
||||
|
||||
Renderer::Renderer() {
|
||||
|
||||
endofthejedi::Renderer::Renderer() {}
|
||||
|
||||
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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue