Archived

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

MV

glut

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
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
"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