I am currently writing an Android application that works with OpenGL ES 1.1. It worked perfectly on my HTC Desire (Android 2.3.7), where I developed it. Now I wanted to test it on a Nexus 7, but it only shows a black screen. I found out that all textures just turn black. In areas where there is no object and no texture, I get a (almost) black background color.
So my question is, why are textures displayed on some devices and not on others?
The textures are all quadratic with a power of size 2 (i.e. 512x512, 1024x1024). These are the settings used to create the textures:
gl.glBindTexture(GL10.GL_TEXTURE_2D, getTextureId());
// 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);
// Different possible texture parameters, e.g. GL10.GL_CLAMP_TO_EDGE
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_REPEAT);
gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE);
// Use the Android GLUtils to specify a two-dimensional texture image
// from our bitmap
GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);
What can I try to get textures displayed on both devices?
source
share