Mesa (master): progs/demos: fix glut initialization calls

Brian Paul brianp at kemper.freedesktop.org
Fri Dec 18 13:03:00 PST 2009


Module: Mesa
Branch: master
Commit: 263f4322e7bfa03a6c025dbc2b280e7f60e2cab1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=263f4322e7bfa03a6c025dbc2b280e7f60e2cab1

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Dec 18 08:12:55 2009 -0700

progs/demos: fix glut initialization calls

Remove glutInitWindowPosition() calls to play nicer with window managers.

Move glutInitWindowSize() calls before glutInit() so the the default window
size can be overridden by the -geometry cmd line option.

---

 progs/demos/arbfplight.c   |    3 +--
 progs/demos/arbfslight.c   |    3 +--
 progs/demos/arbocclude.c   |    3 +--
 progs/demos/bounce.c       |    4 +---
 progs/demos/clearspd.c     |    3 +--
 progs/demos/copypix.c      |    7 +++----
 progs/demos/cubemap.c      |    3 +--
 progs/demos/drawpix.c      |    7 +++----
 progs/demos/engine.c       |    2 +-
 progs/demos/fbo_firecube.c |    2 +-
 progs/demos/fire.c         |    1 -
 progs/demos/fogcoord.c     |    2 +-
 progs/demos/fplight.c      |    3 +--
 progs/demos/fslight.c      |    3 +--
 progs/demos/gamma.c        |    5 +----
 progs/demos/gearbox.c      |    2 +-
 progs/demos/gears.c        |    4 +---
 progs/demos/geartrain.c    |   13 ++++++-------
 progs/demos/gloss.c        |    2 +-
 progs/demos/gltestperf.c   |    3 +--
 progs/demos/ipers.c        |    1 -
 progs/demos/isosurf.c      |    3 +--
 progs/demos/lodbias.c      |    3 +--
 progs/demos/morph3d.c      |    3 +--
 progs/demos/multiarb.c     |    3 +--
 progs/demos/paltex.c       |    5 +----
 progs/demos/pointblast.c   |    4 ++--
 progs/demos/projtex.c      |    9 ++++-----
 progs/demos/ray.c          |    1 -
 progs/demos/readpix.c      |    5 ++---
 progs/demos/renormal.c     |    5 +----
 progs/demos/shadowtex.c    |    3 +--
 progs/demos/spectex.c      |    6 +-----
 progs/demos/spriteblast.c  |    4 ++--
 progs/demos/teapot.c       |    1 -
 progs/demos/terrain.c      |    1 -
 progs/demos/tessdemo.c     |    3 +--
 progs/demos/texcyl.c       |    4 +---
 progs/demos/texenv.c       |    3 +--
 progs/demos/textures.c     |    3 +--
 progs/demos/trispd.c       |    7 ++-----
 progs/demos/tunnel.c       |    1 -
 progs/demos/tunnel2.c      |    1 -
 progs/demos/vao_demo.c     |    3 +--
 progs/demos/winpos.c       |    3 +--
 45 files changed, 54 insertions(+), 106 deletions(-)

