I have a scene that is modified when mouse left button is clicked.
My problem is: this modified scene was supposed to appear with a sound, but the scene waits the sounds to finish before it renders itself.
I'm using this function:
do {
alGetSourcei(source, AL_SOURCE_STATE, &state);
} while (state == AL_PLAYING);
Of course, this function tells the program to wait. But what alternative could I use? if I remove this function, the sound isnt played
I even tried to create a function sound(), that is called after glutPostRedisplay but it still waits the sound complete to render