TextureManager overcluttered

Currently the static class 'TextureManager' has too many methods for loading a texture, which makes it difficult to use.

I believe the arguments minFilter, maxFilter and anisoLevel can be removed from the methods as they can be set on the texture after loading it.

Texture tex = TextureManager.loadTexture(...);

Default values will be set on the texture after loading instead, which can be adjusted by the user:


The argument 'imageType' is also unneccessary as the image type can be set manually by the user, and the only way it effects image loading is if the GUESS_FORMAT_NO_S3TC type is used. In that case the argument can be replaced with a simple boolean flag 'compress' to choose whether the system is allowed to compress the image or not.

All methods which use the AWT Image object can also be removed since they are rarely used, the user can just call the method TextureManager.loadImage and then assign the image to the texture.

If these suggestions are to be added, TextureManager will only have two accessible texture loading methods:

loadTexture(URL file, boolean compress, boolean flipped)
loadTexture(String resourceName, boolean compress, boolean flipped)

With the addition of several assignment methods:

setDefaultMipmapState(int mipmapState)
setDefaultFilter(int filter)
setDefaultAnisoLevel(float aniso)

I suggest the following defaults:

MipmapState: Texture.MM_LINEAR_LINEAR
Filter: Texture.FM_LINEAR
AnisoLevel: 0.0

Much of the jME 1.0 TextureManager clutter is because originally the texture filter modes and aniso setting were not alterable post texture load.    2.0's TextureManager will be less cluttered and I'll look into paring it down even further based on these suggestions.  Thanks Momoko.


So TextureManager can now get a cleanup :wink:

Yeah, I'd almost held back on releasing the 2.0 source until I had the time to get to that…  :|  I will be getting back to it soon though because resource cleanup (textures especially) are high on my todo list at work.