user560571
user560571

Reputation: 2047

Android OpenGL performance issue

Hi I have been using open gl to draw objects on a blank black background and the performance has been fine so far. Now when I add a rectangular texture(similar to a level background) peformance is poor. How can I improve this?

The code I use to draw the background is as follows and is implemented in the onDraw() method

gl.glPushMatrix();
gl.glEnable(GL10.GL_TEXTURE_2D);
level1.draw(gl);
gl.glPopMatrix();

The texture for this background is loaded once as it does not change or animate.

Upvotes: 0

Views: 547

Answers (2)

Dan Brown
Dan Brown

Reputation: 111

You say you are using a rectangular texture. Have you made sure its dimensions are a power of 2? Depending on the implementation of OpenGL it can either work fine, work slowly or not work at all if you don't.

Upvotes: 0

genpfault
genpfault

Reputation: 52166

Remove the sleep(100000) from draw().

Upvotes: 4

Related Questions