I want to display a bitmap image at screen using texture api in android opengl. Some code which I have used in our code as below.

public void onSurfaceChanged(GL10 gl, int width, int height) {
    gl.glGenTextures(1, texture, 0);
    gl.glBindTexture(GL10.GL_TEXTURE_2D, texture[0]);
    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_NEAREST);
    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);
    Bitmap bmp = BitmapFactory.decodeResource(ContextController.getContext().getResources(), R.drawable.ic_launcher);
    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bmp, 0);
    bmp.recycle();
}

I have use this code But image is not display, screen is display as blank.

link|improve this question
What's the size of ic_launcher? – Rubber Mallet May 2 at 23:30
Image size is 48*48 pixel..... – Manoj Kumar May 3 at 12:30
You should be getting white polygons for textures that have not loaded correctly, rather than just a blank screen. What about the rest of your code? Also, images must be power of 2 for opengl-es. So 16x16, 32x32, 64x64 etc – Spoon Thumb May 15 at 15:10
feedback

1 Answer

You are omitting important opengl calls. http://www.opengl.org/wiki/Common_Mistakes#Creating_a_Texture

link|improve this answer
Thank you very much for supporting me for this issue, but i have resolved this issue already...... – Manoj Kumar 2 days ago
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.