Finding some documentation and examples on using glCompressedTexImage2D with android / java has been a wasted effort. Certainly someone is doing this somewhere. If you know of a good reference please let me know.
Here is the code I am currently working with:
- Code: Select all
ByteBuffer bb = null;
if (useDDSLoader == true)
{
bb = DDSLoader.loadImage(is);
int format = DDSLoader.getFormat();
this.total = bb.capacity();
}
else
{
bb = this.readToByteBuffer(is);
}
textureInfo.source = iFile;
is.close();
this.checkError(gl);
// Generate one texture pointer...
gl.glGenTextures(1, textureInfo.textures, 0);
// ...and bind it to our array
gl.glBindTexture(GL10.GL_TEXTURE_2D, textureInfo.textures[0]);
// Create Nearest Filtered Texture
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_PALETTE4_RGB8_OES, 256, 256, 0, (int) this.total, bb);
This code does not create any gl errors, but generates a totally white background.
Any help at all would be appreciated
RaiderJ

