PDA

View Full Version : GLUT : alternative action when closing window



thibault
12-21-2008, 03:12 PM
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 : http://www.opengl.org/discussion_boards/...true#Post219375 (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Board=10&Number=219375&Searchpage=1&Main=43940&Words=close&topic=0&Search=true#Post219375) ,
but I really would like to stay with normal GLUT. Do you think there is a way to achieve it?

Cheers,
Thibault.

ZbuffeR
12-21-2008, 06:06 PM
no

eternallite
01-10-2009, 08:46 PM
you can try using freeglut :)
It's an alternative to glut, but is quite compatible
with glut's functions :D

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 :)

Here's a link to the web page :D

http://freeglut.sourceforge.net/

thibault
04-21-2009, 05:56 PM
Hi ! I decided to choose GLFW which solved out all the thread-related issues !