Package de.coreengine.asset
Class TextureLoader
- java.lang.Object
-
- de.coreengine.asset.TextureLoader
-
public class TextureLoader extends Object
Class for loading Textures from drive
Supported Formats (From STB):
JPEG baseline and progressive (12 bpc/arithmetic not supported, same as stock IJG lib
PNG 1/2/4/8/16-bit-per-channel
TGA (not sure what subset, if a subset)
BMP non-1bpp, non-RLE
PSD (composited view only, no extra channels, 8/16 bit-per-channel)
GIF (*desired_channels always reports as 4-channel)
HDR (radiance rgbE format)
PIC (Softimage PIC)
PNM (PPM and PGM binary only)
- Author:
- Darius Dinger
-
-
Constructor Summary
Constructors Constructor Description TextureLoader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
loadCubeMap(String path, String ext, boolean asResource)
Loading cube map texture from abstract path and extension and storing into asset database.static void
loadCubeMap(String key, String left, String right, String top, String bottom, String front, String back, boolean asResource)
Loadig cubemap texture from 6 texture files and storing into asset databasestatic void
loadTextureFile(String textureFile, boolean mipmap, int filtering, boolean asResource)
Loading a TextureData file into an opengl texture and storing into asset databasestatic TextureData
loadTextureFileMeta(String textureFile, boolean mipmap, int filtering, boolean asResource)
Load TextureData file and store into TextureData object
-
-
-
Method Detail
-
loadTextureFileMeta
public static TextureData loadTextureFileMeta(String textureFile, boolean mipmap, int filtering, boolean asResource)
Load TextureData file and store into TextureData object- Parameters:
textureFile
- Path to TextureData relative to applicationmipmap
- Uses this TextureData mipmapping/anisotropic filtering (if supported)filtering
- Wich filtering mathod (GL_NEARES, GL_LINEAR, ...)asResource
- Loading TextureData from resources- Returns:
- TextureData object
-
loadTextureFile
public static void loadTextureFile(String textureFile, boolean mipmap, int filtering, boolean asResource)
Loading a TextureData file into an opengl texture and storing into asset database- Parameters:
textureFile
- Path to TextureData relative to applicationmipmap
- Uses this TextureData mipmapping/anisotropic filtering (if supported)filtering
- Wich filtering mathod (GL_NEARES, GL_LINEAR, ...)asResource
- Loading TextureData from resources
-
loadCubeMap
public static void loadCubeMap(String path, String ext, boolean asResource)
Loading cube map texture from abstract path and extension and storing into asset database. The cube map file names will be generated by:
path + ['_lf', '_rt', '_up', '_dn', '_ft', '_bk'] + '.' + ext- Parameters:
path
- Abstract path to the cubemapext
- Extension of the cube map TexturesasResource
- Loading cube map Textures from resources
-
loadCubeMap
public static void loadCubeMap(String key, String left, String right, String top, String bottom, String front, String back, boolean asResource)
Loadig cubemap texture from 6 texture files and storing into asset database- Parameters:
key
- Key in the asset databaseleft
- Left sube map textureright
- Right sube map texturetop
- Top sube map texturebottom
- Bottom sube map texturefront
- Front sube map textureback
- Back sube map textureasResource
- Loading cube map Textures from resources
-
-