void MultiThreadedDisplay ( void ) { // OK! We're done displaying & updating data. Restart workers! displayBarrier->Wait(); // // Here other threads are busy doing computation. We go right to sleep... // // Wait for threads to finish computing this frame... displayBarrier->Wait(); // Draw this set of pixels onto the OpenGL screen glRasterPos2i(0,0); glDrawPixels( myScene->GetWidth(), myScene->GetHeight(), GL_RGB, GL_UNSIGNED_BYTE, charTexData ); // Calculate and display an average framerate over the past few frames DisplayTimer(); // Flush the OpenGL buffer so everything is on screen. glFlush(); glutSwapBuffers(); }