Login  Register

Re: Some issues using NEWT

Posted by Sven Gothel on Feb 20, 2012; 4:03pm
URL: https://forum.jogamp.org/Some-issues-using-NEWT-tp3757230p3761120.html

On 02/20/2012 04:08 PM, ac [via jogamp] wrote:

>
>
> Ok, here is the bug report:
>
>  https://jogamp.org/bugzilla/show_bug.cgi?id=555
>
> Another question. I realized that I can create my GLWindow using a native
> window as argument in addition to the gl capabilities. Something like this:
>
> AWTGraphicsScreen screen =
> (AWTGraphicsScreen)AWTGraphicsScreen.createDefault();
> AWTGraphicsConfiguration config =
> (AWTGraphicsConfiguration)GraphicsConfigurationFactory
>        
> .getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(capabilities,
> capabilities, null, screen);
> NativeWindow natWin = NativeWindowFactory.getNativeWindow(applet, config);  
>    
> window = GLWindow.create(natWin, capabilities);
This cstr is avail to allow native parenting,
and actually exactly what NewtCanvasAWT does plus all the
required event handling etc.

> canvas = new NewtCanvasAWT(window);
>
> where I pass the parent applet objet to the getNativeWindow() method. Is
> this recommended, not recommended, or same as creating the GLWindow passing
> only the capablilities?

So for the 'NewtCanvasAWT' case, you just shall use it as advertised.
As described above, it handles the native AWT parenting and event translation
itself.

~Sven


signature.asc (910 bytes) Download Attachment