Hello, I asked some time ago if it was possible to use an external context (for example created in an external C app) in JOGL. It is of course possible using GLDrawableFactory.createExternalContext().
I now want to paint swing UIs (living inside GLJPanels) inside this external context. This would for example allow to draw swing widgets in a 3D world created by external code. I don’t want here to simply use java2D inside OpenGL, but an entire GLJPanel and all its contained widgets. I assume that is is possible by:
- creating a JOGL context using the current external OpenGL context (by GLDrawableFactory.createExternalContext)
- create a new GLJPanel sharing its context with the previously created JOGL context
- simply add children widgets in the GLJPanel
Alternatively, another way may be to treat swing widgets as regular java2D objects, and paint them like the various demos using the Java2D / JOGL interoperability.
Any hints ?
Herve