GLUT : alternative action when closing window

Hi everyone,
I created in my main progran a pthread that opens a GLUT window. This works perfectly, both processes run in parallel. But when I close the GLUT window, it exits also my main process.
Is there a way so that when the user closes the GLUT window, instead of calling exit(0) it just exits the thread (pthread_exit()) ?
I saw an idea hacking GLUT :…true#Post219375 ,
but I really would like to stay with normal GLUT. Do you think there is a way to achieve it?



you can try using freeglut :slight_smile:
It’s an alternative to glut, but is quite compatible
with glut’s functions :smiley:

It allows you to specify what action to take
when selecting the close button.

Although I did do an fps check on glut vs. freeglut
and for some odd reason I get about 1300 fps with
freeglut and 2000 fps in speed with glut :S

But freeglut is currently being maintained
by steve baker so hopefully it’ll improve
over time :slight_smile:

Here’s a link to the web page :smiley:

Hi ! I decided to choose GLFW which solved out all the thread-related issues !