#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400, Height = 400;
static float Step = 0.125;
enum {
- POINTS,
- HLINES,
- VLINES,
- QUADS,
+ MODE_POINTS,
+ MODE_HLINES,
+ MODE_VLINES,
+ MODE_QUADS,
NUM_MODES
};
-static int Mode = POINTS;
+static int Mode = MODE_POINTS;
static void
glPushMatrix();
glTranslatef(tx + Xtrans, ty + Ytrans, 0);
- if (Mode == POINTS) {
+ if (Mode == MODE_POINTS) {
glBegin(GL_POINTS);
for (j = 0; j < Height; j += 2) {
for (i = 0; i < Width; i += 2) {
}
glEnd();
}
- else if (Mode == HLINES) {
+ else if (Mode == MODE_HLINES) {
glBegin(GL_LINES);
for (i = 0; i < Height; i += 2) {
glVertex2f(0, i);
}
glEnd();
}
- else if (Mode == VLINES) {
+ else if (Mode == MODE_VLINES) {
glBegin(GL_LINES);
for (i = 0; i < Width; i += 2) {
glVertex2f(i, 0 );
}
glEnd();
}
- else if (Mode == QUADS) {
+ else if (Mode == MODE_QUADS) {
glBegin(GL_QUADS);
for (j = 0; j < Height; j += 4) {
for (i = 0; i < Width; i += 4) {
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);