PDA

View Full Version : glut display call back



01-27-2004, 07:45 AM
I am creating a talking face. I have the code for speech working and it correctly returns information to my program about which mouth position is required to be drawn in realtime. That is, each time a word is being spoken, the function is returning the correct mouth position in time with the synthesized speech. In theory all I should have to do is determine which mouth position it is and get glut to redisplay when it recieves a new position. I understand however that that glutPostRedisplay only calls my display update function upon the end of the next iteration of glutMainLoop. As my speech is using a keyboard callback to enter the sentence (ie. press T and the program is ready to accept input from the keyboard to speak) it doesnt finish that iteration of the glutMainLoop until the callback function (that is the speak function) has finished, and so therefore only updates the graphics when after speech has finished, instead of during speech. Not very good!! Is there another way to update the graphics in realtime whilst the computer is still doing something else?

nexusone
01-27-2004, 09:27 AM
That are some limitations when using GLUT, you may want to try something like SDL over GLUT. www.libsdl.org (http://www.libsdl.org)

But there also maybe some changes to how you structure your glut program to fix this also. I would have to see your code to see if maybe some changes could be made to fix it.