Login  Register

Re: JOGL 2.4 - Canvas White Screen

Posted by jim1987s on Apr 02, 2019; 12:16am
URL: https://forum.jogamp.org/JOGL-2-4-Canvas-White-Screen-tp4039645p4039658.html

Hi Julien,

Thank you for the reply, and thank you for pointing out a flaw in my design.
Unfortunately, I haven't had much time recently to create an SSCCE. However, I've followed your suggestions and want to make sure I am on the right track. The line(s) that I believe may be the culprit are:
GLCapabilities glCapabilities = new GLCapabilities();
GLDrawableFactory glDrawableFac = GLDrawableFactory.getFactory();
GLDrawable glDrawable = glDrawableFac.getGLDrawable(canvas, glCapabilities, null);
glDrawable.setRealized(true);
In the above and below implementations, `canvas` is just a java.awt.Canvas object.

Using JOGL 2.3.2 (as you rightfully clarified), I "converted" the lines above to interface with JOGL2:
GLProfile.initSingleton();
GLProfile glProfile = GLProfile.get(GLProfile.GL2);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
AWTGraphicsConfiguration config = AWTGraphicsConfiguration.create(canvas.getGraphicsConfiguration(), glCapabilities, glCapabilities);
JAWTWindow jawtWindow = NewtFactoryAWT.getNativeWindow(canvas, config);
GLDrawableFactory glDrawableFactory = GLDrawableFactory.getFactory(glProfile);
GLDrawable glDrawable = glDrawableFactory.createGLDrawable(jawtWindow);
glDrawable.setRealized(true);
Does this conversion seem correct, or am I overlooking something that was introduced from JOGL1 to JOGL2?


Additionally, I wanted to ask for some clarification on some debug output I am receiving.
Info: setGL (OpenGL 2.1 (Compat profile, arb, debug, compat[], FBO, hardware) - 2.1 NVIDIA-12.0.23 355.11.10.50.10.103): Thread-1, GL4bcImpl, jogamp.opengl.gl4.GL4bcImpl@4ec2bd58 -> DebugGL4bc, DebugGL4bc [this 0x22c5ab8e implementing com.jogamp.opengl.GL4bc,
	 downstream: jogamp.opengl.gl4.GL4bcImpl@4ec2bd58
Is it OK that
Thread-1
 is using GL4bcImpl, rather than some GL2-based implementation class?


Many thanks,
Jim