[Theverse-developer] GLUT and threading

Reid Nichol sigma at fireflylabs.ca
Tue Apr 10 18:56:15 CEST 2007


Thought I'd post this as it was discovered by experimentation rather
than finding the solution online.

Ok, so GLUT is _not_ thread safe.  Basically, I was calling GLUT
functions from the two running threads; can't do that.

So, my solution was:

thread render:
  - all GLUT function *must* be here.
  - set GLUT timer function to check a re-draw var


thread sim:
  - run the simulation.
  - upon each completion, set the re-draw var

Not sure /exactly/ how to work mouse and keyboard input.  But, it will
probably be very similar to the above.  But, in the other direction.

-- 
best regards,
Reid Nichol

wait
worry
who cares?



More information about the Theverse-developer mailing list