1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#include<glut.h>
#include"shape.h"
#include"triangle.h"
#include"circle.h"
#include<cmath>
circle c1(0.2, 0, 0);
triangle t(0, 0.3, 0.5, 0.4);
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
c1.setColour(0, 0, 1);
c1.move(0.0000001, 0);
c1.show();
t.setColour(0, 0, 1);
t.move(0.0001, -0.0002);
t.show();
glFlush();
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutCreateWindow("Simple Shapes");
glClearColor(1, 0, 0, 0.5);
glutDisplayFunc(display);
glutIdleFunc(display);
glutMainLoop();
return 0;
}
|