diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 1999-10-21 16:39:06 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 1999-10-21 16:39:06 +0000 |
commit | ac12609099dfe34a2934256bc0aa32446c9cc49d (patch) | |
tree | 61b10603e2ac60a0304ee10d3c9e1968cd4ac031 /progs/demos/gears.c | |
parent | bc937424f13094923d67e1409f3f9b6aa38b254f (diff) |
added -info command line option
Diffstat (limited to 'progs/demos/gears.c')
-rw-r--r-- | progs/demos/gears.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/progs/demos/gears.c b/progs/demos/gears.c index 8d99a8d317..91f5eff024 100644 --- a/progs/demos/gears.c +++ b/progs/demos/gears.c @@ -1,8 +1,12 @@ -/* $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 */ @@ -10,8 +14,11 @@ /* * $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 @@ -28,6 +35,7 @@ #include <math.h> #include <stdlib.h> #include <stdio.h> +#include <string.h> #include <GL/glut.h> #ifndef M_PI @@ -287,7 +295,7 @@ reshape(int width, int height) } static void -init(void) +init(int argc, char *argv[]) { static GLfloat pos[4] = {5.0, 5.0, 10.0, 0.0}; @@ -324,6 +332,13 @@ init(void) 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 @@ -343,7 +358,7 @@ int main(int argc, char *argv[]) glutInitWindowPosition(0, 0); glutInitWindowSize(300, 300); glutCreateWindow("Gears"); - init(); + init(argc, argv); glutDisplayFunc(draw); glutReshapeFunc(reshape); |