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 ...
Get OpenGL ES 2 for Android now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.