X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=progs%2Ftests%2Fmultipal.c;h=52818fca7eea1ccbe96d6c878a077155732f15d6;hb=789fae163dbdbd7669b0442bd1a3ca4fea4ec259;hp=109135080d3babba53d6cd26ad460de49dd52d6c;hpb=ede37839aef5969e1ea1c18c1fe62bfdb8b71bae;p=mesa.git diff --git a/progs/tests/multipal.c b/progs/tests/multipal.c index 109135080d3..52818fca7ee 100644 --- a/progs/tests/multipal.c +++ b/progs/tests/multipal.c @@ -1,50 +1,6 @@ -/* $Id: multipal.c,v 1.1 2000/11/18 17:12:33 brianp Exp $ */ /* - * GL_ARB_multitexture demo - * - * Command line options: - * -info print GL implementation information - * - * - * Brian Paul November 1998 This program is in the public domain. - */ - -/* - * $Log: multipal.c,v $ - * Revision 1.1 2000/11/18 17:12:33 brianp - * test texture palettes with multitexture - * - * Revision 1.7 2000/11/01 16:02:01 brianp - * print number of texture units - * - * Revision 1.6 2000/05/23 23:21:00 brianp - * set default window pos - * - * Revision 1.5 2000/02/02 17:31:45 brianp - * changed > to >= - * - * Revision 1.4 2000/02/02 01:07:21 brianp - * limit Drift to [0, 1] - * - * Revision 1.3 1999/10/21 16:40:32 brianp - * added -info command line option - * - * Revision 1.2 1999/10/13 12:02:13 brianp - * use texture objects now - * - * Revision 1.1.1.1 1999/08/19 00:55:40 jtg - * Imported sources - * - * Revision 1.3 1999/03/28 18:20:49 brianp - * minor clean-up - * - * Revision 1.2 1998/11/05 04:34:04 brianp - * moved image files to ../images/ directory - * - * Revision 1.1 1998/11/03 01:36:33 brianp - * Initial revision - * + * Test multitexture and paletted textures. */ #include @@ -52,6 +8,15 @@ #include #include #include +#ifdef __VMS +# include /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */ +#else +# include /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */ +#endif +#ifdef _WIN32 +#include +#endif +#define GL_GLEXT_LEGACY #include #include "../util/readtex.c" /* I know, this is a hack. */ @@ -252,7 +217,7 @@ static void SpecialKey( int key, int x, int y ) static void load_tex(const char *fname, int channel) { GLubyte *image; - GLenum format, type; + GLenum format; GLint w, h; GLubyte *grayImage; int i; @@ -299,11 +264,14 @@ static void Init( int argc, char *argv[] ) GLuint texObj[2]; GLint units; - const char *exten = (const char *) glGetString(GL_EXTENSIONS); - if (!strstr(exten, "GL_ARB_multitexture")) { + if (!glutExtensionSupported("GL_ARB_multitexture")) { printf("Sorry, GL_ARB_multitexture not supported by this renderer.\n"); exit(1); } + if (!glutExtensionSupported("GL_EXT_paletted_texture")) { + printf("Sorry, GL_EXT_paletted_texture not supported by this renderer.\n"); + exit(1); + } glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &units); printf("%d texture units supported\n", units);