multiple instances of GLCanvas in a single container (Swing)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

multiple instances of GLCanvas in a single container (Swing)

jacksmash
Is it possible to do this? I'm using Netbeans as my IDE. I'd like to have, say, a grid of 6 (or more) GLCanvases on a single JPanel. They don't necessarily share context, and they are not just different views of the same scene.

I've been searching the web and can't seem to find any tutorials. Any suggestions?
Reply | Threaded
Open this post in threaded view
|

Re: multiple instances of GLCanvas in a single container (Swing)

gouessej
Administrator
Hi

This looks like what you're talking about, 3 GLCanvas instances inside a single JFrame:
http://forum.jogamp.org/JOGL-2-support-for-Ardor3D-JMonkeyEngine-3-jzy3d-and-NiftyGUI-tp1706747p3330841.html

I think it is possible to do it without Ardor3D.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: multiple instances of GLCanvas in a single container (Swing)

jacksmash
Thanks for your reply! That thread was interesting. So I'm guessing it should be possible in Swing then. I'll keep searching for more clues...
Reply | Threaded
Open this post in threaded view
|

Re: multiple instances of GLCanvas in a single container (Swing)

gouessej
Administrator
You can put several GLCanvas instances inside a JPanel. By default, the JPanel uses a BorderLayout, you can use another one if you want. You can use one animator per canvas (maybe this option does not work) or do active rendering like me.
Julien Gouesse | Personal blog | Website