Search code examples
androidopengl-esrotationglrotate

Problems rotating a sprite using drawtexture (OpenGl ES Android)


I´m trying to rotate a sprite using drawtexture but nothing happens. I´m using the following code:

gl.glRotatef(90, 0, 0, 1.0f); gl.glBindTexture(GL10.GL_TEXTURE_2D, TextureID); (GL11Ext) gl).glDrawTexfOES(x, y, z, width, height);

The texture is drawn to the screen but it is not rotated... Anyone? :)


Solution

  • After testing quite a bit og different ways to do this, I found the answer was right in front of me the whole time... I was using the SpriteMethodTest example as my codebase, but I ignored the VBO extension part there, wich basically has all the needed functionality.

    SpriteMethodTest: http://code.google.com/p/apps-for-android/source/browse/trunk/#trunk/SpriteMethodTest