display() is called before init() finishes?

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

display() is called before init() finishes?

imakerobots
Running v2.5.0.  GL3 context is not created due to wonky hardware.
I have put my test before creating the GLCanvas(), everything is working as expected.

However.  

Before putting the test there... I tried putting a dialog box and a system.exit() in the override for GLEventListener.init().
The dialog box appeared and exit() was called but I was surprised to see the rest of the app appear and that display() was called after that.

So I don't know if this is important to you or not, I just thought it worth noting.  Is display() happening in a different thread from init()?
Reply | Threaded
Open this post in threaded view
|

Re: display() is called before init() finishes?

Sven Gothel
Administrator
imakerobots wrote
I tried putting a dialog box and a
system.exit() in the override for GLEventListener.init().
The dialog box appeared and exit() was called but I was surprised to see the
rest of the app appear and that display() was called after that.
Yes, this is surprising.
As if System.exit() is processed after completing our GLEventListener processing.

imakerobots wrote
Is display() happening in a different thread from init()?
No. it is called from same rendering thread helper processing all GLEventListener.
init is called before display, usually only once or if recreating the resource.