Advertisement

glut

Started by October 24, 2003 08:52 AM
5 comments, last by MV 21 years, 4 months ago
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) ?
No they cant. Why would u want to do that anyway.
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)
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.
Ok, thx for your help
"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
Advertisement
Unless you call it in between ...

The official zorx website
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)

This topic is closed to new replies.

Advertisement