Professional Documents
Culture Documents
#include <gl/glut.h>
struct Point {
int x;
int y;
};
//////////////////////////////////////////////////////////////////////////
#define VERTEX_COUNT 5
Point points[VERTEX_COUNT] = {
103, 273,
516, 273,
184, 32,
308, 452,
439, 32
};
//////////////////////////////////////////////////////////////////////////
GLfloat x1 = p1.x;
GLfloat y1 = p1.y;
GLfloat step = 0;
void init() {
glClearColor(1.0, 1.0, 1.0, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);
gluOrtho2D(0.0, 640.0, 0.0, 480.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glPointSize(1.0f);
}
void display() {
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POINTS);
Point stPoint = points[0];
glEnd();
glFlush();
}