Merge branch 'mesa_7_5_branch'
[mesa.git] / progs / demos / ray.c
index 2173b54fd4d74d8db812621150fb87802ff919e5..c2d8e4f545e352207f7628e470388eb97a73b828 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <math.h>
 
 #ifdef WIN32
@@ -48,7 +49,9 @@ static GLint Frames = 0;
 
 #define clamp255(a)  ( (a)<(0.0f) ? (0.0f) : ((a)>(255.0f) ? (255.0f) : (a)) )
 
+#ifndef fabs
 #define fabs(x) ((x)<0.0f?-(x):(x))
+#endif
 
 #define vequ(a,b) { (a)[0]=(b)[0]; (a)[1]=(b)[1]; (a)[2]=(b)[2]; }
 #define vsub(a,b,c) { (a)[0]=(b)[0]-(c)[0]; (a)[1]=(b)[1]-(c)[1]; (a)[2]=(b)[2]-(c)[2]; }
@@ -268,13 +271,13 @@ printhelp(void)
    printstring(GLUT_BITMAP_HELVETICA_18, "Help");
 
    glRasterPos2i(60, 390);
-   printstring(GLUT_BITMAP_HELVETICA_12, "h - Togle Help");
+   printstring(GLUT_BITMAP_HELVETICA_12, "h - Toggle Help");
    glRasterPos2i(60, 370);
-   printstring(GLUT_BITMAP_HELVETICA_12, "f - Togle Fog");
+   printstring(GLUT_BITMAP_HELVETICA_12, "f - Toggle Fog");
    glRasterPos2i(60, 350);
-   printstring(GLUT_BITMAP_HELVETICA_12, "b - Togle Back face culling");
+   printstring(GLUT_BITMAP_HELVETICA_12, "b - Toggle Back face culling");
    glRasterPos2i(60, 330);
-   printstring(GLUT_BITMAP_HELVETICA_12, "p - Togle Wire frame");
+   printstring(GLUT_BITMAP_HELVETICA_12, "p - Toggle Wire frame");
    glRasterPos2i(60, 310);
    printstring(GLUT_BITMAP_HELVETICA_12, "Arrow Keys - Rotate");
    glRasterPos2i(60, 290);
@@ -285,7 +288,7 @@ printhelp(void)
    glRasterPos2i(60, 250);
    if (joyavailable)
       printstring(GLUT_BITMAP_HELVETICA_12,
-                 "j - Togle jostick control (Joystick control available)");
+                 "j - Toggle jostick control (Joystick control available)");
    else
       printstring(GLUT_BITMAP_HELVETICA_12,
                  "(No Joystick control available)");
@@ -299,11 +302,11 @@ printhelp(void)
 
    glRasterPos2i(60, 190);
    printstring(GLUT_BITMAP_HELVETICA_12,
-              "1 - Togle the plane texture map window");
+              "1 - Toggle the plane texture map window");
 
    glRasterPos2i(60, 170);
    printstring(GLUT_BITMAP_HELVETICA_12,
-              "2 - Togle the sphere texture map window");
+              "2 - Toggle the sphere texture map window");
 }
 
 static GLboolean