Login  Register

Re: Aviatrix3D JOGL Problem

Posted by Xerxes Rånby on Dec 12, 2017; 10:29am
URL: https://forum.jogamp.org/Aviatrix3D-JOGL-Problem-tp4038396p4038408.html



2017-12-11 20:55 GMT+01:00 Arvid [via jogamp] <[hidden email]>:
But why works the JOGLExample (see my first post above)?


The JOGLExample work because it is only using jogamp classes!
A Jogamp GLWindow work on all platforms we support. (no AWT or java2d is required required to initialize a GLWindow we call the operatingsystems window toolkit directly)
 
What is so different with this and the Aviatrix3D init with AWT-Frame?

When using an AWT-Frame then JOGL is instructed to paint directly on an window initialized by AWT.
In this case JOGL need to use the OGLUtilities class in order to know where to render.
Using this setup window initialization and all events are handled by AWT.

 

Maybe I can change the way how Avaitrix3D does it in it's Surface classes??? 

What you can do in Avitrix3D is letting JOGL initialize the window using a GLWindow.
Place the GLWindow into a com.jogamp.newt.awt.NewtCanvasAWT.
And then place the NewtCanvasAWT into an AWT or Swing GUI.
Using this setup window initialization and all events are handled by JogAmp.

NewtCanvasAWT, representing an AWT Canvas, allows you to hook a NEWT Window into it.

Since the NewtCanvasAWT is an AWT heavyweight Component, this gives you the ability hook NEWT into an AWT UI.

The implementation uses the AWT native JAWT API to reparent the NEWT Window natively into the AWT one
and hence is even more compatible with JOGL’s GLCanvas implementation.

Example how to initialize a GLWindow, place it into a NewtCanvasAWT and placing it all into an AWT GUI.