com.jme.util
Class TextureManager

java.lang.Object
  extended bycom.jme.util.TextureManager

public final class TextureManager
extends java.lang.Object

TextureManager provides static methods for building a Texture object. Typically, the information supplied is the filename and the texture properties.

Version:
$Id: TextureManager.java,v 1.35 2005/02/25 03:10:18 renanse Exp $
Author:
Mark Powell, Joshua Slack -- cache code

Method Summary
static void clearCache()
           
static boolean hasAlpha(java.awt.Image image)
          hasAlpha returns true if the specified image has transparent pixels
static Image loadImage(java.awt.Image image, boolean flipImage)
          loadImage sets the image data.
static Texture loadTexture(java.awt.Image image, int minFilter, int magFilter, boolean flipped)
           
static Texture loadTexture(java.awt.Image image, int minFilter, int magFilter, float anisoLevel, boolean flipped)
           
static Texture loadTexture(java.lang.String file, int minFilter, int magFilter)
          loadTexture loads a new texture defined by the parameter string.
static Texture loadTexture(java.lang.String file, int minFilter, int magFilter, float anisoLevel, boolean flipped)
          loadTexture loads a new texture defined by the parameter string.
static Texture loadTexture(java.lang.String file, int minFilter, int magFilter, int imageType, float anisoLevel, boolean flipped)
           
static Texture loadTexture(java.net.URL file, int minFilter, int magFilter)
          loadTexture loads a new texture defined by the parameter url.
static Texture loadTexture(java.net.URL file, int minFilter, int magFilter, float anisoLevel, boolean flipped)
           
static Texture loadTexture(java.net.URL file, int minFilter, int magFilter, int imageType, float anisoLevel, boolean flipped)
          loadTexture loads a new texture defined by the parameter url.
static boolean releaseTexture(Texture texture)
           
static boolean releaseTexture(TextureKey tKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadTexture

public static Texture loadTexture(java.lang.String file,
                                  int minFilter,
                                  int magFilter)
loadTexture loads a new texture defined by the parameter string. Filter parameters are used to define the filtering of the texture. If there is an error loading the file, null is returned.

Parameters:
file - the filename of the texture image.
minFilter - the filter for the near values.
magFilter - the filter for the far values.
Returns:
the loaded texture. If there is a problem loading the texture, null is returned.

loadTexture

public static Texture loadTexture(java.lang.String file,
                                  int minFilter,
                                  int magFilter,
                                  float anisoLevel,
                                  boolean flipped)
loadTexture loads a new texture defined by the parameter string. Filter parameters are used to define the filtering of the texture. If there is an error loading the file, null is returned.

Parameters:
file - the filename of the texture image.
minFilter - the filter for the near values.
magFilter - the filter for the far values.
flipped - If true, the images Y values are flipped.
Returns:
the loaded texture. If there is a problem loading the texture, null is returned.

loadTexture

public static Texture loadTexture(java.lang.String file,
                                  int minFilter,
                                  int magFilter,
                                  int imageType,
                                  float anisoLevel,
                                  boolean flipped)

loadTexture

public static Texture loadTexture(java.net.URL file,
                                  int minFilter,
                                  int magFilter)
loadTexture loads a new texture defined by the parameter url. Filter parameters are used to define the filtering of the texture. If there is an error loading the file, null is returned.

Parameters:
file - the url of the texture image.
minFilter - the filter for the near values.
magFilter - the filter for the far values.
Returns:
the loaded texture. If there is a problem loading the texture, null is returned.

loadTexture

public static Texture loadTexture(java.net.URL file,
                                  int minFilter,
                                  int magFilter,
                                  float anisoLevel,
                                  boolean flipped)

loadTexture

public static Texture loadTexture(java.net.URL file,
                                  int minFilter,
                                  int magFilter,
                                  int imageType,
                                  float anisoLevel,
                                  boolean flipped)
loadTexture loads a new texture defined by the parameter url. Filter parameters are used to define the filtering of the texture. If there is an error loading the file, null is returned.

Parameters:
file - the url of the texture image.
minFilter - the filter for the near values.
magFilter - the filter for the far values.
imageType - the image type to use. if -1, the type is determined by jME. If S3TC/DXT1[A] is available we use that. if -2, the type is determined by jME without using S3TC, even if available. See com.jme.image.Image for possible types.
flipped - If true, the images Y values are flipped.
Returns:
the loaded texture. If there is a problem loading the texture, null is returned.

loadTexture

public static Texture loadTexture(java.awt.Image image,
                                  int minFilter,
                                  int magFilter,
                                  boolean flipped)

loadTexture

public static Texture loadTexture(java.awt.Image image,
                                  int minFilter,
                                  int magFilter,
                                  float anisoLevel,
                                  boolean flipped)

loadImage

public static Image loadImage(java.awt.Image image,
                              boolean flipImage)
loadImage sets the image data.

Parameters:
image - The image data.
flipImage - if true will flip the image's y values.
Returns:
the loaded image.

hasAlpha

public static boolean hasAlpha(java.awt.Image image)
hasAlpha returns true if the specified image has transparent pixels

Parameters:
image - Image to check
Returns:
true if the specified image has transparent pixels

releaseTexture

public static boolean releaseTexture(Texture texture)

releaseTexture

public static boolean releaseTexture(TextureKey tKey)

clearCache

public static void clearCache()