Android Live Wallpapers with OpenGL ES 2.0?

user382157 picture user382157 · Feb 15, 2011 · Viewed 8.2k times · Source

Has anyone managed to get OpenGL ES 2.0 working in a live wallpaper? I have a class that uses OpenGL ES 2.0 and runs fine as a Renderer for a GLSurfaceView. However, I want it to function as a live wallpaper. I found Robert Green's GLWallpaperService, but that is based on an older version of GLSurfaceView and does not support setEGLContextClientVersion, which is needed to run OpenGL ES 2.0.

Answer

JesusFreke picture JesusFreke · Aug 14, 2011

I've managed to get an opengl-based LWP working by extending GLSurfaceView and then wrapping that in a wallpaper service. I haven't specifically tested if opengl es 2.0 works with this method, but I see no reason it wouldn't.

You can find the LWP specific files at https://github.com/JesusFreke/Penroser/tree/master/src/org/jf/GLWallpaper. They should be generic and usable as-is in other projects. For an example of how to use these classes, see https://github.com/JesusFreke/Penroser/blob/master/src/org/jf/Penroser/PenroserLiveWallpaper.java