PDA

View Full Version : Getting my viewer to run parallel with physical simulation



Hakan Kihlstrom
03-31-2004, 11:10 AM
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

nexusone
03-31-2004, 03:46 PM
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:
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