Using NEWT the window flashes and then the program terminates.

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Using NEWT the window flashes and then the program terminates.

petsagouris
Hello everyone, I have been trying out the tutorials on https://sites.google.com/site/justinscsstuff/jogl-tutorial-2  and I have opted for the NEWT approach after seeing the comparison in the wiki regarding the performance. The AWT example SimpleScene provided work fine and it can be debugged. Trying the NEWT SimpleScene class thow actualy is giving a problem. The program compiles fine, the threads are started and then it all shuts down, while in the AWT version the window stays up until I close it. Please see details in the video below: http://youtu.be/KbR2-QBTJGw

Reply | Threaded
Open this post in threaded view
|

Re: Using NEWT the window flashes and then the program terminates.

Pixelapp
I know this tutorial https://sites.google.com/site/justinscsstuff/jogl-tutorial-2 works fine from experience.

I say double check your code. Or show it here.
Reply | Threaded
Open this post in threaded view
|

Re: Using NEWT the window flashes and then the program terminates.

petsagouris
The code is exactly the same as it is at the moment on the justincstuff site.

Simple copy and paste, although it is not visible in the video since I used Ctrl+C/V for getting it rather than the context menus.

The weird thing is that using the TestGearsNEWT.java as referenced from the NEWT Overview page (adapting slightly the class layout to work standalone) makes everything work properly. I don't know why the only new thing in that class is the usage of the Animator object...
Reply | Threaded
Open this post in threaded view
|

Re: Using NEWT the window flashes and then the program terminates.

Sven Gothel
Administrator
On 05/22/2012 09:46 PM, petsagouris [via jogamp] wrote:

> The code is exactly the same as it is at the moment on the justincstuff site.
>
> Simple copy and paste, although it is not visible in the video since I used
> Ctrl+C/V for getting it rather than the context menus.
>
> The weird thing is that using the TestGearsNEWT.java
> <http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java;hb=HEAD> as
> referenced from the NEWT Overview
> <http://jogamp.org/jogl/doc/NEWT-Overview.html> page (adapting slightly the
> class layout to work standalone) makes everything tick. I don't know why the
> only new thing in that class is the usage of the Animator object...

Unlike AWT, creating a NEWT Window does not stop the JVM from being closed!

To do so, you either need to manually keep the main thread alive,
or - like many of the NEWT demos - keep another non daemon thread alive,
like the Animator.

~Sven

Reply | Threaded
Open this post in threaded view
|

Re: Using NEWT the window flashes and then the program terminates.

petsagouris
Sven thanks a lot for clearing this up. *bows*