maxprod wrote:zamrate wrote:i think you have to use OpenGlCompoent::getContextLock( ) when transfering textures.
I will check that when I'll find minutes. Thanks for replying. If it's the solution, i will rewrite the component more proper, especially CoverFlowComponent is badly written.
Just found this thread, super work Max! And it looks like you're learning OpenGL as you go along too? Cool.
So yes, OpenGL is fussy about threads. You should ideally:
- only use each context on one thread
- create and destroy the context on the same thread
There are two things you may want to look at as well:
- shared contexts, where each context can access the textures, lists etc. of the other (you can use one thread/context just to upload)
- PBOs, where you can 'start' a texture upload, then go off and do other things in that thread - the GPU will use DMA to transfer, as long as you don't try to access the texture right away.
Keep it up, great stuff.
Bruce