Render JFrame to texture?

Hello. Is there some library currently that would render Swing JFrame as a texture, and receive JOGL mouse events back to the JFrame? Perhaps TextureRenderer could be used for that?

Depends on what you want to archieve. It sounds, like you are after integrating a Swing-GUI into your games environment. I am afraid this is not easily possible. There is a Swing GUI renderer in the Xith3D codebase, but this never really worked without a flaw.

I would suggest to consider using a ingame GUI like FengGUI. Note that projected GUIs (e.g. functional GUI on a cube) is not possible with FengGUI at the moment, but the devs are friendly and open for suggestions :wink:

It looks indeed like a game gui, but the app I write is not a game.

Not yet but we’ve been thinking about this. I agree that the TextureRenderer could probably be used for this. We’ve been thinking along the lines of a SwingOverlay which would be a container that attaches to a GLDrawable and contains Swing components to render over your 3D scene.

It would be even better if we could attach multiple “swing layers” to the GLDrawable. This would enable us to render more then one Window as Overlay or in 3D. The scene graph outside JOGL for example would be responsible to add/remove “swing layers” by testing the swing textured geometry against the Frustum (in the 3d case).

Doom 3 like in game PDAs or usable Workstations could be implemented really easy with this API.