Re: Sharing context between drawables issues.
Posted by ZooChar on Nov 06, 2015; 10:09am
URL: https://forum.jogamp.org/Sharing-context-between-drawables-issues-tp4035716p4035751.html
After fixing all the issues, it seems that the problem is now the sharing of VAOs. After looking it up, I found out that VAOs are not meant to be shared, which is something I didn't know. If I don't use VAOs, everything works just fine.
It turns out that in my original application I was using both VAOs and rebinding VBOs every time (making the use of VAOs obsolete. Shame on me). After modifying my code to use VAOs correctly, the shared context does not display anything at all. Using only VBOs creates a valid output and does not produce any errors.
I could create a VAO for each mesh and for each context seperately, I suppose, and still share VBOs. But I think it'd be simpler to just create a single dummy VAO per context and keep it bound. Is this a good idea, or will it create too much of an overhead (assuming I don't have a lot of meshes on the screen)?