Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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]);
    Bitmap bmp = BitmapFactory.decodeResource(ContextController.getContext().getResources(), R.drawable.ic_launcher);
    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bmp, 0);

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

share|improve this question
What's the size of ic_launcher? – Chuck D May 2 '12 at 23:30
Image size is 48*48 pixel..... – Manoj Kumar May 3 '12 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 '12 at 15:10

You are omitting important opengl calls.

share|improve this answer
Thank you very much for supporting me for this issue, but i have resolved this issue already...... – Manoj Kumar May 23 '12 at 7:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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