progs: Port most of the demos to glew.
authorJosé Fonseca <jfonseca@vmware.com>
Sat, 24 Jan 2009 16:39:49 +0000 (16:39 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Sat, 24 Jan 2009 16:39:49 +0000 (16:39 +0000)
A couple of test weren't ported due to glew breakage -- it undefines
GLAPIENTRY.

12 files changed:
progs/demos/Makefile
progs/demos/arbocclude.c
progs/demos/copypix.c
progs/demos/engine.c
progs/demos/fbo_firecube.c
progs/demos/fplight.c
progs/demos/isosurf.c
progs/demos/paltex.c
progs/demos/pointblast.c
progs/demos/shadowtex.c
progs/demos/spriteblast.c
progs/demos/streaming_rect.c

index 467dbc5cdf9d9cd6fac0692470ec043880f5099b..e636cbd9ad9eefda31c2247ce19970724467e599 100644 (file)
@@ -5,16 +5,16 @@ include $(TOP)/configs/current
 
 INCDIR = $(TOP)/include
 
-OSMESA_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa -lGLU -lGL $(APP_LIB_DEPS)
+OSMESA_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lglew -lOSMesa -lGLU -lGL $(APP_LIB_DEPS)
 
-OSMESA16_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa16 -lGLU -lGL $(APP_LIB_DEPS)
+OSMESA16_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lglew -lOSMesa16 -lGLU -lGL $(APP_LIB_DEPS)
 
-OSMESA32_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa32 -lGLU -lGL $(APP_LIB_DEPS)
+OSMESA32_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lglew -lOSMesa32 -lGLU -lGL $(APP_LIB_DEPS)
 
 LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) \
        $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
 
-LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
+LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
        $(APP_LIB_DEPS)
 
 PROGS = \
index 6bf4fd218b900052b1237162c6c1a204d11a7f55..9188ad5a5658743c1fb3e3edaaffe0dd004e8f74 100644 (file)
@@ -29,7 +29,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
 #include <GL/glut.h>
 
 #define TEST_DISPLAY_LISTS 0
@@ -273,6 +273,7 @@ int main( int argc, char *argv[] )
    glutInitWindowSize( 400, 400 );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
    Win = glutCreateWindow(argv[0]);
+   glewInit();
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );
    glutSpecialFunc( SpecialKey );
index 15001e851be6d8cdc9e1c865d8df3270336f6e54..51435acfa0fb2a3f85b753dbc6a3fdb68720806b 100644 (file)
@@ -6,11 +6,10 @@
  */
 
 
-#define GL_GLEXT_PROTOTYPES
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <GL/glew.h>
 #include <GL/glut.h>
 
 #include "readtex.h"
@@ -234,6 +233,7 @@ int main( int argc, char *argv[] )
       glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
 
    glutCreateWindow(argv[0]);
+   glewInit();
 
    Init(ciMode, filename);
    Usage();
index 6040a2f1030dad433aed4d8e28ff65205710df57..5b9b5baa7b359de969b5bab62cafed2e8105da6b 100644 (file)
@@ -5,12 +5,11 @@
  * June 2006
  */
 
-#define GL_GLEXT_PROTOTYPES
-
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
+#include <GL/glew.h>
 #include <GL/glut.h>
 #include "readtex.h"
 #include "trackball.h"
@@ -1288,6 +1287,7 @@ main(int argc, char *argv[])
    glutInitWindowSize(WinWidth, WinHeight);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
    glutCreateWindow("OpenGL Engine Demo");
+   glewInit();
    glutReshapeFunc(Reshape);
    glutMouseFunc(Mouse);
    glutMotionFunc(Motion);
index f5ee82a2f11598394d28789ebf80f04d6cf811a9..4e42924a09eff19d25ffd011934babcf41e6bad0 100644 (file)
  *
  */
 
-#define GL_GLEXT_PROTOTYPES
 #include <math.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <GL/glew.h>
 #include <GL/glut.h>
 #include "readtex.h"
 
@@ -1037,6 +1037,7 @@ main(int argc, char *argv[])
 
    glutInitWindowSize(WinWidth, WinHeight);
    Win = glutCreateWindow("fbo_firecube");
+   glewInit();
    init(argc, argv);
 
    glutDisplayFunc(draw);
