Re: JOGL + Swing + Multiple viewports
Posted by
Wilds on
Jan 16, 2018; 11:07am
URL: https://forum.jogamp.org/JOGL-Swing-Multiple-viewports-tp4038537p4038546.html
gouessej wrote
There are several implementations of animator, the most basic one performs active rendering, another one attempts to respect a fixed frame rate (but I advise you to use V-sync instead of this animator).
NewtCanvasAWT is a kind of bridge, it contains a NEWT window but it extends a basic (heavyweight) java.awt.Canvas. It helps to write cross-platform source code as you can use the same listeners with AWT and in AWT-free environments (typically Android).
You must identify the root cause in order to choose the appropriate solution. Multithreading isn't magic but you should do on the EDT only what is necessary.
Where do you call glCullFace(GL2.GL_BACK)?
Thank you again for your explanation, it helps alot.
I guess I can't use newt as heavyweight components do not work with the components I am using.
About `GL_BACK`I have it commented out below the code I posted. It has the same effect(Black screen) and should be default with OpenGL? (Guess it depends on driver impl)
@Override
public void init(GLAutoDrawable glAutoDrawable) {
GL2 gl2 = (GL2) glAutoDrawable.getGL();
gl2.glClearColor(31.0f / 255.0f, 31.0f / 255.0f, 31.0f / 255.0f, 1.0f);
gl2.glEnable(GL2.GL_DEPTH_TEST);
gl2.glEnable(GL2.GL_CULL_FACE);
gl2.glFrontFace(GL2.GL_CW);
gl2.glCullFace(GL2.GL_BACK);
LOGGER.info("OpenGL Canvas initialized = " + Thread.currentThread().getName());
}