#include #include #include #include "Angel.h" #include #include "keys.h" using namespace std; // globals vector data; GLenum DRAWING_MODE; // Constants const int POINTS = 20; void Init(void) { vec2 tmp; float theta; srand(time(NULL)); // background clear color glClearColor(1.0,1.0,1.0,1.0); // start off with a random color glColor3f(1.0,0,0); // I want to be able to see what is happening with polygons glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); // generate the data on a circle for( theta=0;theta<2*M_PI;theta+= 2*M_PI/POINTS) { tmp.x = .5*cos(theta); tmp.y = .5*sin(theta); data.push_back(tmp); } // a default mode for drawing things DRAWING_MODE = GL_POINTS; return; } void display(void) { int i; // erase the board glClear( GL_COLOR_BUFFER_BIT ); // draw the shape glBegin(DRAWING_MODE); for(i=0;i