diff --git a/progs/demos/arbfplight.c b/progs/demos/arbfplight.c
index 7b7a12b..861b3b7 100644
--- a/progs/demos/arbfplight.c
+++ b/progs/demos/arbfplight.c
@@ -388,9 +388,8 @@ static void Init( void )
 
 int main( int argc, char *argv[] )
 {
-   glutInit( &argc, argv );
-   glutInitWindowPosition( 0, 0 );
    glutInitWindowSize( 200, 200 );
+   glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
    Win = glutCreateWindow(argv[0]);
    glutReshapeFunc( Reshape );
diff --git a/progs/demos/arbfslight.c b/progs/demos/arbfslight.c
index 275c851..a0ce7f3 100644
--- a/progs/demos/arbfslight.c
+++ b/progs/demos/arbfslight.c
@@ -311,9 +311,8 @@ static void Init (void)
 
 int main (int argc, char *argv[])
 {
-	glutInit (&argc, argv);
-	glutInitWindowPosition ( 0, 0);
 	glutInitWindowSize (200, 200);
+	glutInit (&argc, argv);
 	glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
 	glutCreateWindow (argv[0]);
 	glutReshapeFunc (Reshape);
diff --git a/progs/demos/arbocclude.c b/progs/demos/arbocclude.c
index 9188ad5..f669a1f 100644
--- a/progs/demos/arbocclude.c
+++ b/progs/demos/arbocclude.c
@@ -268,9 +268,8 @@ static void Init( void )
 
 int main( int argc, char *argv[] )
 {
-   glutInit( &argc, argv );
-   glutInitWindowPosition( 0, 0 );
    glutInitWindowSize( 400, 400 );
+   glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
    Win = glutCreateWindow(argv[0]);
    glewInit();
diff --git a/progs/demos/bounce.c b/progs/demos/bounce.c
index 436bc7d..a9a291e 100644
--- a/progs/demos/bounce.c
+++ b/progs/demos/bounce.c
@@ -192,10 +192,8 @@ visible(int vis)
 
 int main(int argc, char *argv[])
 {
-  glutInit(&argc, argv);
-  glutInitWindowPosition(0, 0);
   glutInitWindowSize(600, 450);
-
+  glutInit(&argc, argv);
 
   IndexMode = argc > 1 && strcmp(argv[1], "-ci") == 0;
   if (IndexMode)
diff --git a/progs/demos/clearspd.c b/progs/demos/clearspd.c
index 42953f6..c40f118 100644
--- a/progs/demos/clearspd.c
+++ b/progs/demos/clearspd.c
@@ -187,9 +187,8 @@ int main( int argc, char *argv[] )
 
    Init( argc, argv );
 
-   glutInit( &argc, argv );
    glutInitWindowSize( (int) Width, (int) Height );
-   glutInitWindowPosition( 0, 0 );
+   glutInit( &argc, argv );
 
    mode = ColorMode | GLUT_DOUBLE;
    if (BufferMask & GL_STENCIL_BUFFER_BIT)
diff --git a/progs/demos/copypix.c b/progs/demos/copypix.c
index a13339e..98c835f 100644
--- a/progs/demos/copypix.c
+++ b/progs/demos/copypix.c
@@ -237,6 +237,9 @@ int main( int argc, char *argv[] )
    const char *filename = IMAGE_FILE;
    int i = 1;
 
+   glutInitWindowSize( WinWidth, WinHeight );
+   glutInit( &argc, argv );
+
    if (argc > i && strcmp(argv[i], "-ci")==0) {
       ciMode = GL_TRUE;
       i++;
@@ -245,10 +248,6 @@ int main( int argc, char *argv[] )
       filename = argv[i];
    }
 
-   glutInit( &argc, argv );
-   glutInitWindowPosition( 0, 0 );
-   glutInitWindowSize( WinWidth, WinHeight );
-
    if (ciMode)
       glutInitDisplayMode( GLUT_INDEX | GLUT_DOUBLE );
    else
diff --git a/progs/demos/cubemap.c b/progs/demos/cubemap.c
index 20332b1..3e79d6a 100644
--- a/progs/demos/cubemap.c
+++ b/progs/demos/cubemap.c
@@ -613,9 +613,8 @@ static void parse_args(int argc, char *argv[])
 
 int main( int argc, char *argv[] )
 {
-   glutInit(&argc, argv);
-   glutInitWindowPosition(0, 0);
    glutInitWindowSize(600, 500);
+   glutInit(&argc, argv);
    glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
    glutCreateWindow("Texture Cube Mapping");
    glewInit();
diff --git a/progs/demos/drawpix.c b/progs/demos/drawpix.c
index 5490bcc..9bc7086 100644
--- a/progs/demos/drawpix.c
+++ b/progs/demos/drawpix.c
@@ -328,6 +328,9 @@ int main( int argc, char *argv[] )
    const char *filename = IMAGE_FILE;
    int i = 1;
 
+   glutInitWindowSize( 500, 400 );
+   glutInit( &argc, argv );
+
    if (argc > i && strcmp(argv[i], "-ci")==0) {
       ciMode = GL_TRUE;
       i++;
@@ -336,10 +339,6 @@ int main( int argc, char *argv[] )
       filename = argv[i];
    }
 
-   glutInit( &argc, argv );
-   glutInitWindowPosition( 0, 0 );
-   glutInitWindowSize( 500, 400 );
-
    if (ciMode)
       glutInitDisplayMode( GLUT_INDEX | GLUT_DOUBLE );
    else
diff --git a/progs/demos/engine.c b/progs/demos/engine.c
index 3cf311e..c54e3b8 100644
--- a/progs/demos/engine.c
+++ b/progs/demos/engine.c
@@ -1308,8 +1308,8 @@ Init(void)
 int
 main(int argc, char *argv[])
 {
-   glutInit(&argc, argv);
    glutInitWindowSize(WinWidth, WinHeight);
+   glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
    glutCreateWindow("OpenGL Engine Demo");
    glewInit();
diff --git a/progs/demos/fbo_firecube.c b/progs/demos/fbo_firecube.c
index b3f7e00..17767a1 100644
--- a/progs/demos/fbo_firecube.c
+++ b/progs/demos/fbo_firecube.c
@@ -1051,11 +1051,11 @@ visible(int vis)
 int
 main(int argc, char *argv[])
 {
+   glutInitWindowSize(WinWidth, WinHeight);
    glutInit(&argc, argv);
 
    glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
 
-   glutInitWindowSize(WinWidth, WinHeight);
    Win = glutCreateWindow("fbo_firecube");
    glewInit();
    init(argc, argv);
diff --git a/progs/demos/fire.c b/progs/demos/fire.c
index dd70f61..3db4541 100644
--- a/progs/demos/fire.c
+++ b/progs/demos/fire.c
@@ -733,7 +733,6 @@ main(int ac, char **av)
       HEIGHT = atoi(av[3]);
    }
 
-   glutInitWindowPosition(0, 0);
    glutInitWindowSize(WIDTH, HEIGHT);
    glutInit(&ac, av);
 
diff --git a/progs/demos/fogcoord.c b/progs/demos/fogcoord.c
index 7d5c11a..336aa58 100644
--- a/progs/demos/fogcoord.c
+++ b/progs/demos/fogcoord.c
@@ -404,8 +404,8 @@ Init(void)
 int
 main( int argc, char *argv[] )
 {
-   glutInit( &argc, argv );
    glutInitWindowSize( 600, 600 );
+   glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
    glutCreateWindow(argv[0]);
    glewInit();
diff --git a/progs/demos/fplight.c b/progs/demos/fplight.c
index c297354..f52a4f7 100644
--- a/progs/demos/fplight.c
+++ b/progs/demos/fplight.c
@@ -268,9 +268,8 @@ static void Init( void )
 
 int main( int argc, char *argv[] )
 {
-   glutInit( &argc, argv );
-   glutInitWindowPosition( 0, 0 );
    glutInitWindowSize( 200, 200 );
+   glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
    Win = glutCreateWindow(argv[0]);
    glewInit();
diff --git a/progs/demos/fslight.c b/progs/demos/fslight.c
index acba3e9..395b7ca 100644
--- a/progs/demos/fslight.c
+++ b/progs/demos/fslight.c
@@ -600,9 +600,8 @@ ParseOptions(int argc, char *argv[])
 int
 main(int argc, char *argv[])
 {
-   glutInit(&argc, argv);
-   glutInitWindowPosition( 0, 0);
    glutInitWindowSize(200, 200);
+   glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
    win = glutCreateWindow(argv[0]);
    glutReshapeFunc(Reshape);
diff --git a/progs/demos/gamma.c b/progs/demos/gamma.c
index 9b2c3e1..61c6d12 100644
--- a/progs/demos/gamma.c
+++ b/progs/demos/gamma.c
@@ -146,12 +146,9 @@ display(void)
 int
 main(int argc, char **argv)
 {
+  glutInitWindowSize(500, 400);
   glutInit(&argc, argv);
   glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
-
-  glutInitWindowPosition(50, 50);
-  glutInitWindowSize(500, 400);
-
   glutCreateWindow("gamma test patterns");
   glutReshapeFunc(Reshape);
   glutDisplayFunc(display);
diff --git a/progs/demos/gearbox.c b/progs/demos/gearbox.c
index 2dcf32f..71d0281 100644
--- a/progs/demos/gearbox.c
+++ b/progs/demos/gearbox.c
@@ -474,10 +474,10 @@ visible(int vis)
 int
 main(int argc, char *argv[])
 {
+   glutInitWindowSize(WinWidth, WinHeight);
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
 
-   glutInitWindowSize(WinWidth, WinHeight);
    Win = glutCreateWindow("gearbox");
    init(argc, argv);
 
diff --git a/progs/demos/gears.c b/progs/demos/gears.c
index 6016162..31a5b79 100644
--- a/progs/demos/gears.c
+++ b/progs/demos/gears.c
@@ -385,11 +385,9 @@ visible(int vis)
 
 int main(int argc, char *argv[])
 {
+  glutInitWindowSize(300, 300);
   glutInit(&argc, argv);
   glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
-
-  glutInitWindowPosition(0, 0);
-  glutInitWindowSize(300, 300);
   win = glutCreateWindow("Gears");
   init(argc, argv);
 
diff --git a/progs/demos/geartrain.c b/progs/demos/geartrain.c
index 8fe405e..d2a195f 100644
--- a/progs/demos/geartrain.c
+++ b/progs/demos/geartrain.c
@@ -1049,19 +1049,18 @@ main (int argc, char *argv[])
 {
     char *file;
 
-    if (argc < 2)
-       file = "geartrain.dat";
-    else
-       file = argv[1];
-
-    glutInit(&argc, argv); 
-    glutInitWindowPosition (0, 0);
     glutInitWindowSize(640,480);
+    glutInit(&argc, argv); 
     glutInitDisplayMode (GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
 
     if (glutCreateWindow ("Gear Train Simulation") == GL_FALSE)
       exit (1);
 
+    if (argc < 2)
+       file = "geartrain.dat";
+    else
+       file = argv[1];
+
     getdata (file);
     process ();
     init ();
diff --git a/progs/demos/gloss.c b/progs/demos/gloss.c
index 69694b2..578736b 100644
--- a/progs/demos/gloss.c
+++ b/progs/demos/gloss.c
@@ -436,8 +436,8 @@ static void Init( int argc, char *argv[] )
 
 int main( int argc, char *argv[] )
 {
-   glutInit( &argc, argv );
    glutInitWindowSize(WinWidth, WinHeight);
+   glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
    glutCreateWindow(argv[0] );
    glewInit();
diff --git a/progs/demos/gltestperf.c b/progs/demos/gltestperf.c
index 2188b02..3658a39 100644
--- a/progs/demos/gltestperf.c
+++ b/progs/demos/gltestperf.c
@@ -569,10 +569,9 @@ main(int ac, char **av)
    if (ac == 2)
       frontbuffer = 0;
 
+   glutInitWindowSize(640, 480);
    glutInit(&ac, av);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
-   glutInitWindowPosition(0, 0);
-   glutInitWindowSize(640, 480);
    glutCreateWindow("OpenGL/Mesa Performances");
    glutDisplayFunc(display);
    glutMainLoop();
diff --git a/progs/demos/ipers.c b/progs/demos/ipers.c
index ed03673..265378b 100644
--- a/progs/demos/ipers.c
+++ b/progs/demos/ipers.c
@@ -682,7 +682,6 @@ main(int ac, char **av)
    fprintf(stderr,
 	   "IperS V1.0\nWritten by David Bucciarelli (tech.hmw at plus.it)\n");
 
-   glutInitWindowPosition(0, 0);
    glutInitWindowSize(WIDTH, HEIGHT);
    glutInit(&ac, av);
 
diff --git a/progs/demos/isosurf.c b/progs/demos/isosurf.c
index 2e9dff1..56781f6 100644
--- a/progs/demos/isosurf.c
+++ b/progs/demos/isosurf.c
@@ -1061,9 +1061,8 @@ int main(int argc, char **argv)
 
    read_surface( "isosurf.dat" );
 
-   glutInit( &argc, argv);
-   glutInitWindowPosition(0, 0);
    glutInitWindowSize(400, 400);
+   glutInit( &argc, argv);
 
    type = GLUT_DEPTH;
    type |= GLUT_RGB;
diff --git a/progs/demos/lodbias.c b/progs/demos/lodbias.c
index 8d39bd6..23488b1 100644
--- a/progs/demos/lodbias.c
+++ b/progs/demos/lodbias.c
@@ -282,9 +282,8 @@ static void Init( void )
 
 int main( int argc, char *argv[] )
 {
-   glutInit( &argc, argv );
-   glutInitWindowPosition( 0, 0 );
    glutInitWindowSize( 350, 350 );
+   glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
    win = glutCreateWindow(argv[0]);
    glutReshapeFunc( Reshape );
diff --git a/progs/demos/morph3d.c b/progs/demos/morph3d.c
index 01a06ab..0f8ac42 100644
--- a/progs/demos/morph3d.c
+++ b/progs/demos/morph3d.c
@@ -841,9 +841,8 @@ int main(int argc, char **argv)
 
   object=1;
 
-  glutInit(&argc, argv);
-  glutInitWindowPosition(0,0);
   glutInitWindowSize(640,480);
+  glutInit(&argc, argv);
 
   glutInitDisplayMode( GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGB );
 
diff --git a/progs/demos/multiarb.c b/progs/demos/multiarb.c
index 3d89d3a..82796a0 100644
--- a/progs/demos/multiarb.c
+++ b/progs/demos/multiarb.c
@@ -338,9 +338,8 @@ int main( int argc, char *argv[] )
 {
    GLint i;
 
-   glutInit( &argc, argv );
    glutInitWindowSize( 300, 300 );
-   glutInitWindowPosition( 0, 0 );
+   glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
    glutCreateWindow(argv[0] );
    glewInit();
diff --git a/progs/demos/paltex.c b/progs/demos/paltex.c
index d0cbcfb..5d4b866 100644
--- a/progs/demos/paltex.c
+++ b/progs/demos/paltex.c
@@ -248,12 +248,9 @@ static void Init2( void )
 
 int main( int argc, char *argv[] )
 {
-   glutInit( &argc, argv );
-   glutInitWindowPosition( 0, 0 );
    glutInitWindowSize( 400, 300 );
-
+   glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
-
    glutCreateWindow(argv[0]);
    glewInit();
 
diff --git a/progs/demos/pointblast.c b/progs/demos/pointblast.c
index 2d70b72..b4d0a67 100644
--- a/progs/demos/pointblast.c
+++ b/progs/demos/pointblast.c
@@ -427,10 +427,10 @@ int
 main(int argc, char **argv)
 {
   int i;
+
+  glutInitWindowSize(300, 300);
   glutInit(&argc, argv);
   glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_MULTISAMPLE);
-  glutInitWindowPosition(0, 0);
-  glutInitWindowSize(300, 300);
 
   for (i=1; i<argc; i++) {
     if(!strcmp("-noms", argv[i])) {
diff --git a/progs/demos/projtex.c b/progs/demos/projtex.c
index 503cf5d..d162568 100644
--- a/progs/demos/projtex.c
+++ b/progs/demos/projtex.c
@@ -998,18 +998,17 @@ menu(int selection)
 int
 main(int argc, char **argv)
 {
+  glutInitWindowSize(500,500);
   glutInit(&argc, argv);
+  glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE);
+  (void) glutCreateWindow("projtex");
+  glewInit();
 
   if (argc > 1) {
      NumTextures = atoi(argv[1]);
   }
   assert(NumTextures <= MAX_TEX);
 
-  glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE);
-  glutInitWindowSize(500,500);
-  (void) glutCreateWindow("projtex");
-  glewInit();
-
   loadTexture = loadImageTextures;
   drawObject = drawCube;
   initialize();
diff --git a/progs/demos/ray.c b/progs/demos/ray.c
index e9211aa..9cc464d 100644
--- a/progs/demos/ray.c
+++ b/progs/demos/ray.c
@@ -856,7 +856,6 @@ main(int ac, char **av)
       }
     */
 
-   glutInitWindowPosition(0, 0);
    glutInitWindowSize(WIDTH, HEIGHT);
    glutInit(&ac, av);
 
diff --git a/progs/demos/readpix.c b/progs/demos/readpix.c
index bbb3a68..05f89bb 100644
--- a/progs/demos/readpix.c
+++ b/progs/demos/readpix.c
@@ -382,12 +382,11 @@ int
 main( int argc, char *argv[] )
 {
    GLboolean ciMode = GL_FALSE;
+   glutInitWindowSize( 750, 250 );
+   glutInit( &argc, argv );
    if (argc > 1 && strcmp(argv[1], "-ci")==0) {
       ciMode = GL_TRUE;
    }
-   glutInit( &argc, argv );
-   glutInitWindowPosition( 0, 0 );
-   glutInitWindowSize( 750, 250 );
    if (ciMode)
       glutInitDisplayMode( GLUT_INDEX | GLUT_DOUBLE );
    else
diff --git a/progs/demos/renormal.c b/progs/demos/renormal.c
index 9e5da95..61dd860 100644
--- a/progs/demos/renormal.c
+++ b/progs/demos/renormal.c
@@ -112,12 +112,9 @@ key(unsigned char k, int x, int y)
 
 int main( int argc, char *argv[] )
 {
-   glutInit( &argc, argv );
-   glutInitWindowPosition(0, 0);
    glutInitWindowSize( 400, 400 );
-
+   glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
-
    glutCreateWindow(argv[0]);
 
    Init();
diff --git a/progs/demos/shadowtex.c b/progs/demos/shadowtex.c
index dc5a4bb..036f73d 100644
--- a/progs/demos/shadowtex.c
+++ b/progs/demos/shadowtex.c
@@ -1022,9 +1022,8 @@ PrintHelp(void)
 int
 main(int argc, char *argv[])
 {
-   glutInit(&argc, argv);
-   glutInitWindowPosition(0, 0);
    glutInitWindowSize(WindowWidth, WindowHeight);
+   glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
    glutCreateWindow(argv[0]);
    glewInit();
diff --git a/progs/demos/spectex.c b/progs/demos/spectex.c
index 6ab1191..c1dada9 100644
--- a/progs/demos/spectex.c
+++ b/progs/demos/spectex.c
@@ -239,13 +239,9 @@ static void ModeMenu(int entry)
 
 int main( int argc, char *argv[] )
 {
-
-   glutInit( &argc, argv );
-   glutInitWindowPosition( 0, 0 );
    glutInitWindowSize( 300, 300 );
-
+   glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
-
    glutCreateWindow( "spectex" );
 
    Init();
diff --git a/progs/demos/spriteblast.c b/progs/demos/spriteblast.c
index d73b680..36e226e 100644
--- a/progs/demos/spriteblast.c
+++ b/progs/demos/spriteblast.c
@@ -493,6 +493,8 @@ int
 main(int argc, char **argv)
 {
   int i;
+
+  glutInitWindowSize(600,300);
   glutInit(&argc, argv);
   glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_MULTISAMPLE);
 
@@ -506,8 +508,6 @@ main(int argc, char **argv)
       linearFiltering = 0;
     }
   }
-  glutInitWindowPosition(0, 0);
-  glutInitWindowSize(600,300);
   glutCreateWindow("sprite blast");
   glewInit();
   glutReshapeFunc(reshape);
diff --git a/progs/demos/teapot.c b/progs/demos/teapot.c
index 6bf6e06..04a675f 100644
--- a/progs/demos/teapot.c
+++ b/progs/demos/teapot.c
@@ -638,7 +638,6 @@ int main(int ac, char **av)
     }
     */
 
-  glutInitWindowPosition(0,0);
   glutInitWindowSize(WIDTH,HEIGHT);
   glutInit(&ac,av);
 
diff --git a/progs/demos/terrain.c b/progs/demos/terrain.c
index be78ea4..627c3bf 100644
--- a/progs/demos/terrain.c
+++ b/progs/demos/terrain.c
@@ -623,7 +623,6 @@ init(void)
 int
 main(int ac, char **av)
 {
-   glutInitWindowPosition(0, 0);
    glutInitWindowSize(WIDTH, HEIGHT);
    glutInit(&ac, av);
 
diff --git a/progs/demos/tessdemo.c b/progs/demos/tessdemo.c
index f71cea1..8b988e3 100644
--- a/progs/demos/tessdemo.c
+++ b/progs/demos/tessdemo.c
@@ -503,10 +503,9 @@ int main( int argc, char **argv )
 
    usage();
 
+   glutInitWindowSize( 400, 400 );
    glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_SINGLE | GLUT_RGB );
-   glutInitWindowPosition(0, 0);
-   glutInitWindowSize( 400, 400 );
    glutCreateWindow( argv[0] );
 
    /* GH: Bit of a hack...
diff --git a/progs/demos/texcyl.c b/progs/demos/texcyl.c
index 0e6089b..4df97ec 100644
--- a/progs/demos/texcyl.c
+++ b/progs/demos/texcyl.c
@@ -261,10 +261,8 @@ static void Init( int argc, char *argv[] )
 
 int main( int argc, char *argv[] )
 {
-   glutInit( &argc, argv );
    glutInitWindowSize( 400, 400 );
-   glutInitWindowPosition( 0, 0 );
-
+   glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
 
    Win = glutCreateWindow(argv[0] );
diff --git a/progs/demos/texenv.c b/progs/demos/texenv.c
index c5a8b13..260ca87 100644
--- a/progs/demos/texenv.c
+++ b/progs/demos/texenv.c
@@ -765,6 +765,7 @@ int main( int argc, char *argv[] )
    GLboolean info = GL_FALSE;
    int i;
 
+   glutInitWindowSize( winWidth, winHeight );
    glutInit( &argc, argv );
 
    for ( i = 1 ; i < argc ; i++ ) {
@@ -786,8 +787,6 @@ int main( int argc, char *argv[] )
       glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE );
    }
 
-   glutInitWindowSize( winWidth, winHeight );
-   glutInitWindowPosition( 0, 0 );
    Win = glutCreateWindow( "Texture Environment Test" );
 
    initialize();
diff --git a/progs/demos/textures.c b/progs/demos/textures.c
index d94154a..773d737 100644
--- a/progs/demos/textures.c
+++ b/progs/demos/textures.c
@@ -356,9 +356,8 @@ Usage(void)
 int
 main(int argc, char *argv[])
 {
-   glutInit(&argc, argv);
-   glutInitWindowPosition(0, 0);
    glutInitWindowSize(700, 700);
+   glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
    Win = glutCreateWindow(argv[0]);
    glutReshapeFunc(Reshape);
diff --git a/progs/demos/trispd.c b/progs/demos/trispd.c
index 165d088..c07c340 100644
--- a/progs/demos/trispd.c
+++ b/progs/demos/trispd.c
@@ -227,15 +227,12 @@ static void Help( const char *program )
 
 int main( int argc, char *argv[] )
 {
-   printf("For options:  %s -help\n", argv[0]);
-   glutInit( &argc, argv );
    glutInitWindowSize( (int) Width, (int) Height );
-   glutInitWindowPosition( 0, 0 );
-
+   glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
-
    glutCreateWindow( argv[0] );
 
+   printf("For options:  %s -help\n", argv[0]);
    if (argc==2 && strcmp(argv[1],"-help")==0) {
       Help(argv[0]);
       return 0;
diff --git a/progs/demos/tunnel.c b/progs/demos/tunnel.c
index 6981da3..efc007c 100644
--- a/progs/demos/tunnel.c
+++ b/progs/demos/tunnel.c
@@ -491,7 +491,6 @@ main(int ac, char **av)
    fprintf(stderr,
 	   "Tunnel V1.5\nWritten by David Bucciarelli (tech.hmw at plus.it)\n");
 
-   glutInitWindowPosition(0, 0);
    glutInitWindowSize(WIDTH, HEIGHT);
    glutInit(&ac, av);
 
diff --git a/progs/demos/tunnel2.c b/progs/demos/tunnel2.c
index 0288ea0..f15da95 100644
--- a/progs/demos/tunnel2.c
+++ b/progs/demos/tunnel2.c
@@ -559,7 +559,6 @@ main(int ac, char **av)
    fprintf(stderr,
 	   "Tunnel2 V1.0\nWritten by David Bucciarelli (tech.hmw at plus.it)\n");
 
-   glutInitWindowPosition(0, 0);
    glutInitWindowSize(WIDTHC0, HEIGHTC0);
    glutInit(&ac, av);
 
diff --git a/progs/demos/vao_demo.c b/progs/demos/vao_demo.c
index 206e06f..5ce07ec 100644
--- a/progs/demos/vao_demo.c
+++ b/progs/demos/vao_demo.c
@@ -317,9 +317,8 @@ static void Init( void )
 
 int main( int argc, char *argv[] )
 {
-   glutInit( &argc, argv );
-   glutInitWindowPosition( 0, 0 );
    glutInitWindowSize( Width, Height );
+   glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
    Win = glutCreateWindow( "GL_APPLE_vertex_array_object demo" );
    glutReshapeFunc( Reshape );
diff --git a/progs/demos/winpos.c b/progs/demos/winpos.c
index 13a9c7e..f935f9b 100644
--- a/progs/demos/winpos.c
+++ b/progs/demos/winpos.c
@@ -96,9 +96,8 @@ static void init( void )
 
 int main( int argc, char *argv[] )
 {
-   glutInit(&argc, argv);
-   glutInitWindowPosition(0, 0);
    glutInitWindowSize(500, 500);
+   glutInit(&argc, argv);
    glutInitDisplayMode( GLUT_RGB );
 
    if (glutCreateWindow("winpos") <= 0) {



More information about the mesa-commit mailing list