Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

getting out of the glut main loop

This topic is 6302 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I would like to exit the glut main loop, but so far the only way I have found to do this is to call exit(), which of course also exits my entire program. I would like to destroy the glut window and go back to only having the console. Is there a way to do this? Thanks for any help. /riley

Share this post


Link to post
Share on other sites
Advertisement
No, you can''t do that. Your best bet is to modify the GLUT source code to suit your needs. Look around on the net, I am sure someone has modified GLUT to return from the main loop.

Nate Miller

Share this post


Link to post
Share on other sites
I''m so surprised that there''s no built in way to exit the loop. I''ll experiment a little bit with the source but I''m a little nervous about screwing it up.

So what happens when you close the glut window via the little x button? Does it just call exit()?

Share this post


Link to post
Share on other sites
maybe ''freeglut'' does something like this last i heard about it stephen j baker taken over the running of it

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
Well, once I stopped spending hours looking for different implementations of glut and looked at the source, I realized it would take about 3 lines (literally) to add a glutExitMainLoop() function. So I did it, and it worked. Thanks for the help.

/riley

Share this post


Link to post
Share on other sites
oh but wait - does this mean people will have to have my special version of glut32.dll to run my programs now? Or does linking with my new glut32.lib take care of that? Oy, that would be annoying.

Share this post


Link to post
Share on other sites
provided u added this function ''glutExitMainLoop()'' to your own code and in no way changed the glut code no problem. though i tend to think the only way around this problem is to alter the glut source (btw i checked freeglut does have the ability to leave the main loop) if so ppl will need the changed libs.

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
quote:
Original post by zedzeek

if so ppl will need the changed libs.




which I''m not allowed to do, right? bleh - I''m getting kind of sick of glut. It also turns out you cannot give it class member functions as callbacks. Just kind of annoying.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!