Package org.sunflow.core
Class TextureCache
java.lang.Object
org.sunflow.core.TextureCache
Maintains a cache of all loaded texture maps. This is usefull if the same
texture might be used more than once in your scene.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidflush()Flush all textures from the cache, this will cause them to be reloaded anew the next time they are accessed.getTexture(String filename, boolean isLinear) Gets a reference to the texture specified by the given filename.
-
Constructor Details
-
TextureCache
public TextureCache()
-
-
Method Details
-
getTexture
Gets a reference to the texture specified by the given filename. If the texture has already been loaded the previous reference is returned, otherwise, a new texture is created.- Parameters:
filename- image file to loadisLinear- is the texture gamma corrected?- Returns:
- texture object
- See Also:
-
flush
public void flush()Flush all textures from the cache, this will cause them to be reloaded anew the next time they are accessed.
-