index fb510cccc8ad4ef670bc605e79e1e02f4c51f173..c297354103fedefa7c7599098bb7f3192edb2329 100644 (file)
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
 #include <GL/glut.h>
 
 
@@ -273,6 +273,7 @@ int main( int argc, char *argv[] )
    glutInitWindowSize( 200, 200 );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
    Win = glutCreateWindow(argv[0]);
+   glewInit();
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );
    glutSpecialFunc( SpecialKey );
index 10f94b6ace236081c914ca8ca825490a190bdb3a..e2ff6bea0b336f11ed53dd892c02a8746b4bdb3c 100644 (file)
@@ -33,7 +33,7 @@
 #include <windows.h>
 #undef CLIP_MASK
 #endif
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
 #include "GL/glut.h"
 
 #include "readtex.h"
@@ -1052,6 +1052,7 @@ int main(int argc, char **argv)
    glutInitDisplayMode(type);
 
    if (glutCreateWindow("Isosurface") <= 0) {
+   glewInit();
       exit(0);
    }
 
index aa9c0da36b7c1e80cb6bd4c33ea70e09468963f4..d0cbcfb5e9a3b130de18850a2228e601e59ee686 100644 (file)
@@ -11,7 +11,7 @@
 #ifdef _WIN32
 #include <windows.h>
 #endif
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
 #include <GL/glut.h>
 
 
@@ -255,6 +255,7 @@ int main( int argc, char *argv[] )
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
 
    glutCreateWindow(argv[0]);
+   glewInit();
 
    Init();
    (void) Init2; /* silence warning */
index dbbe2f35a28f80c9ee0fbff4e60a5e01def4ed81..2a91b76ad32963138e23d3e18b1ddef6e3225e71 100644 (file)
@@ -18,7 +18,7 @@
 #ifdef _WIN32
 #include <windows.h>
 #endif
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
 #include <GL/glut.h>
 
 /* Some <math.h> files do not define M_PI... */
@@ -444,6 +444,7 @@ main(int argc, char **argv)
   }
 
   glutCreateWindow("point burst");
+  glewInit();
   glutDisplayFunc(redraw);
   glutMouseFunc(mouse);
   glutMotionFunc(mouseMotion);
index 4787f0f29d2aa6b86e597ffe970e51cf2bfba71f..f10a01ec26557919b2b01174fed0d3f710dc2e0f 100644 (file)
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#define GL_GLEXT_PROTOTYPES
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
+#include <GL/glew.h>
 #include <GL/glut.h>
 #include "showbuffer.h"
 
@@ -1025,6 +1025,7 @@ main(int argc, char *argv[])
    glutInitWindowSize(WindowWidth, WindowHeight);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
    glutCreateWindow(argv[0]);
+   glewInit();
    glutReshapeFunc(Reshape);
    glutKeyboardFunc(Key);
    glutSpecialFunc(SpecialKey);
index 5ad8e4d9a94a645a99d498278935ce4d82c24aab..f6630c25d070b64a8c789b2243ed61077477eb50 100644 (file)
@@ -21,7 +21,7 @@
 #ifdef _WIN32
 #include <windows.h>
 #endif
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
 #include <GL/glut.h>
 
 /* Some <math.h> files do not define M_PI... */
@@ -509,6 +509,7 @@ main(int argc, char **argv)
   glutInitWindowPosition(0, 0);
   glutInitWindowSize(600,300);
   glutCreateWindow("sprite blast");
+  glewInit();
   glutReshapeFunc(reshape);
   glutDisplayFunc(redraw);
   glutMouseFunc(mouse);
index 4c1d8535fd78f92f13769f8b2a7144f72e8d4992..4d4656e722b1e225f7b0cbbbf73492a6f455dc0b 100644 (file)
@@ -6,12 +6,11 @@
  *
  */
 
-#define GL_GLEXT_PROTOTYPES
-
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <GL/glew.h>
 #include <GL/glut.h>
 
 #include "readtex.h"
@@ -303,6 +302,7 @@ int main( int argc, char *argv[] )
    glutInitWindowPosition( 0, 0 );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
    glutCreateWindow(argv[0] );
+   glewInit();
 
    Init( argc, argv );