1. Are you ready for the Galaxy S20? Here is everything we know so far!

glDrawTexiOES texture flipped

Discussion in 'Android Development' started by blither, May 24, 2010.

  1. blither

    blither Newbie
    Thread Starter

    I am currently trying just to get my texture to display on the background with only some luck. Currently my screen displays the texture but it displays it upside-down. And it appears to be the entire screen is inverted vertically; because when I move the image in moves the image in the opposite direction.

    I have my look at projection like...

    Code (Text):
    1.  
    2. GLU.gluLookAt(gl, 0.0f, 0.0f, 5f,
    3.                 0.0f, 0.0f, 0.0f,
    4.                 0.0f, 1.0f, 0.0f);
    5.  
    My main issue is when I tried rendering a texture with verteces it rendered fine.

    Any ideas?
     



    1. Download the Forums for Android™ app!


      Download

       
  2. blither

    blither Newbie
    Thread Starter

    Here is what I am using to render

    Code (Text):
    1.  
    2.         gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);
    3.  
    4.         gl.glEnable(GL10.GL_BLEND);
    5.         gl.glColor4x(0x10000, 0x00000, 0x10000, 0x10000)
    6.        
    7.         int[] cropRect={0,0,256,256};
    8.         gl.glFrontFace(GL10.GL_CW);
    9.         ((GL11)gl).glTexParameteriv(GL10.GL_TEXTURE_2D,
    10.                 GL11Ext.GL_TEXTURE_CROP_RECT_OES, cropRect, 0);
    11.         ((GL11Ext) gl).glDrawTexiOES(0, 0, 0, 256, 256);
    12.        
    13.         gl.glDisable(GL10.GL_BLEND);
    14.  
     
Loading...

Share This Page

Loading...