简体   繁体   中英

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.

draw()删除sleep(100000) draw()

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM