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

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)
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.
Anyway, i have never made a multi-threaded app so i wouldnt noe.
"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
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
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement