|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [gameprogrammer] Re: OpenGL + SDL + multi-threading + Theora
Hi There,
I ran into similar problem with OpenGL and Multi-Threading. I was able to generate textures without errors but they never displayed correctly in the application. I think you run into problems because of the glBegin() and glEnd() in your Main Thread. You can't manipulate Textures between these (I think from memory) and you cannot guaranty the current status of you main thread when generating the texture.
What you could try is decoding the video frames to a Memory Bitmap and then generate the Texture in your main thread from the memory BMP. Also, you could use a BMP pair and alternate between them for each frame. You can then set a flag to show which one the main thread should use. This will avoid errors as you are likely to render each frame a different number of times depending on the speed of your main thread.
I have not done this myself but it should be possible. This was my planned workaround but I never got as far as coding it. My wife had a baby and I haven't looked at a line of code since! He's two months old now. Maybe I can start sneaking back to the keyboard while my wife isn't looking...
Let me know if it works or if you try it.
Rich
On 22/08/07, Husam Zakaria <hzcppff@gmail.com> wrote:
Hi, every one
|
|