Login  Register

JOGL + Swing + Multiple viewports

Posted by Wilds on Jan 15, 2018; 8:38pm
URL: https://forum.jogamp.org/JOGL-Swing-Multiple-viewports-tp4038537.html

I am currently working on a 3D level editor with swing and java which has the following needs:

- Multiple viewports.
- High performance, smooth rendering.
- Ability to do real time active rendering. (game simulation in editor, physics, particles)

I am having an issue finding and using all the information I need as it is scattered around the internet.
Currently I am using a GLJPanel that handles a GLEventListener and does GLJPanel.display() to repaint if any changes occured to viewport state (camera, etc...).  I want to be able to create active rendered viewports at 60 fps, I just need to be pointed in the right directions.

For example, I created a 3D CSG level editor in C# with Winforms and OpenTK.
It uses one canvas, that is divided into 4 parts with GLViewport. (Do not want this in java)
The viewport is not active rendered, but switches to active rendering when I press in the perspecive viewport that allows me to fly around at 60 fps.



# Multiple viewports, what is the best modern way to do context sharing in Jogl?
I guess the following: https://jogamp.org/deployment/v2.3.2/javadoc/jogl/javadoc/com/jogamp/opengl/GLSharedContextSetter.html

I have also seen this, where a GLPBuffer is used:
http://www.java-gaming.org/index.php/topic,22798.0

# High performance, smooth rendering. NEWT?
I read about using NEWT as it is the prefered way of doing JOGL, because AWT and Swing can lock?
I found out that NEWT could be used with Swing, but how?

Is NEWT preferable in all situations? as in standalone window for a game and GUI(AWT, Swing) applications?
What about context sharing with NEWT?

Guess I need to use this resource: http://jogamp.org/jogl/doc/NEWT-Overview.html

# Ability to do real time active rendering.
I found an article about active rendering dating from 2006, is this still needed or can this be done efficiently with Animator(GJPanel) or NEWT?