summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-11-06 13:10:54 +0000
committerJosé Fonseca <jfonseca@vmware.com>2010-11-06 13:10:54 +0000
commit00a6f9c531eb245ae07715aa1f75cfee03ef21d8 (patch)
tree17da53eb99beb21f0e6ef99967a247530a7f3440
parent1986d6c57f73932fdf8eaf4c07eb726c954b2537 (diff)
Portability fixes.
These are necessary because we're not longer building against the Mesa GL headers here, but the system headers, which on windows miss several of the extensions. Simply including glew.h addresses most cases.
-rw-r--r--src/redbook/cubemap.c1
-rw-r--r--src/redbook/multisamp.c1
-rw-r--r--src/samples/nurb.c12
-rw-r--r--src/samples/quad.c12
-rw-r--r--src/tests/texdown.c1
-rw-r--r--src/tests/texleak.c2
-rw-r--r--src/trivial/line-smooth.c1
-rw-r--r--src/trivial/point-sprite.c1
-rw-r--r--src/trivial/quad-tex-2d.c1
-rw-r--r--src/trivial/quad-tex-alpha.c1
-rw-r--r--src/trivial/tri-alpha-tex.c1
-rw-r--r--src/trivial/tri-tex-1d.c1
-rw-r--r--src/trivial/tri-tex.c1
13 files changed, 18 insertions, 18 deletions
diff --git a/src/redbook/cubemap.c b/src/redbook/cubemap.c
index 92026c70..e82cec64 100644
--- a/src/redbook/cubemap.c
+++ b/src/redbook/cubemap.c
@@ -50,6 +50,7 @@
* forward and backward.
*/
+#include <GL/glew.h>
#include <GL/glut.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/src/redbook/multisamp.c b/src/redbook/multisamp.c
index 38bd572f..4826227a 100644
--- a/src/redbook/multisamp.c
+++ b/src/redbook/multisamp.c
@@ -53,6 +53,7 @@
* background. Antialiasing is sometimes easier to see
* when objects are rendered over a contrasting background.
*/
+#include <GL/glew.h>
#include <GL/glut.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/src/samples/nurb.c b/src/samples/nurb.c
index dc899129..099144e4 100644
--- a/src/samples/nurb.c
+++ b/src/samples/nurb.c
@@ -26,14 +26,10 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
-#ifndef CALLBACK
-#define CALLBACK
-#endif
-
-
#define INREAL float
#define S_NUMPOINTS 13
@@ -207,7 +203,7 @@ Point ctlpoints[S_NUMPOINTS][T_NUMPOINTS] = {
GLUnurbsObj *theNurbs;
-static void CALLBACK ErrorCallback(GLenum which)
+static void GLAPIENTRY ErrorCallback(GLenum which)
{
if (which != expectedError) {
@@ -216,13 +212,11 @@ static void CALLBACK ErrorCallback(GLenum which)
}
}
-typedef void (GLAPIENTRY *callback_t)();
-
static void Init(void)
{
theNurbs = gluNewNurbsRenderer();
- gluNurbsCallback(theNurbs, GLU_ERROR, (callback_t) ErrorCallback);
+ gluNurbsCallback(theNurbs, GLU_ERROR, (_GLUfuncptr) ErrorCallback);
gluNurbsProperty(theNurbs, GLU_SAMPLING_TOLERANCE, 15.0);
gluNurbsProperty(theNurbs, GLU_DISPLAY_MODE, GLU_OUTLINE_PATCH);
diff --git a/src/samples/quad.c b/src/samples/quad.c
index 193850ab..8171d765 100644
--- a/src/samples/quad.c
+++ b/src/samples/quad.c
@@ -25,14 +25,10 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
-#ifndef CALLBACK
-#define CALLBACK
-#endif
-
-
#define PI 3.141592654
#define BLACK 0
#define GRAY 128
@@ -96,14 +92,12 @@ GLubyte brickImage[4*brickImageWidth*brickImageHeight] = {
char *texFileName = 0;
-static void CALLBACK ErrorHandler(GLenum which)
+static void GLAPIENTRY ErrorHandler(GLenum which)
{
fprintf(stderr, "Quad Error: %s\n", (char *) gluErrorString(which));
}
-typedef void (GLAPIENTRY *callback_t)();
-
static void Init(void)
{
static GLint colorIndexes[3] = {0, 200, 255};
@@ -165,7 +159,7 @@ static void Init(void)
}
quadObj = gluNewQuadric();
- gluQuadricCallback(quadObj, GLU_ERROR, (callback_t) ErrorHandler);
+ gluQuadricCallback(quadObj, GLU_ERROR, (_GLUfuncptr) ErrorHandler);
radius1 = 10;
radius2 = 5;
diff --git a/src/tests/texdown.c b/src/tests/texdown.c
index 92df01b8..7d7af1a5 100644
--- a/src/tests/texdown.c
+++ b/src/tests/texdown.c
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
diff --git a/src/tests/texleak.c b/src/tests/texleak.c
index 5cf4ff32..e9dcb584 100644
--- a/src/tests/texleak.c
+++ b/src/tests/texleak.c
@@ -84,7 +84,9 @@ static void Display( void )
end.tv_sec * 1000 + end.tv_usec / 1000 - start.tv_sec * 1000 -
start.tv_usec / 1000, numTexObj * 4 * size / 1024 * size / 1024);
+#ifndef _WIN32
sleep(1);
+#endif
}
diff --git a/src/trivial/line-smooth.c b/src/trivial/line-smooth.c
index 9c4b9a01..78eac6f3 100644
--- a/src/trivial/line-smooth.c
+++ b/src/trivial/line-smooth.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
diff --git a/src/trivial/point-sprite.c b/src/trivial/point-sprite.c
index 16e67715..e6c7ee2a 100644
--- a/src/trivial/point-sprite.c
+++ b/src/trivial/point-sprite.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
diff --git a/src/trivial/quad-tex-2d.c b/src/trivial/quad-tex-2d.c
index 8a886ef5..54a1a314 100644
--- a/src/trivial/quad-tex-2d.c
+++ b/src/trivial/quad-tex-2d.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static GLenum Target = GL_TEXTURE_2D;
diff --git a/src/trivial/quad-tex-alpha.c b/src/trivial/quad-tex-alpha.c
index 9db6792f..a8d01df2 100644
--- a/src/trivial/quad-tex-alpha.c
+++ b/src/trivial/quad-tex-alpha.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
diff --git a/src/trivial/tri-alpha-tex.c b/src/trivial/tri-alpha-tex.c
index 853d564a..64030e83 100644
--- a/src/trivial/tri-alpha-tex.c
+++ b/src/trivial/tri-alpha-tex.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
diff --git a/src/trivial/tri-tex-1d.c b/src/trivial/tri-tex-1d.c
index 5a8a23c3..881ddbe6 100644
--- a/src/trivial/tri-tex-1d.c
+++ b/src/trivial/tri-tex-1d.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static GLenum Target = GL_TEXTURE_1D;
diff --git a/src/trivial/tri-tex.c b/src/trivial/tri-tex.c
index 244e1545..30639079 100644
--- a/src/trivial/tri-tex.c
+++ b/src/trivial/tri-tex.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>