Re: Best approach for multiple GLCanvas + Swing + multi-screen
Posted by
Brandon Borkholder on
Jun 04, 2012; 9:10pm
URL: https://forum.jogamp.org/Best-approach-for-multiple-GLCanvas-Swing-multi-screen-tp4025136p4025140.html
So what I'm trying to figure out is...what is the best approach for combining JoGL and Swing in the same application in such a way as to maximize the performance of the GL part? Should I try to change the threading somehow? Use something from NEWT?
One possible approach would be to draw all your Swing components into the same canvas as your other OpenGL graphics.
GLG2D lets you render Swing directly into a JOGL canvas. It's not feature-complete, but I'm actively developing it. There are two significant benefits to this:
- You have better control over when Swing draws (e.g. 30fps) and Swing won't clog the EDT queue with repaint requests
- Drawing Swing using glg2d is actually faster in some cases, specifically if you're rendering something complex in a single pass