Posted by
jim1987s on
Mar 23, 2019; 8:51pm
URL: https://forum.jogamp.org/JOGL-2-4-Canvas-White-Screen-tp4039645.html
Good afternoon,
I've recently undertaken a project where I am required to convert a very old (8yrs+) JOGL (what appears to be a pre-1.1.1 version) application to JOGL 2.4 so that it will run without issue on Java 8.
I should specify I am currently running MacOS Mojave 10.14.3 and Java 8u201.
Initially, I had no problem working on this. I was able to include the new JOGL 2.4 library (jogamp-fat.jar from
http://jogamp.org/deployment/archive/master/gluegen_910-joal_636-jogl_1474-jocl_1112/fat/) to my project, and just had to change `GL` to `GL2` (and correct some method names from calling their ARB variant to their plain variant).
However, the part of the application where I actually initialize OpenGL seems to be a bit tricky.
For reference, here is the old (antiquated) implementation:
https://gist.github.com/jim1987s/3fd724d737a97f04654b2c94ed03ff63The method of note is `startToolkit`.
The main issue I found was that:
GLDrawableFactory glDrawableFac = GLDrawableFactory.getFactory();
glDrawable = glDrawableFac.getGLDrawable(canvas, glCapabilities, null);
...does not exist in JOGL 2.4.
As such, here is my attempted implementation for startToolkit:
https://gist.github.com/jim1987s/687d4ae03385b70d358b616171ab1b89For all intents and purposes, it *appears* to work. I am able to start the application, but after it loads, the Canvas is white. I can interact with it still (clicking on components and typing yields print statements in the Console), yet of course, this is not what I desire.
I have also run this application using Debug and Verbose mode to get as much information as possible, which is shown at:
https://gist.github.com/jim1987s/55c19acd0fd84f74044ea87813ef3a0aI feel I am missing something small, and have spent a few days trying different approaches to no avail.
Any help would be greatly appreciated.
All the best,
Jim