|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.opengl.InternalTextureLoader
public class InternalTextureLoader
A texture loaded based on many old versions that will load image data from a file and produce OpenGL textures.
ImageData
Field Summary | |
---|---|
protected static SGL |
GL
The renderer to use for all GL operations |
Method Summary | |
---|---|
void |
clear()
Clear out the cached textures |
void |
clear(java.lang.String name)
Remove a particular named image from the cache |
static java.nio.IntBuffer |
createIntBuffer(int size)
Creates an integer buffer to hold specified ints - strictly a utility method |
Texture |
createTexture(int width,
int height)
Create an empty texture |
Texture |
createTexture(int width,
int height,
int filter)
Create an empty texture |
static int |
createTextureID()
Create a new texture ID |
static InternalTextureLoader |
get()
Get the single instance of this texture loader |
static int |
get2Fold(int fold)
Get the closest greater power of 2 to the fold number |
Texture |
getTexture(java.io.File source,
boolean flipped,
int filter)
Get a texture from a specific file |
Texture |
getTexture(java.io.File source,
boolean flipped,
int filter,
int[] transparent)
Get a texture from a specific file |
Texture |
getTexture(ImageData dataSource,
int filter)
Get a texture from a image file |
Texture |
getTexture(java.io.InputStream in,
java.lang.String resourceName,
boolean flipped,
int filter)
Get a texture from a image file |
TextureImpl |
getTexture(java.io.InputStream in,
java.lang.String resourceName,
boolean flipped,
int filter,
int[] transparent)
Get a texture from a image file |
Texture |
getTexture(java.lang.String resourceName,
boolean flipped,
int filter)
Get a texture from a resource location |
Texture |
getTexture(java.lang.String resourceName,
boolean flipped,
int filter,
int[] transparent)
Get a texture from a resource location |
boolean |
isDeferredLoading()
Check if we're using deferred loading |
void |
reload()
Reload all the textures loaded in this loader |
int |
reload(TextureImpl texture,
int srcPixelFormat,
int componentCount,
int minFilter,
int magFilter,
java.nio.ByteBuffer textureBuffer)
Reload a given texture blob |
void |
set16BitMode()
Tell the loader to produce 16 bit textures |
void |
setDeferredLoading(boolean deferred)
True if we should only record the request to load in the intention of loading the texture later |
void |
setHoldTextureData(boolean holdTextureData)
Indicate where texture data should be held for reinitialising at a future point. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static SGL GL
Method Detail |
---|
public static InternalTextureLoader get()
public void setHoldTextureData(boolean holdTextureData)
holdTextureData
- True if we should hold texture datapublic void setDeferredLoading(boolean deferred)
deferred
- True if the we should load a tokenpublic boolean isDeferredLoading()
public void clear(java.lang.String name)
name
- The name of the image to be clearedpublic void clear()
public void set16BitMode()
public static int createTextureID()
public Texture getTexture(java.io.File source, boolean flipped, int filter) throws java.io.IOException
source
- The file to load the texture fromflipped
- True if we should flip the texture on the y axis while loadingfilter
- The filter to use
java.io.IOException
- Indicates a failure to load the imagepublic Texture getTexture(java.io.File source, boolean flipped, int filter, int[] transparent) throws java.io.IOException
source
- The file to load the texture fromflipped
- True if we should flip the texture on the y axis while loadingfilter
- The filter to usetransparent
- The colour to interpret as transparent or null if none
java.io.IOException
- Indicates a failure to load the imagepublic Texture getTexture(java.lang.String resourceName, boolean flipped, int filter) throws java.io.IOException
resourceName
- The location to load the texture fromflipped
- True if we should flip the texture on the y axis while loadingfilter
- The filter to use when scaling the texture
java.io.IOException
- Indicates a failure to load the imagepublic Texture getTexture(java.lang.String resourceName, boolean flipped, int filter, int[] transparent) throws java.io.IOException
resourceName
- The location to load the texture fromflipped
- True if we should flip the texture on the y axis while loadingfilter
- The filter to use when scaling the texturetransparent
- The colour to interpret as transparent or null if none
java.io.IOException
- Indicates a failure to load the imagepublic Texture getTexture(java.io.InputStream in, java.lang.String resourceName, boolean flipped, int filter) throws java.io.IOException
in
- The stream from which we can load the imageresourceName
- The name to give this image in the internal cacheflipped
- True if we should flip the image on the y-axis while loadingfilter
- The filter to use when scaling the texture
java.io.IOException
- Indicates a failure to load the imagepublic TextureImpl getTexture(java.io.InputStream in, java.lang.String resourceName, boolean flipped, int filter, int[] transparent) throws java.io.IOException
in
- The stream from which we can load the imageresourceName
- The name to give this image in the internal cacheflipped
- True if we should flip the image on the y-axis while loadingfilter
- The filter to use when scaling the texturetransparent
- The colour to interpret as transparent or null if none
java.io.IOException
- Indicates a failure to load the imagepublic Texture createTexture(int width, int height) throws java.io.IOException
width
- The width of the new textureheight
- The height of the new texture
java.io.IOException
- Indicates a failure to create the texture on the graphics hardwarepublic Texture createTexture(int width, int height, int filter) throws java.io.IOException
width
- The width of the new textureheight
- The height of the new texture
java.io.IOException
- Indicates a failure to create the texture on the graphics hardwarepublic Texture getTexture(ImageData dataSource, int filter) throws java.io.IOException
dataSource
- The image data to generate the texture fromfilter
- The filter to use when scaling the texture
java.io.IOException
- Indicates the texture is too big for the hardwarepublic static int get2Fold(int fold)
fold
- The target number
public static java.nio.IntBuffer createIntBuffer(int size)
size
- how many int to contain
public void reload()
public int reload(TextureImpl texture, int srcPixelFormat, int componentCount, int minFilter, int magFilter, java.nio.ByteBuffer textureBuffer)
texture
- The texture being reloadedsrcPixelFormat
- The source pixel formatcomponentCount
- The component countminFilter
- The minification filtermagFilter
- The magnification filtertextureBuffer
- The pixel data
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |