Android EGL/OpenGL ES Frame Rate Stuttering

前端 未结 2 849
醉话见心
醉话见心 2021-02-04 07:20

TL;DR

Even when doing no drawing at all, it seems impossible to maintain a 60Hz update rate on an OpenGL ES rendering thread on an Android device. Myste

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-04 07:58

    Not sure if this is the answer, but note that the call to eglSwapBuffers() blocks for at least 16 ms, even if there is nothing to draw.

    Running the game logic in a separate thread could win back some time.

    Check out the blog post at the open source Platforming game Relica Island. The game logic is heavy, yet the framrate is smooth due to the authors pipeline/double buffer solution.

    http://replicaisland.blogspot.com/2009/10/rendering-with-two-threads.html

提交回复
热议问题