summaryrefslogtreecommitdiffstats
path: root/progs/tests/exactrast.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-03-10 13:11:23 +0000
committerKeith Whitwell <[email protected]>2009-03-10 13:11:23 +0000
commita58065d4e2fc29644d804c92be773731242664c5 (patch)
treea5a7387d97c3b4a2f4138769ab90cce54e9156df /progs/tests/exactrast.c
parent225de01f83b58a09adfad47a5d71bece63a6ebfd (diff)
progs/tests: compile with SCons and glew
Also get mingw cross-compilation of these tests working
Diffstat (limited to 'progs/tests/exactrast.c')
-rw-r--r--progs/tests/exactrast.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/progs/tests/exactrast.c b/progs/tests/exactrast.c
index 56c0c79c3fa..63b8336d973 100644
--- a/progs/tests/exactrast.c
+++ b/progs/tests/exactrast.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400, Height = 400;
@@ -34,14 +35,14 @@ static float Xtrans = 0, Ytrans = 0;
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
@@ -58,7 +59,7 @@ Draw(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) {
@@ -67,7 +68,7 @@ Draw(void)
}
glEnd();
}
- else if (Mode == HLINES) {
+ else if (Mode == MODE_HLINES) {
glBegin(GL_LINES);
for (i = 0; i < Height; i += 2) {
glVertex2f(0, i);
@@ -75,7 +76,7 @@ Draw(void)
}
glEnd();
}
- else if (Mode == VLINES) {
+ else if (Mode == MODE_VLINES) {
glBegin(GL_LINES);
for (i = 0; i < Width; i += 2) {
glVertex2f(i, 0 );
@@ -83,7 +84,7 @@ Draw(void)
}
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) {
@@ -189,6 +190,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);