How can I find out if I'm in the OpenGl Thread?

To simplify my Code and make it more reliable I want to create a few Loader functions, that either use a Callable in the Update/Render to make sure that they are running in the OpenGl Thread.

The Problem is, that if I try to use a Callable while already in the OpenGl Thread, the Game freezes, so back to the question, is there a Way to find out if I#m in the OpenGl Thread.

StandardGame has a inGLThread() and executeInGL() method, the opengl thread name is also set to: "OpenGL"

Thanks, I build a similar method into my Project now, works fine.



Btw, since it#s kinda related to the loading:



How can I recursivly check files inside a jar?

I have a folder for my Sounds, Models, ect and want to precache them, so I need to recursivly go through the directory in the jar file. Does maybee anyone has any hints for me?

Empire Phoenix said:

Thanks, I build a similar method into my Project now, works fine.

Btw, since it#s kinda related to the loading:

How can I recursivly check files inside a jar?
I have a folder for my Sounds, Models, ect and want to precache them, so I need to recursivly go through the directory in the jar file. Does maybee anyone has any hints for me?

java.util.jar.JarFile?