O'Reilly logo

OpenGL ES 2 for Android by Kevin Brothaler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exercises

We’ve covered a lot of the basics of live wallpapers in this chapter, but there’s still a lot of low-hanging fruit left for us to pick. Let’s start off with the following exercises:

  • To optimize performance, let’s change the way we initialize the particle system and reduce the total particle count from 10,000 to something a lot lower. Once that’s done, let’s optimize things further by removing particles that fall below the terrain. One way you can do this is by swapping each particle to be removed with the last good active particle in the array.

    When you make these changes, try updating the behavior so that the particle system doesn’t get reset if onSurfaceCreated is called a second time.

  • Android live wallpapers support an additional ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required