Hi everybody.
I’m new to this message board.
I have a problem using VBOs ina multithread application. Shortly I have two threads, the “renderer” which draws data with VBOs and the “updater” which update the VBOs’ content. To achieve this, I create two GL contexes, one for each thread. Moreover, whenever both threads should refer to the same VBO I guarantee mutual exclusion on that. The problem is that the updater never update the vbo content.
This is the actual order of operations:
- Create rendering (main) GL context;
- Create empty VBOs.
- Launch the “updater” thread.
3-a) create the updater GL context and make it current.
3-b) call wglShareLists(rendering_ctx, updater_ctx). - When the renderer wants to render a vbo, locks it, draw it and unlock it.
- Similarly, when the updater wants to update the content of a vbo, locks it, update it and unlock it.
In effect, I get a GL_INVALID_VALUE after a glBufferSubData() in the updater thread (yes, I checked thousand times the parameters passed and they are ok).
Some help?
Thanks in advance
Marco.