Getting my viewer to run parallel with physical simulation

Hi

I am trying to write a simple viewer that takes 2D-data from a physical simulation and display it using openGL and glut. Now the thing is that I want to run in parallel with the simulation so that once the simulation has produced a new set of data I feed it to my viewer.
I use pthreads to fork off glutMainLoop while keeping the main-thread occupied with the simulation, but the viewer is unable to display the image using this technique.
Does anybody have experience with this?
I would really appreciate any help, especially code examples etc.

Thanks
Hakan

Could be to do with how glut handles things, maybe should look into using something like SDL or pure windows code.

Originally posted by Hakan Kihlstrom:
[b]Hi

I am trying to write a simple viewer that takes 2D-data from a physical simulation and display it using openGL and glut. Now the thing is that I want to run in parallel with the simulation so that once the simulation has produced a new set of data I feed it to my viewer.
I use pthreads to fork off glutMainLoop while keeping the main-thread occupied with the simulation, but the viewer is unable to display the image using this technique.
Does anybody have experience with this?
I would really appreciate any help, especially code examples etc.

Thanks
Hakan[/b]