Multi threading in openGL

Hi,
I am new to openGL.
I would like to use openGL in video decoding and display decoded video using mutlti threading.
While running video decoder after completion of one frame decoding
I will get the YUV data for that frame then convert this YUV into RGB and I should able to display on the
screen using openGL. Once that frame displaying is over i should able to come back and decode the secound
frame by calling the decoder function and then display again the newly decoded frame, like this i need to
run the application upto end of file.
For this i used the following code
glutDisplayFunc(display);
glutMainLoop();
display function will use the image poiter.

But my problem is once glutMainLoop() function is called it is not allowing to execute the decoder functions.
So is there any method to comeout from glutMainLoop() after displaying one frame? so that i can decode the
next frame and then i will call display function again.

One more doubt is it necessary to write all GL related functions like display, reshap … in the main function
or we can write and call from any where from the application?

Sorry for my bad english.

Thanks & Regards
Jayaprakash

Try using glutMainLoopEvent() (http://freeglut.sourceforge.net/docs/api.php#EventProcessing)
or use a timer callback with glutTimerFunc(…) (http://freeglut.sourceforge.net/docs/api.php#GlobalCallback).

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.