Does TextureManager Operate on a Parallel Thread?

Started by AGP, January 12, 2018, 05:45:37 PM

Previous topic - Next topic

AGP

If so, how do I wait for it? My app is failing to find a texture after it's been added to the TextureManager.

EgonOlsen

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.

AGP

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?

AGP

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?

EgonOlsen

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.

AGP

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?