com.threerings.opengl.util
Class DDSLoader

java.lang.Object
  extended by com.threerings.opengl.util.DDSLoader

public class DDSLoader
extends Object

Provides a means of loading texture data from DirectDraw Surface (DDS) files. Note: Currently, this class does not do any format conversions, so it will fail for formats not supported by the OpenGL implementation. We may need to decompress or swizzle textures in unsupported formats.


Nested Class Summary
protected static class DDSLoader.Header
          The DDS file header.
 
Field Summary
protected static int DDPF_ALPHAPIXELS
          Pixel format flag indicating that the texture contains alpha data.
protected static int DDPF_FOURCC
          Pixel format flag indicating that the texture contains compressed RGB data.
protected static int DDSCAPS2_CUBEMAP
          Caps flag indicating that the texture contains a cube map.
protected static int DDSCAPS2_VOLUME
          Caps flag indicating that the texture is a volume texture.
protected static int DDSD_MIPMAPCOUNT
          Flag indicating that the header contains a mipmap count.
 
Constructor Summary
DDSLoader()
           
 
Method Summary
protected static ByteBuffer load(File file)
          Loads the entire file into a (direct, little-endian) byte buffer.
static void load(File file, Texture1D texture, boolean border)
          Loads a 1D texture from the supplied file.
static void load(File file, Texture2D texture, boolean border)
          Loads a 2D texture from the supplied file.
static void load(File file, Texture3D texture, boolean border)
          Loads a 3D texture from the supplied file.
static void load(File file, TextureCubeMap texture, boolean border)
          Loads a cube map texture from the supplied file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DDSD_MIPMAPCOUNT

protected static final int DDSD_MIPMAPCOUNT
Flag indicating that the header contains a mipmap count.

See Also:
Constant Field Values

DDPF_FOURCC

protected static final int DDPF_FOURCC
Pixel format flag indicating that the texture contains compressed RGB data.

See Also:
Constant Field Values

DDPF_ALPHAPIXELS

protected static final int DDPF_ALPHAPIXELS
Pixel format flag indicating that the texture contains alpha data.

See Also:
Constant Field Values

DDSCAPS2_CUBEMAP

protected static final int DDSCAPS2_CUBEMAP
Caps flag indicating that the texture contains a cube map.

See Also:
Constant Field Values

DDSCAPS2_VOLUME

protected static final int DDSCAPS2_VOLUME
Caps flag indicating that the texture is a volume texture.

See Also:
Constant Field Values
Constructor Detail

DDSLoader

public DDSLoader()
Method Detail

load

public static void load(File file,
                        Texture1D texture,
                        boolean border)
                 throws IOException
Loads a 1D texture from the supplied file.

Throws:
IOException

load

public static void load(File file,
                        Texture2D texture,
                        boolean border)
                 throws IOException
Loads a 2D texture from the supplied file.

Throws:
IOException

load

public static void load(File file,
                        Texture3D texture,
                        boolean border)
                 throws IOException
Loads a 3D texture from the supplied file.

Throws:
IOException

load

public static void load(File file,
                        TextureCubeMap texture,
                        boolean border)
                 throws IOException
Loads a cube map texture from the supplied file.

Throws:
IOException

load

protected static ByteBuffer load(File file)
                          throws IOException
Loads the entire file into a (direct, little-endian) byte buffer.

Throws:
IOException