Login  Register

Re: [2.0 RC3] PBuffer uses awtlock during display

Posted by Tovi on Sep 28, 2011; 3:12pm
URL: https://forum.jogamp.org/2-0-RC3-PBuffer-uses-awtlock-during-display-tp3355580p3376342.html

Sven,

Is there any way to detect whether a call to GLProfile.initSingleton(true) will crash the JVM or block it? i.e. is there a set of conditions that will cause GLProfile.initSingleton(true) to crash my application. I'm asking because in my application I can't always be sure that I can call this as the first line.

I'm trying to find a way to detect whether or not a call to GLProfile.initSingleton(true) will crash the JVM, so I can display an error message instead.

I really can't make out when it will or won't happen. Some small examples will not crash it, while others will.

For instance, the following code will not crash it:

JFrame jframe = new JFrame()
jFrame.setVisible(true)
GLProfile.initSingleton(true)

but for some reason this will:

Frame jframe = new Frame()
jFrame.setVisible(true)
GLProfile.initSingleton(true)

Also, only in Linux (not windows), as far as I can tell. But still strange because JFrame extends from Frame.

What exactly is the reason that GLProfile.initSingleton(true) should be called before any other AWT call?