# TextureLoader (Slick - The 2D Library)
Date: 2013-06-03

## org.newdawn.slick.opengl
Class TextureLoader

    java.lang.Object
      org.newdawn.slick.opengl.TextureLoader

    public class TextureLoader

extends java.lang.Object

A utility class to wrap the Slick internal texture loader and present a rational interface.

Author:
  kevin

Constructor Summary
`TextureLoader()`

Method Summary
`static Texture` `getTexture(java.lang.String format, java.io.InputStream in)` Load a texture with a given format from the supplied input stream
`static Texture` `getTexture(java.lang.String format, java.io.InputStream in, boolean flipped)` Load a texture with a given format from the supplied input stream
`static Texture` `getTexture(java.lang.String format, java.io.InputStream in, boolean flipped, int filter)` Load a texture with a given format from the supplied input stream
`static Texture` `getTexture(java.lang.String format, java.io.InputStream in, int filter)` Load a texture with a given format from the supplied input stream

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TextureLoader

    public TextureLoader()

Method Detail

### getTexture

    public static Texture getTexture(java.lang.String format,
                                     java.io.InputStream in)
                              throws java.io.IOException

  Load a texture with a given format from the supplied input stream

  Parameters:
    `format` - The format of the texture to be loaded (something like "PNG" or "TGA")
    `in` - The input stream from which the image data will be read
  Returns:
    The newly created texture
  Throws:
    `java.io.IOException` - Indicates a failure to read the image data

### getTexture

    public static Texture getTexture(java.lang.String format,
                                     java.io.InputStream in,
                                     boolean flipped)
                              throws java.io.IOException

  Load a texture with a given format from the supplied input stream

  Parameters:
    `format` - The format of the texture to be loaded (something like "PNG" or "TGA")
    `in` - The input stream from which the image data will be read
    `flipped` - True if the image should be flipped vertically on loading
  Returns:
    The newly created texture
  Throws:
    `java.io.IOException` - Indicates a failure to read the image data

### getTexture

    public static Texture getTexture(java.lang.String format,
                                     java.io.InputStream in,
                                     int filter)
                              throws java.io.IOException

  Load a texture with a given format from the supplied input stream

  Parameters:
    `format` - The format of the texture to be loaded (something like "PNG" or "TGA")
    `in` - The input stream from which the image data will be read
    `filter` - The GL texture filter to use for scaling up and down
  Returns:
    The newly created texture
  Throws:
    `java.io.IOException` - Indicates a failure to read the image data

### getTexture

    public static Texture getTexture(java.lang.String format,
                                     java.io.InputStream in,
                                     boolean flipped,
                                     int filter)
                              throws java.io.IOException

  Load a texture with a given format from the supplied input stream

  Parameters:
    `format` - The format of the texture to be loaded (something like "PNG" or "TGA")
    `in` - The input stream from which the image data will be read
    `flipped` - True if the image should be flipped vertically on loading
    `filter` - The GL texture filter to use for scaling up and down
  Returns:
    The newly created texture
  Throws:
    `java.io.IOException` - Indicates a failure to read the image data

Copyright © 2006 New Dawn Software. All Rights Reserved.