Our client talks to a custom remote server over a proprietary protocol. When a model (of any type) loads, I need to be able to do the following:
- Model is loaded
- A placeholder texture is created and assigned for each referenced texture name
- My client is notificed with referenced texture name and placeholder texture object
- My client obtains each referenced texture through our various and sundry means, over the course of time
- When the actual texture arrives, I load the real texture data into the placeholder texture object
So here’s what I’m thinking:
- Model loading functions are provided a TextureProvider type object by the parent process
- jME provides the TextureProviderJAR class, designed to read from JAR files
- My client can then provide our own custom TextureProvider
- The TextureProvider provides a texture immediately (either real or placeholder). It’s the responsibility of the parent process/TextureProvider to keep track of placeholders and update them later.
This should actually be done for ANY dependency (textures, referenced external model files, etc). Maybe TextureProvider should be named ExternalDependencyProvider or something…