title: GLUT Warning: glutInit being called a second time
body: <p>I am creating a program using a combination of QT and OpenGL. I get a warning when I try to initialize the OpenGL portion: GLUT Warning: glutInit being called a second time. I am only calling it once in my program. The program works on Linux based machines, but not on Macs.</p>
  
  <p>Where the OpenGL is initially called from in the drawOpTableFunction:</p>
  
  <pre><code>n = ui-&gt;opTableSize-&gt;currentText().toInt();
  basePatternCode = ui-&gt;basePatternChoose-&gt;currentText().toStdString().c_str()[0];
  
  ui-&gt;modAddWidget-&gt;close();
  
  ModNAdd modA(n);
  modA.fillTable();
  tiles = new Tile*[n];
  for(int i = 0; i &lt; n; i ++)
      tiles[i] = new Tile(m_color, basePatternCode);
  drawOpTableFunction(modA.getTable(), tiles, n);
  </code></pre>
  
  <p>Where the drawOpTableFunction leads you:</p>
  
  <pre><code>void drawOpTableFunction(int **ta, Tile **ti, int en)
  {
      table1 = ta;
      tiles1 = ti;
      n1 = en;
      HEIGHT = ((n1*50));
      WIDTH = ((n1*50));
  
      init_gl_window();
  }
  </code></pre>
  
  <p>init_gl_window():</p>
  
  <pre><code>void init_gl_window()
  {
      char *argv[] = {programName};
      int argc = sizeof(argv) / sizeof(argv[0]);
      glutInit(&amp;argc, argv);
      glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
      glutInitWindowSize(WIDTH,HEIGHT);
      glutInitWindowPosition(100,100);
      glutCreateWindow(programName);
      init();
  
      glutDisplayFunc(drawWindow);
      glutReshapeFunc(reshape);
      glutMainLoop();
  }
  </code></pre>
  
  <p>As you can see, glutInit() is only called once.</p>