Posted by
ThomasR on
Feb 08, 2018; 6:57pm
URL: https://forum.jogamp.org/Initialization-steps-tp4038597p4038604.html
Hi Julien,
Jogamp Ardor3D is wonderful, and the examples are great!
Finally, maybe you're asking something impossible to do as there are some constraints when initializing the canvases except if you prefer working around the various weirdnesses of OpenGL drivers under Windows by yourself.
Yes, quite likely! I'm afraid we've become accustomed to bad and sloppy practice at times.
The problem is order of initialization and realization of components. I tool a look at ExampleBase and JoglBasicExample, and if you can, verify this is the proper initialization sequence:
frame = new JFrame()
canvas = new JoglAwt/Swing/NewtCanvas()
frame.setContentPane(canvas)
frame.setVisible(true)
canvas.init() // Also done by the FrameHandler.init()
I think this is the only order that will work.
We've become used to just creating and JFrames and Java3D Canvas3D in any order. So I think my workaround stated earlier is really "Don't canvas.init() until it has a visible, heavyweight ancestor". Perhaps there's a much better approach? I would just force the steps above, but there's already quite a bit of user and application code out there. I'm not sure if I'm making sensor or not.
I don't think my question is unreasonable considering that in JoglAwtInitializerRunnable:
if (_joglAwtCanvas.getDelegatedDrawable().isRealized())
since getDelagatedDrawable() can be null, isRealized() will possibly throw a NPE (which it does, if above steps are not followed)
As to JogAmp's Ardor3D Continuation 1.0, that would be fantastic whenever you feel it's ready. Of course, entirely up to you. Perhaps, it could be branch on the Jogamp git repo? Whatever you think.
Is the version currently on the Jogamp git repo now the official version to use, it's what I'm running with now.
Thanks again,
Tom