-/* $Id: gears.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
+/* $Id: gears.c,v 1.2 1999/10/21 16:39:06 brianp Exp $ */
/*
* 3-D gear wheels. This program is in the public domain.
*
+ * Command line options:
+ * -info print GL implementation information
+ *
+ *
* Brian Paul
*/
/*
* $Log: gears.c,v $
- * Revision 1.1 1999/08/19 00:55:40 jtg
- * Initial revision
+ * Revision 1.2 1999/10/21 16:39:06 brianp
+ * added -info command line option
+ *
+ * Revision 1.1.1.1 1999/08/19 00:55:40 jtg
+ * Imported sources
*
* Revision 3.2 1999/06/03 17:07:36 brianp
* an extra quad was being drawn in front and back faces
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <GL/glut.h>
#ifndef M_PI
}
static void
-init(void)
+init(int argc, char *argv[])
{
static GLfloat pos[4] =
{5.0, 5.0, 10.0, 0.0};
glEndList();
glEnable(GL_NORMALIZE);
+
+ if (argc > 1 && strcmp(argv[1], "-info")==0) {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
+ }
}
void
glutInitWindowPosition(0, 0);
glutInitWindowSize(300, 300);
glutCreateWindow("Gears");
- init();
+ init(argc, argv);
glutDisplayFunc(draw);
glutReshapeFunc(reshape);
-/* $Id: isosurf.c,v 1.3 1999/09/08 22:14:31 brianp Exp $ */
+/* $Id: isosurf.c,v 1.4 1999/10/21 16:39:06 brianp Exp $ */
/*
* Display an isosurface of 3-D wind speed volume.
*
+ * Command line options:
+ * -info print GL implementation information
+ *
* Brian Paul This file in public domain.
*/
/*
* $Log: isosurf.c,v $
+ * Revision 1.4 1999/10/21 16:39:06 brianp
+ * added -info command line option
+ *
* Revision 1.3 1999/09/08 22:14:31 brianp
* minor changes. always call compactify_arrays()
*
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <string.h>
#include <math.h>
#include "GL/glut.h"
static GLdouble plane[4] = {1.0, 0.0, -1.0, 0.0};
static GLuint surf1;
+static GLboolean PrintInfo = GL_FALSE;
+
/* forward decl */
int BuildList( int mode );
#define COMPARE_FUNC( AXIS ) \
-int compare_axis_##AXIS( const void *a, const void *b ) \
+static int compare_axis_##AXIS( const void *a, const void *b ) \
{ \
float t = ( (*(struct data_idx *)a).data[AXIS] - \
(*(struct data_idx *)b).data[AXIS] ); \
-static void Init(void)
+static void Init(int argc, char *argv[])
{
GLfloat fogColor[4] = {0.5,1.0,0.5,1.0};
NO_MATERIALS|
NO_FOG|
GLVERTEX);
+
+ if (PrintInfo) {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
+ }
}
else if (strcmp(argv[i], "-db") == 0) {
doubleBuffer = GL_TRUE;
}
+ else if (strcmp(argv[i], "-info") == 0) {
+ PrintInfo = GL_TRUE;
+ }
else {
printf("%s (Bad option).\n", argv[i]);
return QUIT;
allowed &= ~COMPILED;
}
- Init();
+ Init(argc, argv);
ModeMenu(arg_mode);
glutCreateMenu(ModeMenu);
-/* $Id: multiarb.c,v 1.2 1999/10/13 12:02:13 brianp Exp $ */
+/* $Id: multiarb.c,v 1.3 1999/10/21 16:40:32 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: multiarb.c,v $
+ * 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
*
}
-static void Init( void )
+static void Init( int argc, char *argv[] )
{
GLuint texObj[2];
glClearColor(0.3, 0.3, 0.4, 1.0);
ModeMenu(TEXBOTH);
+
+ if (argc > 1 && strcmp(argv[1], "-info")==0) {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
+ }
}
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
- Init();
+ Init( argc, argv );
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
-/* $Id: texcyl.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
+/* $Id: texcyl.c,v 1.2 1999/10/21 16:39:06 brianp Exp $ */
/*
* Textured cylinder demo: lighting, texturing, reflection mapping.
+ *
+ * Command line options:
+ * -info print GL implementation information
+ *
+ *
* Brian Paul May 1997 This program is in the public domain.
*/
/*
* $Log: texcyl.c,v $
- * Revision 1.1 1999/08/19 00:55:40 jtg
- * Initial revision
+ * Revision 1.2 1999/10/21 16:39:06 brianp
+ * added -info command line option
+ *
+ * Revision 1.1.1.1 1999/08/19 00:55:40 jtg
+ * Imported sources
*
* Revision 3.3 1999/03/28 18:24:37 brianp
* minor clean-up
}
-static void Init( void )
+static void Init( int argc, char *argv[] )
{
GLUquadricObj *q = gluNewQuadric();
CylinderObj = glGenLists(1);
glEnable(GL_CULL_FACE); /* don't need Z testing for convex objects */
SetMode(LIT);
+
+ if (argc > 1 && strcmp(argv[1], "-info")==0) {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
+ }
}
glutCreateWindow(argv[0] );
- Init();
+ Init(argc, argv);
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );