Jump to content
  • Advertisement

Archived

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

MV

glut

This topic is 5499 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

Using glut, can the functions defined in the glutMouseFunc and glutDisplayFunc be executed at the same time ? I mean if I delete an object at the beginning of the glutMouseFunc function, recreate it at the end, can the glutDisplayFunc function be executed between the delete and the recreation (and try yo draw the deleted object that can cause a crash) ?

Share this post


Link to post
Share on other sites
Advertisement
I dont want ; I''m afraid...
Are u sure of your answer ? Can''t a multithread system manage the render process in parrallele of the event process (that could keep the render with a good framerate even if event processing is long)

Share this post


Link to post
Share on other sites
A multi threaded program should be able to do that. But i dont know if it can be done in GLUT.

Anyway, i have never made a multi-threaded app so i wouldnt noe.

Share this post


Link to post
Share on other sites
"Can''t a multithread system manage the render process in parrallele of the event process"

Yes but you haven''t written a multithreded app hav e you! The way glut works is through its glutMainLoop() call - so whenever a callback like glutMouseFunc() is exected is just being called from the glutMainLoop() function. Glut is not multithreaded and even if you write a multithreaded app all the glut callbacks would run in one of the threads anyway (unless you do some serious stuff which I don''t know about). But have no fear - those two functions you mentioned will never be executed at the same time :D

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!