I’m using https://github.com/markfguerra/GLWallpaperService/ to make an android live wallpaper.
I’m trying to load a png file as fullscreen background, however currently all I get is a black screen.
I’ve searched for a few days now but still haven’t found out the problem.
I’m doing the following:
public void onSurfaceCreated(GL10 gl, EGLConfig config)
{
gl.glEnable(GL10.GL_TEXTURE_2D);
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);
}
and every frame:
public void onDrawFrame(GL10 gl)
{
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.target00074);
int[] textures = new int[1];
gl.glGenTextures(1, textures, 0);
gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);
GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);
}
I found my solution in: http://obviam.net/index.php/texture-mapping-opengl-android-displaying-images-using-opengl-and-squares/