title: FLTK window not showing in while loop c++
body: <p>I am trying to implement a game loop in FLTK</p>
  
  <pre><code>void SnakeFLTK::init() {
      _display = new Fl_Window(900, 600);
      if (!_display)
          throw SnakeFLTKException("Couldn't make fltk window!");
      _display-&gt;color(FL_BLACK);
      _display-&gt;show();
      while (!_doExit) {
          std::cout &lt;&lt; "--&gt;" &lt;&lt; std::endl;
      }
      Fl::run();
  }
  </code></pre>
  
  <p>the problem I have is the window is not showing. I want to keep showing and redrawing on the window in the <code>while (!_doExit)</code> loop and it's important that I use <code>_doExit</code>. I have tried using </p>
  
  <pre><code>while (Fl::wait &gt; 0)
  </code></pre>
  
  <p>but this method seems to have its own loop that waits for events.
  How do I Implement a loop like I did and show the window?</p>