NewtCanvasAWT Examples
Posted by snmvaughan on Aug 12, 2010; 3:48pm
URL: https://forum.jogamp.org/NewtCanvasAWT-Examples-tp1113619.html
Are there any examples which use the NewtCanvasAWT? If I create a Window and use it in the constructor for NewtCanvasAWT, then a 2ndScreen is allocated during the reparenting process. This occurs because isNativeWindowValid() returns false (the window isn't displayed yet), which throws off the reference counts used in Display. Enabling the debug for Display demonstrates the reference count is at 2.
-----------
Display.create(Windows_nil) BEGIN DisplayMap[] entries: 0 - AWT-EventQueue-0
Display.create(Windows_nil) NEW: refCount 0, NEWT-Display[Windows_nil, refCount 0, hasEDT false, null] AWT-EventQueue-0
Display.create(Windows_nil) CreateNative: NEWT-Display[Windows_nil, refCount 1, hasEDT true, class javax.media.nativewindow.windows.WindowsGraphicsDevice[type Windows, handle 0x0]] AWT-EventQueue-0
Display.create(Windows_nil) END DisplayMap[] entries: 1 - AWT-EventQueue-0
[0] Windows_nil -> NEWT-Display[Windows_nil, refCount 1, hasEDT true, class javax.media.nativewindow.windows.WindowsGraphicsDevice[type Windows, handle 0x0]]
Detected screen size 1920x1200
Display.create(Windows_nil) BEGIN DisplayMap[] entries: 1 - AWT-EventQueue-0
[0] Windows_nil -> NEWT-Display[Windows_nil, refCount 1, hasEDT true, class javax.media.nativewindow.windows.WindowsGraphicsDevice[type Windows, handle 0x0]]
Display.create(Windows_nil) REUSE: refCount 1, NEWT-Display[Windows_nil, refCount 1, hasEDT true, class javax.media.nativewindow.windows.WindowsGraphicsDevice[type Windows, handle 0x0]] AWT-EventQueue-0
Display.create(Windows_nil) END DisplayMap[] entries: 1 - AWT-EventQueue-0
[0] Windows_nil -> NEWT-Display[Windows_nil, refCount 2, hasEDT true, class javax.media.nativewindow.windows.WindowsGraphicsDevice[type Windows, handle 0x0]]
Detected screen size 1920x1200