loading DXT texture files in android using Java
<p>I am looking to load compressed jpg and png files in android. Loading the raw files is just too slow. The plan is to compress the files ahead of time into DXT files. I tried to use DXTViewer to compress some images and attempt to load them as textures.</p>

<p>Currently I am getting a GL_INVALID_ENUM from gl.glCompressedTexImage2D(...).</p>

<p>Here is the code.</p>

<p><i></p>

<pre><code>    InputStream is = ESGLTextureUtility.loadFile(iFile, assetManager);
    ByteBuffer bb = this.readToByteBuffer(is);
    textureInfo.source = iFile;
    is.close();

    this.checkError(gl);

    gl.glGenTextures(1, textureInfo.textures, 0);

    gl.glBindTexture(GL10.GL_TEXTURE_2D, textureInfo.textures[0]);

    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);

    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);

    gl.glCompressedTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA, 512, 512, 0, (int) this.total, bb);
</code></pre>

<p></i></p>

<p>Like I said, this triggers a GL_INVALID_ENUM.</p>

<p>There seems to be very little documentation or examples on this topic. </p>

<p>Thanks in advance.</p>
