|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jagatoo.loaders.textures.AbstractTextureLoader
org.xith3d.loaders.texture.TextureLoader
public class TextureLoader
Loads Textures from various image resources.
Loading (by name) works in the following order:
TextureStreamLocatorZips are tried in the order in which they are registered. If a
stream was found then the following is tried on the stream:
TextureImageFormatLoaders are tried in the order in which they are registered. A
texture can then be created from this AbstractTextureImage.TextureFormatLoaders are tried in the order in which they are registered.TextureImageFormatLoader is used to load the Texture. It will
most probably use ImageIO.The loading stops as soon as a Texture is created.
| Nested Class Summary | |
|---|---|
static class |
TextureLoader.FlipMode
The FlipMode defines if Textures are to be vertically flipped at load time. |
| Field Summary | |
|---|---|
protected static Texture2D |
fallbackTexture
Reference to the fallback Texture. |
| Fields inherited from class org.jagatoo.loaders.textures.AbstractTextureLoader |
|---|
autoDotAddedOnce, fallbackTextureImageFormatLoader, textureFormatLoaders, textureImageFormatLoaders, textureStreamLocators |
| Method Summary | |
|---|---|
static Texture2D |
getFallbackTexture()
Returns the fallback Texture. |
static TextureLoader |
getInstance()
Returns the singleton instance of the TextureLoader. |
Texture2D |
getTexture(java.lang.String name)
Retrieves the Texture with the given name, with mipmap. |
Texture2D |
getTexture(java.lang.String name,
Texture.MipmapMode mipmapMode)
Retrieves the texture with the given name. |
Texture2D |
getTexture(java.lang.String name,
org.jagatoo.opengl.enums.TextureFormat format)
Retrieves the texture with the given name. |
Texture2D |
getTexture(java.lang.String name,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode)
Retrieves the texture with the given name. |
Texture2D |
getTexture(java.lang.String name,
TextureLoader.FlipMode flipVertically)
Retrieves the texture with the given name, with mipmap. |
Texture2D |
getTexture(java.lang.String name,
TextureLoader.FlipMode flipVertically,
Texture.MipmapMode mipmapMode)
Retrieves the texture with the given name. |
Texture2D |
getTexture(java.lang.String name,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode)
Retrieves the requested Texture resource either from the cache or loads it and stores it to the cache. |
Texture2D |
getTexture(java.lang.String name,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode,
boolean allowStreching)
Retrieves the requested Texture resource either from the cache or loads it and stores it to the cache. |
Texture2D |
getTexture(java.lang.String name,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode,
boolean allowStreching,
boolean useCache,
boolean writeToCache)
Retrieves the requested Texture resource either from the cache or loads it and stores it to the cache. |
Texture2D |
getTextureOrNull(java.lang.String textureName)
This is a convenience method needed many times. |
Texture2D |
getTextureOrNull(java.lang.String textureName,
Texture.MipmapMode mipmapMode)
This is a convenience method needed many times. |
static boolean |
isFallbackTexture(Texture tex)
Checks whether the given Texture is a fallback Texture. |
Texture2D |
loadTexture(java.io.InputStream in)
Loads the requested Texture resource. |
Texture2D |
loadTexture(java.io.InputStream in,
Texture.MipmapMode mipmapMode)
Loads the requested Texture resource. |
Texture2D |
loadTexture(java.io.InputStream in,
org.jagatoo.opengl.enums.TextureFormat format)
Loads the requested Texture resource. |
Texture2D |
loadTexture(java.io.InputStream in,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode)
Loads the requested Texture resource. |
Texture2D |
loadTexture(java.io.InputStream in,
TextureLoader.FlipMode flipVertically)
Loads the requested Texture resource. |
Texture2D |
loadTexture(java.io.InputStream in,
TextureLoader.FlipMode flipVertically,
Texture.MipmapMode mipmapMode)
Loads the requested Texture resource. |
Texture2D |
loadTexture(java.io.InputStream in,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode)
Loads the requested Texture resource. |
Texture2D |
loadTexture(java.io.InputStream in,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode,
boolean allowStreching)
Loads the requested Texture resource. |
Texture2D |
loadTexture(java.net.URL imageURL)
Loads the texture with the given URL, with mipmap. |
Texture2D |
loadTexture(java.net.URL imageURL,
Texture.MipmapMode mipmapMode)
Loads the texture with the given URL. |
Texture2D |
loadTexture(java.net.URL imageURL,
org.jagatoo.opengl.enums.TextureFormat format)
Loads the texture with the given URL. |
Texture2D |
loadTexture(java.net.URL imageURL,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode)
Loads the texture with the given URL. |
Texture2D |
loadTexture(java.net.URL imageURL,
TextureLoader.FlipMode flipVertically)
Loads the texture with the given URL, with mipmap. |
Texture2D |
loadTexture(java.net.URL imageURL,
TextureLoader.FlipMode flipVertically,
Texture.MipmapMode mipmapMode)
Loads the texture with the given URL. |
Texture2D |
loadTexture(java.net.URL imageURL,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode)
Loads the requested Texture resource. |
Texture2D |
loadTexture(java.net.URL imageURL,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode,
boolean allowStreching)
Loads the requested Texture resource. |
Texture3D |
loadTexture3D(java.lang.String[] names)
Loads the requested Texture3D resource. |
Texture3D |
loadTexture3D(java.lang.String[] names,
org.jagatoo.opengl.enums.TextureFormat format)
Loads the requested Texture3D resource. |
Texture3D |
loadTexture3D(java.lang.String[] names,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format)
Loads the requested Texture3D resource. |
TextureImage2D |
loadTextureImage(java.lang.String name)
Loads a TextureImage. |
TextureImage2D |
loadTextureImage(java.lang.String name,
org.jagatoo.opengl.enums.TextureFormat format)
Loads a TextureImage. |
TextureImage2D |
loadTextureImage(java.lang.String name,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format)
Loads a TextureImage. |
TextureImage2D |
loadTextureImage(java.lang.String name,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
boolean allowStreching)
Loads a TextureImage. |
protected void |
onTextureLoaded(org.jagatoo.loaders.textures.AbstractTexture texture,
java.lang.String resourceName)
|
| Methods inherited from class org.jagatoo.loaders.textures.AbstractTextureLoader |
|---|
addTextureFormatLoader, addTextureImageFormatLoader, addTextureStreamLocator, addTextureStreamLocator, addTextureStreamLocator, addTextureStreamLocator, addTextureStreamLocator, checkCache, createTextureFromTextureImage, generateCacheKey, getCache, getFallbackTextureImageFormatLoader, getInputStream, initStandardFormatLoaders, loadOrGetTexture, loadTextureFromStream, loadTextureFromURL, loadTextureImage, loadTextureImageFromStream, removeTextureFormatLoader, removeTextureImageFormatLoader, removeTextureStreamLocator, setCache, setFallbackTextureImageFormatLoader |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Texture2D fallbackTexture
| Method Detail |
|---|
public static Texture2D getFallbackTexture()
public static boolean isFallbackTexture(Texture tex)
tex - the sample Texture to check
true if the sample Texture IS the fallback Texture; false otherwisepublic static TextureLoader getInstance()
TextureLoader.
public TextureImage2D loadTextureImage(java.lang.String name,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
boolean allowStreching)
TextureImage.
name - the texture resource nameflipVertically - whether to flip the texture verticallyformat - the texture format to useallowStreching - whether to allow stretching
TextureImage loaded
public final TextureImage2D loadTextureImage(java.lang.String name,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format)
TextureImage.
name - the texture resource nameflipVertically - whether to flip the texture verticallyformat - the texture format to use
TextureImage loaded
public final TextureImage2D loadTextureImage(java.lang.String name,
org.jagatoo.opengl.enums.TextureFormat format)
TextureImage.
name - the texture resource nameformat - the texture format to use
TextureImage loadedpublic final TextureImage2D loadTextureImage(java.lang.String name)
TextureImage.
name - the texture resource name
TextureImage loaded
protected void onTextureLoaded(org.jagatoo.loaders.textures.AbstractTexture texture,
java.lang.String resourceName)
onTextureLoaded in class org.jagatoo.loaders.textures.AbstractTextureLoader
public Texture2D getTexture(java.lang.String name,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode,
boolean allowStreching,
boolean useCache,
boolean writeToCache)
name - The name of the textureflipVertically - whether to flip the texture verticallyformat - The desired texture format. The returned texture format may differ from this
formatmipmapMode - Should the texture contain mipmaps?allowStreching - whether to allow stretchinguseCache - whether to use the cachewriteToCache - whether to write to the cache (ignored if useCache is false)
public Texture2D getTexture(java.lang.String name,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode,
boolean allowStreching)
name - The name of the textureflipVertically - whether to flip the texture verticallyformat - The desired texture format. The returned texture format may differ from this
formatmipmapMode - Should the texture contain mipmaps?allowStreching - whether to allow stretching
public final Texture2D getTexture(java.lang.String name,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode)
name - The name of the textureformat - The desired texture format. The returned texture format may differ from this
formatmipmapMode - Should the texture contain mipmaps?
public Texture2D getTexture(java.lang.String name,
TextureLoader.FlipMode flipVertically)
name - the name of the textureflipVertically - whether to flip the texture vertically
public Texture2D getTexture(java.lang.String name)
name - the name of the texture
public Texture2D getTexture(java.lang.String name,
TextureLoader.FlipMode flipVertically,
Texture.MipmapMode mipmapMode)
name - The name of the textureflipVertically - whether to flip the texture verticallymipmapMode - Should the texture contain mipmaps?
public Texture2D getTexture(java.lang.String name,
org.jagatoo.opengl.enums.TextureFormat format)
name - The name of the textureformat - the format to use: Texture.RGB or Texture.RGBA
public Texture2D getTexture(java.lang.String name,
Texture.MipmapMode mipmapMode)
name - The name of the texturemipmapMode - Should the texture contain mipmaps?
public Texture2D getTexture(java.lang.String name,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode)
TextureLocator are tried in the order in which they are registered.TextureStreamLocatorZip are tried in the order in which they are registered.TextureStreamLoader are tried in the order in which they are registered.TextureImageFormatLoader are tried in the order in which they are registered. A
texture is then created with this AbstractTextureImage (mipmaps are currently not
implemented).ImageIO.read() is tried. From this a Texture with optional mipmaps is
created.
name - The name of the textureformat - The desired texture format. The returned texture format may differ from this
formatmipmapMode - Should the texture contain mipmaps?
public Texture2D getTextureOrNull(java.lang.String textureName,
Texture.MipmapMode mipmapMode)
textureName is null or an empty string, null is returned.
textureName - the requested Texture's name or nullmipmapMode - the MipmapMode to use
nullpublic Texture2D getTextureOrNull(java.lang.String textureName)
textureName is null or an empty string, null is returned.
textureName - the requested Texture name
null
public Texture2D loadTexture(java.net.URL imageURL,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode,
boolean allowStreching)
imageURL - The URL pointing to the texture imageflipVertically - whether to flip the texture verticallyformat - The desired texture format. The returned texture format may differ from this
formatmipmapMode - Should the texture contain mipmaps?allowStreching - whether to allow stretching
public Texture2D loadTexture(java.net.URL imageURL,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode)
imageURL - The URL pointing to the texture imageflipVertically - whether to flip the texture verticallyformat - The desired texture format. The returned texture format may differ from this
formatmipmapMode - Should the texture contain mipmaps?
public Texture2D loadTexture(java.net.URL imageURL,
TextureLoader.FlipMode flipVertically)
imageURL - The URL pointing to the texture imageflipVertically - whether to flip the texture vertically
public Texture2D loadTexture(java.net.URL imageURL)
imageURL - The URL pointing to the texture image
public Texture2D loadTexture(java.net.URL imageURL,
Texture.MipmapMode mipmapMode)
imageURL - The URL pointing to the texture imagemipmapMode - Should the texture contain mipmaps?
public Texture2D loadTexture(java.net.URL imageURL,
org.jagatoo.opengl.enums.TextureFormat format)
imageURL - The URL pointing to the texture imageformat - the format to use: Texture.RGB or Texture.RGBA
public Texture2D loadTexture(java.net.URL imageURL,
TextureLoader.FlipMode flipVertically,
Texture.MipmapMode mipmapMode)
imageURL - The URL pointing to the texture imageflipVertically - whether to flip the texture verticallymipmapMode - Should the texture contain mipmaps?
public Texture2D loadTexture(java.net.URL imageURL,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode)
imageURL - The URL pointing to the texture imageformat - The desired texture format. The returned texture format may differ from this
formatmipmapMode - Should the texture contain mipmaps?
public Texture2D loadTexture(java.io.InputStream in,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode,
boolean allowStreching)
in - An InputStream for the texture resourceflipVertically - whether to flip the texture verticallyformat - The desired texture format. The returned texture format may differ from this
formatmipmapMode - Should the texture contain mipmaps?allowStreching - whether to allow stretching
public Texture2D loadTexture(java.io.InputStream in,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode)
in - An InputStream for the texture resourceflipVertically - whether to flip the texture verticallyformat - The desired texture format. The returned texture format may differ from this
formatmipmapMode - Should the texture contain mipmaps?
public Texture2D loadTexture(java.io.InputStream in,
TextureLoader.FlipMode flipVertically)
in - An InputStream for the texture resourceflipVertically - whether to flip the texture vertically
public Texture2D loadTexture(java.io.InputStream in)
in - An InputStream for the texture resource
public Texture2D loadTexture(java.io.InputStream in,
Texture.MipmapMode mipmapMode)
in - An InputStream for the texture resourcemipmapMode - Should the texture contain mipmaps?
public Texture2D loadTexture(java.io.InputStream in,
org.jagatoo.opengl.enums.TextureFormat format)
in - An InputStream for the texture resourceformat - the format to use: Texture.RGB or Texture.RGBA
public Texture2D loadTexture(java.io.InputStream in,
TextureLoader.FlipMode flipVertically,
Texture.MipmapMode mipmapMode)
in - An InputStream for the texture resourceflipVertically - whether to flip the texture verticallymipmapMode - Should the texture contain mipmaps?
public Texture2D loadTexture(java.io.InputStream in,
org.jagatoo.opengl.enums.TextureFormat format,
Texture.MipmapMode mipmapMode)
in - An InputStream for the texture resourceformat - The desired texture format. The returned texture format may differ from this
formatmipmapMode - Should the texture contain mipmaps?
public Texture3D loadTexture3D(java.lang.String[] names,
TextureLoader.FlipMode flipVertically,
org.jagatoo.opengl.enums.TextureFormat format)
Texture3D resource.
names - names of the texture image resourcesflipVertically - whether to flip the texture verticallyformat - The desired texture format. The returned texture format may differ from this
format
null).
public final Texture3D loadTexture3D(java.lang.String[] names,
org.jagatoo.opengl.enums.TextureFormat format)
Texture3D resource.
names - names of the texture image resourcesformat - The desired texture format. The returned texture format may differ from this
format
null).public final Texture3D loadTexture3D(java.lang.String[] names)
Texture3D resource.
names - names of the texture image resources
null).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||