title: How to update particles position inside an iterative (for-loop) solver
body: <p>I'm writing some OpenGL/Glut functions for visualize the results of my fluid dynamics code (all in C++).
  My data is stored in a matrix declared as global.</p>
  
  <p>Here is the pseudo-code:</p>
  
  <pre><code>class fluid_dynamics{
      //...
      void set_conditions();    // Here is my opengl init function
      void solve();             // This is an iterative loop with stop criteria
      void IterateLoop();
  }
  </code></pre>
  
  <p>On the solve() function I have a Loop.</p>
  
  <pre><code>void fluid_dynamics::solve(){
      glutDisplayFunc(DisplayMatrix);
  
      IterateLoop(  // here I update my data each n-steps
                    // and I want to update my "scene" every time I do that.
                 );
      glutMainLoop();          
  </code></pre>
  
  <p>I'm quite new to OpenGL, but as far as I understand using glutPostRedisplay() inside IterateLoop() function will not perform a new image until the loop finish (because glutPostRedisplay() only set a flag and wait to an idle state), so...Any ideas? (1) </p>
  
  <p>It's possible to employ glutIdleFunc?
  or glutTimerFunc pointing to IterateLoop splitting the Loop in small ones? (in that case, how it's supposed to pass a void pointer to a class member from inside the class? :S)</p>
  
  <p>NOTE; I could re-write code so I accept every suggestion, but I think it's important to have all my fluid dynamics operations inside a class.  </p>