hi everyone:

I don't know how many people are working on android platform. I am working on that platform. And the opengl es on android is 1.0.
In my android program, I want to change the bitmap of a texture on a key event, but when I call following function to change the texture, nothing happened. has anyone encountered this problem before? Or when the surfaceview is created, texture can't be changed???
Waiting for exports!!!!


private void loadTexture1(int tex,int picid, GL10 gl)
{
Log.d(LOG_TAG, "TriangleRenderer enter loadTexture1()");

Bitmap bitmap;

gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER,GL10.GL_NEAREST);
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.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE,GL10.GL_REPLACE);

InputStream is = mContext.getResources().openRawResource(picid);
try {
bitmap = BitmapFactory.decodeStream(is);
} finally {
try {
is.close();
} catch(IOException e) {
// Ignore.
}
}
GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);
bitmap.recycle();

}