Android Opengl Texture Binding
can anyone tell that , if i generate a texture in construtor, then how can i bind a texture in   
draw?
*public void loadTexture(GL10 gl, Bitmap bitmap) {
		
		int textureId;
		int[] mTextures = new int[1];
		
		textureId = mTextures[0];
		// generate one texture pointer
		gl.glGenTextures(1, mTextures , 0);
		// ...and bind it to our array
		gl.glBindTexture(GL10.GL_TEXTURE_2D, textureId);
		
		// create nearest filtered texture
		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);
		// Use Android GLUtils to specify a two-dimensional texture image from our bitmap
		if(bitmap == null) {
			bitmap = BitmapFactory.decodeResource(ParsecLauncher.mCtx.getResources(), R.drawable.sides);
		}
		GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);
		
		// Clean up
		//bitmap.recycle();
	} 
	public void draw(GL10 gl) {
		mColorBuffer.position(0);
		mVertexBuffer.position(0);
		mIndexBuffer.position(0);
		mTextureBuffer.position(0);

		gl.glFrontFace(GL10.GL_CW);
		gl.glCullFace(GL10.GL_BACK);
        gl.glShadeModel(GL10.GL_FLAT);
        gl.glVertexPointer(3, GL10.GL_FIXED, 0, mVertexBuffer);
        //gl.glColorPointer(4, GL10.GL_FIXED, 0, mColorBuffer);
        gl.glTexCoordPointer(2, GL10.GL_FIXED, 0, mTextureBuffer);
        //gl.glDrawArrays(GL10.GL_TRIANGLES, 0, mIndexCount);
        
        mSliceTexture.loadTexture(gl, mBitmap);        
        gl.glDrawElements(GL10.GL_TRIANGLES, mIndexCount, GL10.GL_UNSIGNED_SHORT, mIndexBuffer);
	}

i want to move the GLU.textImage() in construtor but if i moved then just one texture is applied on all faces. can anyone help


Android Opengl Texture Binding
===

can anyone tell that , if i generate a texture in construtor, then how can i bind a texture in   
draw?
*public void loadTexture(GL10 gl, Bitmap bitmap) {
		
		int textureId;
		int[] mTextures = new int[1];
		
		textureId = mTextures[0];
		// generate one texture pointer
		gl.glGenTextures(1, mTextures , 0);
		// ...and bind it to our array
		gl.glBindTexture(GL10.GL_TEXTURE_2D, textureId);
		
		// create nearest filtered texture
		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);
		// Use Android GLUtils to specify a two-dimensional texture image from our bitmap
		if(bitmap == null) {
			bitmap = BitmapFactory.decodeResource(ParsecLauncher.mCtx.getResources(), R.drawable.sides);
		}
		GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);
		
		// Clean up
		//bitmap.recycle();
	} 
	public void draw(GL10 gl) {
		mColorBuffer.position(0);
		mVertexBuffer.position(0);
		mIndexBuffer.position(0);
		mTextureBuffer.position(0);

		gl.glFrontFace(GL10.GL_CW);
		gl.glCullFace(GL10.GL_BACK);
        gl.glShadeModel(GL10.GL_FLAT);
        gl.glVertexPointer(3, GL10.GL_FIXED, 0, mVertexBuffer);
        //gl.glColorPointer(4, GL10.GL_FIXED, 0, mColorBuffer);
        gl.glTexCoordPointer(2, GL10.GL_FIXED, 0, mTextureBuffer);
        //gl.glDrawArrays(GL10.GL_TRIANGLES, 0, mIndexCount);
        
        mSliceTexture.loadTexture(gl, mBitmap);        
        gl.glDrawElements(GL10.GL_TRIANGLES, mIndexCount, GL10.GL_UNSIGNED_SHORT, mIndexBuffer);
	}

i want to move the GLU.textImage() in construtor but if i moved then just one texture is applied on all faces. can anyone help

