Has anyone coded a worker thread using Glut under Windoze? I’ve just recently got into threads. Ive done a few with MFC using AfxBeginThread() and the WIN32 API using _beginthread(), _endthread(). Its by far the best way Ive tried to do animations.
Someone posted on rendering material removeal using csg. I fooled around with it a bit last night, using Glut. I used the Idle func to do the animations, but of course, this just eats up the processor time and the gui is dead while the tool is animating.
I’m trying to use _beginthread() _endthread(), found in processes.h, with Glut. The thread does execute and terminate as it should. The problem is, my screen doesnt refresh. My render callback does get called, but nothing moves.
I know the Interpolation code is good, because I had it working, but I was calling it from my glutIdleFunc(), not using a worker thread.
Heres the code if anyone has a multi threaded bent, and can give me a suggestion http://personal.lig.bellsouth.net/lig/s/_/s_dolan/CppSource/cnc_csg.cpp
Sean
BTW I tried passing a pointer to a struct to the thread as well, same results.