I have an application that requires multiple OpenGL viewports (using Eclipse and JOGL). My initial pass at it had multiple GLCanvas objects and each GLCanvas had 1 or more viewports. Predictably the "swapbuffers" calls for each of those GLCanvas objects is killing me. I am now trying to consolidate into a single top-level GLCanvas however I have several java "Composite" objects between my singleton GLCanvas and the viewports. I am working with a mature existing project so I am avoiding a complete re-organization if at all possible. Would it be possible to substitute nested GLCanvas objects in place of the Composite object and then simply call "swapbuffers" on the top-level GLCanvas object?
I am really trying to avoid rewriting all of the existing java widgets and re-implementing them in the OpenGL context....that would suck :-(