Posted by
Sven Gothel on
Nov 25, 2012; 11:51am
URL: https://forum.jogamp.org/X11-and-libEGL-crashes-on-Archlinux-tp4027187p4027191.html
On 11/25/2012 11:17 AM, matheus23 [via jogamp] wrote:
> Hello JogAmp! :)
>
> I've found something strange lately when trying to use JOGL with NEWT.
>
> I've setup this demo code:
>
.. snip ..
>
> This crashes with this output:
>
> Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
> libEGL warning: DRI2: failed to authenticate
> libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/xorg/modules/dri)
> init()
> reshape()
> display()
> X11Util.Display: Shutdown (JVM shutdown: true, open (no close attempt): 2/2, reusable (open, marked uncloseable): 0, pending (open in creation order): 2)
> X11Util: Open X11 Display Connections: 2
> X11Util: Open[0]: NamedX11Display[:0, 0x7f96180c1d80, refCount 1, unCloseable false]
> X11Util: Open[1]: NamedX11Display[:0, 0x7f96180e3aa0, refCount 1, unCloseable false]
This is not a crash.
The 'shutdown' message simply notifies you that you haven't closed NEWT resources at exit.
Why does the JVM shutdown ?
Because you main method exists and there is no non-daemon thread running,
see our class Animator's API doc (Will copy this to FPSAnimator as well).
* The Animator execution thread does not run as a daemon thread,
* so it is able to keep an application from terminating.<br>
* Call {@link #stop() } to terminate the animation and it's execution thread.
>
>
> However, if I uncomment these lines:
>
> FPSAnimator animator = new FPSAnimator(window, 60);
> animator.start();
>
> Everything works almost as expected,
Now main exits, but since the non-daemon thread still operates,
the JVM will not shutdown.
> only this output is given:
>
> Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
something w/ your X11 setup .. not JOGL related
> libEGL warning: DRI2: failed to authenticate
> libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/xorg/modules/dri)
thats 'normal' and related to Mesa3D's ES/EGL impl.
> init()
> reshape()
> display()
> display()
> [...]
> dispose()
>
>
> If I want to do the "looping" myself, would I need to create this FPSAnimator
> or subclass it?
.. or implement AnimatorControl, see API doc of GLAutoDrawable and it's setAnimator(..) for hints.
> Is there another way than GLEventListener?
Anyway you want it :)
You can go as low level as you wish via factories etc
and deal w/ GLContext creation and drawable handling yourself.
However, keep in mind that our managed code path includes lot's
of experience and is an efficient and compatible way of running
GL rendering in a GL*Drawable.
~Sven