www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: AGP on January 12, 2018, 05:45:37 pm

Title: Does TextureManager Operate on a Parallel Thread?
Post by: AGP on January 12, 2018, 05:45:37 pm
If so, how do I wait for it? My app is failing to find a texture after it's been added to the TextureManager.
Title: Re: Does TextureManager Operate on a Parallel Thread?
Post by: EgonOlsen on January 12, 2018, 05:51:41 pm
No, it doesn't. There are no threads on jPCT other than the ones used by the software renderer (optional) and the SEAT Renderer. If you add a texture, it's in there when the method returns.
Title: Re: Does TextureManager Operate on a Parallel Thread?
Post by: AGP on January 12, 2018, 05:57:40 pm
I have loadModels() method whose first line is loadTextures(). But the loader fails at finding the texture even before loadTextures prints its name. What gives?
Title: Re: Does TextureManager Operate on a Parallel Thread?
Post by: AGP on January 12, 2018, 06:17:19 pm
It's not the model loader that's failing, it's the TextureManager. Any chance you could improve the error message here, to indicate that it's the TextureManager that's failing to add the texture?
Title: Re: Does TextureManager Operate on a Parallel Thread?
Post by: EgonOlsen on January 13, 2018, 12:09:38 am
It actually can't fail. It's a simple list of names associated with texture instances. addTexture is an extremely simple operation. If you can't assign a texture, chances are that it hasn't been added by your code. You can obtain all the names from the manager. Try to check if it contains the ones that you think it should.
Title: Re: Does TextureManager Operate on a Parallel Thread?
Post by: AGP on January 13, 2018, 06:41:15 am
It did because the loader and the texture weren't in the same directory. I fixed it by getting the absolute path. Would it be possible to add a line identifying the fact that the problem is coming from trying to load the texture, rather than when loading the model?