StandardGame and threading

Hi!



Does the StandardGame class start its own OpenGL thread? The problem is that complicates the fixes for the issues I submitted, especially the issue 24. The fixes I will provide will fix the bugs but they are dirty as it is required to check very often if the context is current and some operations still have to be executed on the event dispatch thread. The default threading model of JOGL performs all OpenGL calls on the EDT. Would it be simple to modify StandardGame so that it performs these OpenGL calls on the EDT?

Yes it does:



http://code.google.com/p/jmonkeyengine/source/browse/trunk/src/com/jmex/game/StandardGame.java#196

Line #196



I dont know what you mean with EDT, so cant answer the second question.



Regards,



snare

snareoj2 said:

Yes it does:

http://code.google.com/p/jmonkeyengine/source/browse/trunk/src/com/jmex/game/StandardGame.java#196
Line #196

I dont know what you mean with EDT, so cant answer the second question.

Regards,

snare

Thank you. The EDT is the event dispatch thread.

Technically yes, you could modify standard game relatively easily to support an external update call from display() in JOGL.  Why would you need to do this though?

darkfrog said:

Technically yes, you could modify standard game relatively easily to support an external update call from display() in JOGL.  Why would you need to do this though?

I wanted to perform OpenGL calls to avoid lots of checks in some classes about the context. I am currently trying to use StandardGame with the fixes in my game, I only have some problems with mouse centering (java.awt.Robot) but I assume it will be fixed in some weeks. I will show the whole patch then in the contribution depot and it will be important that some people including you watch this before I submit it as it has an important impact.